import{R as t,r as n,d as a,e as r,C as i,n as e,h as s}from"./timer-DFzT7np-.js";import{c as o,a as u}from"./linear-BuATvq_r.js";import{i as c}from"./init-DLRA0X12.js";import{aP as l,aQ as f,aR as h,aS as p,aT as b,aU as y,aV as v,aW as w,aX as g,aY as m,aZ as d,a_ as M,a$ as N,b0 as D,b1 as j,b2 as k,b3 as I,b4 as x,b5 as P,b6 as R,b7 as S,b8 as Y,b9 as q,ba as A}from"./index-D3XtisvU.js";function B(t,n){let a;if(void 0===n)for(const r of t)null!=r&&(a<r||void 0===a&&r>=r)&&(a=r);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(a<i||void 0===a&&i>=i)&&(a=i)}return a}function C(t,n){let a;if(void 0===n)for(const r of t)null!=r&&(a>r||void 0===a&&r>=r)&&(a=r);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(a>i||void 0===a&&i>=i)&&(a=i)}return a}function F(t,n,a,r,i,e){const s=[[f,1,h],[f,5,5*h],[f,15,15*h],[f,30,30*h],[e,1,p],[e,5,5*p],[e,15,15*p],[e,30,30*p],[i,1,b],[i,3,3*b],[i,6,6*b],[i,12,12*b],[r,1,y],[r,2,2*y],[a,1,v],[n,1,w],[n,3,3*w],[t,1,g]];function o(n,a,r){const i=Math.abs(a-n)/r,e=l((([,,t])=>t)).right(s,i);if(e===s.length)return t.every(m(n/g,a/g,r));if(0===e)return d.every(Math.max(m(n,a,r),1));const[o,u]=s[i/s[e-1][2]<s[e][2]/i?e-1:e];return o.every(u)}return[function(t,n,a){const r=n<t;r&&([t,n]=[n,t]);const i=a&&"function"==typeof a.range?a:o(t,n,a),e=i?i.range(t,+n+1):[];return r?e.reverse():e},o]}const[L,Q]=F(q,Y,S,R,P,x),[T,U]=F(I,k,j,D,N,M),V=Math.PI/180,W=180/Math.PI,X=.96422,Z=.82521,$=4/29,_=6/29,z=3*_*_,E=_*_*_;function G(a){if(a instanceof J)return new J(a.l,a.a,a.b,a.opacity);if(a instanceof rt)return it(a);a instanceof t||(a=n(a));var r,i,e=nt(a.r),s=nt(a.g),o=nt(a.b),u=K((.2225045*e+.7168786*s+.0606169*o)/1);return e===s&&s===o?r=i=u:(r=K((.4360747*e+.3850649*s+.1430804*o)/X),i=K((.0139322*e+.0971045*s+.7141733*o)/Z)),new J(116*u-16,500*(r-u),200*(u-i),a.opacity)}function H(t,n,a,r){return 1===arguments.length?G(t):new J(t,n,a,null==r?1:r)}function J(t,n,a,r){this.l=+t,this.a=+n,this.b=+a,this.opacity=+r}function K(t){return t>E?Math.pow(t,1/3):t/z+$}function O(t){return t>_?t*t*t:z*(t-$)}function tt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function at(t,n,a,r){return 1===arguments.length?function(t){if(t instanceof rt)return new rt(t.h,t.c,t.l,t.opacity);if(t instanceof J||(t=G(t)),0===t.a&&0===t.b)return new rt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*W;return new rt(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new rt(t,n,a,null==r?1:r)}function rt(t,n,a,r){this.h=+t,this.c=+n,this.l=+a,this.opacity=+r}function it(t){if(isNaN(t.h))return new J(t.l,0,0,t.opacity);var n=t.h*V;return new J(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}function et(t){return function(n,a){var r=t((n=at(n)).h,(a=at(a)).h),i=e(n.c,a.c),s=e(n.l,a.l),o=e(n.opacity,a.opacity);return function(t){return n.h=r(t),n.c=i(t),n.l=s(t),n.opacity=o(t),n+""}}}a(J,H,r(i,{brighter(t){return new J(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new J(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,a=isNaN(this.a)?n:n+this.a/500,r=isNaN(this.b)?n:n-this.b/200;return a=X*O(a),n=1*O(n),r=Z*O(r),new t(tt(3.1338561*a-1.6168667*n-.4906146*r),tt(-.9787684*a+1.9161415*n+.033454*r),tt(.0719453*a-.2289914*n+1.4052427*r),this.opacity)}})),a(rt,at,r(i,{brighter(t){return new rt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new rt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return it(this).rgb()}}));const st=et(s);var ot=et(e);function ut(t,n){var a,r=0,i=(t=t.slice()).length-1,e=t[r],s=t[i];return s<e&&(a=r,r=i,i=a,a=e,e=s,s=a),t[r]=n.floor(e),t[i]=n.ceil(s),t}function ct(t){return new Date(t)}function lt(t){return t instanceof Date?+t:+new Date(+t)}function ft(t,n,a,r,i,e,s,c,l,f){var h=o(),p=h.invert,b=h.domain,y=f(".%L"),v=f(":%S"),w=f("%I:%M"),g=f("%I %p"),m=f("%a %d"),d=f("%b %d"),M=f("%B"),N=f("%Y");function D(t){return(l(t)<t?y:c(t)<t?v:s(t)<t?w:e(t)<t?g:r(t)<t?i(t)<t?m:d:a(t)<t?M:N)(t)}return h.invert=function(t){return new Date(p(t))},h.domain=function(t){return arguments.length?b(Array.from(t,lt)):b().map(ct)},h.ticks=function(n){var a=b();return t(a[0],a[a.length-1],null==n?10:n)},h.tickFormat=function(t,n){return null==n?D:f(n)},h.nice=function(t){var a=b();return t&&"function"==typeof t.range||(t=n(a[0],a[a.length-1],null==t?10:t)),t?b(ut(a,t)):h},h.copy=function(){return u(h,ft(t,n,a,r,i,e,s,c,l,f))},h}function ht(){return c.apply(ft(T,U,I,k,j,D,N,M,f,A).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}export{B as a,L as b,ft as c,W as d,at as e,ot as h,st as i,H as l,C as m,ut as n,V as r,ht as t,Q as u};
