import{d as e,t}from"./d3-array-Dy1FNIg7.js";const s=new Date,n=new Date;function r(e,t,a,o){function l(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return l.floor=t=>(e(t=new Date(+t)),t),l.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),l.round=e=>{const t=l(e),s=l.ceil(e);return e-t<s-e?t:s},l.offset=(e,s)=>(t(e=new Date(+e),null==s?1:Math.floor(s)),e),l.range=(s,n,r)=>{const a=[];if(s=l.ceil(s),r=null==r?1:Math.floor(r),!(s<n&&r>0))return a;let o;do{a.push(o=new Date(+s)),t(s,r),e(s)}while(o<s&&s<n);return a},l.filter=s=>r(t=>{if(t>=t)for(;e(t),!s(t);)t.setTime(t-1)},(e,n)=>{if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!s(e););else for(;--n>=0;)for(;t(e,1),!s(e););}),a&&(l.count=(t,r)=>(s.setTime(+t),n.setTime(+r),e(s),e(n),Math.floor(a(s,n))),l.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?l.filter(o?t=>o(t)%e===0:t=>l.count(0,t)%e===0):l:null)),l}const a=r(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);a.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r(t=>{t.setTime(Math.floor(t/e)*e)},(t,s)=>{t.setTime(+t+s*e)},(t,s)=>(s-t)/e):a:null),a.range;const o=1e3,l=6e4,g=36e5,u=864e5,i=6048e5,T=2592e6,f=31536e6,c=r(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*o)},(e,t)=>(t-e)/o,e=>e.getUTCSeconds());c.range;const C=r(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*o)},(e,t)=>{e.setTime(+e+t*l)},(e,t)=>(t-e)/l,e=>e.getMinutes());C.range;r(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*l)},(e,t)=>(t-e)/l,e=>e.getUTCMinutes()).range;const U=r(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*o-e.getMinutes()*l)},(e,t)=>{e.setTime(+e+t*g)},(e,t)=>(t-e)/g,e=>e.getHours());U.range;r(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*g)},(e,t)=>(t-e)/g,e=>e.getUTCHours()).range;const M=r(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*l)/u,e=>e.getDate()-1);M.range;const h=r(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/u,e=>e.getUTCDate()-1);h.range;function D(e){return r(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*l)/i)}r(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/u,e=>Math.floor(e/u)).range;const F=D(0),m=D(1),Y=D(2),H=D(3),d=D(4),y=D(5),w=D(6);function v(e){return r(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/i)}F.range,m.range,Y.range,H.range,d.range,y.range,w.range;const p=v(0),z=v(1),O=v(2),S=v(3),b=v(4),j=v(5),x=v(6);p.range,z.range,O.range,S.range,b.range,j.range,x.range;const k=r(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());k.range;r(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth()).range;const q=r(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());q.every=e=>isFinite(e=Math.floor(e))&&e>0?r(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,s)=>{t.setFullYear(t.getFullYear()+s*e)}):null,q.range;const Q=r(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Q.every=e=>isFinite(e=Math.floor(e))&&e>0?r(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,s)=>{t.setUTCFullYear(t.getUTCFullYear()+s*e)}):null,Q.range;const[A,B]=function(s,n,r,C,U,M){const h=[[c,1,o],[c,5,5e3],[c,15,15e3],[c,30,3e4],[M,1,l],[M,5,3e5],[M,15,9e5],[M,30,18e5],[U,1,g],[U,3,108e5],[U,6,216e5],[U,12,432e5],[C,1,u],[C,2,1728e5],[r,1,i],[n,1,T],[n,3,7776e6],[s,1,f]];function D(n,r,o){const l=Math.abs(r-n)/o,g=e(([,,e])=>e).right(h,l);if(g===h.length)return s.every(t(n/f,r/f,o));if(0===g)return a.every(Math.max(t(n,r,o),1));const[u,i]=h[l/h[g-1][2]<h[g][2]/l?g-1:g];return u.every(i)}return[function(e,t,s){const n=t<e;n&&([e,t]=[t,e]);const r=s&&"function"==typeof s.range?s:D(e,t,s),a=r?r.range(e,+t+1):[];return n?a.reverse():a},D]}(q,k,F,M,U,C);export{U as a,M as b,F as c,k as d,q as e,B as f,A as g,h,m as i,Q as j,b as k,p as l,d as m,w as n,y as o,H as p,Y as q,a as r,c as s,C as t,z as u};
