git-truck 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/build/client/assets/GitTruckInfo-DSTHQLpb.js +2 -0
  2. package/build/client/assets/RepoTabs-CAVKlzaP.js +1 -0
  3. package/build/client/assets/browse-BPS_2Q2o.js +1 -0
  4. package/build/client/assets/browse-DtF-O2nh.js +9 -0
  5. package/build/client/assets/clear-cache-C8-c8bzY.js +1 -0
  6. package/build/client/assets/clear-cache-DczfzTH1.js +1 -0
  7. package/build/client/assets/manifest-708752f7.js +1 -0
  8. package/build/client/assets/{root-CGqKHKfX.js → root-BBgpPS0e.js} +2 -2
  9. package/build/client/assets/root-BDi1Y-Zk.css +1 -0
  10. package/build/client/assets/ui-mrRo7bBy.js +1 -0
  11. package/build/client/assets/view-tqZGjwcM.js +1 -0
  12. package/build/client/assets/view.commits-CsXn1fsk.js +1 -0
  13. package/build/client/assets/view.details-DurbDplo.js +1 -0
  14. package/build/server/assets/{server-build-voprGiDU.js → server-build-v6Kp-efC.js} +440 -126
  15. package/build/server/index.js +1 -1
  16. package/cli.mjs +99 -131
  17. package/package.json +4 -3
  18. package/build/client/assets/RepoTabs-36qUc-RT.js +0 -1
  19. package/build/client/assets/browse-B9wBPRaK.js +0 -9
  20. package/build/client/assets/browse-Bx9O5Mvl.js +0 -1
  21. package/build/client/assets/clear-cache-BJQQzFka.js +0 -1
  22. package/build/client/assets/clear-cache-DkN7P69Z.js +0 -1
  23. package/build/client/assets/dist-Bpk5WHYg.js +0 -2
  24. package/build/client/assets/manifest-601d0239.js +0 -1
  25. package/build/client/assets/root-BK0u4vgl.css +0 -1
  26. package/build/client/assets/ui-Bw635ygf.js +0 -1
  27. package/build/client/assets/view-mmd0Q4B8.js +0 -1
  28. package/build/client/assets/view.commits-b-k-A7BT.js +0 -1
  29. package/build/client/assets/view.details-B7LCPu46.js +0 -1
@@ -0,0 +1,9 @@
1
+ import{A as e,H as t,I as n,M as r,N as i,O as a,P as o,U as s,W as c,i as l,j as u,n as d,o as f,t as p,u as m,v as h,z as g}from"./jsx-runtime-s_YwNCZb.js";import{i as _,t as v}from"./react-dom-B9ui1jR3.js";import{$ as y,$t as b,An as x,At as S,B as C,Bn as w,Bt as T,C as E,Cn as D,Ct as O,D as k,Dt as A,En as ee,Et as j,Fn as te,Ft as ne,G as re,Gt as M,H as ie,Hn as ae,Ht as oe,In as se,It as ce,J as le,Jt as ue,K as de,Kt as fe,Ln as pe,Lt as me,Mn as he,Mt as ge,Nn as _e,Nt as ve,O as ye,Ot as be,Pn as xe,Q as Se,Qt as Ce,R as we,Rn as Te,Rt as Ee,S as De,Sn as Oe,T as ke,Tn as Ae,Tt as je,U as Me,Un as Ne,Ut as Pe,V as Fe,Vn as Ie,Vt as Le,W as Re,Wn as N,Wt as ze,X as Be,Xt as Ve,Y as He,Yt as Ue,Z as We,Zt as Ge,_ as Ke,_n as qe,a as Je,an as Ye,at as P,b as Xe,bt as Ze,c as Qe,cn as $e,ct as et,d as tt,dn as nt,dt as rt,en as it,et as at,f as ot,fn as st,ft as ct,g as lt,gn as ut,gt as dt,h as ft,hn as pt,ht as mt,i as ht,in as gt,it as _t,jn as vt,k as yt,kn as bt,kt as xt,l as St,ln as Ct,lt as wt,m as Tt,mn as Et,mt as Dt,n as Ot,nn as kt,nt as At,o as jt,ot as Mt,p as Nt,pn as Pt,pt as Ft,q as It,qt as Lt,r as Rt,rn as zt,rt as Bt,s as Vt,sn as Ht,st as Ut,t as Wt,tn as Gt,tt as Kt,u as qt,ut as Jt,v as Yt,vn as Xt,vt as Zt,w as Qt,wn as $t,wt as en,x as tn,xn as nn,xt as rn,y as an,yt as on,z as sn,zn as cn,zt as ln}from"./GitTruckInfo-DSTHQLpb.js";function un(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function dn(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function fn(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function pn(){return this.eachAfter(fn)}function mn(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function hn(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function gn(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function _n(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function vn(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function yn(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function bn(e){for(var t=this,n=xn(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function xn(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Sn(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Cn(){return Array.from(this)}function wn(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Tn(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*En(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function Dn(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=An)):t===void 0&&(t=kn);for(var n=new Nn(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new Nn(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(Mn)}function On(){return Dn(this).eachBefore(jn)}function kn(e){return e.children}function An(e){return Array.isArray(e)?e[1]:null}function jn(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mn(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Nn(e){this.data=e,this.depth=this.height=0,this.parent=null}Nn.prototype=Dn.prototype={constructor:Nn,count:pn,each:mn,eachAfter:gn,eachBefore:hn,find:_n,sum:vn,sort:yn,path:bn,ancestors:Sn,descendants:Cn,leaves:wn,links:Tn,copy:On,[Symbol.iterator]:En};function Pn(e){return e==null?null:Fn(e)}function Fn(e){if(typeof e!=`function`)throw Error();return e}function In(){return 0}function Ln(e){return function(){return e}}var Rn=1664525,zn=1013904223,Bn=4294967296;function Vn(){let e=1;return()=>(e=(Rn*e+zn)%Bn)/Bn}function Hn(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Un(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Wn(e,t){for(var n=0,r=(e=Un(Array.from(e),t)).length,i=[],a,o;n<r;)a=e[n],o&&qn(o,a)?++n:(o=Yn(i=Gn(i,a)),n=0);return o}function Gn(e,t){var n,r;if(Jn(t,e))return[t];for(n=0;n<e.length;++n)if(Kn(t,e[n])&&Jn(Zn(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Kn(Zn(e[n],e[r]),t)&&Kn(Zn(e[n],t),e[r])&&Kn(Zn(e[r],t),e[n])&&Jn(Qn(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function Kn(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function qn(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Jn(e,t){for(var n=0;n<t.length;++n)if(!qn(e,t[n]))return!1;return!0}function Yn(e){switch(e.length){case 1:return Xn(e[0]);case 2:return Zn(e[0],e[1]);case 3:return Qn(e[0],e[1],e[2])}}function Xn(e){return{x:e.x,y:e.y,r:e.r}}function Zn(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function Qn(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,y=v-o*o-s*s+c*c,b=v-l*l-u*u+d*d,x=p*m-f*h,S=(m*b-h*y)/(x*2)-r,C=(h*g-m*_)/x,w=(p*y-f*b)/(x*2)-i,T=(f*_-p*g)/x,E=C*C+T*T-1,D=2*(a+S*C+w*T),O=S*S+w*w-a*a,k=-(Math.abs(E)>1e-6?(D+Math.sqrt(D*D-4*E*O))/(2*E):O/D);return{x:r+S+C*k,y:i+w+T*k,r:k}}function $n(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function er(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function tr(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function nr(e){this._=e,this.next=null,this.previous=null}function rr(e,t){if(!(a=(e=Hn(e)).length))return 0;var n=e[0],r,i,a,o,s,c,l,u,d,f;if(n.x=0,n.y=0,!(a>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;$n(r,n,i=e[2]),n=new nr(n),r=new nr(r),i=new nr(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;pack:for(c=3;c<a;++c){$n(n._,r._,i=e[c]),i=new nr(i),l=r.next,u=n.previous,d=r._.r,f=n._.r;do if(d<=f){if(er(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue pack}d+=l._.r,l=l.next}else{if(er(u._,i._)){n=u,n.next=r,r.previous=n,--c;continue pack}f+=u._.r,u=u.previous}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,o=tr(n);(i=i.next)!==r;)(s=tr(i))<o&&(n=i,o=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Wn(n,t),c=0;c<a;++c)n=e[c],n.x-=i.x,n.y-=i.y;return i.r}function ir(e){return Math.sqrt(e.value)}function ar(){var e=null,t=1,n=1,r=In;function i(i){let a=Vn();return i.x=t/2,i.y=n/2,e?i.eachBefore(or(e)).eachAfter(sr(r,.5,a)).eachBefore(cr(1)):i.eachBefore(or(ir)).eachAfter(sr(In,1,a)).eachAfter(sr(r,i.r/Math.min(t,n),a)).eachBefore(cr(Math.min(t,n)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=Pn(t),i):e},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(e){return arguments.length?(r=typeof e==`function`?e:Ln(+e),i):r},i}function or(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function sr(e,t,n){return function(r){if(i=r.children){var i,a,o=i.length,s=e(r)*t||0,c;if(s)for(a=0;a<o;++a)i[a].r+=s;if(c=rr(i,n),s)for(a=0;a<o;++a)i[a].r-=s;r.r=c+s}}}function cr(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function lr(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ur(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function dr(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(lr),i}function a(e,t){return function(r){r.children&&ur(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=s}}return i.round=function(e){return arguments.length?(r=!!e,i):r},i.size=function(n){return arguments.length?(e=+n[0],t=+n[1],i):[e,t]},i.padding=function(e){return arguments.length?(n=+e,i):n},i}function fr(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var pr=(1+Math.sqrt(5))/2;function mr(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ur(c,n,r,i,h?r+=m*g/h:a):fr(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var hr=(function e(t){function n(e,n,r,i,a){mr(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(pr);function gr(){var e=hr,t=!1,n=1,r=1,i=[0],a=In,o=In,s=In,c=In,l=In;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(lr),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=Fn(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:Ln(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:Ln(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:Ln(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:Ln(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:Ln(+e),u):l},u}var _r=(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?ur(s,n,r,i,p?r+=(a-r)*s.value/p:a):fr(s,n,r,p?n+=(i-n)*s.value/p:i,a),p-=s.value}else e._squarify=o=mr(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(pr);function vr(){var e=Xe().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=dn(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return vr(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},tn.apply(d(),arguments)}var F=c(t());function yr(){let e=u(),[t]=yt(y_),n=t.objectPath?e.state?.clickedObject??null:null,a=i(),o=r(_(`/view/commits`))?`/view/commits`:`/view/details`;return{clickedObject:n,setClickedObject:(0,F.useCallback)(e=>{if(e){a(o+b_({...t,objectPath:e.path}),{state:{clickedObject:e}});return}a(_(`/view`)+b_({...t,objectPath:null}))},[a,t,o])}}const br=(0,F.createContext)(void 0);function xr(){let e=(0,F.useContext)(br);if(!e)throw Error(`useSearch must be used within a SearchProvider`);return e}var Sr=c(s(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=void 0,i=``,a=` `,o=`\\`,s=/^\s+$/,c=/(?:[^\\]|^)\\$/,l=/^\\!/,u=/^\\#/,d=/\r?\n/g,f=/^\.{0,2}\/|^\.{1,2}$/,p=/\/$/,m=`/`,h=`node-ignore`;typeof Symbol<`u`&&(h=Symbol.for(`node-ignore`));var g=h,_=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),v=/([0-z])-([0-z])/g,y=()=>!1,b=e=>e.replace(v,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:i),x=e=>{let{length:t}=e;return e.slice(0,t-t%2)},S=[[/^\uFEFF/,()=>i],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?a:i)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+a}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>o],[/\\\\/g,()=>o],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===o?`\\[${n}${x(r)}${i}`:i===`]`&&r.length%2==0?`[${b(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],C=/(^|\\\/)?\\\*$/,w=`regex`,T=`checkRegex`,E=`_`,D={[w](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[T](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},O=e=>S.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),k=e=>typeof e==`string`,A=e=>e&&k(e)&&!s.test(e)&&!c.test(e)&&e.indexOf(`#`)!==0,ee=e=>e.split(d).filter(Boolean),j=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,_(this,`body`,n),_(this,`ignoreCase`,r),_(this,`regexPrefix`,a)}get regex(){let e=E+w;return this[e]?this[e]:this._make(w,e)}get checkRegex(){let e=E+T;return this[e]?this[e]:this._make(T,e)}_make(e,t){let n=this.regexPrefix.replace(C,D[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return _(this,t,r)}},te=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(l,`!`).replace(u,`#`);let a=O(i);return new j(e,t,i,n,r,a)},ne=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[g]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(k(e)&&(e={pattern:e}),A(e.pattern)){let t=te(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(k(e)?ee(e):e).forEach(this._add,this),this._added}test(e,t,n){let i=!1,a=!1,o;this._rules.forEach(s=>{let{negative:c}=s;a===c&&i!==a||c&&!i&&!a&&!t||s[n].test(e)&&(i=!c,a=c,o=c?r:s)});let s={ignored:i,unignored:a};return o&&(s.rule=o),s}},re=(e,t)=>{throw new t(e)},M=(e,t,n)=>k(e)?e?M.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),ie=e=>f.test(e);M.isNotRelative=ie,M.convert=e=>e;var ae=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){_(this,g,!0),this._rules=new ne(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&M.convert(e);return M(i,e,this._strictPathCheck?re:y),this._t(i,t,n,r)}checkIgnore(e){if(!p.test(e))return this.test(e);let t=e.split(m).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(m)+m,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,T)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(m).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,w);let i=this._t(r.join(m)+m,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,w)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},oe=e=>new ae(e),se=e=>M(e&&M.convert(e),e,y),ce=()=>{M.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;M.isNotRelative=t=>e.test(t)||ie(t)};typeof process<`u`&&process.platform===`win32`&&ce(),t.exports=oe,oe.default=oe,t.exports.isPathValid=se,_(t.exports,Symbol.for(`setupWindows`),ce)}))()),I=c(p());const Cr=(0,F.memo)(function({hoveredObject:e,setHoveredObject:t}){let[n,a]=Ut(),{searchResults:o,hasSearchResults:s}=xr(),c=(0,F.useDeferredValue)(a),{databaseInfo:l}=me(),{chartType:u,sizeMetric:d,hierarchyType:f,labelsVisible:p,renderCutOff:m}=tt(),h=we(),[g]=yt(y_),[v,y]=ye(`zoomPath`),b=e=>y(e&&e!==l.repo?ne(e):null),x=v?v?.includes(`/`)?`/`:`\\`:null,C=()=>{!x||!v||b(v.split(x).slice(0,-1).join(x))},{clickedObject:w,setClickedObject:T}=yr(),{dominantAuthorCutoff:E,metricType:D,showFilesWithoutChanges:O,showOnlySearchMatches:k}=tt(),A=i();Jt({key:`Escape`},()=>{w&&A(_(`/view`)+b_({...g,objectPath:null}),{state:{clickedObject:null}})});let ee=r(_(`/view/commits`))?`/view/commits`:`/view/details`,j=(0,F.useMemo)(()=>{let e=(0,Sr.default)();e.add(l.hiddenFiles);let t=wr(l.fileTree,{commitCounts:l.commitCounts,showFilesWithoutChanges:O,ig:e,searchResults:o,hasSearchResults:s,showOnlySearchMatches:k});return f===`NESTED`?t:{...t,children:jr(t)}},[l.hiddenFiles,l.fileTree,l.commitCounts,O,o,s,k,f]),te=(0,F.useMemo)(()=>c.width===0||c.height===0?[]:Or({databaseInfo:l,tree:j,size:c,chartType:u,sizeMetricType:d,renderCutOff:m}).descendants(),[c,u,d,m,l,j]);(0,F.useEffect)(()=>{t(null)},[u,c,t]);let re=(0,F.useRef)(0),M=(0,F.useRef)(null),ie=e=>{let n=t=>{if(t.stopPropagation(),w&&e&&w.path===e.data.path){A(_(`/view`)+b_({...g,objectPath:null}),{state:{clickedObject:null}});return}A(ee+b_({...g,objectPath:e?.data.path}),{state:{clickedObject:e?.data}})},r=t=>{if(v&&v===e?.data.path){b(``);return}b(e?.data.path??null)};return{onClick:e=>{M.current||=window.setTimeout(()=>{M.current=null,n(e)},300)},onDoubleClick(e){e.stopPropagation(),M.current&&(window.clearTimeout(M.current),M.current=null,r(e))},onMouseOver:n=>{n.stopPropagation(),e&&t(e.data)},onMouseOut:()=>t(null)}};return(0,I.jsxs)(`div`,{ref:n,className:`relative grid place-items-center`,children:[(0,I.jsx)(`svg`,{className:Le(`stroke-border dark:stroke-border-dark absolute inset-0 grid h-full w-full place-items-center fill-gray-900 text-xs select-none dark:fill-gray-100`),xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${c.width} ${c.height}`,onClick:()=>w?T(null):null,onDoubleClick:()=>{b(null)},onWheel:t=>{re.current+=t.deltaY,re.current<=-50&&e?((0,F.startTransition)(()=>{b(e.path)}),re.current=0):re.current>=50&&e&&((0,F.startTransition)(()=>{C()}),re.current=0)},children:te.map(e=>{let t=!!o[e.data.path],n=ie(e),r=e.data.name.substring(e.data.name.lastIndexOf(`.`)+1),i=Re,a=l.dominantAuthors[e.data.path],c=l.contribSumPerFile[e.data.path],u=a?a.contribcount/c*100:null;u!==null&&u>=E&&(i=a.author);let d=D===`FILE_TYPE`?r:D===`TOP_CONTRIBUTOR`?i:null,f=d?h(d):!0,m=w?e.data.path===w.path||S(w)&&e.data.path.startsWith(w.path+`/`):f,g=s&&!t||!m;return(0,I.jsxs)(`g`,{className:P(`cursor-pointer duration-400`,{"hover:opacity-80":be(e.data)&&!w,"hover:stroke-border-highlight dark:hover:stroke-border-highlight-dark":S(e.data)&&!w,"opacity-30 grayscale hover:opacity-100 hover:grayscale-0":g}),...n,children:[(0,I.jsx)(Tr,{d:e}),p?(0,I.jsx)(Er,{isSearchMatch:t,d:e,children:e.data.name}):null]},e.data.path)})}),(0,I.jsx)(`div`,{className:`absolute bottom-2 left-2 flex gap-2`,children:v&&v!==l.repo?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{className:`btn`,onClick:()=>b(null),children:[(0,I.jsx)(N,{path:Ne}),`Reset zoom`]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:C,children:[(0,I.jsx)(N,{path:Ae}),`Zoom out`]})]}):null})]})});function wr(e,{commitCounts:t,searchResults:n,hasSearchResults:r,showFilesWithoutChanges:i,showOnlySearchMatches:a,ig:o}){function s(e){if(o.ignores(e.path))return null;if(e.type===`blob`)return r&&!n[e.path]&&a||!i&&!t[e.path]?null:e;{let t=[];for(let n of e.children){let e=s(n);e!==null&&t.push(e)}return t.length===0?null:{type:`tree`,name:e.name,path:e.path,children:t}}}let c=s(e);if(c===null&&(c={...e,children:[]}),c.type!==`tree`)throw Error(`Filtered tree must be a tree structure`);return c}function Tr({d:e}){let[t]=ie(),{chartType:n,metricType:r,transitionsEnabled:i}=tt();return(0,I.jsx)(`rect`,{...(0,F.useMemo)(()=>{let i=be(e.data)?{fill:t.get(r)?.colormap.get(e.data.path)??`#808080`,stroke:t.get(r)?.colormap.get(e.data.path)??`#c0c0c0`}:{};if(n===`BUBBLE_CHART`){let t=e;i={...i,x:t.x-t.r,y:t.y-t.r+16-1,width:t.r*2,height:t.r*2,rx:t.r,ry:t.r}}else{let t=e;i={...i,x:t.x0+.5,y:t.y0+.5,width:t.x1-t.x0-1,height:t.y1-t.y0-1,...S(e.data)?{rx:4,ry:4}:{rx:2,ry:2}}}return i},[e,t,r,n]),className:P(S(e.data)?`stroke-inherit`:`stroke-transparent stroke-0`,{"fill-primary-bg dark:fill-primary-bg-dark":S(e.data),"transition-[x,y,rx,ry,width,height,fill] duration-500 ease-in-out":i})})}function Er({d:e,isSearchMatch:t,children:n=null}){let[r]=ie(),{metricType:i}=tt(),a=Dr(e);if(n===null)return null;let o=xt(r.get(i)?.colormap.get(e.data.path)??`#333`),s={startOffset:a?`50%`:void 0,dominantBaseline:a&&S(e.data)?`central`:`hanging`,textAnchor:a?`middle`:`start`,href:`#path-${e.data.path}`,className:`font-bold tracking-widest`},c=Dr(e)?e.r*2-10/2:0,l=!1;if(Dr(e)){if(be(e.data)){if(e.r*2-10>e.data.name.length*7&&(l=!0),e.r*2-10<16)return null}else if(e.r<(S(e.data),16)*2||e.r*Math.PI*(2/3)<e.data.name.length*7.3)return null}else{let t=e;if(be(e.data)&&t.y1-t.y0-10<16)return null}return(0,I.jsxs)(`g`,{children:[(0,I.jsxs)(`defs`,{children:[(0,I.jsx)(`path`,{d:Dr(e)?Ar(e.x,e.y+(S(e.data)?15:16),e.r):void 0,id:`path-${e.data.path}`}),(0,I.jsx)(`clipPath`,{id:`clip-path-${e.data.path}`,children:(0,I.jsx)(`rect`,{stroke:`red`,fill:`transparent`,...Dr(e)?{x:e.x-e.r+10/4+.5,y:e.y-e.r+16-1+10/4+.5,width:Math.max(c-1,0),height:Math.max(e.r*2-10/2-1,0),rx:e.r,ry:e.r}:{x:e.x0+10/2,y:e.y0+10/2,width:Math.max(e.x1-e.x0-10,0),height:Math.max(e.y1-e.y0-10,0),...S(e.data)?{rx:4,ry:4}:{rx:2,ry:2}}})})]}),S(e.data)&&Dr(e)?(0,I.jsx)(`text`,{className:P(`stroke-primary-bg dark:stroke-primary-bg-dark pointer-events-none fill-none stroke-5`),strokeLinecap:`round`,children:(0,I.jsx)(`textPath`,{...s,children:n})}):null,(0,I.jsx)(`text`,{textAnchor:l?`middle`:void 0,alignmentBaseline:`hanging`,...!Dr(e)||be(e.data)?{clipPath:`url(#clip-path-${e.data.path})`}:{},x:Dr(e)?S(e.data)?0:e.x-(l?0:e.r-10/2):e.x0+10/2,y:Dr(e)?S(e.data)?0:e.y+16/2:e.y0+10/2,className:P(`pointer-events-none stroke-none transition-all`,{"font-bold underline":t,"font-bold":S(e.data),"fill-primary-text-dark":o.luminance<.5&&be(e.data),"fill-primary-text":o.luminance>=.5&&be(e.data)}),children:S(e.data)&&Dr(e)?(0,I.jsx)(`textPath`,{...s,children:n}):n})]})}function Dr(e){return typeof e.r==`number`}function Or({databaseInfo:e,tree:t,size:n,chartType:r,sizeMetricType:i,renderCutOff:a}){let o=Dn(t).sum(t=>{let n=t;switch(i){case`FILE_SIZE`:return n.sizeInBytes??1;case`MOST_COMMITS`:return e.commitCounts[n.path]??1;case`EQUAL_SIZE`:return 1;case`LAST_CHANGED`:return(e.lastChanged[n.path]??e.oldestChangeDate+1)-e.oldestChangeDate;case`MOST_CONTRIBUTIONS`:return e.contribSumPerFile[n.path]??1}}).sort((e,t)=>(t.value??1)-(e.value??1)),s=Number.isNaN(a)?2:a;if(r===`TREE_MAP`||r===`PARTITION`){let e=(r===`TREE_MAP`?gr().size([n.width,n.height]).round(!0).tile(_r).paddingInner(2).paddingOuter(4).paddingTop(21):dr().size([n.width,n.height]).padding(2))(o);return kr(e,e=>{let t=e;return t.x1-t.x0>=s&&t.y1-t.y0>=s}),e}if(r===`BUBBLE_CHART`){let e=ar().size([n.width,n.height-16]).padding(10)(o);return kr(e,e=>e.r>=s),e}else throw Error(`Unknown chart type: `+r)}function kr(e,t){e.children&&=e.children.filter(e=>t(e));for(let n of e.children??[])(n.children?.length??0)>0&&kr(n,t)}function Ar(e,t,n){return`M${e},${t}
2
+ m0,${n}
3
+ a${n},${n} 0 1,1 0,${-n*2}
4
+ a${n},${n} 0 1,1 0,${n*2}`}function jr(e){let t=[];for(let n of e.children)n.type===`blob`?t.push(n):t.push(...jr(n));return t}function Mr(){let{databaseInfo:e}=me(),t=Ft(),{authors:n}=e,r=e.authorUnions,[i,a]=(0,F.useState)([]),[s,c]=(0,F.useState)(``),u=o(),[,d]=ie(),[,f]=(0,F.useTransition)(),p=ct(),m=r.reduce((e,t)=>[...e,...t],[]).sort(Nr);function h(e){let n=r.filter((t,n)=>n!==e),i=new FormData;i.append(`unionedAuthors`,JSON.stringify(n)),t(i,{method:`post`})}function g(){let e=new FormData;e.append(`unionedAuthors`,JSON.stringify([])),t(e,{method:`post`})}function _(){if(i.length<2)return;let e=new FormData;e.append(`unionedAuthors`,JSON.stringify([...r,i])),t(e,{method:`post`}),a([])}function v(e,n){let i=r.map((t,r)=>r===n?[e,...t.filter(t=>t!==e)]:t),a=new FormData;a.append(`unionedAuthors`,JSON.stringify(i)),t(a,{method:`post`})}let y=u.state!==`idle`,b=n.filter(e=>!m.includes(e)).slice(0).sort(Nr),x=e=>d.get(e)??`#333`,S=b.filter(e=>e.toLowerCase().includes(s.toLowerCase())),C=S.map(e=>{let t=i.includes(e);return(0,I.jsx)(sn,{className:`hover:opacity-70`,checked:t,onChange:t=>{a(t.target?.checked?[...i,e]:i.filter(t=>t!==e))},children:(0,I.jsxs)(`div`,{className:`inline-flex flex-row place-items-center gap-2`,children:[(0,I.jsx)(Vt,{dotColor:x(e)}),e]})},e+t)}),w=r.map((e,n)=>{let o=e[0],s=u.state!==`idle`;return(0,I.jsxs)(`div`,{className:`card bg-tertiary-bg dark:bg-tertiary-bg-dark group m-0 flex h-full flex-col p-2`,children:[(0,I.jsxs)(`div`,{className:`inline-flex flex-row place-items-center gap-2`,children:[(0,I.jsx)(Vt,{dotColor:x(o)}),(0,I.jsx)(`b`,{className:`truncate`,title:o,children:o})]}),e.slice(1).sort(Nr).map(e=>(0,I.jsx)(T,{alias:e,disabled:s,onClick:()=>v(e,n)},e)),(0,I.jsx)(`div`,{className:`grow`}),(0,I.jsxs)(`div`,{className:`flex items-end justify-end gap-2 opacity-0 transition-opacity duration-200 group-hover:opacity-100`,children:[(0,I.jsxs)(l,{method:`post`,action:p,children:[(0,I.jsx)(`input`,{type:`hidden`,name:`unionedAuthors`,value:JSON.stringify(r)}),(0,I.jsx)(`button`,{className:`btn`,title:`Add selected authors to this group`,disabled:s||i.length===0,onClick:()=>{let e=r.map(([e,...t],r)=>r===n?[e,...t,...i]:[e,...t]),o=new FormData;o.append(`unionedAuthors`,JSON.stringify(e)),t(o,{method:`post`}),a([])},children:`Add selected`})]}),(0,I.jsx)(`button`,{className:`btn`,title:`Ungroup`,disabled:s,onClick:()=>h(n),children:`Ungroup`})]})]},n)});return(0,I.jsxs)(`div`,{className:`flex min-h-0 w-auto max-w-(--breakpoint-lg) min-w-0 flex-col gap-2 p-4`,children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr] gap-2`,children:[(0,I.jsxs)(`h3`,{className:`text-center text-lg font-bold`,children:[`Ungrouped Authors (`,b.length,`)`]}),(0,I.jsxs)(`h3`,{className:`text-center text-lg font-bold`,children:[`Author Groups (`,w.length,`)`]})]}),(0,I.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[1fr_1fr] gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-col rounded-md`,children:[(0,I.jsxs)(`div`,{className:`flex gap-2 p-2`,children:[(0,I.jsx)(`input`,{className:`input min-w-0`,type:`search`,placeholder:`Filter...`,disabled:b.length===0,onChange:e=>f(()=>c(e.target.value))}),(0,I.jsx)(`button`,{disabled:y||i.length===0,className:`btn btn--outlined w-max grow`,title:`Clear selection`,onClick:()=>a([]),children:`Clear`}),(0,I.jsx)(`button`,{disabled:b.length===0,className:`btn btn--outlined w-max grow`,title:`Clear selection`,onClick:()=>i.length===S.length?a([]):a(e=>Array.from(new Set([...e,...S]))),children:i.length===S.length?`Deselect all`:`Select all`})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:C.length>0?C:(0,I.jsx)(`p`,{className:`place-self-center text-sm`,children:s.length>0?`No authors found`:`All authors have been grouped`})})]}),(0,I.jsx)(`div`,{className:`min-h-0 overflow-y-auto`,children:(0,I.jsx)(`div`,{className:`grid h-min min-h-0 grid-cols-1 gap-4 rounded-md p-2 lg:grid-cols-2 xl:grid-cols-3`,children:r.length>0?w:(0,I.jsx)(`p`,{className:`col-span-2 text-center text-sm`,children:`No authors have been grouped yet`})})})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr] gap-2`,children:[(0,I.jsxs)(`button`,{className:`btn btn--primary mx-auto w-fit`,title:y||i.length<2?`Select at least 2 authors to group them`:`Group the selected authors`,disabled:y||i.length<2,onClick:_,children:[(0,I.jsx)(N,{path:fe,size:1}),`Create group`]}),(0,I.jsxs)(`button`,{className:`btn btn--danger mx-auto w-fit`,disabled:y||r.length===0,onClick:()=>{confirm(`Are you sure you want to ungroup all grouped authors?`)&&g()},children:[(0,I.jsx)(N,{path:M,size:1}),`Ungroup all`]})]})]});function T({alias:e,onClick:t,disabled:n}){return(0,I.jsxs)(`button`,{className:`btn flex grid-flow-col gap-2 text-sm [&:hover>svg]:opacity-50 [&>svg]:opacity-0`,disabled:n,title:`Make display name for this grouping`,onClick:t,children:[(0,I.jsx)(N,{path:Ue,size:.75}),(0,I.jsx)(`label`,{title:e,className:`label truncate`,children:e})]},e)}}var Nr=(e,t)=>e.toLowerCase().localeCompare(t.toLowerCase());function Pr(){let e=o(),{databaseInfo:t}=me(),n=(0,F.useRef)(null),r=ct(),i=e.state!==`idle`&&e.formData?e.formData.get(`hide`):null,a=e.state!==`idle`&&e.formData?e.formData.get(`show`):null,s=[...t.hiddenFiles];i&&!t.hiddenFiles.includes(i)&&s.unshift(i);let c=s.filter(e=>e!==a);return(0,I.jsxs)(`div`,{className:`flex min-h-0 max-w-[40ch] flex-col items-start justify-center gap-3 overflow-y-auto p-2 pl-0`,children:[(0,I.jsx)(`p`,{className:`text-sm`,children:`Pattern-matched files are hidden from the file tree and excluded from metric computations.`}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[`Hidden files behave like entries in a `,(0,I.jsx)(Je,{inline:!0,children:`.gitignore`}),` file.`]}),(0,I.jsxs)(l,{action:r,method:`post`,className:`flex w-full flex-wrap items-end gap-2`,onSubmit:()=>{setTimeout(()=>{n.current&&(n.current.value=``)},0)},children:[(0,I.jsxs)(`label`,{className:`label flex min-w-0 flex-1 flex-col gap-2`,children:[`Path or glob`,(0,I.jsx)(`input`,{ref:n,type:`text`,className:`input`,name:`hide`,placeholder:`Enter pattern...`,onChange:e=>{let n=t.hiddenFiles.includes(e.target.value);e.target.setCustomValidity(n?`Pattern already exists`:``)}})]}),(0,I.jsx)(`button`,{className:`btn btn--primary whitespace-nowrap`,children:`Hide`})]}),(0,I.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,I.jsx)(`h3`,{className:`text-tertiary-text dark:text-tertiary-text-dark text-sm font-bold tracking-wide uppercase`,children:`Hidden files/patterns`}),(0,I.jsxs)(l,{action:r,method:`post`,className:P({hidden:t.hiddenFiles.length===0}),children:[(0,I.jsx)(`input`,{type:`hidden`,name:`unhideAll`,value:`true`}),(0,I.jsx)(`button`,{className:`btn btn--danger btn--text`,children:`Reset`})]})]}),(0,I.jsx)(`div`,{className:`flex max-h-96 min-h-0 w-full flex-col gap-2 overflow-y-auto`,children:c.length>0?c.map(t=>{let n=t===i;return(0,I.jsxs)(`div`,{className:`primary grid grid-cols-[auto_1fr] items-center gap-2 rounded-md px-2 py-1 text-sm`,style:{opacity:n?.6:t===a?.4:1},title:t,children:[(0,I.jsxs)(l,{action:r,className:`w-4`,method:`post`,children:[(0,I.jsx)(`input`,{type:`hidden`,name:`show`,value:t}),(0,I.jsxs)(`button`,{className:`btn btn--text btn--hover-swap h-4`,title:`Show file`,disabled:e.state!==`idle`||n,children:[(0,I.jsx)(N,{path:Ct,className:`inline-block h-full`}),(0,I.jsx)(N,{path:$e,className:`hover-swap inline-block h-full`})]})]}),(0,I.jsx)(`span`,{className:`truncate text-sm`,title:t,children:Fr(t)})]},t)}):(0,I.jsx)(`div`,{className:`text-secondary-text dark:text-secondary-text-dark text-sm opacity-70`,children:`No hidden files`})})]})}function Fr(e){if(!e.includes(je(e)))return e;let t=e.split(je(e));return t[t.length-1]}var Ir=typeof document<`u`?F.useLayoutEffect:()=>{},Lr=e=>e?.ownerDocument??document,Rr=e=>e&&`window`in e&&e.window===e?e:Lr(e).defaultView||window;function zr(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Br(e){return zr(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}var Vr=!1;function Hr(){return Vr}function Ur(e,t){if(!Hr())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:Br(n)?n.host:n.parentNode}return!1}var Wr=(e=document)=>{if(!Hr())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function L(e){if(Hr()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function Gr(e){if(qr())e.focus({preventScroll:!0});else{let t=Jr(e);e.focus(),Yr(t)}}var Kr=null;function qr(){if(Kr==null){Kr=!1;try{document.createElement(`div`).focus({get preventScroll(){return Kr=!0,!0}})}catch{}}return Kr}function Jr(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Yr(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function Xr(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function Zr(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Qr(e){let t=null;return()=>(t??=e(),t)}var $r=Qr(function(){return Zr(/^Mac/i)}),ei=Qr(function(){return Zr(/^iPad/i)||$r()&&navigator.maxTouchPoints>1}),ti=Qr(function(){return Xr(/AppleWebKit/i)&&!ni()}),ni=Qr(function(){return Xr(/Chrome/i)}),ri=Qr(function(){return Xr(/Android/i)}),ii=Qr(function(){return Xr(/Firefox/i)});function ai(e,t,n=!0){var r;let{metaKey:i,ctrlKey:a,altKey:o,shiftKey:s}=t;ii()&&(r=window.event)!=null&&r.type?.startsWith(`key`)&&e.target===`_blank`&&($r()?i=!0:a=!0);let c=ti()&&$r()&&!ei()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:i,ctrlKey:a,altKey:o,shiftKey:s}):new MouseEvent(`click`,{metaKey:i,ctrlKey:a,altKey:o,shiftKey:s,detail:1,bubbles:!0,cancelable:!0});ai.isOpening=n,Gr(e),e.dispatchEvent(c),ai.isOpening=!1}ai.isOpening=!1;function oi(){let e=(0,F.useRef)(new Map),t=(0,F.useCallback)((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=(0,F.useCallback)((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,F.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,F.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function si(e){return e.pointerType===``&&e.isTrusted?!0:ri()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ci(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function li(e,t){Object.defineProperty(e,`target`,{value:t}),Object.defineProperty(e,`currentTarget`,{value:t})}function ui(e){let t=(0,F.useRef)({isFocused:!1,observer:null});return Ir(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),(0,F.useCallback)(n=>{let r=L(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=ci(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){var e;(e=t.current.observer)==null||e.disconnect();let r=n===Wr()?null:Wr();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:r})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:r}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}var di=!1,fi=null,pi=new Set,mi=new Map,hi=!1,gi=!1,_i={Tab:!0,Escape:!0};function vi(e,t){for(let n of pi)n(e,t)}function yi(e){return!(e.metaKey||!$r()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function bi(e){hi=!0,!ai.isOpening&&yi(e)&&(fi=`keyboard`,vi(`keyboard`,e))}function xi(e){fi=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(hi=!0,vi(`pointer`,e))}function Si(e){!ai.isOpening&&si(e)&&(hi=!0,fi=`virtual`)}function Ci(e){L(e)===window||L(e)===document||di||!e.isTrusted||(!hi&&!gi&&(fi=`virtual`,vi(`virtual`,e)),hi=!1,gi=!1)}function wi(){di||(hi=!1,gi=!0)}function Ti(e){if(typeof window>`u`||typeof document>`u`||mi.get(Rr(e)))return;let t=Rr(e),n=Lr(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){hi=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,bi,!0),n.addEventListener(`keyup`,bi,!0),n.addEventListener(`click`,Si,!0),t.addEventListener(`focus`,Ci,!0),t.addEventListener(`blur`,wi,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,xi,!0),n.addEventListener(`pointermove`,xi,!0),n.addEventListener(`pointerup`,xi,!0)),t.addEventListener(`beforeunload`,()=>{Ei(e)},{once:!0}),mi.set(t,{focus:r})}var Ei=(e,t)=>{let n=Rr(e),r=Lr(e);t&&r.removeEventListener(`DOMContentLoaded`,t),mi.has(n)&&(n.HTMLElement.prototype.focus=mi.get(n).focus,r.removeEventListener(`keydown`,bi,!0),r.removeEventListener(`keyup`,bi,!0),r.removeEventListener(`click`,Si,!0),n.removeEventListener(`focus`,Ci,!0),n.removeEventListener(`blur`,wi,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,xi,!0),r.removeEventListener(`pointermove`,xi,!0),r.removeEventListener(`pointerup`,xi,!0)),mi.delete(n))};function Di(e){let t=Lr(e),n;return t.readyState===`loading`?(n=()=>{Ti(e)},t.addEventListener(`DOMContentLoaded`,n)):Ti(e),()=>Ei(e,n)}typeof document<`u`&&Di();function Oi(){return fi!==`pointer`}var ki=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Ai(e,t,n){let r=Lr(n?L(n):void 0),i=n?L(n):void 0,a=typeof window<`u`?Rr(i).HTMLInputElement:HTMLInputElement,o=typeof window<`u`?Rr(i).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<`u`?Rr(i).HTMLElement:HTMLElement,c=typeof window<`u`?Rr(i).KeyboardEvent:KeyboardEvent,l=Wr(r);return e=e||l instanceof a&&!ki.has(l.type)||l instanceof o||l instanceof s&&l.isContentEditable,!(e&&t===`keyboard`&&n instanceof c&&!_i[n.key])}function ji(e,t,n){Ti(),(0,F.useEffect)(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Ai(!!n?.isTextInput,t,r)&&e(Oi())};return pi.add(t),()=>{pi.delete(t)}},t)}function Mi(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=(0,F.useCallback)(e=>{if(L(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),o=ui(a),s=(0,F.useCallback)(e=>{let t=L(e),r=Lr(t),a=r?Wr(r):Wr();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),o(e))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}function Ni(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=(0,F.useRef)({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:s}=oi(),c=(0,F.useCallback)(e=>{Ur(e.currentTarget,L(e))&&a.current.isFocusWithin&&!Ur(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,s(),n&&n(e),i&&i(!1))},[n,i,a,s]),l=ui(c),u=(0,F.useCallback)(e=>{if(!Ur(e.currentTarget,L(e)))return;let t=L(e),n=Lr(t),s=Wr(n);if(!a.current.isFocusWithin&&s===t){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,l(e);let t=e.currentTarget;o(n,`focus`,e=>{let r=L(e);if(a.current.isFocusWithin&&!Ur(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});li(e,t),c(ci(e))}},{capture:!0})}},[r,i,l,o,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:c}}}var Pi=!1,Fi=0;function Ii(){Pi=!0,setTimeout(()=>{Pi=!1},50)}function Li(e){e.pointerType===`touch`&&Ii()}function Ri(){if(!(typeof document>`u`))return Fi===0&&typeof PointerEvent<`u`&&document.addEventListener(`pointerup`,Li),Fi++,()=>{Fi--,!(Fi>0)&&typeof PointerEvent<`u`&&document.removeEventListener(`pointerup`,Li)}}function zi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=(0,F.useState)(!1),s=(0,F.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;(0,F.useEffect)(Ri,[]);let{addGlobalListener:c,removeAllGlobalListeners:l}=oi(),{hoverProps:u,triggerHoverEnd:d}=(0,F.useMemo)(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!Ur(e.currentTarget,L(e)))return;s.isHovered=!0;let l=e.currentTarget;s.target=l,c(Lr(L(e)),`pointerover`,e=>{s.isHovered&&s.target&&!Ur(s.target,L(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:l,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,!(t===`touch`||!s.isHovered||!i)&&(s.isHovered=!1,l(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},u={};return typeof PointerEvent<`u`&&(u.onPointerEnter=t=>{Pi&&t.pointerType===`mouse`||e(t,t.pointerType)},u.onPointerLeave=e=>{!i&&Ur(e.currentTarget,L(e))&&a(e,e.pointerType)}),{hoverProps:u,triggerHoverEnd:a}},[t,n,r,i,s,c,l]);return(0,F.useEffect)(()=>{i&&d({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:u,isHovered:a}}function Bi(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,F.useRef)({isFocused:!1,isFocusVisible:t||Oi()}),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),l=(0,F.useCallback)(()=>c(i.current.isFocused&&i.current.isFocusVisible),[]),u=(0,F.useCallback)(e=>{i.current.isFocused=e,i.current.isFocusVisible=Oi(),o(e),l()},[l]);ji(e=>{i.current.isFocusVisible=e,l()},[n,a],{enabled:a,isTextInput:n});let{focusProps:d}=Mi({isDisabled:r,onFocusChange:u}),{focusWithinProps:f}=Ni({isDisabled:!r,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:s,focusProps:r?f:d}}var Vi=Object.defineProperty,Hi=(e,t,n)=>t in e?Vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ui=(e,t,n)=>(Hi(e,typeof t==`symbol`?t:t+``,n),n),Wi=new class{constructor(){Ui(this,`current`,this.detect()),Ui(this,`handoffState`,`pending`),Ui(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function Gi(e){return Wi.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function Ki(e){return Gi(e)?.activeElement??null}function qi(e){return Ki(e)===e}function Ji(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function Yi(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return Ji(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=Yi();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function Xi(){let[e]=(0,F.useState)(Yi);return(0,F.useEffect)(()=>()=>e.dispose(),[e]),e}var Zi=(e,t)=>{Wi.isServer?(0,F.useEffect)(e,t):(0,F.useLayoutEffect)(e,t)};function Qi(e){let t=(0,F.useRef)(e);return Zi(()=>{t.current=e},[e]),t}var $i=function(e){let t=Qi(e);return F.useCallback((...e)=>t.current(...e),[t])};function ea(e){return(0,F.useMemo)(()=>e,Object.values(e))}var ta=(0,F.createContext)(void 0);function na(){return(0,F.useContext)(ta)}function ra({value:e,children:t}){return F.createElement(ta.Provider,{value:e},t)}function ia(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function aa(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,aa),r}var oa=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(oa||{}),sa=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(sa||{});function ca(){let e=da();return(0,F.useCallback)(t=>la({mergeRefs:e,...t}),[e])}function la({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=fa;let c=pa(t,e);if(a)return ua(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return ua(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return aa(e?0:1,{0(){return null},1(){return ua({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return ua(c,n,r,o,s)}function ua(e,t={},n,r,i){let{as:a=n,children:o,refName:s=`ref`,...c}=_a(e,[`unmount`,`static`]),l=e.ref===void 0?{}:{[s]:e.ref},u=typeof o==`function`?o(t):o;`className`in c&&c.className&&typeof c.className==`function`&&(c.className=c.className(t)),c[`aria-labelledby`]&&c[`aria-labelledby`]===c.id&&(c[`aria-labelledby`]=void 0);let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){d[`data-headlessui-state`]=n.join(` `);for(let e of n)d[`data-${e}`]=``}}if(ya(a)&&(Object.keys(ga(c)).length>0||Object.keys(ga(d)).length>0))if(!(0,F.isValidElement)(u)||Array.isArray(u)&&u.length>1||ba(u)){if(Object.keys(ga(c)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(ga(c)).concat(Object.keys(ga(d))).map(e=>` - ${e}`).join(`
5
+ `),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>` - ${e}`).join(`
6
+ `)].join(`
7
+ `))}else{let e=u.props?.className,t=typeof e==`function`?(...t)=>ia(e(...t),c.className):ia(e,c.className),n=t?{className:t}:{},r=pa(u.props,ga(_a(c,[`ref`])));for(let e in d)e in r&&delete d[e];return(0,F.cloneElement)(u,Object.assign({},r,d,l,{ref:i(va(u),l.ref)},n))}return(0,F.createElement)(a,Object.assign({},_a(c,[`ref`]),!ya(a)&&l,!ya(a)&&d),u)}function da(){let e=(0,F.useRef)([]),t=(0,F.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function fa(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function pa(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function ma(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function ha(e){return Object.assign((0,F.forwardRef)(e),{displayName:e.displayName??e.name})}function ga(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function _a(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function va(e){return`19.2.4`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function ya(e){return e===F.Fragment||e===Symbol.for(`react.fragment`)}function ba(e){return ya(e.type)}var xa=v();function Sa(e,t,n){let[r,i]=(0,F.useState)(n),a=e!==void 0,o=(0,F.useRef)(a),s=(0,F.useRef)(!1),c=(0,F.useRef)(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error(`A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.`)):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error(`A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.`)),[a?e:r,$i(e=>(a||(0,xa.flushSync)(()=>i(e)),t?.(e)))]}function Ca(e){let[t]=(0,F.useState)(e);return t}function wa(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Ea(n,Ta(t,r),i);return n}function Ta(e,t){return e?e+`[`+t+`]`:t}function Ea(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Ea(e,Ta(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n==`boolean`?e.push([t,n?`1`:`0`]):typeof n==`string`?e.push([t,n]):typeof n==`number`?e.push([t,`${n}`]):n==null?e.push([t,``]):Oa(n)&&!(0,F.isValidElement)(n)&&wa(n,t,e)}function Da(e){var t;let n=e?.form??e.closest(`form`);if(n){for(let t of n.elements)if(t!==e&&(t.tagName===`INPUT`&&t.type===`submit`||t.tagName===`BUTTON`&&t.type===`submit`||t.nodeName===`INPUT`&&t.type===`image`)){t.click();return}(t=n.requestSubmit)==null||t.call(n)}}function Oa(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var ka=`span`,Aa=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(Aa||{});function ja(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return ca()({ourProps:i,theirProps:r,slot:{},defaultTag:ka,name:`Hidden`})}var Ma=ha(ja),Na=v(),Pa=(0,F.createContext)(null);function Fa(e){let[t,n]=(0,F.useState)(null);return F.createElement(Pa.Provider,{value:{target:t}},e.children,F.createElement(Ma,{features:Aa.Hidden,ref:n}))}function Ia({children:e}){let t=(0,F.useContext)(Pa);if(!t)return F.createElement(F.Fragment,null,e);let{target:n}=t;return n?(0,Na.createPortal)(F.createElement(F.Fragment,null,e),n):null}function La({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[a,o]=(0,F.useState)(null),s=Xi();return(0,F.useEffect)(()=>{if(r&&a)return s.addEventListener(a,`reset`,r)},[a,t,r]),F.createElement(Ia,null,F.createElement(Ra,{setForm:o,formId:t}),wa(e).map(([e,r])=>F.createElement(Ma,{features:Aa.Hidden,...ga({key:e,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,form:t,disabled:n,name:e,value:r,...i})})))}function Ra({setForm:e,formId:t}){return(0,F.useEffect)(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:F.createElement(Ma,{features:Aa.Hidden,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let n=t.closest(`form`);n&&e(n)}})}var za=(0,F.createContext)(void 0);function Ba(){return(0,F.useContext)(za)}function Va({id:e,children:t}){return F.createElement(za.Provider,{value:e},t)}function Ha(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function Ua(e){return Ha(e)&&`tagName`in e}function Wa(e){return Ua(e)&&`accessKey`in e}function Ga(e){return Wa(e)&&e.nodeName===`INPUT`}function Ka(e){return Wa(e)&&e.nodeName===`LABEL`}function qa(e){return Wa(e)&&e.nodeName===`FIELDSET`}function Ja(e){return Wa(e)&&e.nodeName===`LEGEND`}function Ya(e){return Ua(e)?e.matches(`a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]`):!1}function Xa(e){let t=e.parentElement,n=null;for(;t&&!qa(t);)Ja(t)&&(n=t),t=t.parentElement;let r=t?.getAttribute(`disabled`)===``;return r&&Za(n)?!1:r}function Za(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Ja(t))return!1;t=t.previousElementSibling}return!0}var Qa=Symbol();function $a(...e){let t=(0,F.useRef)(e);(0,F.useEffect)(()=>{t.current=e},[e]);let n=$i(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[Qa])?void 0:n}var eo=(0,F.createContext)(null);eo.displayName=`DescriptionContext`;function to(){let e=(0,F.useContext)(eo);if(e===null){let e=Error(`You used a <Description /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,to),e}return e}function no(){return(0,F.useContext)(eo)?.value??void 0}function ro(){let[e,t]=(0,F.useState)([]);return[e.length>0?e.join(` `):void 0,(0,F.useMemo)(()=>function(e){let n=$i(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,F.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return F.createElement(eo.Provider,{value:r},e.children)},[t])]}var io=`p`;function ao(e,t){let n=(0,F.useId)(),r=na(),{id:i=`headlessui-description-${n}`,...a}=e,o=to(),s=$a(t);Zi(()=>o.register(i),[i,o.register]);let c=ea({...o.slot,disabled:r||!1}),l={ref:s,...o.props,id:i};return ca()({ourProps:l,theirProps:a,slot:c,defaultTag:io,name:o.name||`Description`})}var oo=ha(ao),so=Object.assign(oo,{}),co=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(co||{}),lo=(0,F.createContext)(null);lo.displayName=`LabelContext`;function uo(){let e=(0,F.useContext)(lo);if(e===null){let e=Error(`You used a <Label /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,uo),e}return e}function fo(e){let t=(0,F.useContext)(lo)?.value??void 0;return(e?.length??0)>0?[t,...e].filter(Boolean).join(` `):t}function po({inherit:e=!1}={}){let t=fo(),[n,r]=(0,F.useState)([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(` `):void 0,(0,F.useMemo)(()=>function(e){let t=$i(e=>(r(t=>[...t,e]),()=>r(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),n=(0,F.useMemo)(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return F.createElement(lo.Provider,{value:n},e.children)},[r])]}var mo=`label`;function ho(e,t){let n=(0,F.useId)(),r=uo(),i=Ba(),a=na(),{id:o=`headlessui-label-${n}`,htmlFor:s=i??r.props?.htmlFor,passive:c=!1,...l}=e,u=$a(t);Zi(()=>r.register(o),[o,r.register]);let d=$i(e=>{let t=e.currentTarget;if(!(e.target!==e.currentTarget&&Ya(e.target))&&(Ka(t)&&e.preventDefault(),r.props&&`onClick`in r.props&&typeof r.props.onClick==`function`&&r.props.onClick(e),Ka(t))){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute(`disabled`);if(t===`true`||t===``)return;let n=e.getAttribute(`aria-disabled`);if(n===`true`||n===``)return;(Ga(e)&&(e.type===`file`||e.type===`radio`||e.type===`checkbox`)||e.role===`radio`||e.role===`checkbox`||e.role===`switch`)&&e.click(),e.focus({preventScroll:!0})}}}),f=ea({...r.slot,disabled:a||!1}),p={ref:u,...r.props,id:o,htmlFor:s,onClick:d};return c&&(`onClick`in p&&(delete p.htmlFor,delete p.onClick),`onClick`in l&&delete l.onClick),ca()({ourProps:p,theirProps:l,slot:f,defaultTag:s?mo:`div`,name:r.name||`Label`})}var go=ha(ho),_o=Object.assign(go,{});function vo(e,t){return e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&`id`in e&&`id`in t?e.id===t.id:e===t}function yo(e=vo){return(0,F.useCallback)((t,n)=>{if(typeof e==`string`){let r=e;return t?.[r]===n?.[r]}return e(t,n)},[e])}var bo=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),xo=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),So=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(So||{}),Co=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(Co||{}),wo=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(wo||{});function To(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(bo)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function Eo(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(xo)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var Do=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(Do||{}),Oo=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(Oo||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));var ko=[`textarea`,`input`].join(`,`);function Ao(e){return(e?.matches)?.call(e,ko)??!1}function jo(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Mo(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?Gi(e[0]):document:Gi(e),o=Array.isArray(e)?n?jo(e):e:t&64?Eo(e):To(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let e=c+u;if(t&16)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}f=o[e],f?.focus(l),u+=s}while(f!==Ki(f));return t&6&&Ao(f)&&f.select(),2}function No(){return typeof window<`u`}function Po(e){return Lo(e)?(e.nodeName||``).toLowerCase():`#document`}function Fo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Io(e){return((Lo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Lo(e){return No()?e instanceof Node||e instanceof Fo(e).Node:!1}function R(e){return No()?e instanceof Element||e instanceof Fo(e).Element:!1}function Ro(e){return No()?e instanceof HTMLElement||e instanceof Fo(e).HTMLElement:!1}function zo(e){return!No()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Fo(e).ShadowRoot}function Bo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Vo(e){return/^(table|td|th)$/.test(Po(e))}function Ho(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Uo=/transform|translate|scale|rotate|perspective|filter/,Wo=/paint|layout|strict|content/,Go=e=>!!e&&e!==`none`,Ko;function qo(e){let t=R(e)?Zo(e):e;return Go(t.transform)||Go(t.translate)||Go(t.scale)||Go(t.rotate)||Go(t.perspective)||!Yo()&&(Go(t.backdropFilter)||Go(t.filter))||Uo.test(t.willChange||``)||Wo.test(t.contain||``)}function Jo(e){let t=$o(e);for(;Ro(t)&&!Xo(t);){if(qo(t))return t;if(Ho(t))return null;t=$o(t)}return null}function Yo(){return Ko??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ko}function Xo(e){return/^(html|body|#document)$/.test(Po(e))}function Zo(e){return Fo(e).getComputedStyle(e)}function Qo(e){return R(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $o(e){if(Po(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||zo(e)&&e.host||Io(e);return zo(t)?t.host:t}function es(e){let t=$o(e);return Xo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ro(t)&&Bo(t)?t:es(t)}function ts(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=es(e),i=r===e.ownerDocument?.body,a=Fo(r);if(i){let e=ns(a);return t.concat(a,a.visualViewport||[],Bo(r)?r:[],e&&n?ts(e):[])}else return t.concat(r,ts(r,[],n))}function ns(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var rs=Math.min,is=Math.max,as=Math.round,os=Math.floor,ss=e=>({x:e,y:e}),cs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ls(e,t,n){return is(e,rs(t,n))}function us(e,t){return typeof e==`function`?e(t):e}function ds(e){return e.split(`-`)[0]}function fs(e){return e.split(`-`)[1]}function ps(e){return e===`x`?`y`:`x`}function ms(e){return e===`y`?`height`:`width`}function hs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function gs(e){return ps(hs(e))}function _s(e,t,n){n===void 0&&(n=!1);let r=fs(e),i=gs(e),a=ms(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Es(o)),[o,Es(o)]}function vs(e){let t=Es(e);return[ys(e),t,ys(t)]}function ys(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var bs=[`left`,`right`],xs=[`right`,`left`],Ss=[`top`,`bottom`],Cs=[`bottom`,`top`];function ws(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xs:bs:t?bs:xs;case`left`:case`right`:return t?Ss:Cs;default:return[]}}function Ts(e,t,n,r){let i=fs(e),a=ws(ds(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ys)))),a}function Es(e){let t=ds(e);return cs[t]+e.slice(t.length)}function Ds(e){return{top:0,right:0,bottom:0,left:0,...e}}function Os(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ds(e)}function ks(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function As(e,t,n){let{reference:r,floating:i}=e,a=hs(t),o=gs(t),s=ms(o),c=ds(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(fs(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function js(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=us(t,e),p=Os(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ks(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ks(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ms=50,Ns=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:js},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=As(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ms&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=As(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ps=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=us(e,t)||{};if(l==null)return{};let d=Os(u),f={x:n,y:r},p=gs(i),m=ms(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=rs(d[_],T),D=rs(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=ls(O,A,k),j=!c.arrow&&fs(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=j?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:A-ee-te,...j&&{alignmentOffset:te}},reset:j}}}),Fs=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=us(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ds(r),_=hs(o),v=ds(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Es(o)]:vs(o)),x=p!==`none`;!d&&x&&b.push(...Ts(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_s(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==hs(t))||T.every(e=>hs(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=hs(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Is=new Set([`left`,`top`]);async function Ls(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ds(n),s=fs(n),c=hs(n)===`y`,l=Is.has(o)?-1:1,u=a&&c?-1:1,d=us(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Rs=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ls(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}};function zs(e){let t=Zo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ro(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=as(n)!==a||as(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Bs(e){return R(e)?e:e.contextElement}function Vs(e){let t=Bs(e);if(!Ro(t))return ss(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zs(t),o=(a?as(n.width):n.width)/r,s=(a?as(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Hs=ss(0);function Us(e){let t=Fo(e);return!Yo()||!t.visualViewport?Hs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ws(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fo(e)?!1:t}function Gs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Bs(e),o=ss(1);t&&(r?R(r)&&(o=Vs(r)):o=Vs(e));let s=Ws(a,n,r)?Us(a):ss(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Fo(a),t=r&&R(r)?Fo(r):r,n=e,i=ns(n);for(;i&&r&&t!==n;){let e=Vs(i),t=i.getBoundingClientRect(),r=Zo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Fo(i),i=ns(n)}}return ks({width:u,height:d,x:c,y:l})}function Ks(e,t){let n=Qo(e).scrollLeft;return t?t.left+n:Gs(Io(e)).left+n}function qs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ks(e,n),y:n.top+t.scrollTop}}function Js(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Io(r),s=t?Ho(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ss(1),u=ss(0),d=Ro(r);if((d||!d&&!a)&&((Po(r)!==`body`||Bo(o))&&(c=Qo(r)),d)){let e=Gs(r);l=Vs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?qs(o,c):ss(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ys(e){return Array.from(e.getClientRects())}function Xs(e){let t=Io(e),n=Qo(e),r=e.ownerDocument.body,i=is(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=is(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ks(e),s=-n.scrollTop;return Zo(r).direction===`rtl`&&(o+=is(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Zs=25;function Qs(e,t){let n=Fo(e),r=Io(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Yo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ks(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Zs&&(a-=o)}else l<=Zs&&(a+=l);return{width:a,height:o,x:s,y:c}}function $s(e,t){let n=Gs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ro(e)?Vs(e):ss(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ec(e,t,n){let r;if(t===`viewport`)r=Qs(e,n);else if(t===`document`)r=Xs(Io(e));else if(R(t))r=$s(t,n);else{let n=Us(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ks(r)}function tc(e,t){let n=$o(e);return n===t||!R(n)||Xo(n)?!1:Zo(n).position===`fixed`||tc(n,t)}function nc(e,t){let n=t.get(e);if(n)return n;let r=ts(e,[],!1).filter(e=>R(e)&&Po(e)!==`body`),i=null,a=Zo(e).position===`fixed`,o=a?$o(e):e;for(;R(o)&&!Xo(o);){let t=Zo(o),n=qo(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Bo(o)&&!n&&tc(e,o))?r=r.filter(e=>e!==o):i=t,o=$o(o)}return t.set(e,r),r}function rc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ho(t)?[]:nc(t,this._c):[].concat(n),r],o=ec(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ec(t,a[e],i);s=is(n.top,s),c=rs(n.right,c),l=rs(n.bottom,l),u=is(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ic(e){let{width:t,height:n}=zs(e);return{width:t,height:n}}function ac(e,t,n){let r=Ro(t),i=Io(t),a=n===`fixed`,o=Gs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ss(0);function l(){c.x=Ks(i)}if(r||!r&&!a)if((Po(t)!==`body`||Bo(i))&&(s=Qo(t)),r){let e=Gs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?qs(i,s):ss(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function oc(e){return Zo(e).position===`static`}function sc(e,t){if(!Ro(e)||Zo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Io(e)===n&&(n=n.ownerDocument.body),n}function cc(e,t){let n=Fo(e);if(Ho(e))return n;if(!Ro(e)){let t=$o(e);for(;t&&!Xo(t);){if(R(t)&&!oc(t))return t;t=$o(t)}return n}let r=sc(e,t);for(;r&&Vo(r)&&oc(r);)r=sc(r,t);return r&&Xo(r)&&oc(r)&&!qo(r)?n:r||Jo(e)||n}var lc=async function(e){let t=this.getOffsetParent||cc,n=this.getDimensions,r=await n(e.floating);return{reference:ac(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uc(e){return Zo(e).direction===`rtl`}var dc={convertOffsetParentRelativeRectToViewportRelativeRect:Js,getDocumentElement:Io,getClippingRect:rc,getOffsetParent:cc,getElementRects:lc,getClientRects:Ys,getDimensions:ic,getScale:Vs,isElement:R,isRTL:uc};function fc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pc(e,t){let n=null,r,i=Io(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=os(d),h=os(i.clientWidth-(u+f)),g=os(i.clientHeight-(d+p)),_=os(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:is(0,rs(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!fc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function mc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Bs(e),u=i||a?[...l?ts(l):[],...t?ts(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?pc(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Gs(e):null;c&&g();function g(){let t=Gs(e);h&&!fc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var hc=Rs,gc=Fs,_c=Ps,vc=(e,t,n)=>{let r=new Map,i={platform:dc,...n},a={...i.platform,_c:r};return Ns(e,t,{...i,platform:a})},yc=c(v(),1),bc=typeof document<`u`?F.useLayoutEffect:function(){};function xc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cc(e,t){let n=Sc(e);return Math.round(t*n)/n}function wc(e){let t=F.useRef(e);return bc(()=>{t.current=e}),t}function Tc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=F.useState(r);xc(f,r)||p(r);let[m,h]=F.useState(null),[g,_]=F.useState(null),v=F.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=F.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=F.useRef(null),C=F.useRef(null),w=F.useRef(u),T=c!=null,E=wc(c),D=wc(i),O=wc(l),k=F.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),vc(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!xc(w.current,t)&&(w.current=t,yc.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bc(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=F.useRef(!1);bc(()=>(A.current=!0,()=>{A.current=!1}),[]),bc(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=F.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=F.useMemo(()=>({reference:b,floating:x}),[b,x]),te=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Cc(j.floating,u.x),r=Cc(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sc(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return F.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:te}),[u,k,ee,j,te])}var Ec=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:_c({element:r.current,padding:i}).fn(n):r?_c({element:r,padding:i}).fn(n):{}}}},Dc=(e,t)=>{let n=hc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Oc=(e,t)=>{let n=gc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{let n=Ec(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ac=`div`;function jc(e,t){let n=`headlessui-control-${(0,F.useId)()}`,[r,i]=po(),[a,o]=ro(),s=na(),{disabled:c=s||!1,...l}=e,u=ea({disabled:c}),d={ref:t,disabled:c||void 0,"aria-disabled":c||void 0},f=ca();return F.createElement(ra,{value:c},F.createElement(i,{value:r},F.createElement(o,{value:a},F.createElement(Va,{id:n},f({ourProps:d,theirProps:{...l,children:F.createElement(Fa,null,typeof l.children==`function`?l.children(u):l.children)},slot:u,defaultTag:Ac,name:`Field`})))))}var Mc=ha(jc),Nc=(e=>(e[e.RegisterOption=0]=`RegisterOption`,e[e.UnregisterOption=1]=`UnregisterOption`,e))(Nc||{}),Pc={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:jo(n,e=>e.element.current)}},1(e,t){let n=e.options.slice(),r=e.options.findIndex(e=>e.id===t.id);return r===-1?e:(n.splice(r,1),{...e,options:n})}},Fc=(0,F.createContext)(null);Fc.displayName=`RadioGroupDataContext`;function Ic(e){let t=(0,F.useContext)(Fc);if(t===null){let t=Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ic),t}return t}var Lc=(0,F.createContext)(null);Lc.displayName=`RadioGroupActionsContext`;function Rc(e){let t=(0,F.useContext)(Lc);if(t===null){let t=Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Rc),t}return t}function zc(e,t){return aa(t.type,Pc,e,t)}var Bc=`div`;function Vc(e,t){let n=(0,F.useId)(),r=na(),{id:i=`headlessui-radiogroup-${n}`,value:a,form:o,name:s,onChange:c,by:l,disabled:u=r||!1,defaultValue:d,tabIndex:f=0,...p}=e,m=yo(l),[h,g]=(0,F.useReducer)(zc,{options:[]}),_=h.options,[v,y]=po(),[b,x]=ro(),S=(0,F.useRef)(null),C=$a(S,t),w=Ca(d),[T,E]=Sa(a,c,w),D=(0,F.useMemo)(()=>_.find(e=>!e.propsRef.current.disabled),[_]),O=(0,F.useMemo)(()=>_.some(e=>m(e.propsRef.current.value,T)),[_,T]),k=$i(e=>{if(u||m(e,T))return!1;let t=_.find(t=>m(t.propsRef.current.value,e))?.propsRef.current;return t!=null&&t.disabled?!1:(E?.(e),!0)}),A=$i(e=>{if(!S.current)return;let t=_.filter(e=>e.propsRef.current.disabled===!1).map(e=>e.element.current);switch(e.key){case co.Enter:Da(e.currentTarget);break;case co.ArrowLeft:case co.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Mo(t,So.Previous|So.WrapAround)===Co.Success){let e=_.find(e=>qi(e.element.current));e&&k(e.propsRef.current.value)}break;case co.ArrowRight:case co.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Mo(t,So.Next|So.WrapAround)===Co.Success){let e=_.find(e=>qi(e.element.current));e&&k(e.propsRef.current.value)}break;case co.Space:{e.preventDefault(),e.stopPropagation();let t=_.find(e=>qi(e.element.current));t&&k(t.propsRef.current.value)}break}}),ee=$i(e=>(g({type:0,...e}),()=>g({type:1,id:e.id}))),j=(0,F.useMemo)(()=>({value:T,firstOption:D,containsCheckedOption:O,disabled:u,compare:m,tabIndex:f,...h}),[T,D,O,u,m,f,h]),te=(0,F.useMemo)(()=>({registerOption:ee,change:k}),[ee,k]),ne={ref:C,id:i,role:`radiogroup`,"aria-labelledby":v,"aria-describedby":b,onKeyDown:A},re=ea({value:T}),M=(0,F.useCallback)(()=>{if(w!==void 0)return k(w)},[k,w]),ie=ca();return F.createElement(x,{name:`RadioGroup.Description`},F.createElement(y,{name:`RadioGroup.Label`},F.createElement(Lc.Provider,{value:te},F.createElement(Fc.Provider,{value:j},s!=null&&F.createElement(La,{disabled:u,data:{[s]:T||`on`},overrides:{type:`radio`,checked:T!=null},form:o,onReset:M}),ie({ourProps:ne,theirProps:p,slot:re,defaultTag:Bc,name:`RadioGroup`})))))}var Hc=`div`;function Uc(e,t){let n=Ic(`RadioGroup.Option`),r=Rc(`RadioGroup.Option`),i=(0,F.useId)(),{id:a=`headlessui-radiogroup-option-${i}`,value:o,disabled:s=n.disabled||!1,autoFocus:c=!1,...l}=e,u=(0,F.useRef)(null),d=$a(u,t),[f,p]=po(),[m,h]=ro(),g=Qi({value:o,disabled:s});Zi(()=>r.registerOption({id:a,element:u,propsRef:g}),[a,r,u,g]);let _=$i(e=>{var t;if(Xa(e.currentTarget))return e.preventDefault();r.change(o)&&((t=u.current)==null||t.focus())}),v=n.firstOption?.id===a,{isFocusVisible:y,focusProps:b}=Bi({autoFocus:c}),{isHovered:x,hoverProps:S}=zi({isDisabled:s}),C=n.compare(n.value,o),w=ma({ref:d,id:a,role:`radio`,"aria-checked":C?`true`:`false`,"aria-labelledby":f,"aria-describedby":m,"aria-disabled":s?!0:void 0,tabIndex:(()=>s?-1:C||!n.containsCheckedOption&&v?n.tabIndex:-1)(),onClick:s?void 0:_,autoFocus:c},b,S),T=ea({checked:C,disabled:s,active:y,hover:x,focus:y,autofocus:c}),E=ca();return F.createElement(h,{name:`RadioGroup.Description`},F.createElement(p,{name:`RadioGroup.Label`},E({ourProps:w,theirProps:l,slot:T,defaultTag:Hc,name:`RadioGroup.Option`})))}var Wc=`span`;function Gc(e,t){let n=Ic(`Radio`),r=Rc(`Radio`),i=(0,F.useId)(),a=Ba(),o=na(),{id:s=a||`headlessui-radio-${i}`,value:c,disabled:l=n.disabled||o||!1,autoFocus:u=!1,...d}=e,f=(0,F.useRef)(null),p=$a(f,t),m=fo(),h=no(),g=Qi({value:c,disabled:l});Zi(()=>r.registerOption({id:s,element:f,propsRef:g}),[s,r,f,g]);let _=$i(e=>{var t;if(Xa(e.currentTarget))return e.preventDefault();r.change(c)&&((t=f.current)==null||t.focus())}),{isFocusVisible:v,focusProps:y}=Bi({autoFocus:u}),{isHovered:b,hoverProps:x}=zi({isDisabled:l}),S=n.firstOption?.id===s,C=n.compare(n.value,c),w=ma({ref:p,id:s,role:`radio`,"aria-checked":C?`true`:`false`,"aria-labelledby":m,"aria-describedby":h,"aria-disabled":l?!0:void 0,tabIndex:(()=>l?-1:C||!n.containsCheckedOption&&S?n.tabIndex:-1)(),autoFocus:u,onClick:l?void 0:_},y,x),T=ea({checked:C,disabled:l,hover:b,focus:v,autofocus:u});return ca()({ourProps:w,theirProps:d,slot:T,defaultTag:Wc,name:`Radio`})}var Kc=ha(Vc),qc=ha(Uc),Jc=ha(Gc),Yc=_o,Xc=so,Zc=Object.assign(Kc,{Option:qc,Radio:Jc,Label:Yc,Description:Xc});function Qc({group:e,titleMap:t,defaultValue:n,className:r,onChange:i,large:a,iconMap:o,ariaLabel:s}){let c=Object.entries(e);return(0,I.jsx)(Zc,{value:n,className:P(`flex flex-wrap gap-0`,{"gap-2":a},r),"aria-label":s,onChange:i,children:c.map(([e,n])=>(0,I.jsx)(Mc,{children:(0,I.jsx)(Jc,{value:e,className:`group`,title:t?.[e]??n,children:(0,I.jsxs)(`div`,{className:Le(`group btn btn--text cursor-pointer gap-2 text-xs transition-all duration-200 hover:opacity-100! focus-visible:opacity-100!`,{"group-data-checked:bg-blue-primary group-data-checked:fill-primary-text-dark group-data-checked:text-primary-text-dark group-data-checked:border-blue-primary hover:fill-blue-primary hover:text-blue-primary hover:border-blue-primary h-auto flex-col place-items-center items-center rounded border border-transparent p-1":a,"group-data-checked:btn--primary hover:not-group-data-checked:text-primary-text/70 dark:hover:not-group-data-checked:text-primary-text-dark/70 flex h-auto w-max items-center justify-between gap-2 rounded-lg border-transparent px-1 py-1 text-xs/none":!a}),children:[(0,I.jsx)(N,{className:`opacity-100!`,path:o[e],size:a?`1.5rem`:`1rem`,color:`currentColor`}),(0,I.jsx)(_o,{className:`cursor-pointer font-normal opacity-100!`,children:n})]})})},e))})}const $c={FILE_TYPE:`FILE_SIZE`,TOP_CONTRIBUTOR:`MOST_CONTRIBUTIONS`,MOST_COMMITS:`MOST_COMMITS`,LAST_CHANGED:`LAST_CHANGED`,MOST_CONTRIBUTIONS:`MOST_CONTRIBUTIONS`},el=(0,F.memo)(function(){let{metricType:e,chartType:t,sizeMetric:n,linkMetricAndSizeMetric:r,setMetricType:i,setChartType:a,setSizeMetricType:o}=tt();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`card__subtitle`,children:`Layout`}),(0,I.jsx)(Qc,{group:Qe,defaultValue:t,iconMap:{BUBBLE_CHART:Ve,TREE_MAP:Ge,PARTITION:nn},ariaLabel:`Select layout`,onChange:e=>a(e)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`card__subtitle`,title:`Select the metric used to size the visualization`,children:`Size`}),(0,I.jsx)(Qc,{titleMap:Ke,group:ot,defaultValue:n,iconMap:{FILE_SIZE:_e,EQUAL_SIZE:te,MOST_COMMITS:w,LAST_CHANGED:vt,MOST_CONTRIBUTIONS:bt},ariaLabel:`Select size metric`,onChange:e=>{o(e)}})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`card__subtitle`,title:`Select the metric used to color the visualization`,children:`Color`}),(0,I.jsx)(Qc,{titleMap:Tt,group:Nt,defaultValue:e,iconMap:{FILE_TYPE:st,LAST_CHANGED:vt,MOST_COMMITS:w,TOP_CONTRIBUTOR:x,MOST_CONTRIBUTIONS:bt},ariaLabel:`Select color metric`,onChange:e=>{if(i(e),!r)return;let t=$c[e];t&&o(t)}})]})]})});function tl(){let{metricType:e,hierarchyType:t,transitionsEnabled:n,showFilesWithoutChanges:r,linkMetricAndSizeMetric:i,showOnlySearchMatches:a,setLinkMetricAndSizeMetric:o,setTransitionsEnabled:s,labelsVisible:c,setLabelsVisible:l,setHierarchyType:u,setSizeMetricType:d,setShowFilesWithoutChanges:f,setShowOnlySearchMatches:p}=tt();return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(`div`,{className:`flex min-h-0 max-w-max flex-col items-start justify-center gap-3 overflow-y-auto p-2 pl-0`,children:[(0,I.jsxs)(sn,{className:`group text-sm hover:text-blue-500 hover:opacity-100`,checked:!!i,title:`Enable to sync size metric with color metric`,onChange:t=>{o(t.target.checked),t.target.checked&&d($c[e])},children:[(0,I.jsx)(N,{className:`ml-1.5`,path:D,size:`1.25em`}),(0,I.jsx)(`span`,{children:`Link size and color option`})]}),(0,I.jsxs)(sn,{className:`group text-sm hover:text-blue-500 hover:opacity-100`,checked:n,title:`Disable to improve performance when zooming`,onChange:e=>s(e.target.checked),children:[(0,I.jsx)(N,{className:`ml-1.5`,path:ae,size:`1.25em`}),`Transitions`]}),(0,I.jsxs)(sn,{className:`group text-sm hover:text-blue-500 hover:opacity-100`,checked:c,title:`Disable to improve performance`,onChange:e=>l(e.target.checked),children:[(0,I.jsx)(N,{className:`ml-1.5`,path:Oe,size:`1.25em`}),`Labels`]}),(0,I.jsxs)(sn,{className:`group text-sm hover:text-blue-500 hover:opacity-100`,checked:r,title:`Show files that have had no changes in the selected time range`,onChange:e=>f(e.target.checked),children:[(0,I.jsx)(N,{className:`ml-1.5`,path:kt,size:`1.25em`}),`Show files with no activity`]}),(0,I.jsxs)(sn,{className:`group text-sm hover:text-blue-500 hover:opacity-100`,checked:t===`FLAT`,title:`Show all files on the same level, instead of as a file tree`,onChange:()=>{u(t===`FLAT`?`NESTED`:`FLAT`)},children:[(0,I.jsx)(N,{className:`ml-1.5`,path:Et,size:`1.25em`}),`Flatten file tree`]}),(0,I.jsxs)(sn,{className:`group text-sm hover:text-blue-500 hover:opacity-100`,checked:a,title:`When searching, hide files that do not match the search query`,onChange:e=>p(e.target.checked),children:[(0,I.jsx)(N,{className:`ml-1.5`,path:pt,size:`1.25em`}),`Show only search matches`]}),(0,I.jsx)(nl,{})]})})}function nl(){let{renderCutOff:e,setRenderCutOff:t}=tt(),[n,r]=(0,F.useState)(e),[i,a]=(0,F.useTransition)();return(0,I.jsxs)(`label`,{className:`label group flex w-full items-center justify-start gap-2 text-sm hover:text-blue-500 hover:opacity-100`,title:`Increase to improve render performance, decrease it to get higher level of detail`,children:[(0,I.jsxs)(`span`,{className:`group flex grow items-center gap-2`,children:[(0,I.jsx)(N,{className:`ml-1.5`,path:Ye,size:`1.25em`}),`Pixel render cut-off `,i?(0,I.jsx)(`img`,{src:C,alt:``,"aria-hidden":`true`,className:`h-5`}):``]}),(0,I.jsx)(`input`,{type:`number`,min:0,value:n,className:`mr-1 w-12 place-self-end border-b-2`,onChange:e=>{let n=Number.isNaN(e.target.valueAsNumber)?qt().renderCutOff:e.target.valueAsNumber;r(n),a(()=>t(n))}})]})}var rl={"app-settings":{content:(0,I.jsx)(tl,{}),title:`Settings`,icon:gt},"group-authors":{content:(0,I.jsx)(Mr,{}),title:`Group Authors`,icon:ze},"ignore-files":{content:(0,I.jsx)(Pr,{}),title:`Hide files`,icon:Ct}},il=k(Object.keys(rl)).withOptions({shallow:!1});function al(e=null){let[t,n]=ye(`modal`,il);return{modal:t,openModal:(t=e)=>void n(t),closeModal:()=>n(null)}}function ol(){let[e,t]=ye(`modal`,il),n=(0,F.useRef)(null),r=()=>t(null);if((0,F.useEffect)(()=>{let t=n.current;if(t)return e?(document.body.style.setProperty(`overflow`,`hidden`),t.open||t.showModal()):(document.body.style.setProperty(`overflow`,null),t.open&&t.close()),()=>{document.body.style.setProperty(`overflow`,null)}},[e]),!e)return null;let i=rl[e];return(0,I.jsx)(`dialog`,{ref:n,"aria-modal":!0,open:!1,closedby:`any`,className:`z-10 m-auto flex flex-col bg-transparent text-inherit backdrop:bg-gray-400/75 backdrop:backdrop-blur-xs dark:backdrop:bg-gray-800/75`,onClose:r,children:(0,I.jsxs)(`div`,{className:`card flex min-h-0 max-w-(--breakpoint-2xl) gap-2 rounded-xl p-4 shadow-sm`,children:[(0,I.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-row items-center gap-2`,children:[(0,I.jsx)(N,{path:i.icon,size:`1.75em`}),(0,I.jsx)(`h2`,{className:`text-2xl font-semibold`,children:i.title})]}),(0,I.jsx)(ht,{absolute:!1,className:`justify-self-end px-1`,onClick:r})]}),(0,I.jsx)(`span`,{className:`w-full border-b-3 border-gray-500 px-20`}),i.content??null]})})}function sl(){let{openModal:e}=al(`ignore-files`);return(0,I.jsx)(`button`,{className:`btn btn--icon`,title:`Hidden files`,"aria-label":`Hidden files`,onClick:()=>e(),children:(0,I.jsx)(N,{path:Ct})})}function cl(){let e=o();return(0,I.jsxs)(l,{method:`post`,action:ct(),children:[(0,I.jsx)(`input`,{type:`hidden`,name:`rerollColors`,value:``}),(0,I.jsxs)(`button`,{className:`btn w-full`,disabled:e.state!==`idle`,children:[(0,I.jsx)(N,{path:Ht}),`Shuffle colors`]})]})}function ll({hoveredObject:e}){let{metricType:t}=tt(),[n]=ie(),r=n.get(t);if(r===void 0)throw Error(`Metric cache is undefined`);let{minValue:i,maxValue:a,minColor:o,maxColor:s}=r.legend,{clickedObject:c}=yr(),l=c?.path??e?.path??null,u=l?r.colormap.get(l):null,d=u?en(u):-1;u===`#c0c0c0`&&(d=-1);let f=(0,F.useMemo)(()=>{let e=en(o),t=en(s)-e;return t===0?1:(d-e)/t},[d,s,o]),p=l!==null,m=Math.round((a-i)/2);return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`relative h-4 rounded-sm`,style:{backgroundImage:`linear-gradient(to right, ${o}, ${s})`},children:(0,I.jsx)(jt,{offset:f*100,visible:p})}),(0,I.jsxs)(`div`,{className:`flex justify-between`,children:[(0,I.jsx)(`span`,{className:`font-bold`,title:i.toLocaleString(),children:ve(i)}),(0,I.jsx)(`span`,{className:`absolute left-1/2 -translate-x-1/2 font-bold`,title:m.toLocaleString(),children:ve(m)}),(0,I.jsx)(`span`,{className:`font-bold`,title:a.toLocaleString(),children:ve(a)})]})]})}var ul=s(((e,t)=>{var n=!1,r=function(){};if(n){var i=function(e,t){var n=arguments.length;t=Array(n>1?n-1:0);for(var r=1;r<n;r++)t[r-1]=arguments[r];var i=0,a=`Warning: `+e.replace(/%s/g,function(){return t[i++]});typeof console<`u`&&console.error(a);try{throw Error(a)}catch{}};r=function(e,t,n){var r=arguments.length;n=Array(r>2?r-2:0);for(var a=2;a<r;a++)n[a-2]=arguments[a];if(t===void 0)throw Error("`warning(condition, format, ...args)` requires a warning message argument");e||i.apply(null,[t].concat(n))}}t.exports=r})),dl=Math.sqrt(50),fl=Math.sqrt(10),pl=Math.sqrt(2);function ml(e,t,n){var r,i=-1,a,o,s;if(t=+t,e=+e,n=+n,e===t&&n>0)return[e];if((r=t<e)&&(a=e,e=t,t=a),(s=hl(e,t,n))===0||!isFinite(s))return[];if(s>0){let n=Math.round(e/s),r=Math.round(t/s);for(n*s<e&&++n,r*s>t&&--r,o=Array(a=r-n+1);++i<a;)o[i]=(n+i)*s}else{s=-s;let n=Math.round(e*s),r=Math.round(t*s);for(n/s<e&&++n,r/s>t&&--r,o=Array(a=r-n+1);++i<a;)o[i]=(n+i)/s}return r&&o.reverse(),o}function hl(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/10**i;return i>=0?(a>=dl?10:a>=fl?5:a>=pl?2:1)*10**i:-(10**-i)/(a>=dl?10:a>=fl?5:a>=pl?2:1)}var gl=c(ul());function _l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_l(Object(n),!0).forEach(function(t){Sl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yl(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function bl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xl(e,t,n){return t&&bl(e.prototype,t),n&&bl(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Sl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cl(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&Tl(e,t)}function wl(e){return wl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wl(e)}function Tl(e,t){return Tl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Tl(e,t)}function El(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dl(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Ol(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Dl(e)}function kl(e){var t=El();return function(){var n=wl(e),r;if(t){var i=wl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ol(this,r)}}function Al(e,t){return Nl(e)||Fl(e,t)||Il(e,t)||zl()}function jl(e){return Ml(e)||Pl(e)||Il(e)||Rl()}function Ml(e){if(Array.isArray(e))return Ll(e)}function Nl(e){if(Array.isArray(e))return e}function Pl(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Fl(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Il(e,t){if(e){if(typeof e==`string`)return Ll(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ll(e,t)}}function Ll(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rl(){throw TypeError(`Invalid attempt to spread non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zl(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Bl=`react-compound-slider:`;function Vl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return function(t,n){return t.val>n.val?e?-1:1:n.val>t.val?e?1:-1:0}}function Hl(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=e.findIndex(function(e){return e.key===t});if(i!==-1){var a=e[i],o=a.key;return a.val===n?e:[].concat(jl(e.slice(0,i)),[{key:o,val:n}],jl(e.slice(i+1))).sort(Vl(r))}return e}function Ul(e,t){if(!e)return[0,0];var n=e.getBoundingClientRect();return[t?n.top:n.left,t?n.bottom:n.right]}function Wl(e){var t=e.type,n=t===void 0?``:t,r=e.touches;return!r||r.length>1||n.toLowerCase()===`touchend`&&r.length>0}function Gl(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function Kl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=0;return{handles:e.map(function(e){var t=n.getValue(e);return e!==t&&(i+=1,(0,gl.default)(!r,`${Bl} Invalid value encountered. Changing ${e} to ${t}.`)),t}).map(function(e,t){return{key:`\$\$-${t}`,val:e}}).sort(Vl(t)),changes:i}}function ql(e,t){return t}function Jl(e,t){for(var n=0;n<e.length;n++)if(e[n].key!==t[n].key||t[n+1]&&t[n].val===t[n+1].val)return e;return t}function Yl(e,t,n,r,i){for(var a=-1,o=!0,s=0;s<e.length;s++){var c=e[s],l=t[s];if(!l||l.key!==c.key)return e;l.val!==c.val&&(a=s,o=l.val-c.val>0)}if(a===-1)return e;for(var u=o?n:-n,d=0;d<t.length;d++){var f=t[d],p=t[d+1];if(p&&f.val===p.val)if(d===a){var m=p.val+u;if(i(m)===m){var h=Yl(t,Hl(t,p.key,p.val+u,r),n,r,i);return h===t?e:h}else return e}else{var g=f.val+u;if(i(g)===g){var _=Yl(t,Hl(t,f.key,f.val+u,r),n,r,i);return _===t?e:_}else return e}}return t}function Xl(){var e=[...arguments];return function(t){return e.forEach(function(e){return e&&e(t)})}}var Zl=function(){return{value:0,percent:0}},Ql=function(e){Cl(n,e);var t=kl(n);function n(){var e;yl(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),e.getRailProps=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.props,r=n.emitMouse,i=n.emitTouch;return vl(vl({},t),{},{onMouseDown:Xl(t&&t.onMouseDown,r),onTouchStart:Xl(t&&t.onTouchStart,i)})},e}return xl(n,[{key:`render`,value:function(){var e=this.getRailProps,t=this.props,n=t.getEventData,r=t.activeHandleID,i=r===void 0?``:r,a=t.children,o=a({getEventData:n||Zl,activeHandleID:i,getRailProps:e});return o&&F.Children.only(o)}}]),n}(F.Component),$l=function(e){Cl(n,e);var t=kl(n);function n(){var e;yl(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),e.autofocus=function(e){e.target instanceof HTMLElement&&e.target.focus()},e.getHandleProps=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.props,i=r.emitKeyboard,a=r.emitMouse,o=r.emitTouch;return vl(vl({},n),{},{onKeyDown:Xl(n&&n.onKeyDown,function(e){return i&&i(e,t)}),onMouseDown:Xl(n&&n.onMouseDown,e.autofocus,function(e){return a&&a(e,t)}),onTouchStart:Xl(n&&n.onTouchStart,function(e){return o&&o(e,t)})})},e}return xl(n,[{key:`render`,value:function(){var e=this.getHandleProps,t=this.props,n=t.activeHandleID,r=n===void 0?``:n,i=t.children,a=t.handles,o=i({handles:a===void 0?[]:a,activeHandleID:r,getHandleProps:e});return o&&F.Children.only(o)}}]),n}(F.Component),eu=function(){function e(){yl(this,e),this.interpolator=void 0,this.domain=[0,1],this.range=[0,1],this.domain=[0,1],this.range=[0,1],this.interpolator=null}return xl(e,[{key:`createInterpolator`,value:function(e,t){var n=this,r=e[0],i=e[1],a=t[0],o=t[1];return i<r?function(e){return n.interpolateValue(o,a)(n.deinterpolateValue(i,r)(e))}:function(e){return n.interpolateValue(a,o)(n.deinterpolateValue(r,i)(e))}}},{key:`interpolateValue`,value:function(e,t){return e=+e,t-=e,function(n){return e+t*n}}},{key:`deinterpolateValue`,value:function(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(){return t}}},{key:`rescale`,value:function(){return this.interpolator=null,this}},{key:`getValue`,value:function(e){var t=this.domain,n=this.range;return(this.interpolator||=this.createInterpolator(t,n))(+e)}},{key:`setDomain`,value:function(e){return this.domain=[e[0],e[1]],this.rescale(),this}},{key:`getDomain`,value:function(){return this.domain}},{key:`setRange`,value:function(e){return this.range=[e[0],e[1]],this}},{key:`getRange`,value:function(){return this.range}},{key:`getTicks`,value:function(e){var t=this.domain;return ml(t[0],t[t.length-1],e||10)}}]),e}(),tu=function(){return{value:0,percent:0}},nu=function(e){Cl(n,e);var t=kl(n);function n(){return yl(this,n),t.apply(this,arguments)}return xl(n,[{key:`render`,value:function(){var e=this.props,t=e.children,n=e.values,r=e.scale,i=r===void 0?new eu:r,a=e.count,o=a===void 0?10:a,s=e.getEventData,c=s===void 0?tu:s,l=e.activeHandleID,u=t({getEventData:c,activeHandleID:l===void 0?``:l,ticks:(n||i.getTicks(o)).map(function(e){return{id:`\$\$-${e}`,value:e,percent:i.getValue(e)}})});return u&&F.Children.only(u)}}]),n}(F.Component),ru=function(){return{value:0,percent:0}},iu=function(e){Cl(n,e);var t=kl(n);function n(){var e;yl(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),e.getTrackProps=function(t){var n=e.props,r=n.emitMouse,i=n.emitTouch;return vl(vl({},t||{}),{},{onMouseDown:Xl(t&&t.onMouseDown,r),onTouchStart:Xl(t&&t.onTouchStart,i)})},e}return xl(n,[{key:`render`,value:function(){for(var e=this.getTrackProps,t=this.props,n=t.children,r=t.left,i=r===void 0?!0:r,a=t.right,o=a===void 0?!0:a,s=t.scale,c=s===void 0?new eu:s,l=t.handles,u=l===void 0?[]:l,d=t.getEventData,f=d===void 0?ru:d,p=t.activeHandleID,m=p===void 0?``:p,h=c.getDomain(),g=[],_=0;_<u.length+1;_++){var v=u[_-1],y=u[_];_===0&&i===!0?v={id:`$`,value:h[0],percent:0}:_===u.length&&o===!0&&(y={id:`$`,value:h[1],percent:100}),v&&y&&g.push({id:`${v.id}-${y.id}`,source:v,target:y})}var b=n({getEventData:f,activeHandleID:m,tracks:g,getTrackProps:e});return b&&F.Children.only(b)}}]),n}(F.Component);function au(e,t,n){return Math.min(Math.max(e,t),n)}var ou=xl(function e(){var t=this;yl(this,e),this.step=1,this.domain=[0,1],this.range=[0,1],this.setDomain=function(e){return t.domain=[e[0],e[1]],t},this.setRange=function(e){return t.range=[e[0],e[1]],t},this.setStep=function(e){return t.step=e,t},this.getValue=function(e){var n=Al(t.domain,2),r=n[0],i=n[1],a=Al(t.range,2),o=a[0],s=a[1],c=t.step,l=(au(e,r,i)-r)/(i-r);return au(c*Math.round(l*(s-o)/c)+o,o<s?o:s,s>o?s:o)}}),su=typeof window<`u`&&typeof document<`u`,cu=function(){},lu=function(e){return function(t,n,r){return t&&e[r]===n}},uu=function(e,t){return e===t||e.length===t.length&&e.reduce(lu(t),!0)},du=function(e){if(!(0,F.isValidElement)(e))return!1;var t=e.type,n=t?t.name:``;return n===$l.name||n===Ql.name||n===nu.name||n===iu.name},fu=function(e,t,n,r){var i=r?e-t:e+t;return r?Math.max(n[0],i):Math.min(n[1],i)},pu=function(e,t,n,r){var i=r?e+t:e-t;return r?Math.min(n[1],i):Math.max(n[0],i)},mu=[0,100],hu=function(e){Cl(n,e);var t=kl(n);function n(){var e;yl(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),e.state={step:.1,values:[],domain:mu,handles:[],reversed:!1,activeHandleID:``,valueToPerc:null,valueToStep:null,pixelToStep:null},e.slider=F.createRef(),e.onKeyDown=function(t,n){var r=[`ArrowRight`,`ArrowUp`],i=[`ArrowDown`,`ArrowLeft`],a=Dl(e),o=a.state.handles,s=a.props,c=s.step,l=c===void 0?.1:c,u=s.reversed,d=u===void 0?!1:u,f=s.vertical,p=f===void 0?!1:f,m=s.domain,h=m===void 0?[0,100]:m,g=t.key||`${t.keyCode}`;if(r.concat(i).includes(g)){if(p){var _=[i,r];r=_[0],i=_[1]}t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault();var v=o.find(function(e){return e.key===n});if(v){var y=v.val,b=y;r.includes(g)?b=fu(y,l,h,d):i.includes(g)&&(b=pu(y,l,h,d));var x=o.map(function(e){return e.key===n?{key:e.key,val:b}:e});e.submitUpdate(x,!0)}}},e.onMouseDown=function(t,n){e.onStart(t,n,!1)},e.onTouchStart=function(t,n){Wl(t)||e.onStart(t,n,!0)},e.getEventData=function(t,n){var r=Dl(e),i=r.state,a=i.pixelToStep,o=i.valueToPerc,s=r.props.vertical;a.setDomain(Ul(e.slider.current,s));var c;return n&&t instanceof TouchEvent?c=a.getValue(Gl(s,t)):t instanceof MouseEvent&&(c=a.getValue(s?t.clientY:t.pageX)),{value:c,percent:o.getValue(c)}},e.onMouseMove=function(t){var n=Dl(e),r=n.state,i=r.handles,a=r.pixelToStep,o=r.activeHandleID,s=o===void 0?``:o,c=n.props,l=c.vertical,u=c.reversed,d=u===void 0?!1:u;a.setDomain(Ul(e.slider.current,l));var f=Hl(i,s,a.getValue(l?t.clientY:t.pageX),d);e.submitUpdate(f)},e.onTouchMove=function(t){var n=Dl(e),r=n.state,i=r.handles,a=r.pixelToStep,o=r.activeHandleID,s=n.props,c=s.vertical,l=s.reversed;if(!(a===null||Wl(t))){a.setDomain(Ul(e.slider.current,c));var u=Hl(i,o,a.getValue(Gl(c,t)),l);e.submitUpdate(u)}},e.onMouseUp=function(){var t=Dl(e),n=t.state,r=n.handles,i=r===void 0?[]:r,a=n.activeHandleID,o=t.props,s=o.onChange,c=s===void 0?cu:s,l=o.onSlideEnd,u=l===void 0?cu:l;c(i.map(function(e){return e.val})),u(i.map(function(e){return e.val}),{activeHandleID:a}),e.setState({activeHandleID:``}),su&&(document.removeEventListener(`mousemove`,e.onMouseMove),document.removeEventListener(`mouseup`,e.onMouseUp))},e.onTouchEnd=function(){var t=Dl(e),n=t.state,r=n.handles,i=n.activeHandleID,a=t.props,o=a.onChange,s=o===void 0?cu:o,c=a.onSlideEnd,l=c===void 0?cu:c;s(r.map(function(e){return e.val})),l(r.map(function(e){return e.val}),{activeHandleID:i}),e.setState({activeHandleID:``}),su&&(document.removeEventListener(`touchmove`,e.onTouchMove),document.removeEventListener(`touchend`,e.onTouchEnd))},e}return xl(n,[{key:`componentDidMount`,value:function(){var e=this.state.pixelToStep,t=this.props.vertical;e.setDomain(Ul(this.slider.current,t))}},{key:`componentWillUnmount`,value:function(){this.removeListeners()}},{key:`removeListeners`,value:function(){su&&(document.removeEventListener(`mousemove`,this.onMouseMove),document.removeEventListener(`mouseup`,this.onMouseUp),document.removeEventListener(`touchmove`,this.onTouchMove),document.removeEventListener(`touchend`,this.onTouchEnd))}},{key:`onStart`,value:function(e,t,n){var r=this.state.handles,i=this.props.onSlideStart,a=i===void 0?cu:i;n||e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),r.find(function(e){return e.key===t})?(this.setState({activeHandleID:t}),a(r.map(function(e){return e.val}),{activeHandleID:t}),n?this.addTouchEvents():this.addMouseEvents()):(this.setState({activeHandleID:``}),this.handleRailAndTrackClicks(e,n))}},{key:`handleRailAndTrackClicks`,value:function(e,t){var n=this,r=this.state,i=r.handles,a=r.pixelToStep,o=this.props,s=o.vertical,c=o.reversed,l=c===void 0?!1:c,u=this.slider;a.setDomain(Ul(u.current,s));for(var d=t?a.getValue(Gl(s,e)):a.getValue(s?e.clientY:e.pageX),f=``,p=1/0,m=0;m<i.length;m++){var h=i[m],g=h.key,_=h.val,v=Math.abs(_-d);v<p&&(f=g,p=v)}var y=Hl(i,f,d,l);this.setState({activeHandleID:f},function(){n.submitUpdate(y,!0),t?n.addTouchEvents():n.addMouseEvents()})}},{key:`addMouseEvents`,value:function(){su&&(document.addEventListener(`mousemove`,this.onMouseMove),document.addEventListener(`mouseup`,this.onMouseUp))}},{key:`addTouchEvents`,value:function(){su&&(document.addEventListener(`touchmove`,this.onTouchMove),document.addEventListener(`touchend`,this.onTouchEnd))}},{key:`submitUpdate`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.props,r=n.mode,i=r===void 0?1:r,a=n.step,o=a===void 0?.1:a,s=n.onUpdate,c=s===void 0?cu:s,l=n.onChange,u=l===void 0?cu:l,d=n.reversed,f=d===void 0?!1:d,p=this.state.valueToStep.getValue;this.setState(function(n){var r=n.handles,a=[];if(typeof i==`function`)a=i(r,e,o,f,p),(0,gl.default)(Array.isArray(a),`Custom mode function did not return an array.`);else switch(i){case 1:a=ql(r,e);break;case 2:a=Jl(r,e);break;case 3:a=Yl(r,e,o,f,p);break;default:a=e,(0,gl.default)(!1,`${Bl} Invalid mode value.`)}return c(a.map(function(e){return e.val})),t&&u(a.map(function(e){return e.val})),{handles:a}})}},{key:`render`,value:function(){var e=this,t=this.state,n=t.handles,r=t.valueToPerc,i=t.activeHandleID,a=this.props,o=a.className,s=a.rootStyle,c=s===void 0?{}:s,l=a.rootProps,u=l===void 0?{}:l,d=a.component,f=d===void 0?`div`:d,p=a.disabled,m=p===void 0?!1:p,h=a.flatten,g=h===void 0?!1:h,_=n.map(function(e){var t=e.key,n=e.val;return{id:t,value:n,percent:r.getValue(n)}}),v=F.Children.map(this.props.children,function(t){return du(t)===!0?F.cloneElement(t,{scale:r,handles:_,activeHandleID:i,getEventData:e.getEventData,emitKeyboard:m?cu:e.onKeyDown,emitMouse:m?cu:e.onMouseDown,emitTouch:m?cu:e.onTouchStart}):t});return g?F.createElement(F.Fragment,null,F.createElement(f,vl(vl({},u),{},{style:c,className:o,ref:this.slider})),v):F.createElement(F.Fragment,null,F.createElement(f,vl(vl({},u),{},{style:c,className:o,ref:this.slider}),v))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.step,r=n===void 0?.1:n,i=e.values,a=e.domain,o=a===void 0?mu:a,s=e.reversed,c=s===void 0?!1:s,l=e.onUpdate,u=l===void 0?cu:l,d=e.onChange,f=d===void 0?cu:d,p=e.warnOnChanges,m=p===void 0?!1:p,h=t.valueToPerc,g=t.valueToStep,_=t.pixelToStep,v={};if((!h||!g||!_)&&(h=new eu,g=new ou,_=new ou,v.valueToPerc=h,v.valueToStep=g,v.pixelToStep=_),t.domain===mu||t.step===null||t.domain===null||t.reversed===null||r!==t.step||o[0]!==t.domain[0]||o[1]!==t.domain[1]||c!==t.reversed){var y=Al(o,2),b=y[0],x=y[1];g.setStep(r).setRange([b,x]).setDomain([b,x]),c===!0?(h.setDomain([b,x]).setRange([100,0]),_.setStep(r).setRange([x,b])):(h.setDomain([b,x]).setRange([0,100]),_.setStep(r).setRange([b,x])),(0,gl.default)(x>b,`${Bl} Max must be greater than min (even if reversed). Max is ${x}. Min is ${b}.`);var S=Kl(i||t.values,c,g,m),C=S.handles;(S.changes||i===void 0||i===t.values)&&(u(C.map(function(e){return e.val})),f(C.map(function(e){return e.val}))),v.step=r,v.values=i,v.domain=o===mu?jl(o):o,v.handles=C,v.reversed=c}else if(!uu(i,t.values)){var w=Kl(i,c,g,m),T=w.handles;w.changes&&(u(T.map(function(e){return e.val})),f(T.map(function(e){return e.val}))),v.values=i,v.handles=T}return Object.keys(v).length?v:null}}]),n}(F.PureComponent);function gu({domain:[e,t],children:n,disabled:r,handle:i,handleType:a=`round`,title:o,getHandleProps:s,className:c,onClick:l}){return(0,I.jsx)(`button`,{className:P(`absolute z-10 flex size-5 -translate-x-1/2 -translate-y-1.5 place-content-center disabled:grayscale`,{"size-5 rounded-full":a===`round`},r?`cursor-progress`:`cursor-col-resize`,c),role:`slider`,"aria-disabled":r,"aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":i.value,title:o,style:{left:`${i.percent}%`},onClick:l,...s(i.id),children:(0,I.jsx)(`div`,{className:P(`btn--primary`,{"size-5 rounded-full":a===`round`,"h-5 w-0.5":a===`square`}),children:n})})}function _u({getRailProps:e,className:t=``,children:n}){return(0,I.jsx)(`div`,{className:P(`bg-blue-secondary/20 absolute h-2 w-full cursor-pointer`,{},t),...e(),children:n})}function vu({source:e,target:t,trackType:n=`round`,getTrackProps:r,disabled:i}){return(0,I.jsx)(`div`,{className:P(`btn btn--primary absolute h-2 cursor-pointer p-0`,i?`bg-primary-text-dark dark:bg-primary-text`:`bg-blue-primary`,{"rounded-full":n===`round`,"rounded-none":n===`square`}),style:{left:`${e.percent}%`,width:`${t.percent-e.percent}%`},...r()})}var yu={left:`start`,center:`center`,right:`end`};function bu({valueMap:e,titleMap:t=e,onTop:n=!1}){let r=Object.entries(e).length;return(0,I.jsx)(nu,{count:r,children:({ticks:r})=>(0,I.jsx)(`div`,{className:`grid grid-flow-col grid-cols-3 grid-rows-[1fr_auto] pt-4`,children:r.map(r=>{let i=e[r.value*100],a=r.value===0?`left`:r.value===1?`right`:`center`,o=(0,I.jsx)(`div`,{className:`flex justify-${i?yu[a]:`center`}`,children:(0,I.jsx)(`div`,{className:`h-2 w-px bg-gray-950 dark:bg-gray-50`})}),s=(0,I.jsx)(`div`,{title:t[r.value*100],className:`truncate text-xs`,style:{textAlign:a},children:i});return(0,I.jsxs)(I.Fragment,{children:[n?s:o,n?o:s]},r.id)})})})}function xu({className:e=``,count:t,tickToLabel:n,onTop:r=!0,align:i,below:a=!1}){return(0,I.jsx)(`div`,{className:P(`grid grid-flow-col grid-cols-(--cols) gap-1 text-xs`,{"grid-rows-[auto]":!a&&!r,"grid-rows-[auto_auto]":a!==r,"grid-rows-[auto_auto_auto]":a&&r},e),style:{"--cols":`repeat(${t}, minmax(0, 1fr))`},children:Array.from({length:t}).map((e,o)=>{let s=o/(t-1),c=n(s,o),l=i??(s===0?`left`:s===1?`right`:`center`),u=c?yu[l]:`center`;return(0,I.jsxs)(I.Fragment,{children:[r?(0,I.jsx)(Su,{justification:u}):null,(0,I.jsx)(`div`,{className:P(`text-${l}`),children:c===0?``:c}),a?(0,I.jsx)(Su,{justification:u}):null]},o)})})}const Su=({className:e=``,justification:t=`start`})=>(0,I.jsx)(`div`,{className:P(`flex`,`justify-${t}`,e),children:(0,I.jsx)(`div`,{className:`h-2 w-px bg-gray-950 dark:bg-gray-50`})});function Cu({hoveredObject:e}){let{metricType:t}=tt(),[n]=ie(),{steps:r,textGenerator:i,colorGenerator:a,offsetStepCalc:o}=n.get(t).legend,s=100/r,c=!1,l=0,u=yr().clickedObject??e??null;return be(u)&&(c=!0,l=s/2+s*o(u)),(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(`div`,{className:`relative`,children:(0,I.jsxs)(`div`,{className:`relative flex text-xs whitespace-nowrap`,children:[[...Array(r)].map((e,t)=>r>=4?(0,I.jsx)(wu,{className:t===0?`rounded-l-sm`:t===r-1?`rounded-r-sm`:``,width:s,color:a(t),text:i(t),top:t%2==0},t):(0,I.jsx)(Tu,{width:s,color:a(t),text:i(t)},t)),(0,I.jsx)(jt,{offset:l,visible:c})]})})})}function wu({className:e=``,width:t,color:n,text:r,top:i}){return i?(0,I.jsxs)(`div`,{className:`flex flex-col`,style:{width:`${t}%`},children:[(0,I.jsx)(`div`,{className:`h-5 truncate text-left`,title:r,children:r}),(0,I.jsx)(Su,{className:`ml-1`}),(0,I.jsx)(`div`,{className:P(`h-4`,e),style:{backgroundColor:n}}),(0,I.jsx)(Su,{className:`invisible`})]}):(0,I.jsxs)(`div`,{className:`flex flex-col`,style:{width:`${t}%`},children:[(0,I.jsx)(`div`,{className:`invisible h-5 text-left`,children:r}),(0,I.jsx)(Su,{className:`invisible`}),(0,I.jsx)(`div`,{className:P(`h-4`,e),style:{backgroundColor:n}}),(0,I.jsx)(Su,{}),(0,I.jsx)(`div`,{className:`h-5 truncate text-left`,children:r})]})}function Tu({width:e,color:t,text:n}){return(0,I.jsxs)(`div`,{className:`flex flex-col`,style:{width:`${e}%`},children:[(0,I.jsx)(`div`,{className:`h-5 truncate text-left`,children:n}),(0,I.jsx)(Su,{}),(0,I.jsx)(`div`,{className:`h-5`,style:{backgroundColor:t}})]})}function Eu({className:e=``}){let{dominantAuthorCutoff:t,setDominantAuthorCutoff:n}=tt(),[r,i]=(0,F.useState)(t),a=[0,100];return(0,I.jsxs)(`div`,{className:P(`grid grid-cols-[calc(11*var(--spacing))_1fr] px-3`,e),children:[(0,I.jsxs)(`p`,{title:`Min percentage of changes a file's top author must account for to be colored.`,children:[r,`%`]}),(0,I.jsx)(`div`,{className:`relative`,title:`Adjust the dominant author percentage cutoff`,children:(0,I.jsxs)(hu,{mode:1,step:1,domain:a,values:[r],onChange:e=>{n(e[0]),(0,F.startTransition)(()=>{i(e[0])})},onUpdate:e=>{(0,F.startTransition)(()=>{i(e[0])})},children:[(0,I.jsx)(Ql,{children:_u}),(0,I.jsx)($l,{children:({handles:e,getHandleProps:t})=>(0,I.jsx)(F.Fragment,{children:e.map(e=>(0,I.jsx)(gu,{handle:e,domain:a,getHandleProps:t},e.id))})}),(0,I.jsx)(iu,{right:!1,children:({tracks:e,getTrackProps:t})=>(0,I.jsx)(F.Fragment,{children:e.map(({id:e,...n})=>(0,F.createElement)(vu,{...n,key:e,backgroundColor:y,getTrackProps:t}))})}),(0,I.jsx)(bu,{valueMap:{0:`Top author`,50:`Majority author`,100:`Single author`}})]})})]})}function Du({compact:e=!1}){let{openModal:t}=al(`group-authors`);return(0,I.jsxs)(`button`,{className:P(`btn`,{"btn--icon":e}),title:`Group authors`,"aria-label":`Group authors`,onClick:()=>t(),children:[(0,I.jsx)(N,{path:ze}),e?null:(0,I.jsx)(`span`,{children:`Group Authors`})]})}function Ou({hoveredObject:e}){let{sizeMetric:t,metricType:n}=tt(),[r]=ie(),i=(0,F.useDeferredValue)(e),a=r.get(n)??void 0,o=(0,F.useMemo)(()=>{if(a===void 0)return null;switch(lt(n)){case`POINT`:return(0,I.jsx)(De,{});case`GRADIENT`:return(0,I.jsx)(ll,{hoveredObject:i});case`SEGMENTS`:return(0,I.jsx)(Cu,{hoveredObject:i})}},[a,i,n]);return o===null?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`card__subtitle`,children:`Size legend`}),(0,I.jsx)(`p`,{className:`mb-2 text-sm`,children:Yt[t]}),(0,I.jsx)(`h3`,{className:`card__subtitle`,children:`Color legend`}),(0,I.jsx)(`p`,{className:`mb-4 text-sm`,children:Tt[n]}),n===`TOP_CONTRIBUTOR`?(0,I.jsx)(Eu,{className:`my-4`}):null,o,n===`TOP_CONTRIBUTOR`?(0,I.jsxs)(`div`,{className:`mt-2 grid w-full grid-cols-[1fr_1fr] gap-2`,children:[(0,I.jsx)(Du,{}),(0,I.jsx)(cl,{})]}):null]})}function ku({className:e=``,showProgress:t=!1,fetchProgress:n=!0,loadingText:r}){let[i]=ye(`path`),o=a();(0,F.useEffect)(()=>{o.state===`idle`&&t&&n&&o.load(_(`/view/progress`)+b_({path:i}))},[n,o,o.state,i,t]);let[s,c]=(0,F.useMemo)(()=>{if(!o.data)return[`Loading truck...`,0];let{progress:e,analyzationStatus:t}=o.data;switch(t){case`Starting`:return[`Loading truck...`,0];case`GeneratingChart`:return[`Unloading truck...`,100];default:return[e<100?`Driving to destination...`:`Parking truck...`,e]}},[o.data]);return(0,I.jsx)(`div`,{className:Le(`grid h-full w-full place-items-center px-4`,e),children:(0,I.jsxs)(`div`,{className:`flex w-full max-w-[clamp(16rem,80vw,36rem)] flex-col gap-4 px-2 py-2`,children:[(0,I.jsx)(`img`,{src:!t||c>0&&c<100?C:Ot,alt:`🚛`,className:`pixelated aspect-square w-full`}),t?(0,I.jsx)(`div`,{className:`text-center text-3xl font-bold`,children:s}):null,t?(0,I.jsx)(`div`,{className:`h-6 w-3/4 self-center rounded-2xl bg-gray-300`,children:(0,I.jsx)(`div`,{className:P(`bg-blue-primary h-[calc(100%-4px)] min-w-[calc(var(--spacing)*6-4px)] translate-x-0.5 translate-y-0.5 rounded-2xl transition-[width] ease-in-out`,{"animate-skeet":!c}),style:{width:c?`calc(${Math.min(c,100)}% - 4px)`:`40px`}})}):null,r?(0,I.jsx)(`div`,{className:`text-center font-bold`,children:r}):null]})})}const Au=`options`;function ju({children:e,data:t}){let[n,r]=(0,F.useState)(()=>{let e=typeof document<`u`?localStorage.getItem(Au):null;return{...qt(),...e?JSON.parse(e):{},hasLoadedSavedOptions:!!e}}),[i,a]=(0,F.useState)({}),o=(0,F.useMemo)(()=>Object.values(i).length>0,[i]),s=Mt(),[c]=ye(`zoomPath`),l=(0,F.useMemo)(()=>({...t.databaseInfo,fileTree:O(t.databaseInfo.fileTree,c??void 0)}),[t.databaseInfo,c]),u=(0,F.useMemo)(()=>ft({...t,databaseInfo:l},t.databaseInfo.colorSeed,t.databaseInfo.authorColors,n?.dominantAuthorCutoff??70,s),[t,l,n?.dominantAuthorCutoff,s]),d=(0,F.useMemo)(()=>({...n,setMetricType:e=>r(t=>({...t,metricType:e})),setChartType:e=>r(t=>({...t,chartType:e})),setHierarchyType:e=>r(t=>({...t,hierarchyType:e})),setCommitSearch:e=>r(t=>({...t,commitSearch:e})),setSizeMetricType:e=>r(t=>({...t,sizeMetric:e})),setHoveredBlob:e=>r(t=>({...t,hoveredBlob:e})),setTransitionsEnabled:e=>r(t=>({...t,transitionsEnabled:e})),setLabelsVisible:e=>r(t=>({...t,labelsVisible:e})),setRenderCutOff:e=>r(t=>({...t,renderCutOff:e})),setShowFilesWithoutChanges:e=>r(t=>({...t,showFilesWithoutChanges:e})),setDominantAuthorCutoff:e=>r(t=>({...t,dominantAuthorCutoff:e})),setLinkMetricAndSizeMetric:e=>r(t=>({...t,linkMetricAndSizeMetric:e})),setShowOnlySearchMatches:e=>r(t=>({...t,showOnlySearchMatches:e}))}),[n]);return(0,F.useEffect)(()=>{let e=!1;return n&&(typeof requestIdleCallback==`function`?requestIdleCallback(()=>{e||localStorage.setItem(Au,JSON.stringify(n))}):localStorage.setItem(Au,JSON.stringify(n))),()=>{e=!0}},[n]),(0,I.jsx)(ce.Provider,{value:{...t,databaseInfo:l},children:(0,I.jsx)(Fe.Provider,{value:u,children:(0,I.jsx)(St.Provider,{value:d,children:(0,I.jsx)(br.Provider,{value:{searchResults:i,hasSearchResults:o,setSearchResults:a},children:e})})})})}function Mu(e,t){let n={};function r(e){for(let i of e.children)i.path.toLowerCase().includes(t.toLowerCase())&&t&&(n[i.path]=i),i.type===`tree`&&r(i)}return r(e),n}const Nu=(0,F.memo)(function(){let e=(0,F.useRef)(null),[t]=ye(`zoomPath`),[n,r]=(0,F.useTransition)(),[i,a]=(0,F.useState)(``),{clickedObject:o,setClickedObject:s}=yr(),{searchResults:c,setSearchResults:l}=xr(),u=(0,F.useMemo)(()=>Object.values(c),[c]),d=(0,F.useId)(),{databaseInfo:f}=me();(0,F.useEffect)(()=>{l(i.length>0?Mu(f.fileTree,i):{})},[i,l,f.fileTree]);let p=tt(),[m]=ie(),h=Object.keys(c).map(()=>(0,F.createRef)());(0,F.useEffect)(()=>{r(()=>{i.trim()===``?l({}):l(Mu(f.fileTree,i))})},[i,f.fileTree,l]),Jt({key:`f`,ctrlOrMeta:!0},t=>{t.preventDefault(),e.current?.focus()});function g(e){h[e].current?.focus()}let _=Object.values(c),v=`Search within ${t?t.split(j(t)).at(-1):f.repo}`;return(0,I.jsxs)(`form`,{className:`w-sidepanel not-focus-within:has-placeholder-shown:w-button pointer-events-none absolute right-0 z-10 flex flex-col gap-2 transition-[left,width,translate] duration-75 **:pointer-events-auto not-focus-within:has-placeholder-shown:static not-focus-within:has-placeholder-shown:translate-x-0`,onSubmit:e=>{e.preventDefault(),a(``),e.currentTarget.querySelector(`input`)?.blur()},children:[(0,I.jsx)(`button`,{className:`hidden min-w-max cursor-pointer peer-placeholder-shown:hidden peer-focus:inline`,children:(0,I.jsx)(N,{path:zt,size:`1em`})}),(0,I.jsxs)(`label`,{className:`input min-h-button h-button max-h-button relative flex w-full min-w-0 cursor-pointer flex-row-reverse items-center gap-2 overflow-hidden not-focus-within:has-placeholder-shown:grow-0 not-focus-within:has-placeholder-shown:gap-0`,title:v,children:[(0,I.jsx)(`input`,{ref:e,className:`peer w-full grow placeholder-shown:not-focus:w-0 placeholder-shown:not-focus:min-w-0`,id:d,type:`search`,placeholder:v,value:i,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault(),e.key===`Escape`&&(e.preventDefault(),a(``),l({}),e.currentTarget.blur()),e.key===`ArrowDown`&&(e.preventDefault(),h.length>0&&g(0))},onFocus:()=>{o&&s(null)},onBlur:e=>{e.currentTarget.form?.[d].value.trim()===``&&(a(``),l({}))},onChange:e=>{a(e.target.value)}}),(0,I.jsx)(N,{path:$t,className:`hidden min-w-max peer-placeholder-shown:inline peer-focus:hidden`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Search`}),n||i.length>0?(0,I.jsx)(`p`,{className:`text-secondary-text dark:text-secondary-text-dark absolute right-8 ml-2 text-sm select-none`,children:n?`Searching...`:i.length>0?`${u.length} results`:null}):null]}),u.length>0?(0,I.jsx)(`div`,{className:`card bg-tertiary-bg/10 dark:bg-tertiary-bg-dark/50 w-sidepanel max-h-sidepanel relative min-h-0 overflow-auto backdrop-blur-lg`,children:_.map((t,n)=>(0,I.jsxs)(`button`,{ref:h[n],className:`flex cursor-pointer items-center justify-start gap-2 text-sm font-bold`,title:t.path,type:`reset`,value:t.path,onKeyDown:t=>{let n=h.findIndex(e=>e.current===t.currentTarget);if(t.key===`Escape`&&(e.current?.focus(),e.current?.select()),t.key===`ArrowDown`){if(t.preventDefault(),h.length===0)return;g((n+1)%h.length)}if(t.key===`ArrowUp`){if(t.preventDefault(),h.length===0)return;let r=n-1;if(r<0){e.current?.focus(),e.current?.select();return}g(r)}},onClick:()=>s(t),children:[t.type===`tree`?(0,I.jsx)(N,{path:t.type===`tree`?ut:Pt,size:.75,className:`shrink-0`}):(0,I.jsx)(N,{color:m.get(p.metricType)?.colormap.get(t.path)??`grey`,path:nt,size:.75,className:`shrink-0`}),(0,I.jsx)(`span`,{className:`text-secondary-text dark:hover:text-primary-text-dark hover:text-primary-text dark:text-secondary-text-dark truncate`,children:t.path.split(j(t.path)).slice(1).join(`/`)??t.path})]},t.path))}):null]})}),Pu=6048e5,Fu=6e4,Iu=36e5,Lu=3600*24;Lu*7,Lu*365.2425;const Ru=Symbol.for(`constructDateFrom`);function z(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Ru in e?e[Ru](t):e instanceof Date?new e.constructor(t):new Date(t)}function B(e,t){return z(t||e,e)}function zu(e,t,n){let r=B(e,n?.in);return isNaN(t)?z(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Bu(e,t,n){let r=B(e,n?.in);if(isNaN(t))return z(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=z(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}function Vu(e,t,n){return z(n?.in||e,+B(e)+t)}function Hu(e,t,n){return Vu(e,t*Iu,n)}var Uu={};function Wu(){return Uu}function Gu(e,t){let n=Wu(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=B(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Ku(e,t){return Gu(e,{...t,weekStartsOn:1})}function qu(e,t){let n=B(e,t?.in),r=n.getFullYear(),i=z(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=Ku(i),o=z(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=Ku(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Ju(e){let t=B(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function Yu(e,...t){let n=z.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Xu(e,t){let n=B(e,t?.in);return n.setHours(0,0,0,0),n}function Zu(e,t,n){let[r,i]=Yu(n?.in,e,t),a=Xu(r),o=Xu(i),s=+a-Ju(a),c=+o-Ju(o);return Math.round((s-c)/864e5)}function Qu(e,t){let n=qu(e,t),r=z(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ku(r)}function $u(e,t,n){let r=B(e,n?.in);return r.setTime(r.getTime()+t*Fu),r}function ed(e,t,n){return Bu(e,t*3,n)}function td(e,t,n){return Vu(e,t*1e3,n)}function nd(e,t,n){return zu(e,t*7,n)}function rd(e,t,n){return Bu(e,t*12,n)}function id(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=z.bind(null,e));let t=B(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),z(r,n||NaN)}function ad(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=z.bind(null,e));let t=B(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),z(r,n||NaN)}function od(e,t,n){let[r,i]=Yu(n?.in,e,t);return+Xu(r)==+Xu(i)}function sd(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function cd(e){return!(!sd(e)&&typeof e!=`number`||isNaN(+B(e)))}function ld(e,t,n){let[r,i]=Yu(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function ud(e,t){let n=B(e,t?.in);return Math.trunc(n.getMonth()/3)+1}function dd(e,t,n){let[r,i]=Yu(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=ud(r)-ud(i);return a*4+o}function fd(e,t,n){let[r,i]=Yu(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function pd(e,t,n){let[r,i]=Yu(n?.in,e,t),a=md(r,i),o=Math.abs(Zu(r,i));r.setDate(r.getDate()-a*o);let s=a*(o-Number(md(r,i)===-a));return s===0?0:s}function md(e,t){let n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function hd(e,t){let n=B(e,t?.in);return n.setHours(23,59,59,999),n}function gd(e,t){let n=B(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function _d(e,t){let n=B(e,t?.in),r=n.getMonth(),i=r-r%3;return n.setMonth(i,1),n.setHours(0,0,0,0),n}function vd(e,t){let n=B(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function yd(e,t){let n=B(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function bd(e,t){let n=B(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function xd(e,t){let n=Wu(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=B(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}var Sd={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}};const Cd=(e,t,n)=>{let r,i=Sd[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function wd(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Td={date:wd({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:wd({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:wd({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})};var Ed={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`};const Dd=(e,t,n,r)=>Ed[e];function Od(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const kd={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:Od({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Od({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Od({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:Od({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:Od({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Ad(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Md(s,e=>e.test(o)):jd(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function jd(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Md(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Nd(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const Pd={code:`en-US`,formatDistance:Cd,formatLong:Td,formatRelative:Dd,localize:kd,match:{ordinalNumber:Nd({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:Ad({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Ad({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Ad({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Ad({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Ad({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Fd(e,t){let n=B(e,t?.in);return Zu(n,bd(n))+1}function Id(e,t){let n=B(e,t?.in),r=Ku(n)-+Qu(n);return Math.round(r/Pu)+1}function Ld(e,t){let n=B(e,t?.in),r=n.getFullYear(),i=Wu(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=z(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Gu(o,t),c=z(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Gu(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Rd(e,t){let n=Wu(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ld(e,t),a=z(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Gu(a,t)}function zd(e,t){let n=B(e,t?.in),r=Gu(n,t)-+Rd(n,t);return Math.round(r/Pu)+1}function V(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const Bd={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return V(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):V(n+1,2)},d(e,t){return V(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return V(e.getHours()%12||12,t.length)},H(e,t){return V(e.getHours(),t.length)},m(e,t){return V(e.getMinutes(),t.length)},s(e,t){return V(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return V(Math.trunc(r*10**(n-3)),t.length)}};var Vd={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`};const Hd={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Bd.y(e,t)},Y:function(e,t,n,r){let i=Ld(e,r),a=i>0?i:1-i;return t===`YY`?V(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):V(a,t.length)},R:function(e,t){return V(qu(e),t.length)},u:function(e,t){return V(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return V(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return V(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Bd.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return V(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=zd(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):V(i,t.length)},I:function(e,t,n){let r=Id(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):V(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Bd.d(e,t)},D:function(e,t,n){let r=Fd(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):V(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return V(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return V(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return V(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?Vd.noon:r===0?Vd.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?Vd.evening:r>=12?Vd.afternoon:r>=4?Vd.morning:Vd.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Bd.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Bd.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):V(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):V(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Bd.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Bd.s(e,t)},S:function(e,t){return Bd.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Wd(r);case`XXXX`:case`XX`:return Gd(r);case`XXXXX`:case`XXX`:default:return Gd(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Wd(r);case`xxxx`:case`xx`:return Gd(r);case`xxxxx`:case`xxx`:default:return Gd(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Ud(r,`:`);case`OOOO`:default:return`GMT`+Gd(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Ud(r,`:`);case`zzzz`:default:return`GMT`+Gd(r,`:`)}},t:function(e,t,n){return V(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return V(+e,t.length)}};function Ud(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+V(a,2)}function Wd(e,t){return e%60==0?(e>0?`-`:`+`)+V(Math.abs(e)/60,2):Gd(e,t)}function Gd(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=V(Math.trunc(r/60),2),a=V(r%60,2);return n+i+t+a}var Kd=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},qd=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}};const Jd={p:qd,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Kd(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Kd(r,t)).replace(`{{time}}`,qd(i,t))}};var Yd=/^D+$/,Xd=/^Y+$/,Zd=[`D`,`DD`,`YY`,`YYYY`];function Qd(e){return Yd.test(e)}function $d(e){return Xd.test(e)}function ef(e,t,n){let r=tf(e,t,n);if(console.warn(r),Zd.includes(e))throw RangeError(r)}function tf(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var nf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,af=/^'([^]*?)'?$/,of=/''/g,sf=/[a-zA-Z]/;function cf(e,t,n){let r=Wu(),i=n?.locale??r.locale??Pd,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=B(e,n?.in);if(!cd(s))throw RangeError(`Invalid time value`);let c=t.match(rf).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Jd[t];return n(e,i.formatLong)}return e}).join(``).match(nf).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:lf(e)};if(Hd[t])return{isToken:!0,value:e};if(t.match(sf))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&$d(a)||!n?.useAdditionalDayOfYearTokens&&Qd(a))&&ef(a,t,String(e));let o=Hd[a[0]];return o(s,a,i.localize,l)}).join(``)}function lf(e){let t=e.match(af);return t?t[1].replace(of,`'`):e}function uf(e,t){return B(e,t?.in).getDate()}function df(e,t){return B(e,t?.in).getDay()}function ff(e,t){let n=B(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=z(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function pf(){return Object.assign({},Wu())}function mf(e,t){return B(e,t?.in).getHours()}function hf(e,t){let n=B(e,t?.in).getDay();return n===0?7:n}function gf(e,t){return B(e,t?.in).getMinutes()}function _f(e,t){return B(e,t?.in).getMonth()}function vf(e){return B(e).getSeconds()}function yf(e){return+B(e)}function H(e,t){return B(e,t?.in).getFullYear()}function bf(e,t){return+B(e)>+B(t)}function xf(e,t){return+B(e)<+B(t)}function Sf(e,t){return+B(e)==+B(t)}function Cf(e,t){let n=wf(t)?new t(0):z(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function wf(e){return typeof e==`function`&&e.prototype?.constructor===e}var Tf=10,Ef=class{subPriority=0;validate(e,t){return!0}},Df=class extends Ef{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},Of=class extends Ef{priority=Tf;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>z(t,e))}set(e,t){return t.timestampIsSet?e:z(e,Cf(e,this.context))}},U=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new Df(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},kf=class extends U{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});case`GGGG`:default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]};const W={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Af={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function G(e,t){return e&&{value:t(e.value),rest:e.rest}}function K(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function jf(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*Iu+a*Fu+o*1e3),rest:t.slice(n[0].length)}}function Mf(e){return K(W.anyDigitsSigned,e)}function q(e,t){switch(e){case 1:return K(W.singleDigit,t);case 2:return K(W.twoDigits,t);case 3:return K(W.threeDigits,t);case 4:return K(W.fourDigits,t);default:return K(RegExp(`^\\d{1,`+e+`}`),t)}}function Nf(e,t){switch(e){case 1:return K(W.singleDigitSigned,t);case 2:return K(W.twoDigitsSigned,t);case 3:return K(W.threeDigitsSigned,t);case 4:return K(W.fourDigitsSigned,t);default:return K(RegExp(`^-?\\d{1,`+e+`}`),t)}}function Pf(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;case`am`:case`midnight`:case`night`:default:return 0}}function Ff(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function If(e){return e%400==0||e%4==0&&e%100!=0}var Lf=class extends U{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return G(q(4,e),r);case`yo`:return G(n.ordinalNumber(e,{unit:`year`}),r);default:return G(q(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=Ff(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Rf=class extends U{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return G(q(4,e),r);case`Yo`:return G(n.ordinalNumber(e,{unit:`year`}),r);default:return G(q(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=Ld(e,r);if(n.isTwoDigitYear){let t=Ff(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Gu(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Gu(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},zf=class extends U{priority=130;parse(e,t){return Nf(t===`R`?4:t.length,e)}set(e,t,n){let r=z(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ku(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Bf=class extends U{priority=130;parse(e,t){return Nf(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},Vf=class extends U{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return q(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Hf=class extends U{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return q(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Uf=class extends U{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return G(K(W.month,e),r);case`MM`:return G(q(2,e),r);case`Mo`:return G(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},Wf=class extends U{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return G(K(W.month,e),r);case`LL`:return G(q(2,e),r);case`Lo`:return G(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function Gf(e,t,n){let r=B(e,n?.in),i=zd(r,n)-t;return r.setDate(r.getDate()-i*7),B(r,n?.in)}var Kf=class extends U{priority=100;parse(e,t,n){switch(t){case`w`:return K(W.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return q(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return Gu(Gf(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function qf(e,t,n){let r=B(e,n?.in),i=Id(r,n)-t;return r.setDate(r.getDate()-i*7),r}var Jf=class extends U{priority=100;parse(e,t,n){switch(t){case`I`:return K(W.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return q(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return Ku(qf(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Yf=[31,28,31,30,31,30,31,31,30,31,30,31],Xf=[31,29,31,30,31,30,31,31,30,31,30,31],Zf=class extends U{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return K(W.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return q(t.length,e)}}validate(e,t){let n=If(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=Xf[r]:t>=1&&t<=Yf[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},Qf=class extends U{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return K(W.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return q(t.length,e)}}validate(e,t){return If(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function $f(e,t,n){let r=Wu(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=B(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return zu(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var ep=class extends U{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEE`:default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=$f(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},tp=class extends U{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return G(q(t.length,e),i);case`eo`:return G(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeee`:default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=$f(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},np=class extends U{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return G(q(t.length,e),i);case`co`:return G(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`cccc`:default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=$f(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function rp(e,t,n){let r=B(e,n?.in);return zu(r,t-hf(r,n),n)}var ip=class extends U{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return q(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return G(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return G(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return G(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiii`:default:return G(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=rp(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},ap=class extends U{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Pf(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},op=class extends U{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Pf(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},sp=class extends U{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Pf(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},cp=class extends U{priority=70;parse(e,t,n){switch(t){case`h`:return K(W.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return q(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},lp=class extends U{priority=70;parse(e,t,n){switch(t){case`H`:return K(W.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return q(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},up=class extends U{priority=70;parse(e,t,n){switch(t){case`K`:return K(W.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return q(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},dp=class extends U{priority=70;parse(e,t,n){switch(t){case`k`:return K(W.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return q(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},fp=class extends U{priority=60;parse(e,t,n){switch(t){case`m`:return K(W.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return q(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},pp=class extends U{priority=50;parse(e,t,n){switch(t){case`s`:return K(W.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return q(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},mp=class extends U{priority=30;parse(e,t){return G(q(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},hp=class extends U{priority=10;parse(e,t){switch(t){case`X`:return jf(Af.basicOptionalMinutes,e);case`XX`:return jf(Af.basic,e);case`XXXX`:return jf(Af.basicOptionalSeconds,e);case`XXXXX`:return jf(Af.extendedOptionalSeconds,e);case`XXX`:default:return jf(Af.extended,e)}}set(e,t,n){return t.timestampIsSet?e:z(e,e.getTime()-Ju(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},gp=class extends U{priority=10;parse(e,t){switch(t){case`x`:return jf(Af.basicOptionalMinutes,e);case`xx`:return jf(Af.basic,e);case`xxxx`:return jf(Af.basicOptionalSeconds,e);case`xxxxx`:return jf(Af.extendedOptionalSeconds,e);case`xxx`:default:return jf(Af.extended,e)}}set(e,t,n){return t.timestampIsSet?e:z(e,e.getTime()-Ju(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},_p=class extends U{priority=40;parse(e){return Mf(e)}set(e,t,n){return[z(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},vp=class extends U{priority=20;parse(e){return Mf(e)}set(e,t,n){return[z(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`};const yp={G:new kf,y:new Lf,Y:new Rf,R:new zf,u:new Bf,Q:new Vf,q:new Hf,M:new Uf,L:new Wf,w:new Kf,I:new Jf,d:new Zf,D:new Qf,E:new ep,e:new tp,c:new np,i:new ip,a:new ap,b:new op,B:new sp,h:new cp,H:new lp,K:new up,k:new dp,m:new fp,s:new pp,S:new mp,X:new hp,x:new gp,t:new _p,T:new vp};var bp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sp=/^'([^]*?)'?$/,Cp=/''/g,wp=/\S/,Tp=/[a-zA-Z]/;function Ep(e,t,n,r){let i=()=>z(r?.in||n,NaN),a=pf(),o=r?.locale??a.locale??Pd,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():B(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new Of(r?.in,n)],d=t.match(xp).map(e=>{let t=e[0];if(t in Jd){let n=Jd[t];return n(e,o.formatLong)}return e}).join(``).match(bp),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&$d(n)&&ef(n,t,e),!r?.useAdditionalDayOfYearTokens&&Qd(n)&&ef(n,t,e);let a=n[0],s=yp[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=f.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&f.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);f.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(Tp))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=Dp(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&wp.test(e))return i();let p=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=B(n,r?.in);if(isNaN(+m))return i();let h={};for(let e of p){if(!e.validate(m,l))return i();let t=e.set(m,h,l);Array.isArray(t)?(m=t[0],Object.assign(h,t[1])):m=t}return m}function Dp(e){return e.match(Sp)[1].replace(Cp,`'`)}function Op(e,t,n){let[r,i]=Yu(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function kp(e,t,n){let[r,i]=Yu(n?.in,e,t);return+_d(r)==+_d(i)}function Ap(e,t,n){let[r,i]=Yu(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function jp(e,t,n){let r=+B(e,n?.in),[i,a]=[+B(t.start,n?.in),+B(t.end,n?.in)].sort((e,t)=>e-t);return r>=i&&r<=a}function Mp(e,t,n){return zu(e,-t,n)}function Np(e,t){let n=()=>z(t?.in,NaN),r=t?.additionalDigits??2,i=Rp(e),a;if(i.date){let e=zp(i.date,r);a=Bp(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=Hp(i.time),isNaN(s)))return n();if(i.timezone){if(c=Wp(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=B(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return B(o+s+c,t?.in)}var Pp={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fp=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ip=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Lp=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Rp(e){let t={},n=e.split(Pp.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Pp.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Pp.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=Pp.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function zp(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function Bp(e,t){if(t===null)return new Date(NaN);let n=e.match(Fp);if(!n)return new Date(NaN);let r=!!n[4],i=Vp(n[1]),a=Vp(n[2])-1,o=Vp(n[3]),s=Vp(n[4]),c=Vp(n[5])-1;if(r)return Xp(t,s,c)?Gp(t,s,c):new Date(NaN);{let e=new Date(0);return!Jp(t,a,o)||!Yp(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function Vp(e){return e?parseInt(e):1}function Hp(e){let t=e.match(Ip);if(!t)return NaN;let n=Up(t[1]),r=Up(t[2]),i=Up(t[3]);return Zp(n,r,i)?n*Iu+r*Fu+i*1e3:NaN}function Up(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function Wp(e){if(e===`Z`)return 0;let t=e.match(Lp);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Qp(r,i)?n*(r*Iu+i*Fu):NaN}function Gp(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var Kp=[31,null,31,30,31,30,31,31,30,31,30,31];function qp(e){return e%400==0||e%4==0&&e%100!=0}function Jp(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Kp[t]||(qp(e)?29:28))}function Yp(e,t){return t>=1&&t<=(qp(e)?366:365)}function Xp(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Zp(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Qp(e,t){return t>=0&&t<=59}function $p(e,t,n){let r=B(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=z(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=ff(o);return r.setMonth(t,Math.min(a,s)),r}function em(e,t,n){let r=B(e,n?.in);return r.setHours(t),r}function tm(e,t,n){let r=B(e,n?.in);return r.setMinutes(t),r}function nm(e,t,n){let r=B(e,n?.in),i=t-(Math.trunc(r.getMonth()/3)+1);return $p(r,r.getMonth()+i*3)}function rm(e,t,n){let r=B(e,n?.in);return r.setSeconds(t),r}function im(e,t,n){let r=B(e,n?.in);return isNaN(+r)?z(n?.in||e,NaN):(r.setFullYear(t),r)}function am(e,t,n){return Bu(e,-t,n)}function om(e,t,n){return ed(e,-t,n)}function sm(e,t,n){return nd(e,-t,n)}function cm(e,t,n){return rd(e,-t,n)}var lm=typeof document<`u`?F.useLayoutEffect:function(){},um={...F}.useInsertionEffect||(e=>e());function dm(e){let t=F.useRef(()=>{});return um(()=>{t.current=e}),F.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}v();var fm=`ArrowLeft`,pm=`ArrowRight`,mm=`ArrowUp`,hm=`ArrowDown`,gm=[fm,pm],_m=[mm,hm];[...gm,..._m];var vm={...F},ym=!1,bm=0,xm=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ bm++;function Sm(){let[e,t]=F.useState(()=>ym?xm():void 0);return lm(()=>{e??t(xm())},[]),F.useEffect(()=>{ym=!0},[]),e}var Cm=vm.useId||Sm,wm=F.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:o=14,height:s=7,tipRadius:c=0,strokeWidth:l=0,staticOffset:u,stroke:d,d:f,style:{transform:p,...m}={},...h}=e,g=Cm(),[_,v]=F.useState(!1);if(lm(()=>{r&&Zo(r).direction===`rtl`&&v(!0)},[r]),!r)return null;let[y,b]=n.split(`-`),x=y===`top`||y===`bottom`,S=u;(x&&a!=null&&a.x||!x&&a!=null&&a.y)&&(S=null);let C=l*2,w=C/2,T=o/2*(c/-8+1),E=s/2*c/4,D=!!f,O=S&&b===`end`?`bottom`:`top`,k=S&&b===`end`?`right`:`left`;S&&_&&(k=b===`end`?`left`:`right`);let A=i?.x==null?``:S||i.x,ee=i?.y==null?``:S||i.y,j=f||`M0,0`+(` H`+o)+(` L`+(o-T)+`,`+(s-E))+(` Q`+o/2+`,`+s+` `+T+`,`+(s-E))+` Z`,te={top:D?`rotate(180deg)`:``,left:D?`rotate(90deg)`:`rotate(-90deg)`,bottom:D?``:`rotate(180deg)`,right:D?`rotate(-90deg)`:`rotate(90deg)`}[y];return(0,I.jsxs)(`svg`,{...h,"aria-hidden":!0,ref:t,width:D?o:o+C,height:o,viewBox:`0 0 `+o+` `+(s>o?s:o),style:{position:`absolute`,pointerEvents:`none`,[k]:A,[O]:ee,[y]:x||D?`100%`:`calc(100% - `+C/2+`px)`,transform:[te,p].filter(e=>!!e).join(` `),...m},children:[C>0&&(0,I.jsx)(`path`,{clipPath:`url(#`+g+`)`,fill:`none`,stroke:d,strokeWidth:C+(f?0:1),d:j}),(0,I.jsx)(`path`,{stroke:C&&!f?h.fill:`none`,d:j}),(0,I.jsx)(`clipPath`,{id:g,children:(0,I.jsx)(`rect`,{x:-w,y:w*(D?-1:1),width:o+C,height:o})})]})});function Tm(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var Em=F.createContext(null),Dm=F.createContext(null),Om=()=>F.useContext(Em)?.id||null,km=()=>F.useContext(Dm);function Am(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=Cm(),a=F.useRef({}),[o]=F.useState(()=>Tm()),s=Om()!=null,[c,l]=F.useState(r.reference),u=dm((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=F.useMemo(()=>({setPositionReference:l}),[]),f=F.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return F.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function jm(e){e===void 0&&(e={});let{nodeId:t}=e,n=Am({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=F.useState(null),[s,c]=F.useState(null),l=i?.domReference||a,u=F.useRef(null),d=km();lm(()=>{l&&(u.current=l)},[l]);let f=Tc({...e,elements:{...i,...s&&{reference:s}}}),p=F.useCallback(e=>{let t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=F.useCallback(e=>{(R(e)||e===null)&&(u.current=e,o(e)),(R(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!R(e))&&f.refs.setReference(e)},[f.refs]),h=F.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=F.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),_=F.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return lm(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),F.useMemo(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}var Mm=c(v()),Nm=function(e,t){return Nm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Nm(e,t)};function J(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Nm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Y=function(){return Y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Y.apply(this,arguments)};function Pm(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Fm=function(e){var t=e.showTimeSelectOnly,n=t===void 0?!1:t,r=e.showTime,i=r===void 0?!1:r,a=e.className,o=e.children,s=e.inline,c=n?`Choose Time`:`Choose Date${i?` and Time`:``}`;return F.createElement(`div`,{className:a,"aria-label":c,role:s?void 0:`dialog`,"aria-modal":s?void 0:`true`},o)},Im=function(e,t){var n=(0,F.useRef)(null),r=(0,F.useRef)(e);(0,F.useEffect)(function(){r.current=e},[e]);var i=(0,F.useCallback)(function(e){var i,a=e.composed&&e.composedPath&&e.composedPath().find(function(e){return e instanceof Node})||e.target;n.current&&!n.current.contains(a)&&(t&&a instanceof HTMLElement&&a.classList.contains(t)||(i=r.current)==null||i.call(r,e))},[t]);return(0,F.useEffect)(function(){return document.addEventListener(`mousedown`,i),function(){document.removeEventListener(`mousedown`,i)}},[i]),n},Lm=function(e){var t=e.children,n=e.onClickOutside,r=e.className,i=e.containerRef,a=e.style,o=e.ignoreClass,s=Im(n,o);return F.createElement(`div`,{className:r,style:a,ref:function(e){s.current=e,i&&(i.current=e)}},t)},X;(function(e){e.ArrowUp=`ArrowUp`,e.ArrowDown=`ArrowDown`,e.ArrowLeft=`ArrowLeft`,e.ArrowRight=`ArrowRight`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Home=`Home`,e.End=`End`,e.Enter=`Enter`,e.Space=` `,e.Tab=`Tab`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.X=`x`})(X||={});function Rm(){return typeof window<`u`?window:globalThis}var zm=12;function Z(e){if(e==null)return new Date;var t=typeof e==`string`?Np(e):B(e);return Vm(t)?t:new Date}function Bm(e,t,n,r,i){i===void 0&&(i=Z());for(var a=uh(n)||uh(lh()),o=Array.isArray(t)?t:[t],s=0,c=o;s<c.length;s++){var l=c[s],u=Ep(e,l,i,{locale:a,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});if(Vm(u)&&(!r||e===Q(u,l,n)))return u}return null}function Vm(e,t){return cd(e)&&!xf(e,new Date(`1/1/1800`))}function Q(e,t,n){if(n===`en`)return cf(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?uh(n):void 0;return n&&!r&&console.warn(`A locale object was not found for the provided string ["${n}"].`),r||=uh(lh()),cf(e,t,{locale:r,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function Hm(e,t){var n=t.dateFormat,r=t.locale,i=Array.isArray(n)&&n.length>0?n[0]:n;return e&&Q(e,i,r)||``}var Um=` - `;function Wm(e,t,n){if(!e&&!t)return``;var r=e?Hm(e,n):``,i=t?Hm(t,n):``;return`${r}${n.rangeSeparator||Um}${i}`}function Gm(e,t){if(!e?.length)return``;var n=e[0]?Hm(e[0],t):``;return e.length===1?n:e.length===2&&e[1]?`${n}, ${Hm(e[1],t)}`:`${n} (+${e.length-1})`}function Km(e,t){var n=t.hour,r=n===void 0?0:n,i=t.minute,a=i===void 0?0:i,o=t.second;return em(tm(rm(e,o===void 0?0:o),a),r)}function qm(e){return Id(e)}function Jm(e,t){return Q(e,`ddd`,t)}function Ym(e){return Xu(e)}function Xm(e,t,n){return Gu(e,{locale:uh(t||lh()),weekStartsOn:n})}function Zm(e){return vd(e)}function Qm(e){return bd(e)}function $m(e){return _d(e)}function eh(){return Xu(Z())}function th(e){return hd(e)}function nh(e){return xd(e)}function rh(e){return gd(e)}function ih(e,t){return e&&t?Ap(e,t):!e&&!t}function ah(e,t){return e&&t?Op(e,t):!e&&!t}function oh(e,t){return e&&t?kp(e,t):!e&&!t}function $(e,t){return e&&t?od(e,t):!e&&!t}function sh(e,t){return e&&t?Sf(e,t):!e&&!t}function ch(e,t,n){var r,i=Xu(t),a=hd(n);try{r=jp(e,{start:i,end:a})}catch{r=!1}return r}function lh(){return Rm().__localeId__}function uh(e){if(typeof e==`string`){var t=Rm();return t.__localeData__?t.__localeData__[e]:void 0}else return e}function dh(e,t,n){return t(Q(e,`EEEE`,n))}function fh(e,t){return Q(e,`EEEEEE`,t)}function ph(e,t){return Q(e,`EEE`,t)}function mh(e,t){return Q($p(Z(),e),`LLLL`,t)}function hh(e,t){return Q($p(Z(),e),`LLL`,t)}function gh(e,t){return Q(nm(Z(),e),`QQQ`,t)}function _h(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,a=n.excludeDates,o=n.excludeDateIntervals,s=n.includeDates,c=n.includeDateIntervals,l=n.filterDate;return n.disabled?!0:Eh(e,{minDate:r,maxDate:i})||a&&a.some(function(t){return t instanceof Date?$(e,t):$(e,t.date)})||o&&o.some(function(t){var n=t.start,r=t.end;return jp(e,{start:n,end:r})})||s&&!s.some(function(t){return $(e,t)})||c&&!c.some(function(t){var n=t.start,r=t.end;return jp(e,{start:n,end:r})})||l&&!l(Z(e))||!1}function vh(e,t){var n=t===void 0?{}:t,r=n.excludeDates,i=n.excludeDateIntervals;return i&&i.length>0?i.some(function(t){var n=t.start,r=t.end;return jp(e,{start:n,end:r})}):r&&r.some(function(t){return t instanceof Date?$(e,t):$(e,t.date??new Date)})||!1}function yh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,a=n.excludeDates,o=n.includeDates,s=n.filterDate;return Eh(e,{minDate:r?vd(r):void 0,maxDate:i?gd(i):void 0})||a?.some(function(t){return ah(e,t instanceof Date?t:t.date)})||o&&!o.some(function(t){return ah(e,t)})||s&&!s(Z(e))||!1}function bh(e,t,n,r){var i=H(e),a=_f(e),o=H(t),s=_f(t),c=H(r);return i===o&&i===c?a<=n&&n<=s:i<o?c===i&&a<=n||c===o&&s>=n||c<o&&c>i:!1}function xh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,a=n.excludeDates,o=n.includeDates;return Eh(e,{minDate:r,maxDate:i})||a&&a.some(function(t){return ah(t instanceof Date?t:t.date,e)})||o&&!o.some(function(t){return ah(t,e)})||!1}function Sh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,a=n.excludeDates,o=n.includeDates,s=n.filterDate;return n.disabled?!0:Eh(e,{minDate:r,maxDate:i})||a?.some(function(t){return oh(e,t instanceof Date?t:t.date)})||o&&!o.some(function(t){return oh(e,t)})||s&&!s(Z(e))||!1}function Ch(e,t,n){if(!t||!n||!cd(t)||!cd(n))return!1;var r=H(t),i=H(n);return r<=e&&i>=e}function wh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,a=n.excludeDates,o=n.includeDates,s=n.filterDate;if(n.disabled)return!0;var c=new Date(e,0,1);return Eh(c,{minDate:r?bd(r):void 0,maxDate:i?yd(i):void 0})||a?.some(function(e){return ih(c,e instanceof Date?e:e.date)})||o&&!o.some(function(e){return ih(c,e)})||s&&!s(Z(c))||!1}function Th(e,t,n,r){var i=H(e),a=ud(e),o=H(t),s=ud(t),c=H(r);return i===o&&i===c?a<=n&&n<=s:i<o?c===i&&a<=n||c===o&&s>=n||c<o&&c>i:!1}function Eh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate;return(r&&Zu(e,r)<0||i&&Zu(e,i)>0)??!1}function Dh(e,t){return t.some(function(t){return mf(t)===mf(e)&&gf(t)===gf(e)&&vf(t)===vf(e)})}function Oh(e,t){var n=t===void 0?{}:t,r=n.excludeTimes,i=n.includeTimes,a=n.filterTime;return r&&Dh(e,r)||i&&!Dh(e,i)||a&&!a(e)||!1}function kh(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw Error(`Both minTime and maxTime props required`);var i=Z();i=em(i,mf(e)),i=tm(i,gf(e)),i=rm(i,vf(e));var a=Z();a=em(a,mf(n)),a=tm(a,gf(n)),a=rm(a,vf(n));var o=Z();o=em(o,mf(r)),o=tm(o,gf(r)),o=rm(o,vf(r));var s;try{s=!jp(i,{start:a,end:o})}catch{s=!1}return s}function Ah(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,a=am(e,1);return r&&ld(r,a)>0||i&&i.every(function(e){return ld(e,a)>0})||!1}function jh(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,a=Bu(e,1);return r&&ld(a,r)>0||i&&i.every(function(e){return ld(a,e)>0})||!1}function Mh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,a=om(bd(e),1);return r&&dd(r,a)>0||i&&i.every(function(e){return dd(e,a)>0})||!1}function Nh(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,a=ed(yd(e),1);return r&&dd(a,r)>0||i&&i.every(function(e){return dd(a,e)>0})||!1}function Ph(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,a=cm(e,1);return r&&fd(r,a)>0||i&&i.every(function(e){return fd(e,a)>0})||!1}function Fh(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.yearItemNumber,a=i===void 0?zm:i,o=Gh(Qm(cm(e,a)),a).endPeriod,s=r&&H(r);return s&&s>o||!1}function Ih(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,a=rd(e,1);return r&&fd(a,r)>0||i&&i.every(function(e){return fd(a,e)>0})||!1}function Lh(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.yearItemNumber,a=i===void 0?zm:i,o=Gh(rd(e,a),a).startPeriod,s=r&&H(r);return s&&s<o||!1}function Rh(e){var t=e.minDate,n=e.includeDates;return n&&t?ad(n.filter(function(e){return Zu(e,t)>=0})):n?ad(n):t}function zh(e){var t=e.maxDate,n=e.includeDates;return n&&t?id(n.filter(function(e){return Zu(e,t)<=0})):n?id(n):t}function Bh(e,t){e===void 0&&(e=[]),t===void 0&&(t=`react-datepicker__day--highlighted`);for(var n=new Map,r=0,i=e.length;r<i;r++){var a=e[r];if(sd(a)){var o=Q(a,`MM.dd.yyyy`),s=n.get(o)||[];s.includes(t)||(s.push(t),n.set(o,s))}else if(typeof a==`object`){var c=Object.keys(a)[0]??``,l=a[c];if(typeof c==`string`&&Array.isArray(l))for(var u=0,d=l.length;u<d;u++){var f=l[u];if(f){var o=Q(f,`MM.dd.yyyy`),s=n.get(o)||[];s.includes(c)||(s.push(c),n.set(o,s))}}}}return n}function Vh(e,t){return e.length===t.length?e.every(function(e,n){return e===t[n]}):!1}function Hh(e,t){e===void 0&&(e=[]),t===void 0&&(t=`react-datepicker__day--holidays`);var n=new Map;return e.forEach(function(e){var r=e.date,i=e.holidayName;if(sd(r)){var a=Q(r,`MM.dd.yyyy`),o=n.get(a)||{className:``,holidayNames:[]};if(!(`className`in o&&o.className===t&&Vh(o.holidayNames,[i]))){o.className=t;var s=o.holidayNames;o.holidayNames=s?Pm(Pm([],s,!0),[i],!1):[i],n.set(a,o)}}}),n}function Uh(e,t,n,r,i){for(var a=i.length,o=[],s=0;s<a;s++){var c=e,l=i[s];l&&(c=Hu(c,mf(l)),c=$u(c,gf(l)),c=td(c,vf(l)));var u=$u(e,(n+1)*r);bf(c,t)&&xf(c,u)&&l!=null&&o.push(l)}return o}function Wh(e){return e<10?`0${e}`:`${e}`}function Gh(e,t){t===void 0&&(t=zm);var n=Math.ceil(H(e)/t)*t;return{startPeriod:n-(t-1),endPeriod:n}}function Kh(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((n-+t)/36e5)}function qh(e){var t=e.getSeconds(),n=e.getMilliseconds();return B(e.getTime()-t*1e3-n)}function Jh(e,t){return qh(e).getTime()===qh(t).getTime()}function Yh(e){if(!sd(e))throw Error(`Invalid date`);var t=new Date(e);return t.setHours(0,0,0,0),t}function Xh(e,t){if(!sd(e)||!sd(t))throw Error(`Invalid date received`);return xf(Yh(e),Yh(t))}function Zh(e){return e.key===X.Space}var Qh=function(e){J(t,e);function t(t){var n=e.call(this,t)||this;return n.inputRef=F.createRef(),n.onTimeChange=function(e){var t,r;n.setState({time:e});var i=n.props.date,a=i instanceof Date&&!isNaN(+i)?i:new Date;if(e?.includes(`:`)){var o=e.split(`:`),s=o[0],c=o[1];a.setHours(Number(s)),a.setMinutes(Number(c))}(r=(t=n.props).onChange)==null||r.call(t,a)},n.renderTimeInput=function(){var e=n.state.time,t=n.props,r=t.date,i=t.timeString,a=t.customTimeInput;return a?(0,F.cloneElement)(a,{date:r,value:e,onChange:n.onTimeChange}):F.createElement(`input`,{type:`time`,className:`react-datepicker-time__input`,placeholder:`Time`,name:`time-input`,ref:n.inputRef,onClick:function(){var e;(e=n.inputRef.current)==null||e.focus()},required:!0,value:e,onChange:function(e){n.onTimeChange(e.target.value||i)}})},n.state={time:n.props.timeString},n}return t.getDerivedStateFromProps=function(e,t){return e.timeString===t.time?null:{time:e.timeString}},t.prototype.render=function(){return F.createElement(`div`,{className:`react-datepicker__input-time-container`},F.createElement(`div`,{className:`react-datepicker-time__caption`},this.props.timeInputLabel),F.createElement(`div`,{className:`react-datepicker-time__input-container`},F.createElement(`div`,{className:`react-datepicker-time__input`},this.renderTimeInput())))},t}(F.Component),$h=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.dayEl=(0,F.createRef)(),t.handleClick=function(e){!t.isDisabled()&&t.props.onClick&&t.props.onClick(e)},t.handleMouseEnter=function(e){!t.isDisabled()&&t.props.onMouseEnter&&t.props.onMouseEnter(e)},t.handleOnKeyDown=function(e){var n,r;e.key===X.Space&&(e.preventDefault(),e.key=X.Enter),(r=(n=t.props).handleOnKeyDown)==null||r.call(n,e)},t.isSameDay=function(e){return $(t.props.day,e)},t.isKeyboardSelected=function(){if(t.props.disabledKeyboardNavigation)return!1;var e=t.props.selectsMultiple?t.props.selectedDates?.some(function(e){return t.isSameDayOrWeek(e)}):t.isSameDayOrWeek(t.props.selected),n=t.props.preSelection&&t.isDisabled(t.props.preSelection);return!e&&t.isSameDayOrWeek(t.props.preSelection)&&!n},t.isDisabled=function(e){return e===void 0&&(e=t.props.day),_h(e,{minDate:t.props.minDate,maxDate:t.props.maxDate,excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals,includeDateIntervals:t.props.includeDateIntervals,includeDates:t.props.includeDates,filterDate:t.props.filterDate,disabled:t.props.disabled})},t.isExcluded=function(){return vh(t.props.day,{excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals})},t.isStartOfWeek=function(){return $(t.props.day,Xm(t.props.day,t.props.locale,t.props.calendarStartDay))},t.isSameWeek=function(e){return t.props.showWeekPicker&&$(e,Xm(t.props.day,t.props.locale,t.props.calendarStartDay))},t.isSameDayOrWeek=function(e){return t.isSameDay(e)||t.isSameWeek(e)},t.getHighLightedClass=function(){var e=t.props,n=e.day,r=e.highlightDates;if(!r)return!1;var i=Q(n,`MM.dd.yyyy`);return r.get(i)},t.getHolidaysClass=function(){var e=t.props,n=e.day,r=e.holidays;if(!r)return[void 0];var i=Q(n,`MM.dd.yyyy`);return r.has(i)?[r.get(i)?.className]:[void 0]},t.isInRange=function(){var e=t.props,n=e.day,r=e.startDate,i=e.endDate;return!r||!i?!1:ch(n,r,i)},t.isInSelectingRange=function(){var e=t.props,n=e.day,r=e.selectsStart,i=e.selectsEnd,a=e.selectsRange,o=e.selectsDisabledDaysInRange,s=e.startDate,c=e.swapRange,l=e.endDate,u=t.props.selectingDate??t.props.preSelection;if(!(r||i||a)||!u||!o&&t.isDisabled())return!1;if(r&&l&&(xf(u,l)||sh(u,l)))return ch(n,u,l);if(i&&s&&(bf(u,s)||sh(u,s)))return ch(n,s,u);if(a&&s&&!l){if(sh(u,s)||bf(u,s))return ch(n,s,u);if(c&&xf(u,s))return ch(n,u,s)}return!1},t.isSelectingRangeStart=function(){if(!t.isInSelectingRange())return!1;var e=t.props,n=e.day,r=e.startDate,i=e.selectsStart,a=e.swapRange,o=e.selectsRange,s=t.props.selectingDate??t.props.preSelection;return i?$(n,s):o&&a&&r&&s?$(n,xf(s,r)?s:r):$(n,r)},t.isSelectingRangeEnd=function(){if(!t.isInSelectingRange())return!1;var e=t.props,n=e.day,r=e.endDate,i=e.selectsEnd,a=e.selectsRange,o=e.swapRange,s=e.startDate,c=t.props.selectingDate??t.props.preSelection;return i?$(n,c):a&&o&&s&&c?$(n,xf(c,s)?s:c):a?$(n,c):$(n,r)},t.isRangeStart=function(){var e=t.props,n=e.day,r=e.startDate,i=e.endDate;return!r||!i?!1:$(r,n)},t.isRangeEnd=function(){var e=t.props,n=e.day,r=e.startDate,i=e.endDate;return!r||!i?!1:$(i,n)},t.isWeekend=function(){var e=df(t.props.day);return e===0||e===6},t.isAfterMonth=function(){return t.props.month!==void 0&&(t.props.month+1)%12===_f(t.props.day)},t.isBeforeMonth=function(){return t.props.month!==void 0&&(_f(t.props.day)+1)%12===t.props.month},t.isCurrentDay=function(){return t.isSameDay(Z())},t.isSelected=function(){return t.props.selectsMultiple?t.props.selectedDates?.some(function(e){return t.isSameDayOrWeek(e)}):t.isSameDayOrWeek(t.props.selected)},t.getClassNames=function(e){return T(`react-datepicker__day`,t.props.dayClassName?t.props.dayClassName(e):void 0,`react-datepicker__day--`+Jm(t.props.day),{"react-datepicker__day--disabled":t.isDisabled(),"react-datepicker__day--excluded":t.isExcluded(),"react-datepicker__day--selected":t.isSelected(),"react-datepicker__day--keyboard-selected":t.isKeyboardSelected(),"react-datepicker__day--range-start":t.isRangeStart(),"react-datepicker__day--range-end":t.isRangeEnd(),"react-datepicker__day--in-range":t.isInRange(),"react-datepicker__day--in-selecting-range":t.isInSelectingRange(),"react-datepicker__day--selecting-range-start":t.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":t.isSelectingRangeEnd(),"react-datepicker__day--today":t.isCurrentDay(),"react-datepicker__day--weekend":t.isWeekend(),"react-datepicker__day--outside-month":t.isAfterMonth()||t.isBeforeMonth()},t.getHighLightedClass(),t.getHolidaysClass())},t.getAriaLabel=function(){var e=t.props,n=e.day,r=e.ariaLabelPrefixWhenEnabled,i=r===void 0?`Choose`:r,a=e.ariaLabelPrefixWhenDisabled,o=a===void 0?`Not available`:a;return`${t.isDisabled()||t.isExcluded()?o:i} ${Q(n,`PPPP`,t.props.locale)}`},t.getTitle=function(){var e=t.props,n=e.day,r=e.holidays,i=r===void 0?new Map:r,a=e.excludeDates,o=Q(n,`MM.dd.yyyy`),s=[];return i.has(o)&&s.push.apply(s,i.get(o).holidayNames),t.isExcluded()&&s.push(a?.filter(function(e){return e instanceof Date?$(e,n):$(e?.date,n)}).map(function(e){if(!(e instanceof Date))return e?.message})),s.join(`, `)},t.getTabIndex=function(){var e=t.props.selected,n=t.props.preSelection;return!(t.props.showWeekPicker&&(t.props.showWeekNumber||!t.isStartOfWeek()))&&(t.isKeyboardSelected()||t.isSameDay(e)&&$(n,e))?0:-1},t.handleFocusDay=function(){var e;t.shouldFocusDay()&&((e=t.dayEl.current)==null||e.focus({preventScroll:!0}))},t.renderDayContents=function(){return t.props.monthShowsDuplicateDaysEnd&&t.isAfterMonth()||t.props.monthShowsDuplicateDaysStart&&t.isBeforeMonth()?null:t.props.renderDayContents?t.props.renderDayContents(uf(t.props.day),t.props.day):uf(t.props.day)},t.render=function(){return F.createElement(`div`,{ref:t.dayEl,className:t.getClassNames(t.props.day),onKeyDown:t.handleOnKeyDown,onClick:t.handleClick,onMouseEnter:t.props.usePointerEvent?void 0:t.handleMouseEnter,onPointerEnter:t.props.usePointerEvent?t.handleMouseEnter:void 0,tabIndex:t.getTabIndex(),"aria-label":t.getAriaLabel(),role:`gridcell`,title:t.getTitle(),"aria-disabled":t.isDisabled(),"aria-current":t.isCurrentDay()?`date`:void 0,"aria-selected":t.isSelected()||t.isInRange()},t.renderDayContents(),t.getTitle()!==``&&F.createElement(`span`,{className:`overlay`},t.getTitle()))},t}return t.prototype.componentDidMount=function(){this.handleFocusDay()},t.prototype.componentDidUpdate=function(){this.handleFocusDay()},t.prototype.shouldFocusDay=function(){var e=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(e=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(e=!1),this.isDayActiveElement()&&(e=!0),this.isDuplicateDay()&&(e=!1)),e},t.prototype.isDayActiveElement=function(){return(this.props.containerRef?.current)?.contains(document.activeElement)&&document.activeElement?.classList.contains(`react-datepicker__day`)},t.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},t}(F.Component),eg=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.weekNumberEl=(0,F.createRef)(),t.handleClick=function(e){t.props.onClick&&t.props.onClick(e)},t.handleOnKeyDown=function(e){var n,r;e.key===X.Space&&(e.preventDefault(),e.key=X.Enter),(r=(n=t.props).handleOnKeyDown)==null||r.call(n,e)},t.isKeyboardSelected=function(){return!t.props.disabledKeyboardNavigation&&!$(t.props.date,t.props.selected)&&$(t.props.date,t.props.preSelection)},t.getTabIndex=function(){return t.props.showWeekPicker&&t.props.showWeekNumber&&(t.isKeyboardSelected()||$(t.props.date,t.props.selected)&&$(t.props.preSelection,t.props.selected))?0:-1},t.handleFocusWeekNumber=function(e){var n=!1;t.getTabIndex()===0&&!e?.isInputFocused&&$(t.props.date,t.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(n=!0),t.props.inline&&!t.props.shouldFocusDayInline&&(n=!1),t.props.containerRef&&t.props.containerRef.current&&t.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains(`react-datepicker__week-number`)&&(n=!0)),n&&t.weekNumberEl.current&&t.weekNumberEl.current.focus({preventScroll:!0})},t}return Object.defineProperty(t,`defaultProps`,{get:function(){return{ariaLabelPrefix:`week `}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},t.prototype.componentDidUpdate=function(e){this.handleFocusWeekNumber(e)},t.prototype.render=function(){var e=this.props,n=e.weekNumber,r=e.isWeekDisabled,i=e.ariaLabelPrefix,a=i===void 0?t.defaultProps.ariaLabelPrefix:i,o=e.onClick,s={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!o&&!r,"react-datepicker__week-number--selected":!!o&&$(this.props.date,this.props.selected)};return F.createElement(`div`,{ref:this.weekNumberEl,className:T(s),"aria-label":`${a} ${this.props.weekNumber}`,onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:`gridcell`},n)},t}(F.Component),tg=function(e){J(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.isDisabled=function(e){return _h(e,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.handleDayClick=function(e,t){n.props.onDayClick&&n.props.onDayClick(e,t)},n.handleDayMouseEnter=function(e){n.props.onDayMouseEnter&&n.props.onDayMouseEnter(e)},n.handleWeekClick=function(e,r,i){for(var a,o,s=new Date(e),c=0;c<7;c++){var l=new Date(e);if(l.setDate(l.getDate()+c),!n.isDisabled(l)){s=l;break}}typeof n.props.onWeekSelect==`function`&&n.props.onWeekSelect(s,r,i),n.props.showWeekPicker&&n.handleDayClick(s,i),(n.props.shouldCloseOnSelect??t.defaultProps.shouldCloseOnSelect)&&((o=(a=n.props).setOpen)==null||o.call(a,!1))},n.formatWeekNumber=function(e){return n.props.formatWeekNumber?n.props.formatWeekNumber(e):qm(e)},n.isWeekDisabled=function(){for(var e=n.startOfWeek(),t=zu(e,6),r=new Date(e);r<=t;){if(!n.isDisabled(r))return!1;r=zu(r,1)}return!0},n.renderDays=function(){var e=n.startOfWeek(),r=[],i=n.formatWeekNumber(e);if(n.props.showWeekNumber){var a=n.props.onWeekSelect||n.props.showWeekPicker?n.handleWeekClick.bind(n,e,i):void 0;r.push(F.createElement(eg,Y({key:`W`},t.defaultProps,n.props,{weekNumber:i,isWeekDisabled:n.isWeekDisabled(),date:e,onClick:a})))}return r.concat([0,1,2,3,4,5,6].map(function(r){var i=zu(e,r);return F.createElement($h,Y({},t.defaultProps,n.props,{ariaLabelPrefixWhenEnabled:n.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:n.props.disabledDayAriaLabelPrefix,key:i.valueOf(),day:i,onClick:n.handleDayClick.bind(n,i),onMouseEnter:n.handleDayMouseEnter.bind(n,i)}))}))},n.startOfWeek=function(){return Xm(n.props.day,n.props.locale,n.props.calendarStartDay)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!$(n.startOfWeek(),n.props.selected)&&$(n.startOfWeek(),n.props.preSelection)},n}return Object.defineProperty(t,`defaultProps`,{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e={"react-datepicker__week":!0,"react-datepicker__week--selected":$(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},t=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return F.createElement(`div`,{className:T(e,t),role:`row`},this.renderDays())},t}(F.Component),ng,rg=6,ig={TWO_COLUMNS:`two_columns`,THREE_COLUMNS:`three_columns`,FOUR_COLUMNS:`four_columns`},ag=(ng={},ng[ig.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},ng[ig.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},ng[ig.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},ng),og=1;function sg(e,t){return e?ig.FOUR_COLUMNS:t?ig.TWO_COLUMNS:ig.THREE_COLUMNS}var cg=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.MONTH_REFS=Pm([],Array(12),!0).map(function(){return(0,F.createRef)()}),t.QUARTER_REFS=Pm([],[,,,,],!0).map(function(){return(0,F.createRef)()}),t.isDisabled=function(e){return _h(e,{minDate:t.props.minDate,maxDate:t.props.maxDate,excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals,includeDateIntervals:t.props.includeDateIntervals,includeDates:t.props.includeDates,filterDate:t.props.filterDate,disabled:t.props.disabled})},t.isExcluded=function(e){return vh(e,{excludeDates:t.props.excludeDates,excludeDateIntervals:t.props.excludeDateIntervals})},t.handleDayClick=function(e,n){var r,i;(i=(r=t.props).onDayClick)==null||i.call(r,e,n,t.props.orderInDisplay)},t.handleDayMouseEnter=function(e){var n,r;(r=(n=t.props).onDayMouseEnter)==null||r.call(n,e)},t.handleMouseLeave=function(){var e,n;(n=(e=t.props).onMouseLeave)==null||n.call(e)},t.isRangeStartMonth=function(e){var n=t.props,r=n.day,i=n.startDate,a=n.endDate;return!i||!a?!1:ah($p(r,e),i)},t.isRangeStartQuarter=function(e){var n=t.props,r=n.day,i=n.startDate,a=n.endDate;return!i||!a?!1:oh(nm(r,e),i)},t.isRangeEndMonth=function(e){var n=t.props,r=n.day,i=n.startDate,a=n.endDate;return!i||!a?!1:ah($p(r,e),a)},t.isRangeEndQuarter=function(e){var n=t.props,r=n.day,i=n.startDate,a=n.endDate;return!i||!a?!1:oh(nm(r,e),a)},t.isInSelectingRangeMonth=function(e){var n=t.props,r=n.day,i=n.selectsStart,a=n.selectsEnd,o=n.selectsRange,s=n.startDate,c=n.endDate,l=t.props.selectingDate??t.props.preSelection;return!(i||a||o)||!l?!1:i&&c?bh(l,c,e,r):a&&s||o&&s&&!c?bh(s,l,e,r):!1},t.isSelectingMonthRangeStart=function(e){if(!t.isInSelectingRangeMonth(e))return!1;var n=t.props,r=n.day,i=n.startDate,a=n.selectsStart,o=$p(r,e),s=t.props.selectingDate??t.props.preSelection;return a?ah(o,s):ah(o,i)},t.isSelectingMonthRangeEnd=function(e){if(!t.isInSelectingRangeMonth(e))return!1;var n=t.props,r=n.day,i=n.endDate,a=n.selectsEnd,o=n.selectsRange,s=$p(r,e),c=t.props.selectingDate??t.props.preSelection;return a||o?ah(s,c):ah(s,i)},t.isInSelectingRangeQuarter=function(e){var n=t.props,r=n.day,i=n.selectsStart,a=n.selectsEnd,o=n.selectsRange,s=n.startDate,c=n.endDate,l=t.props.selectingDate??t.props.preSelection;return!(i||a||o)||!l?!1:i&&c?Th(l,c,e,r):a&&s||o&&s&&!c?Th(s,l,e,r):!1},t.isWeekInMonth=function(e){var n=t.props.day,r=zu(e,6);return ah(e,n)||ah(r,n)},t.isCurrentMonth=function(e,t){return H(e)===H(Z())&&t===_f(Z())},t.isCurrentQuarter=function(e,t){return H(e)===H(Z())&&t===ud(Z())},t.isSelectedMonth=function(e,t,n){return _f(n)===t&&H(e)===H(n)},t.isSelectMonthInList=function(e,n,r){return r.some(function(r){return t.isSelectedMonth(e,n,r)})},t.isSelectedQuarter=function(e,t,n){return ud(n)===t&&H(e)===H(n)},t.isSelectQuarterInList=function(e,n,r){return r.some(function(r){return t.isSelectedQuarter(e,n,r)})},t.isMonthSelected=function(){var e=t.props,n=e.day,r=e.selected,i=e.selectedDates,a=e.selectsMultiple,o=_f(n);return a?i?.some(function(e){return t.isSelectedMonth(n,o,e)}):!!r&&t.isSelectedMonth(n,o,r)},t.isQuarterSelected=function(){var e=t.props,n=e.day,r=e.selected,i=e.selectedDates,a=e.selectsMultiple,o=ud(n);return a?i?.some(function(e){return t.isSelectedQuarter(n,o,e)}):!!r&&t.isSelectedQuarter(n,o,r)},t.renderWeeks=function(){if(!Vm(t.props.day))return[];for(var e=[],n=t.props.fixedHeight,r=0,i=!1,a=Xm(Zm(t.props.day),t.props.locale,t.props.calendarStartDay),o=function(e){return t.props.showWeekPicker?Xm(e,t.props.locale,t.props.calendarStartDay):t.props.preSelection},s=t.props.selected?function(e){return t.props.showWeekPicker?Xm(e,t.props.locale,t.props.calendarStartDay):t.props.selected}(t.props.selected):void 0,c=t.props.preSelection?o(t.props.preSelection):void 0;e.push(F.createElement(tg,Y({},t.props,{ariaLabelPrefix:t.props.weekAriaLabelPrefix,key:r,day:a,month:_f(t.props.day),onDayClick:t.handleDayClick,onDayMouseEnter:t.handleDayMouseEnter,selected:s,preSelection:c,showWeekNumber:t.props.showWeekNumbers}))),!i;){r++,a=nd(a,1);var l=n&&r>=rg,u=!n&&!t.isWeekInMonth(a);if(l||u)if(t.props.peekNextMonth)i=!0;else break}return e},t.onMonthClick=function(e,n){var r=t.isMonthDisabledForLabelDate(n),i=r.isDisabled,a=r.labelDate;i||t.handleDayClick(Zm(a),e)},t.onMonthMouseEnter=function(e){var n=t.isMonthDisabledForLabelDate(e),r=n.isDisabled,i=n.labelDate;r||t.handleDayMouseEnter(Zm(i))},t.handleMonthNavigation=function(e,n){var r,i,a;(i=(r=t.props).setPreSelection)==null||i.call(r,n),(a=t.MONTH_REFS[e]?.current)==null||a.focus()},t.handleKeyboardNavigation=function(e,n,r){var i=t.props,a=i.selected,o=i.preSelection,s=i.setPreSelection,c=i.minDate,l=i.maxDate,u=i.showFourColumnMonthYearPicker,d=i.showTwoColumnMonthYearPicker;if(o){var f=sg(u,d),p=t.getVerticalOffset(f),m=ag[f]?.grid,h=function(e,t,n){var r=t,i=n;switch(e){case X.ArrowRight:r=Bu(t,og),i=n===11?0:n+og;break;case X.ArrowLeft:r=am(t,og),i=n===0?11:n-og;break;case X.ArrowUp:r=am(t,p),i=(m?.[0])?.includes(n)?n+12-p:n-p;break;case X.ArrowDown:r=Bu(t,p),i=(m?.[m.length-1])?.includes(n)?n-12+p:n+p;break}return{newCalculatedDate:r,newCalculatedMonth:i}},g=function(e,n,r){for(var i=40,a=e,o=!1,s=0,u=h(a,n,r),d=u.newCalculatedDate,f=u.newCalculatedMonth;!o;){if(s>=i){d=n,f=r;break}if(c&&d<c){a=X.ArrowRight;var p=h(a,d,f);d=p.newCalculatedDate,f=p.newCalculatedMonth}if(l&&d>l){a=X.ArrowLeft;var p=h(a,d,f);d=p.newCalculatedDate,f=p.newCalculatedMonth}if(xh(d,t.props)){var p=h(a,d,f);d=p.newCalculatedDate,f=p.newCalculatedMonth}else o=!0;s++}return{newCalculatedDate:d,newCalculatedMonth:f}};if(n===X.Enter){t.isMonthDisabled(r)||(t.onMonthClick(e,r),s?.(a));return}var _=g(n,o,r),v=_.newCalculatedDate,y=_.newCalculatedMonth;switch(n){case X.ArrowRight:case X.ArrowLeft:case X.ArrowUp:case X.ArrowDown:t.handleMonthNavigation(y,v);break}}},t.getVerticalOffset=function(e){return ag[e]?.verticalNavigationOffset??0},t.onMonthKeyDown=function(e,n){var r=t.props,i=r.disabledKeyboardNavigation,a=r.handleOnMonthKeyDown,o=e.key;o!==X.Tab&&e.preventDefault(),i||t.handleKeyboardNavigation(e,o,n),a&&a(e)},t.onQuarterClick=function(e,n){var r=nm(t.props.day,n);Sh(r,t.props)||t.handleDayClick($m(r),e)},t.onQuarterMouseEnter=function(e){var n=nm(t.props.day,e);Sh(n,t.props)||t.handleDayMouseEnter($m(n))},t.handleQuarterNavigation=function(e,n){var r,i,a;t.isDisabled(n)||t.isExcluded(n)||((i=(r=t.props).setPreSelection)==null||i.call(r,n),(a=t.QUARTER_REFS[e-1]?.current)==null||a.focus())},t.onQuarterKeyDown=function(e,n){var r,i,a=e.key;if(!t.props.disabledKeyboardNavigation)switch(a){case X.Enter:t.onQuarterClick(e,n),(i=(r=t.props).setPreSelection)==null||i.call(r,t.props.selected);break;case X.ArrowRight:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===4?1:n+1,ed(t.props.preSelection,1));break;case X.ArrowLeft:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===1?4:n-1,om(t.props.preSelection,1));break}},t.isMonthDisabledForLabelDate=function(e){var n=t.props,r=n.day,i=n.disabled,a=n.minDate,o=n.maxDate,s=n.excludeDates,c=n.includeDates,l=$p(r,e);return i?{isDisabled:!0,labelDate:$p(r,e)}:{isDisabled:((a||o||s||c)&&yh(l,t.props))??!1,labelDate:l}},t.isMonthDisabled=function(e){return t.isMonthDisabledForLabelDate(e).isDisabled},t.getMonthClassNames=function(e){var n=t.props,r=n.day,i=n.startDate,a=n.endDate,o=n.preSelection,s=n.monthClassName,c=s?s($p(r,e)):void 0,l=t.getSelection();return T(`react-datepicker__month-text`,`react-datepicker__month-${e}`,c,{"react-datepicker__month-text--disabled":t.isMonthDisabled(e),"react-datepicker__month-text--selected":l?t.isSelectMonthInList(r,e,l):void 0,"react-datepicker__month-text--keyboard-selected":!t.props.disabledKeyboardNavigation&&o&&t.isSelectedMonth(r,e,o)&&!t.isMonthSelected()&&!t.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":t.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":i&&a?bh(i,a,e,r):void 0,"react-datepicker__month-text--range-start":t.isRangeStartMonth(e),"react-datepicker__month-text--range-end":t.isRangeEndMonth(e),"react-datepicker__month-text--selecting-range-start":t.isSelectingMonthRangeStart(e),"react-datepicker__month-text--selecting-range-end":t.isSelectingMonthRangeEnd(e),"react-datepicker__month-text--today":t.isCurrentMonth(r,e)})},t.getTabIndex=function(e){if(t.props.preSelection==null)return`-1`;var n=_f(t.props.preSelection),r=t.isMonthDisabledForLabelDate(n).isDisabled;return e===n&&!(r||t.props.disabledKeyboardNavigation)?`0`:`-1`},t.getQuarterTabIndex=function(e){if(t.props.preSelection==null)return`-1`;var n=ud(t.props.preSelection),r=Sh(t.props.day,t.props);return e===n&&!(r||t.props.disabledKeyboardNavigation)?`0`:`-1`},t.getAriaLabel=function(e){var n=t.props,r=n.chooseDayAriaLabelPrefix,i=r===void 0?`Choose`:r,a=n.disabledDayAriaLabelPrefix,o=a===void 0?`Not available`:a,s=n.day,c=n.locale,l=$p(s,e);return`${t.isDisabled(l)||t.isExcluded(l)?o:i} ${Q(l,`MMMM yyyy`,c)}`},t.getQuarterClassNames=function(e){var n=t.props,r=n.day,i=n.startDate,a=n.endDate,o=n.minDate,s=n.maxDate,c=n.excludeDates,l=n.includeDates,u=n.filterDate,d=n.preSelection,f=n.disabledKeyboardNavigation,p=n.disabled,m=(o||s||c||l||u||p)&&Sh(nm(r,e),t.props),h=t.getSelection();return T(`react-datepicker__quarter-text`,`react-datepicker__quarter-${e}`,{"react-datepicker__quarter-text--disabled":m,"react-datepicker__quarter-text--selected":h?t.isSelectQuarterInList(r,e,h):void 0,"react-datepicker__quarter-text--keyboard-selected":!f&&d&&t.isSelectedQuarter(r,e,d)&&!t.isQuarterSelected()&&!m,"react-datepicker__quarter-text--in-selecting-range":t.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":i&&a?Th(i,a,e,r):void 0,"react-datepicker__quarter-text--range-start":t.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":t.isRangeEndQuarter(e),"react-datepicker__quarter-text--today":t.isCurrentQuarter(r,e)})},t.getMonthContent=function(e){var n=t.props,r=n.showFullMonthYearPicker,i=n.renderMonthContent,a=n.locale,o=n.day,s=hh(e,a),c=mh(e,a);return i?i(e,s,c,o):r?c:s},t.getQuarterContent=function(e){var n=t.props,r=n.renderQuarterContent,i=n.locale,a=gh(e,i);return r?.(e,a)??a},t.renderMonths=function(){var e=t.props,n=e.showTwoColumnMonthYearPicker,r=e.showFourColumnMonthYearPicker,i=e.day,a=e.selected;return(ag[sg(r,n)]?.grid)?.map(function(e,n){return F.createElement(`div`,{className:`react-datepicker__month-wrapper`,key:n},e.map(function(e,n){return F.createElement(`div`,{ref:t.MONTH_REFS[e],key:n,onClick:function(n){t.onMonthClick(n,e)},onKeyDown:function(n){Zh(n)&&(n.preventDefault(),n.key=X.Enter),t.onMonthKeyDown(n,e)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onMonthMouseEnter(e)},onPointerEnter:t.props.usePointerEvent?function(){return t.onMonthMouseEnter(e)}:void 0,tabIndex:Number(t.getTabIndex(e)),className:t.getMonthClassNames(e),"aria-disabled":t.isMonthDisabled(e),role:`option`,"aria-label":t.getAriaLabel(e),"aria-current":t.isCurrentMonth(i,e)?`date`:void 0,"aria-selected":a?t.isSelectedMonth(i,e,a):void 0},t.getMonthContent(e))}))})},t.renderQuarters=function(){var e=t.props,n=e.day,r=e.selected;return F.createElement(`div`,{className:`react-datepicker__quarter-wrapper`},[1,2,3,4].map(function(e,i){return F.createElement(`div`,{key:i,ref:t.QUARTER_REFS[i],role:`option`,onClick:function(n){t.onQuarterClick(n,e)},onKeyDown:function(n){t.onQuarterKeyDown(n,e)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onQuarterMouseEnter(e)},onPointerEnter:t.props.usePointerEvent?function(){return t.onQuarterMouseEnter(e)}:void 0,className:t.getQuarterClassNames(e),"aria-selected":r?t.isSelectedQuarter(n,e,r):void 0,tabIndex:Number(t.getQuarterTabIndex(e)),"aria-current":t.isCurrentQuarter(n,e)?`date`:void 0},t.getQuarterContent(e))}))},t.getClassNames=function(){var e=t.props,n=e.selectingDate,r=e.selectsStart,i=e.selectsEnd,a=e.showMonthYearPicker,o=e.showQuarterYearPicker,s=e.showWeekPicker;return T(`react-datepicker__month`,{"react-datepicker__month--selecting-range":n&&(r||i)},{"react-datepicker__monthPicker":a},{"react-datepicker__quarterPicker":o},{"react-datepicker__weekPicker":s})},t}return t.prototype.getSelection=function(){var e=this.props,t=e.selected,n=e.selectedDates;if(e.selectsMultiple)return n;if(t)return[t]},t.prototype.render=function(){var e=this.props,t=e.showMonthYearPicker,n=e.showQuarterYearPicker,r=e.day,i=e.ariaLabelPrefix,a=i===void 0?`Month `:i,o=a?a.trim()+` `:``,s=Vm(r)?`${o}${Q(r,`MMMM, yyyy`,this.props.locale)}`:``;return t||n?F.createElement(`div`,{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":s,role:`listbox`},t?this.renderMonths():this.renderQuarters()):F.createElement(`div`,{role:`table`},this.props.dayNamesHeader&&F.createElement(`div`,{role:`rowgroup`},this.props.dayNamesHeader),F.createElement(`div`,{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":s,role:`rowgroup`},this.renderWeeks()))},t}(F.Component),lg=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.monthOptionButtonsRef={},t.isSelectedMonth=function(e){return t.props.month===e},t.handleOptionKeyDown=function(e,n){var r;switch(n.key){case`Enter`:n.preventDefault(),t.onChange(e);break;case`Escape`:n.preventDefault(),t.props.onCancel();break;case`ArrowUp`:case`ArrowDown`:n.preventDefault();var i=(e+(n.key===`ArrowUp`?-1:1)+t.props.monthNames.length)%t.props.monthNames.length;(r=t.monthOptionButtonsRef[i])==null||r.focus();break}},t.renderOptions=function(){return t.monthOptionButtonsRef={},t.props.monthNames.map(function(e,n){return F.createElement(`div`,{ref:function(e){t.monthOptionButtonsRef[n]=e,t.isSelectedMonth(n)&&e?.focus()},role:`button`,tabIndex:0,className:t.isSelectedMonth(n)?`react-datepicker__month-option react-datepicker__month-option--selected_month`:`react-datepicker__month-option`,key:e,onClick:t.onChange.bind(t,n),onKeyDown:t.handleOptionKeyDown.bind(t,n),"aria-selected":t.isSelectedMonth(n)?`true`:void 0},t.isSelectedMonth(n)?F.createElement(`span`,{className:`react-datepicker__month-option--selected`},`✓`):``,e)})},t.onChange=function(e){return t.props.onChange(e)},t.handleClickOutside=function(){return t.props.onCancel()},t}return t.prototype.render=function(){return F.createElement(Lm,{className:`react-datepicker__month-dropdown`,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(F.Component),ug=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(e,t){return F.createElement(`option`,{key:e,value:t},e)})},t.renderSelectMode=function(e){return F.createElement(`select`,{value:t.props.month,className:`react-datepicker__month-select`,onChange:function(e){return t.onChange(parseInt(e.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,n){return F.createElement(`button`,{key:`read`,type:`button`,style:{visibility:e?`visible`:`hidden`},className:`react-datepicker__month-read-view`,onClick:t.toggleDropdown},F.createElement(`span`,{className:`react-datepicker__month-read-view--down-arrow`}),F.createElement(`span`,{className:`react-datepicker__month-read-view--selected-month`},n[t.props.month]))},t.renderDropdown=function(e){return F.createElement(lg,Y({key:`dropdown`},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,r=[t.renderReadView(!n,e)];return n&&r.unshift(t.renderDropdown(e)),r},t.onChange=function(e){t.toggleDropdown(),e!==t.props.month&&t.props.onChange(e)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return t.prototype.render=function(){var e=this,t=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(t){return hh(t,e.props.locale)}:function(t){return mh(t,e.props.locale)}),n;switch(this.props.dropdownMode){case`scroll`:n=this.renderScrollMode(t);break;case`select`:n=this.renderSelectMode(t);break}return F.createElement(`div`,{className:`react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--${this.props.dropdownMode}`},n)},t}(F.Component);function dg(e,t){for(var n=[],r=Zm(e),i=Zm(t);!bf(r,i);)n.push(Z(r)),r=Bu(r,1);return n}var fg=function(e){J(t,e);function t(t){var n=e.call(this,t)||this;return n.renderOptions=function(){return n.state.monthYearsList.map(function(e){var t=yf(e),r=ih(n.props.date,e)&&ah(n.props.date,e);return F.createElement(`div`,{className:r?`react-datepicker__month-year-option--selected_month-year`:`react-datepicker__month-year-option`,key:t,onClick:n.onChange.bind(n,t),"aria-selected":r?`true`:void 0},r?F.createElement(`span`,{className:`react-datepicker__month-year-option--selected`},`✓`):``,Q(e,n.props.dateFormat,n.props.locale))})},n.onChange=function(e){return n.props.onChange(e)},n.handleClickOutside=function(){n.props.onCancel()},n.state={monthYearsList:dg(n.props.minDate,n.props.maxDate)},n}return t.prototype.render=function(){var e=T({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return F.createElement(Lm,{className:e,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(F.Component),pg=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=Zm(t.props.minDate),n=Zm(t.props.maxDate),r=[];!bf(e,n);){var i=yf(e);r.push(F.createElement(`option`,{key:i,value:i},Q(e,t.props.dateFormat,t.props.locale))),e=Bu(e,1)}return r},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return F.createElement(`select`,{value:yf(Zm(t.props.date)),className:`react-datepicker__month-year-select`,onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var n=Q(t.props.date,t.props.dateFormat,t.props.locale);return F.createElement(`div`,{key:`read`,style:{visibility:e?`visible`:`hidden`},className:`react-datepicker__month-year-read-view`,onClick:t.toggleDropdown},F.createElement(`span`,{className:`react-datepicker__month-year-read-view--down-arrow`}),F.createElement(`span`,{className:`react-datepicker__month-year-read-view--selected-month-year`},n))},t.renderDropdown=function(){return F.createElement(fg,Y({key:`dropdown`},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown();var n=Z(e);ih(t.props.date,n)&&ah(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return t.prototype.render=function(){var e;switch(this.props.dropdownMode){case`scroll`:e=this.renderScrollMode();break;case`select`:e=this.renderSelectMode();break}return F.createElement(`div`,{className:`react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--${this.props.dropdownMode}`},e)},t}(F.Component),mg=function(e){J(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={height:null},n.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){n.list&&(n.list.scrollTop=(n.centerLi&&t.calcCenterPosition(n.props.monthRef?n.props.monthRef.clientHeight-(n.header?.clientHeight??0):n.list.clientHeight,n.centerLi))??0)})},n.handleClick=function(e){var t,r;(n.props.minTime||n.props.maxTime)&&kh(e,n.props)||(n.props.excludeTimes||n.props.includeTimes||n.props.filterTime)&&Oh(e,n.props)||(r=(t=n.props).onChange)==null||r.call(t,e)},n.isSelectedTime=function(e){return n.props.selected&&Jh(n.props.selected,e)},n.isDisabledTime=function(e){return(n.props.minTime||n.props.maxTime)&&kh(e,n.props)||(n.props.excludeTimes||n.props.includeTimes||n.props.filterTime)&&Oh(e,n.props)},n.liClasses=function(e){var r=[`react-datepicker__time-list-item`,n.props.timeClassName?n.props.timeClassName(e):void 0];return n.isSelectedTime(e)&&r.push(`react-datepicker__time-list-item--selected`),n.isDisabledTime(e)&&r.push(`react-datepicker__time-list-item--disabled`),n.props.injectTimes&&(mf(e)*3600+gf(e)*60+vf(e))%((n.props.intervals??t.defaultProps.intervals)*60)!=0&&r.push(`react-datepicker__time-list-item--injected`),r.join(` `)},n.handleOnKeyDown=function(e,t){var r,i;e.key===X.Space&&(e.preventDefault(),e.key=X.Enter),(e.key===X.ArrowUp||e.key===X.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===X.ArrowDown||e.key===X.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===X.Enter&&n.handleClick(t),(i=(r=n.props).handleOnKeyDown)==null||i.call(r,e)},n.renderTimes=function(){for(var e=[],r=typeof n.props.format==`string`?n.props.format:`p`,i=n.props.intervals??t.defaultProps.intervals,a=n.props.selected||n.props.openToDate||Z(),o=Ym(a),s=n.props.injectTimes&&n.props.injectTimes.sort(function(e,t){return e.getTime()-t.getTime()}),c=60*Kh(a)/i,l=0;l<c;l++){var u=$u(o,l*i);if(e.push(u),s){var d=Uh(o,u,l,i,s);e=e.concat(d)}}var f=e.reduce(function(e,t){return t.getTime()<=a.getTime()?t:e},e[0]);return e.map(function(e){return F.createElement(`li`,{key:e.valueOf(),onClick:n.handleClick.bind(n,e),className:n.liClasses(e),ref:function(t){e===f&&(n.centerLi=t)},onKeyDown:function(t){n.handleOnKeyDown(t,e)},tabIndex:e===f?0:-1,role:`option`,"aria-selected":n.isSelectedTime(e)?`true`:void 0,"aria-disabled":n.isDisabledTime(e)?`true`:void 0},Q(e,r,n.props.locale))})},n.renderTimeCaption=function(){return n.props.showTimeCaption===!1?F.createElement(F.Fragment,null):F.createElement(`div`,{className:`react-datepicker__header react-datepicker__header--time ${n.props.showTimeSelectOnly?`react-datepicker__header--time--only`:``}`,ref:function(e){n.header=e}},F.createElement(`div`,{className:`react-datepicker-time__header`},n.props.timeCaption))},n}return Object.defineProperty(t,`defaultProps`,{get:function(){return{intervals:30,todayButton:null,timeCaption:`Time`,showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var e;(e=this.resizeObserver)==null||e.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var e=this,t=this.props.monthRef;this.updateContainerHeight(),t&&(this.resizeObserver=new ResizeObserver(function(){e.updateContainerHeight()}),this.resizeObserver.observe(t))},t.prototype.updateContainerHeight=function(){this.props.monthRef&&this.header&&this.setState({height:this.props.monthRef.clientHeight-this.header.clientHeight})},t.prototype.render=function(){var e=this,n=this.state.height;return F.createElement(`div`,{className:`react-datepicker__time-container ${this.props.todayButton??t.defaultProps.todayButton?`react-datepicker__time-container--with-today-button`:``}`},this.renderTimeCaption(),F.createElement(`div`,{className:`react-datepicker__time`},F.createElement(`div`,{className:`react-datepicker__time-box`},F.createElement(`ul`,{className:`react-datepicker__time-list`,ref:function(t){e.list=t},style:n?{height:n}:{},role:`listbox`,"aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(e,t){return t.offsetTop-(e/2-t.clientHeight/2)},t}(F.Component),hg=3,gg=function(e){J(t,e);function t(t){var n=e.call(this,t)||this;return n.YEAR_REFS=Pm([],Array(n.props.yearItemNumber),!0).map(function(){return(0,F.createRef)()}),n.isDisabled=function(e){return _h(e,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.isExcluded=function(e){return vh(e,{excludeDates:n.props.excludeDates})},n.selectingDate=function(){return n.props.selectingDate??n.props.preSelection},n.updateFocusOnPaginate=function(e){window.requestAnimationFrame(function(){var t;(t=n.YEAR_REFS[e]?.current)==null||t.focus()})},n.handleYearClick=function(e,t){n.props.onDayClick&&n.props.onDayClick(e,t)},n.handleYearNavigation=function(e,t){var r,i,a,o=n.props,s=o.date,c=o.yearItemNumber;if(!(s===void 0||c===void 0)){var l=Gh(s,c).startPeriod;n.isDisabled(t)||n.isExcluded(t)||((i=(r=n.props).setPreSelection)==null||i.call(r,t),e-l<0?n.updateFocusOnPaginate(c-(l-e)):e-l>=c?n.updateFocusOnPaginate(Math.abs(c-(e-l))):(a=n.YEAR_REFS[e-l]?.current)==null||a.focus())}},n.isSameDay=function(e,t){return $(e,t)},n.isCurrentYear=function(e){return e===H(Z())},n.isRangeStart=function(e){return n.props.startDate&&n.props.endDate&&ih(im(Z(),e),n.props.startDate)},n.isRangeEnd=function(e){return n.props.startDate&&n.props.endDate&&ih(im(Z(),e),n.props.endDate)},n.isInRange=function(e){return Ch(e,n.props.startDate,n.props.endDate)},n.isInSelectingRange=function(e){var t=n.props,r=t.selectsStart,i=t.selectsEnd,a=t.selectsRange,o=t.startDate,s=t.endDate;return!(r||i||a)||!n.selectingDate()?!1:r&&s?Ch(e,n.selectingDate(),s):i&&o||a&&o&&!s?Ch(e,o,n.selectingDate()):!1},n.isSelectingRangeStart=function(e){if(!n.isInSelectingRange(e))return!1;var t=n.props,r=t.startDate,i=t.selectsStart,a=im(Z(),e);return i?ih(a,n.selectingDate()??null):ih(a,r??null)},n.isSelectingRangeEnd=function(e){if(!n.isInSelectingRange(e))return!1;var t=n.props,r=t.endDate,i=t.selectsEnd,a=t.selectsRange,o=im(Z(),e);return i||a?ih(o,n.selectingDate()??null):ih(o,r??null)},n.isKeyboardSelected=function(e){if(!(n.props.disabledKeyboardNavigation||n.props.date===void 0||n.props.preSelection==null)){var t=n.props,r=t.minDate,i=t.maxDate,a=t.excludeDates,o=t.includeDates,s=t.filterDate,c=t.selected,l=Qm(im(n.props.date,e)),u=(r||i||a||o||s)&&wh(e,n.props),d=!!c&&$(l,Qm(c)),f=$(l,Qm(n.props.preSelection));return!n.props.inline&&!d&&f&&!u}},n.isSelectedYear=function(e){var t=n.props,r=t.selectsMultiple,i=t.selected,a=t.selectedDates;return r?a?.some(function(t){return e===H(t)}):!!i&&e===H(i)},n.onYearClick=function(e,t){var r=n.props.date;r!==void 0&&n.handleYearClick(Qm(im(r,t)),e)},n.onYearKeyDown=function(e,t){var r,i,a=e.key,o=n.props,s=o.date,c=o.yearItemNumber,l=o.handleOnKeyDown;if(a!==X.Tab&&e.preventDefault(),!n.props.disabledKeyboardNavigation)switch(a){case X.Enter:if(n.props.selected==null)break;n.onYearClick(e,t),(i=(r=n.props).setPreSelection)==null||i.call(r,n.props.selected);break;case X.ArrowRight:if(n.props.preSelection==null)break;n.handleYearNavigation(t+1,rd(n.props.preSelection,1));break;case X.ArrowLeft:if(n.props.preSelection==null)break;n.handleYearNavigation(t-1,cm(n.props.preSelection,1));break;case X.ArrowUp:if(s===void 0||c===void 0||n.props.preSelection==null)break;var u=Gh(s,c).startPeriod,d=hg,f=t-d;if(f<u){var p=c%d;t>=u&&t<u+p?d=p:d+=p,f=t-d}n.handleYearNavigation(f,cm(n.props.preSelection,d));break;case X.ArrowDown:if(s===void 0||c===void 0||n.props.preSelection==null)break;var m=Gh(s,c).endPeriod,d=hg,f=t+d;if(f>m){var p=c%d;t<=m&&t>m-p?d=p:d+=p,f=t+d}n.handleYearNavigation(f,rd(n.props.preSelection,d));break}l&&l(e)},n.getYearClassNames=function(e){var t=n.props,r=t.date,i=t.disabled,a=t.minDate,o=t.maxDate,s=t.excludeDates,c=t.includeDates,l=t.filterDate,u=t.yearClassName;return T(`react-datepicker__year-text`,`react-datepicker__year-${e}`,r?u?.(im(r,e)):void 0,{"react-datepicker__year-text--selected":n.isSelectedYear(e),"react-datepicker__year-text--disabled":(a||o||s||c||l||i)&&wh(e,n.props),"react-datepicker__year-text--keyboard-selected":n.isKeyboardSelected(e),"react-datepicker__year-text--range-start":n.isRangeStart(e),"react-datepicker__year-text--range-end":n.isRangeEnd(e),"react-datepicker__year-text--in-range":n.isInRange(e),"react-datepicker__year-text--in-selecting-range":n.isInSelectingRange(e),"react-datepicker__year-text--selecting-range-start":n.isSelectingRangeStart(e),"react-datepicker__year-text--selecting-range-end":n.isSelectingRangeEnd(e),"react-datepicker__year-text--today":n.isCurrentYear(e)})},n.getYearTabIndex=function(e){if(n.props.disabledKeyboardNavigation||n.props.preSelection==null)return`-1`;var t=H(n.props.preSelection),r=wh(e,n.props);return e===t&&!r?`0`:`-1`},n.getYearContent=function(e){return n.props.renderYearContent?n.props.renderYearContent(e):e},n}return t.prototype.render=function(){var e=this,t=[],n=this.props,r=n.date,i=n.yearItemNumber,a=n.onYearMouseEnter,o=n.onYearMouseLeave;if(r===void 0)return null;for(var s=Gh(r,i),c=s.startPeriod,l=s.endPeriod,u=function(n){t.push(F.createElement(`div`,{ref:d.YEAR_REFS[n-c],onClick:function(t){e.onYearClick(t,n)},onKeyDown:function(t){Zh(t)&&(t.preventDefault(),t.key=X.Enter),e.onYearKeyDown(t,n)},tabIndex:Number(d.getYearTabIndex(n)),className:d.getYearClassNames(n),onMouseEnter:d.props.usePointerEvent?void 0:function(e){return a(e,n)},onPointerEnter:d.props.usePointerEvent?function(e){return a(e,n)}:void 0,onMouseLeave:d.props.usePointerEvent?void 0:function(e){return o(e,n)},onPointerLeave:d.props.usePointerEvent?function(e){return o(e,n)}:void 0,key:n,"aria-current":d.isCurrentYear(n)?`date`:void 0},d.getYearContent(n)))},d=this,f=c;f<=l;f++)u(f);return F.createElement(`div`,{className:`react-datepicker__year`},F.createElement(`div`,{className:`react-datepicker__year-wrapper`,onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},t))},t}(F.Component);function _g(e,t,n,r){for(var i=[],a=0;a<2*t+1;a++){var o=e+t-a,s=!0;n&&(s=H(n)<=o),r&&s&&(s=H(r)>=o),s&&i.push(o)}return i}var vg=function(e){J(t,e);function t(t){var n=e.call(this,t)||this;n.yearOptionButtonsRef={},n.handleOptionKeyDown=function(e,t){var r;switch(t.key){case`Enter`:t.preventDefault(),n.onChange(e);break;case`Escape`:t.preventDefault(),n.props.onCancel();break;case`ArrowUp`:case`ArrowDown`:t.preventDefault();var i=e+(t.key===`ArrowUp`?1:-1);n.yearOptionButtonsRef[i]&&((r=n.yearOptionButtonsRef[i])==null||r.focus());break}},n.renderOptions=function(){n.yearOptionButtonsRef={};var e=n.props.year,t=n.state.yearsList.map(function(t){return F.createElement(`div`,{ref:function(r){n.yearOptionButtonsRef[t]=r,t===e&&r?.focus()},role:`button`,tabIndex:0,className:e===t?`react-datepicker__year-option react-datepicker__year-option--selected_year`:`react-datepicker__year-option`,key:t,onClick:n.onChange.bind(n,t),onKeyDown:n.handleOptionKeyDown.bind(n,t),"aria-selected":e===t?`true`:void 0},e===t?F.createElement(`span`,{className:`react-datepicker__year-option--selected`},`✓`):``,t)}),r=n.props.minDate?H(n.props.minDate):null,i=n.props.maxDate?H(n.props.maxDate):null;return(!i||!n.state.yearsList.find(function(e){return e===i}))&&t.unshift(F.createElement(`div`,{className:`react-datepicker__year-option`,key:`upcoming`,onClick:n.incrementYears},F.createElement(`a`,{className:`react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming`}))),(!r||!n.state.yearsList.find(function(e){return e===r}))&&t.push(F.createElement(`div`,{className:`react-datepicker__year-option`,key:`previous`,onClick:n.decrementYears},F.createElement(`a`,{className:`react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous`}))),t},n.onChange=function(e){n.props.onChange(e)},n.handleClickOutside=function(){n.props.onCancel()},n.shiftYears=function(e){var t=n.state.yearsList.map(function(t){return t+e});n.setState({yearsList:t})},n.incrementYears=function(){return n.shiftYears(1)},n.decrementYears=function(){return n.shiftYears(-1)};var r=t.yearDropdownItemNumber,i=t.scrollableYearDropdown,a=r||(i?10:5);return n.state={yearsList:_g(n.props.year,a,n.props.minDate,n.props.maxDate)},n.dropdownRef=(0,F.createRef)(),n}return t.prototype.componentDidMount=function(){var e=this.dropdownRef.current;if(e){var t=e.children?Array.from(e.children):null,n=t?t.find(function(e){return e.ariaSelected}):null;e.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-e.clientHeight)/2:(e.scrollHeight-e.clientHeight)/2}},t.prototype.render=function(){var e=T({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return F.createElement(Lm,{className:e,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},t}(F.Component),yg=function(e){J(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?H(t.props.minDate):1900,n=t.props.maxDate?H(t.props.maxDate):2100,r=[],i=e;i<=n;i++)r.push(F.createElement(`option`,{key:i,value:i},i));return r},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return F.createElement(`select`,{value:t.props.year,className:`react-datepicker__year-select`,onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return F.createElement(`button`,{key:`read`,type:`button`,style:{visibility:e?`visible`:`hidden`},className:`react-datepicker__year-read-view`,onClick:t.toggleDropdown},F.createElement(`span`,{className:`react-datepicker__year-read-view--down-arrow`}),F.createElement(`span`,{className:`react-datepicker__year-read-view--selected-year`},t.props.year))},t.renderDropdown=function(){return F.createElement(vg,Y({key:`dropdown`},t.props,{onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(){var e=t.state.dropdownVisible,n=[t.renderReadView(!e)];return e&&n.unshift(t.renderDropdown()),n},t.onChange=function(e){t.toggleDropdown(),e!==t.props.year&&t.props.onChange(e)},t.toggleDropdown=function(e){t.setState({dropdownVisible:!t.state.dropdownVisible},function(){t.props.adjustDateOnChange&&t.handleYearChange(t.props.date,e)})},t.handleYearChange=function(e,n){var r;(r=t.onSelect)==null||r.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var r,i;(i=(r=t.props).onSelect)==null||i.call(r,e,n)},t.setOpen=function(){var e,n;(n=(e=t.props).setOpen)==null||n.call(e,!0)},t}return t.prototype.render=function(){var e;switch(this.props.dropdownMode){case`scroll`:e=this.renderScrollMode();break;case`select`:e=this.renderSelectMode();break}return F.createElement(`div`,{className:`react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--${this.props.dropdownMode}`},e)},t}(F.Component),bg=[`react-datepicker__year-select`,`react-datepicker__month-select`,`react-datepicker__month-year-select`],xg=`react-datepicker-ignore-onclickoutside`,Sg=function(e){var t=(e.className||``).split(/\s+/);return bg.some(function(e){return t.indexOf(e)>=0})},Cg=function(e){J(t,e);function t(n){var r=e.call(this,n)||this;return r.monthContainer=void 0,r.handleClickOutside=function(e){r.props.onClickOutside(e)},r.setClickOutsideRef=function(){return r.containerRef.current},r.handleDropdownFocus=function(e){var t,n;Sg(e.target)&&((n=(t=r.props).onDropdownFocus)==null||n.call(t,e))},r.getDateInView=function(){var e=r.props,t=e.preSelection,n=e.selected,i=e.openToDate,a=Rh(r.props),o=zh(r.props),s=Z();return i||n||t||(a&&xf(s,a)?a:o&&bf(s,o)?o:s)},r.increaseMonth=function(){r.setState(function(e){var t=e.date;return{date:Bu(t,1)}},function(){return r.handleMonthChange(r.state.date)})},r.decreaseMonth=function(){r.setState(function(e){var t=e.date;return{date:am(t,1)}},function(){return r.handleMonthChange(r.state.date)})},r.handleDayClick=function(e,t,n){r.props.onSelect(e,t,n),r.props.setPreSelection&&r.props.setPreSelection(e)},r.handleDayMouseEnter=function(e){r.setState({selectingDate:e}),r.props.onDayMouseEnter&&r.props.onDayMouseEnter(e)},r.handleMonthMouseLeave=function(){r.setState({selectingDate:void 0}),r.props.onMonthMouseLeave&&r.props.onMonthMouseLeave()},r.handleYearMouseEnter=function(e,t){r.setState({selectingDate:im(Z(),t)}),r.props.onYearMouseEnter&&r.props.onYearMouseEnter(e,t)},r.handleYearMouseLeave=function(e,t){r.props.onYearMouseLeave&&r.props.onYearMouseLeave(e,t)},r.handleYearChange=function(e){var t,n,i,a;(n=(t=r.props).onYearChange)==null||n.call(t,e),r.setState({isRenderAriaLiveMessage:!0}),r.props.adjustDateOnChange&&(r.props.onSelect(e),(a=(i=r.props).setOpen)==null||a.call(i,!0)),r.props.setPreSelection&&r.props.setPreSelection(e)},r.getEnabledPreSelectionDateForMonth=function(e){if(!_h(e,r.props))return e;for(var t=Zm(e),n=pd(rh(e),t),i=null,a=0;a<=n;a++){var o=zu(t,a);if(!_h(o,r.props)){i=o;break}}return i},r.handleMonthChange=function(e){var t,n,i=r.getEnabledPreSelectionDateForMonth(e)??e;r.handleCustomMonthChange(i),r.props.adjustDateOnChange&&(r.props.onSelect(i),(n=(t=r.props).setOpen)==null||n.call(t,!0)),r.props.setPreSelection&&r.props.setPreSelection(i)},r.handleCustomMonthChange=function(e){var t,n;(n=(t=r.props).onMonthChange)==null||n.call(t,e),r.setState({isRenderAriaLiveMessage:!0})},r.handleMonthYearChange=function(e){r.handleYearChange(e),r.handleMonthChange(e)},r.changeYear=function(e){r.setState(function(t){var n=t.date;return{date:im(n,Number(e))}},function(){return r.handleYearChange(r.state.date)})},r.changeMonth=function(e){r.setState(function(t){var n=t.date;return{date:$p(n,Number(e))}},function(){return r.handleMonthChange(r.state.date)})},r.changeMonthYear=function(e){r.setState(function(t){var n=t.date;return{date:im($p(n,_f(e)),H(e))}},function(){return r.handleMonthYearChange(r.state.date)})},r.header=function(e){if(e===void 0&&(e=r.state.date),!Vm(e))return[];var t=r.props.disabled,n=Xm(e,r.props.locale,r.props.calendarStartDay),i=[];return r.props.showWeekNumbers&&i.push(F.createElement(`div`,{key:`W`,className:`react-datepicker__day-name ${t?`react-datepicker__day-name--disabled`:``}`,role:`columnheader`},F.createElement(`span`,{className:`react-datepicker__sr-only`},`Week number`),F.createElement(`span`,{"aria-hidden":`true`},r.props.weekLabel||`#`))),i.concat([0,1,2,3,4,5,6].map(function(e){var i=zu(n,e),a=r.formatWeekday(i,r.props.locale),o=r.props.weekDayClassName?r.props.weekDayClassName(i):void 0;return F.createElement(`div`,{key:e,role:`columnheader`,className:T(`react-datepicker__day-name`,o,t?`react-datepicker__day-name--disabled`:``)},F.createElement(`span`,{className:`react-datepicker__sr-only`},Q(i,`EEEE`,r.props.locale)),F.createElement(`span`,{"aria-hidden":`true`},a))}))},r.formatWeekday=function(e,t){return r.props.formatWeekDay?dh(e,r.props.formatWeekDay,t):r.props.useWeekdaysShort?ph(e,t):fh(e,t)},r.decreaseYear=function(){r.setState(function(e){var n=e.date;return{date:cm(n,r.props.showYearPicker?r.props.yearItemNumber??t.defaultProps.yearItemNumber:1)}},function(){return r.handleYearChange(r.state.date)})},r.clearSelectingDate=function(){r.setState({selectingDate:void 0})},r.renderPreviousButton=function(){if(!r.props.renderCustomHeader){var e=r.props.monthsShown??t.defaultProps.monthsShown,n=r.props.showPreviousMonths?e-1:0,i=r.props.monthSelectedIn??n,a=am(r.state.date,i),o;switch(!0){case r.props.disabled:o=!0;break;case r.props.showMonthYearPicker:o=Ph(r.state.date,r.props);break;case r.props.showYearPicker:o=Fh(r.state.date,r.props);break;case r.props.showQuarterYearPicker:o=Mh(r.state.date,r.props);break;default:o=Ah(a,r.props);break}if(!(!(r.props.forceShowMonthNavigation??t.defaultProps.forceShowMonthNavigation)&&!r.props.showDisabledMonthNavigation&&o||r.props.showTimeSelectOnly)){var s=[`react-datepicker__navigation-icon`,`react-datepicker__navigation-icon--previous`],c=[`react-datepicker__navigation`,`react-datepicker__navigation--previous`],l=r.decreaseMonth;(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker)&&(l=r.decreaseYear),o&&r.props.showDisabledMonthNavigation&&(c.push(`react-datepicker__navigation--previous--disabled`),l=void 0);var u=r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker,d=r.props,f=d.previousMonthButtonLabel,p=f===void 0?t.defaultProps.previousMonthButtonLabel:f,m=d.previousYearButtonLabel,h=m===void 0?t.defaultProps.previousYearButtonLabel:m,g=r.props,_=g.previousMonthAriaLabel,v=_===void 0?typeof p==`string`?p:`Previous Month`:_,y=g.previousYearAriaLabel,b=y===void 0?typeof h==`string`?h:`Previous Year`:y;return F.createElement(`button`,{type:`button`,className:c.join(` `),onClick:l,onKeyDown:r.props.handleOnKeyDown,"aria-label":u?b:v},F.createElement(`span`,{className:s.join(` `)},u?h:p))}}},r.increaseYear=function(){r.setState(function(e){var n=e.date;return{date:rd(n,r.props.showYearPicker?r.props.yearItemNumber??t.defaultProps.yearItemNumber:1)}},function(){return r.handleYearChange(r.state.date)})},r.renderNextButton=function(){if(!r.props.renderCustomHeader){var e;switch(!0){case r.props.disabled:e=!0;break;case r.props.showMonthYearPicker:e=Ih(r.state.date,r.props);break;case r.props.showYearPicker:e=Lh(r.state.date,r.props);break;case r.props.showQuarterYearPicker:e=Nh(r.state.date,r.props);break;default:e=jh(r.state.date,r.props);break}if(!(!(r.props.forceShowMonthNavigation??t.defaultProps.forceShowMonthNavigation)&&!r.props.showDisabledMonthNavigation&&e||r.props.showTimeSelectOnly)){var n=[`react-datepicker__navigation`,`react-datepicker__navigation--next`],i=[`react-datepicker__navigation-icon`,`react-datepicker__navigation-icon--next`];r.props.showTimeSelect&&n.push(`react-datepicker__navigation--next--with-time`),r.props.todayButton&&n.push(`react-datepicker__navigation--next--with-today-button`);var a=r.increaseMonth;(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker)&&(a=r.increaseYear),e&&r.props.showDisabledMonthNavigation&&(n.push(`react-datepicker__navigation--next--disabled`),a=void 0);var o=r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker,s=r.props,c=s.nextMonthButtonLabel,l=c===void 0?t.defaultProps.nextMonthButtonLabel:c,u=s.nextYearButtonLabel,d=u===void 0?t.defaultProps.nextYearButtonLabel:u,f=r.props,p=f.nextMonthAriaLabel,m=p===void 0?typeof l==`string`?l:`Next Month`:p,h=f.nextYearAriaLabel,g=h===void 0?typeof d==`string`?d:`Next Year`:h;return F.createElement(`button`,{type:`button`,className:n.join(` `),onClick:a,onKeyDown:r.props.handleOnKeyDown,"aria-label":o?g:m},F.createElement(`span`,{className:i.join(` `)},o?d:l))}}},r.renderCurrentMonth=function(e){e===void 0&&(e=r.state.date);var t=[`react-datepicker__current-month`];return r.props.showYearDropdown&&t.push(`react-datepicker__current-month--hasYearDropdown`),r.props.showMonthDropdown&&t.push(`react-datepicker__current-month--hasMonthDropdown`),r.props.showMonthYearDropdown&&t.push(`react-datepicker__current-month--hasMonthYearDropdown`),F.createElement(`h2`,{className:t.join(` `)},Vm(e)?Q(e,r.props.dateFormat,r.props.locale):``)},r.renderYearDropdown=function(e){if(e===void 0&&(e=!1),!(!r.props.showYearDropdown||e))return F.createElement(yg,Y({},t.defaultProps,r.props,{date:r.state.date,onChange:r.changeYear,year:H(r.state.date)}))},r.renderMonthDropdown=function(e){if(e===void 0&&(e=!1),!(!r.props.showMonthDropdown||e))return F.createElement(ug,Y({},t.defaultProps,r.props,{month:_f(r.state.date),onChange:r.changeMonth}))},r.renderMonthYearDropdown=function(e){if(e===void 0&&(e=!1),!(!r.props.showMonthYearDropdown||e))return F.createElement(pg,Y({},t.defaultProps,r.props,{date:r.state.date,onChange:r.changeMonthYear}))},r.handleTodayButtonClick=function(e){r.props.onSelect(eh(),e),r.props.setPreSelection&&r.props.setPreSelection(eh())},r.renderTodayButton=function(){if(!(!r.props.todayButton||r.props.showTimeSelectOnly))return F.createElement(`div`,{className:`react-datepicker__today-button`,onClick:r.handleTodayButtonClick},r.props.todayButton)},r.renderDayNamesHeader=function(e){return F.createElement(`div`,{className:`react-datepicker__day-names`,role:`row`},r.header(e))},r.renderDefaultHeader=function(e){var t=e.monthDate,n=e.i;return F.createElement(`div`,{className:`react-datepicker__header ${r.props.showTimeSelect?`react-datepicker__header--has-time-select`:``}`},r.renderCurrentMonth(t),F.createElement(`div`,{className:`react-datepicker__header__dropdown react-datepicker__header__dropdown--${r.props.dropdownMode}`,onFocus:r.handleDropdownFocus},r.renderMonthDropdown(n!==0),r.renderMonthYearDropdown(n!==0),r.renderYearDropdown(n!==0)))},r.renderCustomHeader=function(e){var t,n=e.monthDate,i=e.i;if(r.props.showTimeSelect&&!r.state.monthContainer||r.props.showTimeSelectOnly)return null;var a=r.props,o=a.showYearPicker,s=a.yearItemNumber,c;if(o){var l=Gh(n,s);c={startYear:l.startPeriod,endYear:l.endPeriod}}var u=Ah(r.state.date,r.props),d=jh(r.state.date,r.props),f=Ph(r.state.date,r.props),p=Ih(r.state.date,r.props);return F.createElement(`div`,{className:`react-datepicker__header react-datepicker__header--custom`,onFocus:r.props.onDropdownFocus},(t=r.props).renderCustomHeader?.call(t,Y(Y(Y({},r.state),o&&{visibleYearsRange:c}),{customHeaderCount:i,monthDate:n,changeMonth:r.changeMonth,changeYear:r.changeYear,decreaseMonth:r.decreaseMonth,increaseMonth:r.increaseMonth,decreaseYear:r.decreaseYear,increaseYear:r.increaseYear,prevMonthButtonDisabled:u,nextMonthButtonDisabled:d,prevYearButtonDisabled:f,nextYearButtonDisabled:p})))},r.renderYearHeader=function(e){var n=e.monthDate,i=r.props,a=i.showYearPicker,o=i.yearItemNumber,s=Gh(n,o===void 0?t.defaultProps.yearItemNumber:o),c=s.startPeriod,l=s.endPeriod;return F.createElement(`div`,{className:`react-datepicker__header react-datepicker-year-header`},a?`${c} - ${l}`:H(n))},r.renderHeader=function(e){var t=e.monthDate,n=e.i,i={monthDate:t,i:n===void 0?0:n};switch(!0){case r.props.renderCustomHeader!==void 0:return r.renderCustomHeader(i);case r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker:return r.renderYearHeader(i);default:return r.renderDefaultHeader(i)}},r.renderMonths=function(){if(!(r.props.showTimeSelectOnly||r.props.showYearPicker)){for(var e=[],n=r.props.monthsShown??t.defaultProps.monthsShown,i=r.props.showPreviousMonths?n-1:0,a=r.props.showMonthYearPicker||r.props.showQuarterYearPicker?rd(r.state.date,i):am(r.state.date,i),o=r.props.monthSelectedIn??i,s=0;s<n;++s){var c=s-o+i,l=r.props.showMonthYearPicker||r.props.showQuarterYearPicker?rd(a,c):Bu(a,c),u=`month-${s}`,d=s<n-1,f=s>0;e.push(F.createElement(`div`,{key:u,ref:function(e){r.monthContainer=e??void 0},className:`react-datepicker__month-container`},r.renderHeader({monthDate:l,i:s}),F.createElement(cg,Y({},t.defaultProps,r.props,{containerRef:r.containerRef,ariaLabelPrefix:r.props.monthAriaLabelPrefix,day:l,onDayClick:r.handleDayClick,handleOnKeyDown:r.props.handleOnDayKeyDown,handleOnMonthKeyDown:r.props.handleOnKeyDown,onDayMouseEnter:r.handleDayMouseEnter,onMouseLeave:r.handleMonthMouseLeave,orderInDisplay:s,selectingDate:r.state.selectingDate,monthShowsDuplicateDaysEnd:d,monthShowsDuplicateDaysStart:f,dayNamesHeader:r.renderDayNamesHeader(l)}))))}return e}},r.renderYears=function(){if(!r.props.showTimeSelectOnly&&r.props.showYearPicker)return F.createElement(`div`,{className:`react-datepicker__year--container`},r.renderHeader({monthDate:r.state.date}),F.createElement(gg,Y({},t.defaultProps,r.props,{selectingDate:r.state.selectingDate,date:r.state.date,onDayClick:r.handleDayClick,clearSelectingDate:r.clearSelectingDate,onYearMouseEnter:r.handleYearMouseEnter,onYearMouseLeave:r.handleYearMouseLeave})))},r.renderTimeSection=function(){if(r.props.showTimeSelect&&(r.state.monthContainer||r.props.showTimeSelectOnly))return F.createElement(mg,Y({},t.defaultProps,r.props,{onChange:r.props.onTimeChange,format:r.props.timeFormat,intervals:r.props.timeIntervals,monthRef:r.state.monthContainer}))},r.renderInputTimeSection=function(){var e=r.props.selected?new Date(r.props.selected):void 0,n=e&&Vm(e)&&r.props.selected?`${Wh(e.getHours())}:${Wh(e.getMinutes())}`:``;if(r.props.showTimeInput)return F.createElement(Qh,Y({},t.defaultProps,r.props,{date:e,timeString:n,onChange:r.props.onTimeChange}))},r.renderAriaLiveRegion=function(){if(!Vm(r.state.date))return F.createElement(`span`,{role:`alert`,"aria-live":`polite`,className:`react-datepicker__aria-live`});var e=Gh(r.state.date,r.props.yearItemNumber??t.defaultProps.yearItemNumber),n=e.startPeriod,i=e.endPeriod,a=r.props.showYearPicker?`${n} - ${i}`:r.props.showMonthYearPicker||r.props.showQuarterYearPicker?H(r.state.date):`${mh(_f(r.state.date),r.props.locale)} ${H(r.state.date)}`;return F.createElement(`span`,{role:`alert`,"aria-live":`polite`,className:`react-datepicker__aria-live`},r.state.isRenderAriaLiveMessage&&a)},r.renderChildren=function(){if(r.props.children)return F.createElement(`div`,{className:`react-datepicker__children-container`},r.props.children)},r.containerRef=(0,F.createRef)(),r.state={date:r.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},r}return Object.defineProperty(t,`defaultProps`,{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:xg,timeCaption:`Time`,previousYearButtonLabel:`Previous Year`,nextYearButtonLabel:`Next Year`,previousMonthButtonLabel:`Previous Month`,nextMonthButtonLabel:`Next Month`,yearItemNumber:zm}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){var e=this;this.props.showTimeSelect&&(this.assignMonthContainer=(function(){e.setState({monthContainer:e.monthContainer})})())},t.prototype.componentDidUpdate=function(e){var t=this;if(this.props.preSelection&&Vm(this.props.preSelection)&&(!$(this.props.preSelection,e.preSelection)||this.props.monthSelectedIn!==e.monthSelectedIn)){var n=!ah(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&t.handleCustomMonthChange(t.state.date)})}else this.props.openToDate&&!$(this.props.openToDate,e.openToDate)&&this.setState({date:this.props.openToDate})},t.prototype.render=function(){var e=this.props.container||Fm;return F.createElement(Lm,{onClickOutside:this.handleClickOutside,style:{display:`contents`},ignoreClass:this.props.outsideClickIgnoreClass},F.createElement(`div`,{style:{display:`contents`},ref:this.containerRef},F.createElement(e,{className:T(`react-datepicker`,this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly,inline:this.props.inline},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},t}(F.Component),wg=function(e){var t=e.icon,n=e.className,r=n===void 0?``:n,i=e.onClick,a=`react-datepicker__calendar-icon`;if(typeof t==`string`)return F.createElement(`i`,{className:`${a} ${t} ${r}`,"aria-hidden":`true`,onClick:i});if(F.isValidElement(t)){var o=t;return F.cloneElement(o,{className:`${o.props.className||``} ${a} ${r}`,onClick:function(e){typeof o.props.onClick==`function`&&o.props.onClick(e),typeof i==`function`&&i(e)}})}return F.createElement(`svg`,{className:`${a} ${r}`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,onClick:i},F.createElement(`path`,{d:`M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z`}))},Tg=function(e){J(t,e);function t(t){var n=e.call(this,t)||this;return n.portalRoot=null,n.el=document.createElement(`div`),n}return t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement(`div`),this.portalRoot.setAttribute(`id`,this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Mm.createPortal(this.props.children,this.el)},t}(F.Component),Eg=`[tabindex], a, button, input, select, textarea`,Dg=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&e.tabIndex!==-1},Og=function(e){J(t,e);function t(t){var n=e.call(this,t)||this;return n.getTabChildren=function(){return Array.prototype.slice.call(n.tabLoopRef.current?.querySelectorAll(Eg),1,-1).filter(Dg)},n.handleFocusStart=function(){var e=n.getTabChildren();e&&e.length>1&&e[e.length-1].focus()},n.handleFocusEnd=function(){var e=n.getTabChildren();e&&e.length>1&&e[0].focus()},n.tabLoopRef=(0,F.createRef)(),n}return t.prototype.render=function(){return this.props.enableTabLoop??t.defaultProps.enableTabLoop?F.createElement(`div`,{className:`react-datepicker__tab-loop`,ref:this.tabLoopRef},F.createElement(`div`,{className:`react-datepicker__tab-loop__start`,tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,F.createElement(`div`,{className:`react-datepicker__tab-loop__end`,tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},t.defaultProps={enableTabLoop:!0},t}(F.Component);function kg(e){function t(t){var n=typeof t.hidePopper==`boolean`?t.hidePopper:!0,r=(0,F.useRef)(null),i=jm(Y({open:!n,whileElementsMounted:mc,placement:t.popperPlacement,middleware:Pm([Oc({padding:15}),Dc(10),kc({element:r})],t.popperModifiers??[],!0)},t.popperProps)),a=Y(Y({},t),{hidePopper:n,popperProps:Y(Y({},i),{arrowRef:r})});return F.createElement(e,Y({},a))}return t.displayName=`withFloating(${e.displayName||e.name||`Component`})`,t}var Ag=kg(function(e){var t=e.className,n=e.wrapperClassName,r=e.hidePopper,i=r===void 0?!0:r,a=e.popperComponent,o=e.targetComponent,s=e.enableTabLoop,c=e.popperOnKeyDown,l=e.portalId,u=e.portalHost,d=e.popperProps,f=e.showArrow,p=void 0;if(!i){var m=T(`react-datepicker-popper`,t);p=F.createElement(Og,{enableTabLoop:s},F.createElement(`div`,{ref:d.refs.setFloating,style:d.floatingStyles,className:m,"data-placement":d.placement,onKeyDown:c},a,f&&F.createElement(wm,{ref:d.arrowRef,context:d.context,fill:`currentColor`,strokeWidth:1,height:8,width:16,style:{transform:`translateY(-1px)`},className:`react-datepicker__triangle`})))}e.popperContainer&&(p=(0,F.createElement)(e.popperContainer,{},p)),l&&!i&&(p=F.createElement(Tg,{portalId:l,portalHost:u},p));var h=T(`react-datepicker-wrapper`,n);return F.createElement(F.Fragment,null,F.createElement(`div`,{ref:d.refs.setReference,className:h},o),p)});function jg(e,t){return e&&t?_f(e)!==_f(t)||H(e)!==H(t):e!==t}var Mg=`Date input not valid.`,Ng=function(e){J(t,e);function t(n){var r=e.call(this,n)||this;return r.calendar=null,r.input=null,r.getPreSelection=function(){return r.props.openToDate?r.props.openToDate:r.props.selectsEnd&&r.props.startDate?r.props.startDate:r.props.selectsStart&&r.props.endDate?r.props.endDate:Z()},r.modifyHolidays=function(){return r.props.holidays?.reduce(function(e,t){var n=new Date(t.date);return Vm(n)?Pm(Pm([],e,!0),[Y(Y({},t),{date:n})],!1):e},[])},r.calcInitialState=function(){var e=r.getPreSelection(),t=Rh(r.props),n=zh(r.props),i=t&&xf(e,Ym(t))?t:n&&bf(e,th(n))?n:e;return{open:r.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(r.props.selectsRange?r.props.startDate:r.props.selected)??i,highlightDates:Bh(r.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},r.getInputValue=function(){var e=r.props,n=e.locale,i=e.startDate,a=e.endDate,o=e.rangeSeparator,s=e.selected,c=e.selectedDates,l=e.selectsMultiple,u=e.selectsRange,d=e.value,f=r.props.dateFormat??t.defaultProps.dateFormat,p=r.state.inputValue;return typeof d==`string`?d:typeof p==`string`?p:u?Wm(i,a,{dateFormat:f,locale:n,rangeSeparator:o}):l?Gm(c??[],{dateFormat:f,locale:n}):Hm(s,{dateFormat:f,locale:n})},r.resetHiddenStatus=function(){r.setState(Y(Y({},r.state),{wasHidden:!1}))},r.setHiddenStatus=function(){r.setState(Y(Y({},r.state),{wasHidden:!0}))},r.setHiddenStateOnVisibilityHidden=function(){document.visibilityState===`hidden`&&r.setHiddenStatus()},r.clearPreventFocusTimeout=function(){r.preventFocusTimeout&&clearTimeout(r.preventFocusTimeout)},r.setFocus=function(){var e,t;(t=(e=r.input)?.focus)==null||t.call(e,{preventScroll:!0})},r.setBlur=function(){var e,t;(t=(e=r.input)?.blur)==null||t.call(e),r.cancelFocusInput()},r.deferBlur=function(){requestAnimationFrame(function(){r.setBlur()})},r.setOpen=function(e,t){t===void 0&&(t=!1),r.setState({open:e,preSelection:e&&r.state.open?r.state.preSelection:r.calcInitialState().preSelection,lastPreSelectChange:Fg},function(){e||r.setState(function(e){return{focused:t?e.focused:!1}},function(){!t&&r.deferBlur(),r.setState({inputValue:null})})})},r.inputOk=function(){return sd(r.state.preSelection)},r.isCalendarOpen=function(){return r.props.open===void 0?r.state.open&&!r.props.disabled&&!r.props.readOnly:r.props.open},r.handleFocus=function(e){var t,n,i=r.state.wasHidden,a=i?r.state.open:!0;i&&r.resetHiddenStatus(),r.state.preventFocus||((n=(t=r.props).onFocus)==null||n.call(t,e),a&&!r.props.preventOpenOnFocus&&!r.props.readOnly&&r.setOpen(!0)),r.setState({focused:!0})},r.sendFocusBackToInput=function(){r.preventFocusTimeout&&r.clearPreventFocusTimeout(),r.setState({preventFocus:!0},function(){r.preventFocusTimeout=setTimeout(function(){r.setFocus(),r.setState({preventFocus:!1})})})},r.cancelFocusInput=function(){clearTimeout(r.inputFocusTimeout),r.inputFocusTimeout=void 0},r.deferFocusInput=function(){r.cancelFocusInput(),r.inputFocusTimeout=setTimeout(function(){return r.setFocus()},1)},r.handleDropdownFocus=function(){r.cancelFocusInput()},r.resetInputValue=function(){r.setState(Y(Y({},r.state),{inputValue:null}))},r.handleBlur=function(e){var t,n;(!r.state.open||r.props.withPortal||r.props.showTimeInput)&&((n=(t=r.props).onBlur)==null||n.call(t,e)),r.resetInputValue(),r.state.open&&r.props.open===!1&&r.setOpen(!1),r.setState({focused:!1})},r.handleCalendarClickOutside=function(e){var t,n;r.props.inline||r.setOpen(!1),(n=(t=r.props).onClickOutside)==null||n.call(t,e),r.props.withPortal&&e.preventDefault()},r.handleChange=function(){for(var e,n,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=i[0];if(!(r.props.onChangeRaw&&(r.props.onChangeRaw.apply(r,i),!o||typeof o.isDefaultPrevented!=`function`||o.isDefaultPrevented()))){r.setState({inputValue:o?.target instanceof HTMLInputElement?o.target.value:null,lastPreSelectChange:Pg});var s=r.props,c=s.selectsRange,l=s.startDate,u=s.endDate,d=r.props.dateFormat??t.defaultProps.dateFormat,f=r.props.strictParsing??t.defaultProps.strictParsing,p=o?.target instanceof HTMLInputElement?o.target.value:``;if(c){var m=r.props.rangeSeparator,h=m.trim(),g=p.split(d.includes(h)?m:h,2).map(function(e){return e.trim()}),_=g[0],v=g[1],y=Bm(_??``,d,r.props.locale,f),b=y?Bm(v??``,d,r.props.locale,f):null,x=l?.getTime()!==y?.getTime(),S=u?.getTime()!==b?.getTime();if(!x&&!S||y&&_h(y,r.props)||b&&_h(b,r.props))return;(n=(e=r.props).onChange)==null||n.call(e,[y,b],o)}else{var C=Bm(p,d,r.props.locale,f,r.props.selected??void 0);(C||!p)&&r.setSelected(C,o,!0)}}},r.handleSelect=function(e,n,i){if(!r.props.readOnly){var a=r.props,o=a.selectsRange,s=a.startDate,c=a.endDate,l=a.locale,u=a.swapRange,d=r.props.dateFormat??t.defaultProps.dateFormat,f=!o||s&&!c&&(u||!Xh(e,s));if(r.props.shouldCloseOnSelect&&!r.props.showTimeSelect&&f&&r.sendFocusBackToInput(),r.props.onChangeRaw){var p=Hm(e,{dateFormat:d,locale:l});r.props.onChangeRaw(n,{date:e,formattedDate:p})}r.setSelected(e,n,!1,i),r.props.showDateSelect&&r.setState({isRenderAriaLiveMessage:!0}),!r.props.shouldCloseOnSelect||r.props.showTimeSelect?r.setPreSelection(e):f&&r.setOpen(!1)}},r.setSelected=function(e,t,n,i){var a,o,s=e;if(r.props.showYearPicker){if(s!==null&&wh(H(s),r.props))return}else if(r.props.showMonthYearPicker){if(s!==null&&yh(s,r.props))return}else if(s!==null&&_h(s,r.props))return;var c=r.props,l=c.onChange,u=c.selectsRange,d=c.startDate,f=c.endDate,p=c.selectsMultiple,m=c.selectedDates,h=c.minTime,g=c.swapRange;if(!sh(r.props.selected,s)||r.props.allowSameDay||u||p)if(s!==null&&(r.props.selected&&(!n||!r.props.showTimeSelect&&!r.props.showTimeSelectOnly&&!r.props.showTimeInput)&&(s=Km(s,{hour:mf(r.props.selected),minute:gf(r.props.selected),second:vf(r.props.selected)})),!n&&(r.props.showTimeSelect||r.props.showTimeSelectOnly)&&h&&(s=Km(s,{hour:h.getHours(),minute:h.getMinutes(),second:h.getSeconds()})),r.props.inline||r.setState({preSelection:s}),r.props.focusSelectedMonth||r.setState({monthSelectedIn:i})),u){var _=!d&&!f,v=d&&!f,y=!d&&!!f,b=d&&f;_?l?.([s,null],t):v?s===null?l?.([null,null],t):Xh(s,d)?g?l?.([s,d],t):l?.([s,null],t):l?.([d,s],t):y&&(s&&Xh(s,f)?l?.([s,f],t):l?.([s,null],t)),b&&l?.([s,null],t)}else if(p){if(s!==null)if(!m?.length)l?.([s],t);else if(m.some(function(e){return $(e,s)})){var x=m.filter(function(e){return!$(e,s)});l?.(x,t)}else l?.(Pm(Pm([],m,!0),[s],!1),t)}else l?.(s,t);n||((o=(a=r.props).onSelect)==null||o.call(a,s,t),r.setState({inputValue:null}))},r.setPreSelection=function(e){if(!r.props.readOnly){var t=sd(r.props.minDate),n=sd(r.props.maxDate),i=!0;if(e){var a=Ym(e);if(t&&n)i=ch(e,r.props.minDate,r.props.maxDate);else if(t){var o=Ym(r.props.minDate);i=bf(e,o)||sh(a,o)}else if(n){var s=th(r.props.maxDate);i=xf(e,s)||sh(a,s)}}i&&r.setState({preSelection:e})}},r.toggleCalendar=function(){r.setOpen(!r.state.open)},r.handleTimeChange=function(e){var t,n;if(!(r.props.selectsRange||r.props.selectsMultiple)){var i=r.props.selected?r.props.selected:r.getPreSelection(),a=r.props.selected?e:Km(i,{hour:mf(e),minute:gf(e)});r.setState({preSelection:a}),(n=(t=r.props).onChange)==null||n.call(t,a),r.props.shouldCloseOnSelect&&!r.props.showTimeInput&&(r.sendFocusBackToInput(),r.setOpen(!1)),r.props.showTimeInput&&r.setOpen(!0),(r.props.showTimeSelectOnly||r.props.showTimeSelect)&&r.setState({isRenderAriaLiveMessage:!0}),r.setState({inputValue:null})}},r.onInputClick=function(){var e,t;!r.props.disabled&&!r.props.readOnly&&r.setOpen(!0),(t=(e=r.props).onInputClick)==null||t.call(e)},r.handleTimeOnlyArrowKey=function(e){var n,i,a=r.props.selected||r.state.preSelection||Z(),o=r.props.timeIntervals??30,s=r.props.dateFormat??t.defaultProps.dateFormat,c=Array.isArray(s)?s[0]:s,l=Ym(a),u=mf(a)*60+gf(a),d=1440-o,f;if(e===X.ArrowUp){var p=Math.max(0,u-o);f=$u(l,p)}else{var p=Math.min(d,u+o);f=$u(l,p)}var m=Q(f,c||t.defaultProps.dateFormat,r.props.locale);if(r.setState({preSelection:f,inputValue:m}),!(r.props.selectsRange||r.props.selectsMultiple)){var h=r.props.selected?r.props.selected:r.getPreSelection(),g=r.props.selected?f:Km(h,{hour:mf(f),minute:gf(f)});(i=(n=r.props).onChange)==null||i.call(n,g),(r.props.showTimeSelectOnly||r.props.showTimeSelect)&&r.setState({isRenderAriaLiveMessage:!0}),requestAnimationFrame(function(){r.scrollToTimeOption(f)})}},r.handleTimeOnlyEnterKey=function(e){var n=e.target.value,i=r.props.dateFormat??t.defaultProps.dateFormat,a=r.props.timeFormat||`p`,o=r.state.preSelection||r.props.selected||Z(),s=Bm(n,i,r.props.locale,r.props.strictParsing??!1,o),c=o;if(s&&Vm(s))c=s;else{var l=r.calendar?.containerRef.current instanceof Element&&r.calendar.containerRef.current.querySelector(`.react-datepicker__time-list-item[tabindex='0']`);if(l instanceof HTMLElement){var u=l.textContent?.trim();if(u){var d=Bm(u,a,r.props.locale,!1,o);d&&Vm(d)&&(c=d)}}}r.handleTimeChange(c),r.setOpen(!1),r.sendFocusBackToInput()},r.scrollToTimeOption=function(e){if(r.calendar?.containerRef.current){for(var t=r.calendar.containerRef.current,n=Array.from(t.querySelectorAll(`.react-datepicker__time-list-item`)),i=null,a=1/0,o=r.props.timeFormat||`p`,s=0,c=n;s<c.length;s++){var l=c[s],u=l.textContent?.trim();if(u){var d=Bm(u,o,r.props.locale,!1,e);if(d&&Vm(d)){if(Jh(d,e)){i=l;break}var f=Math.abs(d.getTime()-e.getTime());f<a&&(a=f,i=l)}}}i&&(n.forEach(function(e){e.setAttribute(`tabindex`,`-1`)}),i.setAttribute(`tabindex`,`0`),i.scrollIntoView({behavior:`smooth`,block:`center`}))}},r.onInputKeyDown=function(e){var t,n,i,a,o;(n=(t=r.props).onKeyDown)==null||n.call(t,e);var s=e.key;if(!r.state.open&&!r.props.inline&&!r.props.preventOpenOnFocus){(s===X.ArrowDown||s===X.ArrowUp||s===X.Enter)&&((i=r.onInputClick)==null||i.call(r));return}if(r.state.open&&r.props.showTimeSelectOnly){if(s===X.ArrowDown||s===X.ArrowUp){e.preventDefault(),r.handleTimeOnlyArrowKey(s);return}if(s===X.Enter){e.preventDefault(),r.handleTimeOnlyEnterKey(e);return}}if(r.state.open){if(s===X.ArrowDown||s===X.ArrowUp){e.preventDefault();var c=r.props.showTimeSelectOnly?`.react-datepicker__time-list-item[tabindex='0']`:r.props.showWeekPicker&&r.props.showWeekNumbers?`.react-datepicker__week-number[tabindex="0"]`:r.props.showFullMonthYearPicker||r.props.showMonthYearPicker?`.react-datepicker__month-text[tabindex="0"]`:`.react-datepicker__day[tabindex="0"]`,l=r.calendar?.containerRef.current instanceof Element&&r.calendar.containerRef.current.querySelector(c);l instanceof HTMLElement&&l.focus({preventScroll:!0});return}var u=Z(r.state.preSelection);s===X.Enter?(e.preventDefault(),e.target.blur(),r.inputOk()&&r.state.lastPreSelectChange===Fg?(r.handleSelect(u,e),!r.props.shouldCloseOnSelect&&r.setPreSelection(u)):r.setOpen(!1)):s===X.Escape?(e.preventDefault(),e.target.blur(),r.sendFocusBackToInput(),r.setOpen(!1)):s===X.Tab&&r.setOpen(!1),r.inputOk()||(o=(a=r.props).onInputError)==null||o.call(a,{code:1,msg:Mg})}},r.onPortalKeyDown=function(e){e.key===X.Escape&&(e.preventDefault(),r.setState({preventFocus:!0},function(){r.setOpen(!1),setTimeout(function(){r.setFocus(),r.setState({preventFocus:!1})})}))},r.onDayKeyDown=function(e){var t,n,i,a,o,s,c=r.props,l=c.minDate,u=c.maxDate,d=c.disabledKeyboardNavigation,f=c.showWeekPicker,p=c.shouldCloseOnSelect,m=c.locale,h=c.calendarStartDay,g=c.adjustDateOnChange,_=c.inline;if((n=(t=r.props).onKeyDown)==null||n.call(t,e),!d){var v=e.key,y=e.shiftKey,b=Z(r.state.preSelection),x=function(e,t){var n=t;switch(e){case X.ArrowRight:n=f?nd(t,1):zu(t,1);break;case X.ArrowLeft:n=f?sm(t,1):Mp(t,1);break;case X.ArrowUp:n=sm(t,1);break;case X.ArrowDown:n=nd(t,1);break;case X.PageUp:n=y?cm(t,1):am(t,1);break;case X.PageDown:n=y?rd(t,1):Bu(t,1);break;case X.Home:n=Xm(t,m,h);break;case X.End:n=nh(t);break}return n},S=function(e,t){for(var n=40,i=e,a=!1,o=0,s=x(e,t);!a;){if(o>=n){s=t;break}l&&s<l&&(i=X.ArrowRight,s=_h(l,r.props)?x(i,s):l),u&&s>u&&(i=X.ArrowLeft,s=_h(u,r.props)?x(i,s):u),_h(s,r.props)?((i===X.PageUp||i===X.Home)&&(i=X.ArrowRight),(i===X.PageDown||i===X.End)&&(i=X.ArrowLeft),s=x(i,s)):a=!0,o++}return s};if(v===X.Enter){e.preventDefault(),r.handleSelect(b,e),!p&&r.setPreSelection(b);return}else if(v===X.Escape){e.preventDefault(),r.setOpen(!1),r.inputOk()||(a=(i=r.props).onInputError)==null||a.call(i,{code:1,msg:Mg});return}var C=null;switch(v){case X.ArrowLeft:case X.ArrowRight:case X.ArrowUp:case X.ArrowDown:case X.PageUp:case X.PageDown:case X.Home:case X.End:C=S(v,b);break}if(!C){(s=(o=r.props).onInputError)==null||s.call(o,{code:1,msg:Mg});return}e.preventDefault(),r.setState({lastPreSelectChange:Fg}),g&&r.setSelected(C),r.setPreSelection(C),_&&r.setState({shouldFocusDayInline:!0})}},r.onPopperKeyDown=function(e){e.key===X.Escape&&(e.preventDefault(),r.sendFocusBackToInput(),r.setOpen(!1))},r.onClearClick=function(e){e&&e.preventDefault&&e.preventDefault(),r.sendFocusBackToInput();var t=r.props,n=t.selectsRange,i=t.onChange;n?i?.([null,null],e):i?.(null,e),r.setState({inputValue:null})},r.clear=function(){r.onClearClick()},r.onScroll=function(e){typeof r.props.closeOnScroll==`boolean`&&r.props.closeOnScroll?(e.target===document||e.target===document.documentElement||e.target===document.body)&&r.setOpen(!1):typeof r.props.closeOnScroll==`function`&&r.props.closeOnScroll(e)&&r.setOpen(!1)},r.renderCalendar=function(){return!r.props.inline&&!r.isCalendarOpen()?null:F.createElement(Cg,Y({showMonthYearDropdown:void 0,ref:function(e){r.calendar=e}},r.props,r.state,{setOpen:r.setOpen,dateFormat:r.props.dateFormatCalendar??t.defaultProps.dateFormatCalendar,onSelect:r.handleSelect,onClickOutside:r.handleCalendarClickOutside,holidays:Hh(r.modifyHolidays()),outsideClickIgnoreClass:r.props.outsideClickIgnoreClass,onDropdownFocus:r.handleDropdownFocus,onTimeChange:r.handleTimeChange,className:r.props.calendarClassName,container:r.props.calendarContainer,handleOnKeyDown:r.props.onKeyDown,handleOnDayKeyDown:r.onDayKeyDown,setPreSelection:r.setPreSelection,dropdownMode:r.props.dropdownMode??t.defaultProps.dropdownMode}),r.props.children)},r.renderAriaLiveRegion=function(){var e=r.props.locale,n=r.props.dateFormat??t.defaultProps.dateFormat,i=r.props.showTimeInput||r.props.showTimeSelect?`PPPPp`:`PPPP`,a=r.props.selectsRange?`Selected start date: ${Hm(r.props.startDate,{dateFormat:i,locale:e})}. ${r.props.endDate?`End date: `+Hm(r.props.endDate,{dateFormat:i,locale:e}):``}`:r.props.showTimeSelectOnly?`Selected time: ${Hm(r.props.selected,{dateFormat:n,locale:e})}`:r.props.showYearPicker?`Selected year: ${Hm(r.props.selected,{dateFormat:`yyyy`,locale:e})}`:r.props.showMonthYearPicker?`Selected month: ${Hm(r.props.selected,{dateFormat:`MMMM yyyy`,locale:e})}`:r.props.showQuarterYearPicker?`Selected quarter: ${Hm(r.props.selected,{dateFormat:`yyyy, QQQ`,locale:e})}`:`Selected date: ${Hm(r.props.selected,{dateFormat:i,locale:e})}`;return F.createElement(`span`,{role:`alert`,"aria-live":`polite`,className:`react-datepicker__aria-live`},a)},r.renderDateInput=function(){var e,n,i=T(r.props.className,(e={},e[r.props.outsideClickIgnoreClass||t.defaultProps.outsideClickIgnoreClass]=r.state.open,e)),a=r.props.customInput||F.createElement(`input`,{type:`text`}),o=r.props.customInputRef||`ref`,s={},c=r.props[`aria-describedby`]??r.props.ariaDescribedBy,l=r.props[`aria-invalid`]??r.props.ariaInvalid,u=r.props[`aria-labelledby`]??r.props.ariaLabelledBy,d=r.props[`aria-required`]??r.props.ariaRequired;return c!=null&&(s[`aria-describedby`]=c),l!=null&&(s[`aria-invalid`]=l),u!=null&&(s[`aria-labelledby`]=u),d!=null&&(s[`aria-required`]=d),(0,F.cloneElement)(a,Y((n={},n[o]=function(e){r.input=e},n.value=r.getInputValue(),n.onBlur=r.handleBlur,n.onChange=r.handleChange,n.onClick=r.onInputClick,n.onFocus=r.handleFocus,n.onKeyDown=r.onInputKeyDown,n.id=r.props.id,n.name=r.props.name,n.form=r.props.form,n.autoFocus=r.props.autoFocus,n.placeholder=r.props.placeholderText,n.disabled=r.props.disabled,n.autoComplete=r.props.autoComplete,n.className=T(a.props.className,i),n.title=r.props.title,n.readOnly=r.props.readOnly,n.required=r.props.required,n.tabIndex=r.props.tabIndex,n),s))},r.renderClearButton=function(){var e=r.props,t=e.isClearable,n=e.disabled,i=e.selected,a=e.startDate,o=e.endDate,s=e.clearButtonTitle,c=e.clearButtonClassName,l=c===void 0?``:c,u=e.ariaLabelClose,d=u===void 0?`Close`:u,f=e.selectedDates,p=e.readOnly;return t&&!p&&(i!=null||a!=null||o!=null||f?.length)?F.createElement(`button`,{type:`button`,className:T(`react-datepicker__close-icon`,l,{"react-datepicker__close-icon--disabled":n}),disabled:n,"aria-label":d,onClick:r.onClearClick,title:s,tabIndex:-1}):null},r.state=r.calcInitialState(),r.preventFocusTimeout=void 0,r}return Object.defineProperty(t,`defaultProps`,{get:function(){return{allowSameDay:!1,dateFormat:`MM/dd/yyyy`,dateFormatCalendar:`LLLL yyyy`,disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:`scroll`,preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:xg,readOnly:!1,rangeSeparator:Um,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:`Time`,previousMonthAriaLabel:`Previous Month`,previousMonthButtonLabel:`Previous Month`,nextMonthAriaLabel:`Next Month`,nextMonthButtonLabel:`Next Month`,previousYearAriaLabel:`Previous Year`,previousYearButtonLabel:`Previous Year`,nextYearAriaLabel:`Next Year`,nextYearButtonLabel:`Next Year`,timeInputLabel:`Time`,enableTabLoop:!0,yearItemNumber:zm,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){window.addEventListener(`scroll`,this.onScroll,!0),document.addEventListener(`visibilitychange`,this.setHiddenStateOnVisibilityHidden)},t.prototype.componentDidUpdate=function(e,t){var n,r,i,a;e.inline&&jg(e.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&e.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),this.props.selectsRange&&this.state.monthSelectedIn!==0&&this.setState({monthSelectedIn:0}),e.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:Bh(this.props.highlightDates)}),!t.focused&&!sh(e.selected,this.props.selected)&&this.setState({inputValue:null}),t.open!==this.state.open&&(t.open===!1&&this.state.open===!0&&((r=(n=this.props).onCalendarOpen)==null||r.call(n)),t.open===!0&&this.state.open===!1&&((a=(i=this.props).onCalendarClose)==null||a.call(i)))},t.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener(`scroll`,this.onScroll,!0),document.removeEventListener(`visibilitychange`,this.setHiddenStateOnVisibilityHidden)},t.prototype.renderInputContainer=function(){var e=this.props,t=e.showIcon,n=e.icon,r=e.calendarIconClassname,i=e.calendarIconClassName,a=e.toggleCalendarOnIconClick,o=this.state.open;return r&&console.warn(`calendarIconClassname props is deprecated. should use calendarIconClassName props.`),F.createElement(`div`,{className:`react-datepicker__input-container${t?` react-datepicker__view-calendar-icon`:``}`},t&&F.createElement(wg,Y({icon:n,className:T(i,!i&&r,o&&`react-datepicker-ignore-onclickoutside`)},a?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},t.prototype.render=function(){var e=this.renderCalendar();if(this.props.inline)return e;if(this.props.withPortal){var t=this.state.open?F.createElement(Og,{enableTabLoop:this.props.enableTabLoop},F.createElement(`div`,{className:`react-datepicker__portal`,tabIndex:-1,onKeyDown:this.onPortalKeyDown},e)):null;return this.state.open&&this.props.portalId&&(t=F.createElement(Tg,Y({portalId:this.props.portalId},this.props),t)),F.createElement(`div`,null,this.renderInputContainer(),t)}return F.createElement(Ag,Y({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:e,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},t}(F.Component),Pg=`input`,Fg=`navigate`,Ig=()=>{let e=(0,F.useRef)(null),{databaseInfo:t}=me(),[n,r]=Ut(),i=(0,F.useDeferredValue)(r),a=t.commitCountPerTimeInterval,[o,s]=t.selectedRange,c=i.width,l=vr().domain(a.map(e=>e.date.toString())).range([0,c]),u=an().domain([0,un(a,e=>e.count)||0]).range([50,0]),d=Ft();function f(e){let t=new FormData;t.append(`timeseries`,`${e[0]}-${e[1]}`),d(t,{method:`post`})}return(0,I.jsx)(`div`,{ref:n,className:`flex flex-col justify-center`,children:(0,I.jsx)(`svg`,{ref:e,width:`100%`,height:50,className:`fill-transparent`,children:a.map((e,n)=>{let r=(l(e.date)??0)+2,i=Math.max(1,l.bandwidth()-4),a=50-u(e.count);return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`rect`,{x:r,y:u(e.count),width:i,height:a,rx:2,ry:2,className:P(`transition-[height,y] duration-300 ease-out`,e.timestamp>=o&&e.timestamp<s?`fill-blue-primary`:`fill-blue-primary/40`)}),(0,I.jsx)(`rect`,{x:r,y:0,width:i,height:50,rx:2,ry:2,className:`hover:stroke-blue-secondary stroke-transparent stroke-1 hover:fill-transparent`,onClick:()=>{let[n,r]=rn(e.timestamp,t.commitCountPerTimeIntervalUnit);f([n,r])},children:(0,I.jsx)(`title`,{children:`${e.date}: ${e.count.toLocaleString()} commit${e.count===1?``:`s`}`})})]},`${e.date}-${n}`)})})})};function Lg({className:e}){let[t,n]=(0,F.useTransition)(),{databaseInfo:r}=me(),{timerange:i,selectedRange:a}=r,s=i[1],c=i[0],l=Ft(),[u,d]=(0,F.useState)(a[0]===0?i:a),f=o().state!==`idle`;function p(e){let t=new FormData;t.append(`timeseries`,`${e[0]}-${e[1]}`),l(t,{method:`post`})}let m=u[0]*1e3,h=u[1]*1e3;return(0,I.jsxs)(`div`,{className:P(`group flex flex-col gap-2`,e),children:[(0,I.jsx)(Ig,{}),(0,I.jsxs)(hu,{className:`relative`,mode:2,step:1,domain:i,values:u,disabled:f,onUpdate:e=>d([...e]),onChange:e=>{n(()=>{p(e)})},children:[(0,I.jsx)(Ql,{children:_u}),(0,I.jsx)($l,{children:({handles:e,getHandleProps:t})=>(0,I.jsx)(`div`,{className:``,children:e.map((e,n)=>(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(`div`,{className:P(`absolute left-(--left) w-max translate-y-[calc(50%)] opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100`,{"left-(--left)":n===0,"right-[calc(100%-var(--left))] -translate-x-full":n===1}),style:{"--left":`${e.percent}%`},children:(0,I.jsx)(ln,{trigger:({onClick:e})=>(0,I.jsx)(`button`,{className:P(`bg-blue-primary text-primary-text-dark cursor-pointer rounded-lg px-1 break-keep shadow`,{"rounded-tl-none":n===0,"rounded-tr-none":n===1}),onClick:e,children:(0,I.jsx)(`time`,{className:`w-max text-xs`,dateTime:dt(n===0?m:h),title:`Click or drag to set the ${n===0?`start`:`end`} of time range`,children:on(n===0?m:h)})}),children:(0,I.jsx)(Rg,{setsBeginning:n===0,range:u,setRange:d,timerange:i,updateTimeseries:p,disabled:f})},e.id)}),(0,I.jsx)(gu,{handleType:`square`,title:`Drag to adjust interval, click to set specific date`,className:P(``),handle:e,domain:i,getHandleProps:t},e.id)]},e.id))})}),(0,I.jsx)(iu,{left:!1,right:!1,children:({tracks:e,getTrackProps:t})=>(0,I.jsx)(`div`,{children:e.map(({id:e,source:n,target:r})=>(0,I.jsx)(vu,{trackType:`square`,backgroundColor:`#7aa0c4`,source:n,target:r,getTrackProps:t},e))})})]}),(0,I.jsx)(xu,{className:`mb-2`,count:2,tickToLabel:e=>on((c+(s-c)*e)*1e3)})]})}function Rg({range:e,setRange:t,timerange:n,setsBeginning:r,updateTimeseries:i,disabled:a}){return(0,I.jsx)(`div`,{className:`z-30`,children:(0,I.jsx)(Ng,{inline:!0,fixedHeight:!0,renderCustomHeader:({date:e,decreaseMonth:t,increaseMonth:n,prevMonthButtonDisabled:r,nextMonthButtonDisabled:i})=>(0,I.jsxs)(`div`,{className:`m-2 flex justify-between`,children:[(0,I.jsx)(`button`,{disabled:r,onClick:t,children:`<`}),(0,I.jsx)(`h2`,{children:mt(e.getTime())}),(0,I.jsx)(`button`,{disabled:i,onClick:n,children:`>`})]}),disabled:a,selected:new Date(e[r?0:1]*1e3),minDate:new Date(r?n[0]*1e3:Math.max(n[0]*1e3,e[0]*1e3)),maxDate:new Date(r?Math.min(n[1]*1e3,e[1]*1e3):n[1]*1e3),onChange:n=>{if(n){let a;a=r?[n.getTime()/1e3,e[1]]:[e[0],n.getTime()/1e3],t(a),i(a)}}})})}function zg(){let e=o().formData?.get(`refresh`)===`true`;return(0,I.jsxs)(l,{method:`post`,action:ct(),className:`contents`,children:[(0,I.jsx)(`input`,{type:`hidden`,name:`refresh`,value:`true`}),(0,I.jsx)(`button`,{className:`btn btn--icon`,disabled:e,title:`Refresh analysis`,"aria-label":`Refresh analysis`,children:(0,I.jsx)(N,{path:he,size:`1.25em`,className:P({"animate-spin":e})})})]})}function Bg({className:e=``,hoveredObject:t}){let{x:n,y:r}=rt(),i=(0,F.useRef)(null),{sizeMetric:a,metricType:o,dominantAuthorCutoff:s}=tt(),[c]=ie(),{databaseInfo:l}=me(),u=t?c.get(o)?.colormap?.get(t.path):Se,d=(0,F.useMemo)(()=>n<window.innerWidth/2,[n]),f=(0,F.useMemo)(()=>r<window.innerHeight/2,[r]),p=(0,F.useMemo)(()=>d?`calc(1rem + ${n}px)`:`calc(-0.5rem + ${n}px - 100%)`,[d,n]),m=(0,F.useMemo)(()=>f?`calc(1rem + ${r}px)`:`calc(-0.5rem + ${r}px - 100%)`,[f,r]),h=t!==null;return(0,I.jsxs)(`div`,{ref:i,className:P(`secondary border-primary-bg dark:border-primary-bg-dark bg-primary-bg/50 dark:bg-primary-bg-dark/40 absolute top-0 left-0 z-50 flex w-min max-w-sm flex-wrap gap-0.5 border bg-none py-0.5 pr-2 pl-1 text-xs backdrop-blur will-change-transform select-none backface-hidden`,e,{hidden:!h,"font-bold":S(t)},be(t)&&u?xt(u).luminance>=.5?`text-primary-text`:`text-primary-text-dark`:`dark:text-primary-text-dark text-primary-text`),style:{transform:h?`translateX(${p}) translateY(${m}) translateZ(0)`:`none`,...u?{backgroundColor:`hsl(from ${u} h s l / 0.7)`}:{}},children:[(0,I.jsx)(`span`,{className:`flex w-max place-items-center gap-1`,children:t&&be(t)?t?.name:Dt(t?.path.split(`/`)??[]).map((e,t,n)=>(0,I.jsxs)(F.Fragment,{children:[e,n.length>1&&t<n.length-1?(0,I.jsx)(N,{path:it,className:`opacity-50`,size:.5}):null]},`segment-${t}${e}`))}),t?.type===`blob`?(0,I.jsxs)(`div`,{className:`flex w-max flex-col gap-1`,children:[(0,I.jsx)(`div`,{className:`flex gap-1`,children:(0,I.jsx)(Vg,{metric:o,hoveredBlob:t,databaseInfo:l,dominantAuthorCutoff:s})}),o===a?null:(0,I.jsx)(`div`,{className:`flex gap-1`,children:(0,I.jsx)(Hg,{sizeMetric:a,databaseInfo:l,hoveredBlob:t})})]}):null]})}function Vg(e){let t,n,r=e.hoveredBlob?.path??``;switch(e.metric){case`MOST_COMMITS`:{t=w;let i=e.databaseInfo.commitCounts[r];if(!i){n=`No activity in selected range`;break}n=`${ve(i)} commit${i>1?`s`:``}`;break}case`LAST_CHANGED`:{t=vt;let i=e.databaseInfo.lastChanged[r];if(!i){n=`No activity in selected range`;break}n=Zt(i);break}case`TOP_CONTRIBUTOR`:{t=oe;let i=e.databaseInfo.dominantAuthors[r],a=e.databaseInfo.contribSumPerFile[r];if(!i){n=`No activity in selected range`;break}if(!a){n=i.author;break}let o=Math.round(i.contribcount/a*100);if(o<e.dominantAuthorCutoff){t=Pe,n=Re;break}n=`${i.author} ${o}%`;break}case`MOST_CONTRIBUTIONS`:{t=bt;let i=e.databaseInfo.contribSumPerFile[r];if(!i){n=`No activity in selected range`;break}n=`${ve(i)} lines`;break}case`FILE_TYPE`:t=Pt,n=e.hoveredBlob?.name.substring(e.hoveredBlob.name.lastIndexOf(`.`))??``;break}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{path:t,color:`currentColor`}),n]})}function Hg({sizeMetric:e,hoveredBlob:t,databaseInfo:n}){let r=Gt,i=null;if(!t)return null;switch(e){case`FILE_SIZE`:{r=_e;let e=t.sizeInBytes;i=e==null?`Size unknown`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`;break}case`MOST_COMMITS`:{r=w;let e=n.commitCounts[t.path];if(!e){i=`No activity in selected range`;break}i=`${ve(e)} commit${e>1?`s`:``}`;break}case`LAST_CHANGED`:{r=vt;let e=n.lastChanged[t.path];if(!e){i=`No activity in selected range`;break}i=Zt(e);break}case`MOST_CONTRIBUTIONS`:{r=bt;let e=n.contribSumPerFile[t.path];if(!e){i=`No activity in selected range`;break}i=`${ve(e)} lines`;break}}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N,{path:r,color:`currentColor`}),i]})}function Ug({hoveredObject:e}){let{chartType:t}=tt();return(0,I.jsx)(Bg,{hoveredObject:e,className:t===`BUBBLE_CHART`?`rounded-xl`:`rounded-xs`})}function Wg(){let{isFullscreen:e,toggleFullscreen:t}=et(()=>document.documentElement);return(0,I.jsx)(`button`,{className:P(`btn btn--icon`,{"btn--primary":e}),title:e?`Exit fullscreen`:`Enter fullscreen`,"aria-label":e?`Exit fullscreen`:`Enter fullscreen`,onClick:t,children:(0,I.jsx)(N,{path:e?Xt:qe,size:1})})}var Gg=(0,F.createContext)(e=>{});function Kg(){return(0,F.use)(Gg)}function qg({title:e,children:t,defaultOpen:n=!0,className:r,contentClassName:i=``}){let[a,o]=(0,F.useState)(n);return(0,I.jsx)(Gg.Provider,{value:o,children:(0,I.jsxs)(`details`,{className:P(`relative flex flex-col gap-2`,r),open:a,onToggle:e=>o(e.currentTarget.open),children:[(0,I.jsxs)(`summary`,{className:`dark:text-secondary-text-dark hover:text-primary-text dark:hover:text-primary-text-dark flex cursor-pointer list-none items-center justify-start gap-2 text-sm leading-relaxed font-bold tracking-wider text-inherit uppercase select-none`,children:[(0,I.jsx)(Me,{"aria-hidden":!0,as:`span`,open:a}),(0,I.jsx)(`h2`,{className:`flex min-w-0 flex-1 items-center justify-between gap-2`,children:e})]}),(0,I.jsx)(`div`,{className:P(`pr-1 pb-6 pl-8`,i),children:t})]})})}function Jg(e){return e===null||Array.isArray(e)&&e.length===0}function Yg(e,t,n){if(typeof e==`string`)n.set(t,e);else{n.delete(t);for(let r of e)n.append(t,r);n.has(t)||n.set(t,``)}return n}function Xg(e,{urlKeys:t={}}={}){function n(r,{strict:i=!1}={}){if(r instanceof Promise)return r.then(e=>n(e,{strict:i}));let a=Zg(r),o={};for(let[n,r]of Object.entries(e)){let e=t[n]??n,s=r.type===`multi`?a.getAll(e):a.get(e);if(Jg(s)){o[n]=r.defaultValue??null;continue}let c;try{c=r.parse(s)}catch(e){if(i)throw Error(`[nuqs] Error while parsing query \`${s}\` for key \`${n}\`: ${e}`);c=null}if(i&&s&&c===null)throw Error(`[nuqs] Failed to parse query \`${s}\` for key \`${n}\` (got null)`);o[n]=c??r.defaultValue??null}return o}return n}function Zg(e){try{if(e instanceof Request)return e.url?new URL(e.url).searchParams:new URLSearchParams;if(e instanceof URL)return e.searchParams;if(e instanceof URLSearchParams)return e;if(typeof e==`object`){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r);return t}if(typeof e==`string`)return URL.hasOwnProperty(`canParse`)&&URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e)}catch{}return new URLSearchParams}function Qg(){if(typeof window>`u`||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}Qg();var $g=t_();function e_(e,...t){$g&&console.warn(e,...t)}function t_(){if(typeof window>`u`)return({}.DEBUG||``).includes(`nuqs`);try{let e=`nuqs-localStorage-test`;if(typeof localStorage>`u`)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem(`debug`)||``).includes(`nuqs`)}catch{return!1}}function n_(e,t,n){try{return e(t)}catch(e){return e_("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":``),t,e,n),null}}function r_(e){function t(t){if(t===void 0)return null;let n=``;if(Array.isArray(t)){if(t[0]===void 0)return null;n=t[0]}return typeof t==`string`&&(n=t),n_(e.parse,n)}return{type:`single`,eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(n){return t(n)??e}}},withOptions(e){return{...this,...e}}}}var i_=r_({parse:e=>e,serialize:String}),a_=r_({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>``+Math.round(e)});r_({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>``+Math.round(e+1)}),r_({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(t.length&1?`0`:``)+t}}),r_({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),r_({parse:e=>e.toLowerCase()===`true`,serialize:String});function o_(e,t){return e.valueOf()===t.valueOf()}r_({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>``+e.valueOf(),eq:o_}),r_({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:o_}),r_({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:o_});function s_(e){return r_({parse:t=>{let n=t;return e.includes(n)?n:null},serialize:String})}function c_(e){if(e.size===0)return``;let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/\+/g,`%2B`).replace(/=/g,`%3D`).replace(/\?/g,`%3F`);t.push(`${e}=${l_(r)}`)}return`?`+t.join(`&`)}function l_(e){return e.replace(/%/g,`%25`).replace(/\+/g,`%2B`).replace(/ /g,`+`).replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/"/g,`%22`).replace(/'/g,`%27`).replace(/`/g,`%60`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}function u_(e,{clearOnDefault:t=!0,urlKeys:n={},processUrlSearchParams:r}={}){function i(i,a={}){let[o,s]=d_(i)?f_(i):[``,new URLSearchParams],c=d_(i)?a:i;if(c===null){for(let t in e){let e=n[t]??t;s.delete(e)}return r&&(s=r(s)),o+c_(s)}for(let r in e){let i=e[r],a=c[r];if(!i||a===void 0)continue;let o=n[r]??r,l=i.defaultValue!==void 0&&a!==null&&(i.eq??((e,t)=>e===t))(a,i.defaultValue);a===null||(i.clearOnDefault??t??!0)&&l?s.delete(o):s=Yg(i.serialize(a),o,s)}return r&&(s=r(s)),o+c_(s)}return i}function d_(e){return typeof e==`string`||e instanceof URLSearchParams||e instanceof URL}function f_(e){if(typeof e==`string`){let[t=``,...n]=e.split(`?`);return[t,new URLSearchParams(n.join(`?`))]}else if(e instanceof URLSearchParams)return[``,new URLSearchParams(e)];else return[e.origin+e.pathname,new URLSearchParams(e.searchParams)]}function p_({headGroups:e,disabled:t,className:n=``,analyzedBranches:r,...i}){let a=Object.entries(e);return(0,I.jsxs)(`div`,{title:`Change branch`,className:P(`input grid grid-cols-[auto_1fr] place-items-center`,n),children:[(0,I.jsx)(N,{path:cn,size:.75}),(0,I.jsx)(`select`,{className:P(`w-full`,n),...i,children:a.map(([e,n])=>Object.entries(n).length>0?(0,I.jsx)(`optgroup`,{label:e,children:Object.entries(n).map(([e])=>(0,I.jsx)(`option`,{value:e,disabled:t,title:r.find(t=>t.branch===e)?`Analyzed`:`Not analyzed`,children:e},e))},e):null)})]})}function m_(){let{openModal:e}=al(`app-settings`);return(0,I.jsx)(`button`,{className:`btn btn--icon`,title:`Settings`,"aria-label":`Settings`,onClick:()=>e(),children:(0,I.jsx)(N,{path:gt})})}function h_(){let e=n(_(`/view`))?.dataPromise,t=e?(0,F.use)(e):null;return t?(0,I.jsx)(`div`,{children:t.repo.parentDirPath}):null}function g_(){let e=me(),t=ct();return(0,I.jsxs)(l,{className:P({invisible:e.databaseInfo.timerange[0]===e.databaseInfo.selectedRange[0]&&e.databaseInfo.timerange[1]===e.databaseInfo.selectedRange[1]}),method:`post`,action:t,children:[(0,I.jsx)(`input`,{type:`hidden`,name:`timeseries`,value:`${e.databaseInfo.timerange[0]}-${e.databaseInfo.timerange[1]}`}),(0,I.jsxs)(`button`,{className:P(`btn btn--text`,{}),children:[(0,I.jsx)(N,{path:xe}),`Reset time interval`]})]})}function __(){let{clickedObject:e,setClickedObject:t}=yr(),n=Ee();return!e||!n?null:(0,I.jsxs)(`button`,{className:`btn btn--primary`,title:`Deselect clicked object`,onClick:()=>{t(null)},children:[(0,I.jsx)(N,{path:zt}),e.name]})}var v_=v();h();const y_={path:i_,objectPath:i_,zoomPath:i_,branch:i_},b_=u_(y_);Xg(y_);const x_=({loaderData:e})=>[{title:`${e.repositoryName} - Git Truck`}];var S_=g(function(){let{versionInfo:t,dataPromise:n}=e(),[{leftExpanded:r},a]=(0,F.useReducer)((e,t)=>{switch(t){case`toggleLeft`:return{leftExpanded:!e.leftExpanded}}},{leftExpanded:!0}),o=()=>a(`toggleLeft`),[s,c]=(0,F.useState)(null),l=u(),p=i(),[h]=ye(`objectPath`,y_.objectPath),g=`/clear-cache?${new URLSearchParams({redirect:l.pathname+l.search}).toString()}`,v=h?.split(`/`).pop()?.includes(`.`);return(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(`div`,{className:`grid h-screen place-items-center`,children:(0,I.jsx)(ku,{showProgress:!0,loadingText:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[`Stuck? Try clearing the cache:`,(0,I.jsx)(f,{to:g,className:`btn btn--primary`,children:`Clear Cache`})]})})}),children:(0,I.jsx)(d,{resolve:n,children:e=>(0,I.jsxs)(ju,{data:e,children:[(0,I.jsxs)(`div`,{className:P(`grid grid-cols-1 transition-all [grid-template-areas:"main"_"left"] lg:h-screen lg:grid-cols-[0_1fr] lg:grid-rows-[1fr] lg:overflow-hidden lg:[grid-template-areas:"left_main"]`,{"lg:grid-cols-[var(--spacing-sidepanel)_1fr]":r}),children:[(0,I.jsx)(F.Activity,{mode:r?`visible`:`hidden`,children:(0,I.jsxs)(`aside`,{className:Le(`*:not-first:m-2 lg:transition-transform`,r?`overflow-y-auto [grid-area:left]`:`lg:-translate-x-sidepanel`),children:[(0,I.jsxs)(`div`,{className:`bg-primary-bg dark:bg-primary-bg-dark sticky top-0 z-10 flex justify-between p-2`,children:[(0,I.jsx)(Wt,{className:``,installedVersion:t.installedVersion,latestVersion:t.latestVersion}),(0,I.jsx)(`button`,{className:`btn`,title:`Hide left panel`,onClick:o,children:(0,I.jsx)(N,{path:ee,size:`1.5em`})})]}),(0,I.jsx)(qg,{className:`card`,title:(0,I.jsx)(I.Fragment,{children:h?(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(`span`,{className:`truncate`,title:h,children:[`Details:`,` `,(0,I.jsx)(`span`,{className:`normal-case`,children:v?h.split(`/`).pop():h})]})}):`Details`}),contentClassName:`pb-6`,children:(0,I.jsx)(m,{})}),(0,I.jsx)(qg,{className:`card`,title:(0,I.jsx)(I.Fragment,{children:`Visualization options`}),contentClassName:`pb-6 flex flex-col gap-2`,children:(0,I.jsx)(el,{})}),(0,I.jsx)(qg,{className:`card group`,title:`Legend`,contentClassName:`pb-6`,children:(0,I.jsx)(Ou,{hoveredObject:s})})]})}),(0,I.jsxs)(`main`,{className:P(`relative grid h-full min-h-screen min-w-25 grid-rows-[auto_1fr_auto] gap-2 p-2 [grid-area:main] lg:transition-transform`),children:[(0,I.jsxs)(`header`,{className:`grid grid-flow-col items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[r?null:(0,I.jsx)(`button`,{title:`Show left panel`,className:`btn btn--text aspect-square`,onClick:o,children:(0,I.jsx)(N,{path:ee,size:1})}),(0,I.jsx)(h_,{}),(0,I.jsx)(w_,{zoom:!0})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(__,{})}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`div`,{className:`relative`,children:(0,I.jsx)(Nu,{})}),e.repo.status===`Success`?(0,I.jsx)(p_,{className:`max-w-32`,title:`Select branch`,defaultValue:e.databaseInfo.branch,headGroups:e.repo.refs,analyzedBranches:e.databaseInfo.analyzedRepos.filter(t=>t.repo===e.databaseInfo.repo),onChange:t=>p(_(`/view`)+b_({path:e.repo.repositoryPath,branch:t.target.value}))},e.databaseInfo.branch):(0,I.jsx)(`div`,{}),(0,I.jsx)(zg,{}),(0,I.jsx)(sl,{}),(0,I.jsx)(Du,{compact:!0}),(0,I.jsx)(m_,{}),(0,I.jsx)(Wg,{})]})]}),(0,I.jsx)(`div`,{className:`grid`,children:(0,I.jsx)(Rt,{children:()=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(`div`,{className:`grid h-screen place-items-center`,children:(0,I.jsx)(ku,{showProgress:!0})}),children:(0,I.jsx)(d,{resolve:n,children:()=>(0,I.jsx)(Cr,{hoveredObject:s,setHoveredObject:c})})}),(0,v_.createPortal)((0,I.jsx)(Ug,{hoveredObject:s}),document.body)]})})}),(0,I.jsxs)(`div`,{className:`flex flex-col text-center select-none`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`h2`,{className:`card__title`,children:[`Commits per `,e.databaseInfo.commitCountPerTimeIntervalUnit]}),(0,I.jsx)(g_,{})]}),(0,I.jsx)(Lg,{},`${e.databaseInfo.selectedRange[0]}-${e.databaseInfo.selectedRange[1]}`)]})]})]}),(0,I.jsx)(ol,{})]})})})});function C_({className:e=``,trigger:t}){let n=wt(),{databaseInfo:r}=me(),i=new Date(r.lastRunInfo.time).toISOString();return(0,I.jsx)(`div`,{className:P(`flex flex-col gap-2`,e),children:(0,I.jsx)(`div`,{className:`relative flex w-full items-center justify-between gap-2`,children:(0,I.jsx)(ln,{triggerOnHover:!0,popoverTitle:`Analysis details`,trigger:()=>t,children:(0,I.jsxs)(`div`,{className:`grid auto-rows-fr grid-cols-2 gap-0`,children:[(0,I.jsx)(`span`,{children:`Time analyzed`}),(0,I.jsx)(`time`,{className:`text-right`,dateTime:i,title:i,children:n?Ze(r.lastRunInfo.time*1e3):``}),(0,I.jsx)(`span`,{children:`As of commit`}),(0,I.jsx)(`span`,{className:`text-right`,children:(0,I.jsx)(Je,{inline:!0,children:r.lastRunInfo.hash.slice(0,7)})}),(0,I.jsx)(`span`,{children:`Files analyzed`}),(0,I.jsx)(`span`,{className:`text-right`,children:r.fileCount??0}),(0,I.jsx)(`span`,{children:`Commits analyzed`}),(0,I.jsx)(`span`,{className:`text-right`,children:r.commitCount})]})})})})}function w_({className:e=``,zoom:t=!1}){let[n]=yt(O_),[r,i]=yt(y_),{path:a,zoomPath:o}=r,s=Ee(),c=(0,F.useMemo)(()=>{if(!a)return[];let e=a.split(je(a)).map((e,t,n)=>{let r=n.slice(0,t+1).join(`/`);return{type:`browse`,segment:e.length===0&&t===0?`/`:e,fullPath:t===0?r+je(a):r,showAnalysisInfo:!1}}).filter(e=>e.segment.length>0),n=s?[{type:`browse`,segment:s.repo.parentDirName??``,fullPath:s.repo.parentDirPath??``,showAnalysisInfo:!1},{type:`zoom`,segment:s.repo.repositoryName??``,fullPath:s.repo.repositoryName??``,showAnalysisInfo:!0},...(o?.split(je(o))??[]).flatMap((e,t,n)=>e===s?.repo.repositoryName?[]:{type:`zoom`,segment:e,fullPath:n.slice(0,t+1).join(`/`),showAnalysisInfo:!1})]:[],r=t?n:e;return r.length>4?[r[0],r[1],{type:`filler`,segment:`...`,fullPath:``,showAnalysisInfo:!1},r[r.length-2],r[r.length-1]]:r},[s,a,t,o]);return(0,I.jsx)(`div`,{className:P(`text-secondary-text dark:text-secondary-text-dark flex items-center gap-1 overflow-x-auto`,e),children:c.map(({type:e,segment:t,fullPath:r,showAnalysisInfo:a},o)=>{let l=a?`Reset zoom to repository root`:e===`browse`?`Browse ${t} directory`:`Zoom to ${t} directory`,u=o===0,d=c.length-1===o,p=(0,I.jsxs)(I.Fragment,{children:[a?(0,I.jsx)(N,{path:Ie}):null,t]}),m=d||e===`filler`?(0,I.jsx)(`span`,{className:`flex items-center gap-1 truncate font-bold`,title:r,children:p}):e===`browse`?(0,I.jsx)(f,{to:_(`/browse`)+k_({...n,offset:0,search:null,path:r}),title:l,className:`btn btn--primary truncate`,children:p}):(0,I.jsx)(`button`,{title:l,className:`btn btn--primary truncate`,onClick:()=>{if(!s)throw Error(`Attempting to access data when none is loaded`);i(e=>({...e,zoomPath:r}))},children:p});return(0,I.jsxs)(F.Fragment,{children:[u?null:(0,I.jsx)(N,{path:it}),a?(0,I.jsx)(C_,{trigger:m}):m]},r)})})}var T_=10,E_=0,D_=[10,25,50,100];const O_={path:i_.withOptions({shallow:!1}),count:ke(D_).withOptions({shallow:!1}).withDefault(T_),offset:a_.withOptions({shallow:!1}).withDefault(E_),sort:s_([`most-recent`,`least-recent`,`asc`,`desc`]).withOptions({shallow:!1}).withDefault(`most-recent`),search:i_.withOptions({shallow:!1,limitUrlUpdates:{method:`throttle`,timeMs:1e3}}).withDefault(``),"include-dirs":Qt.withDefault(!0).withOptions({clearOnDefault:!1})},k_=E(O_),A_=({loaderData:e})=>[{title:`${e.parentDirectoryName} - Git Truck`}];var j_=g(function(){let{error:t,versionInfo:n,directories:r,parentDirectoryPath:i,analyzedReposPromise:a,totalCount:s}=e(),c=u(),p=o(),[{path:m,"include-dirs":h,sort:g,search:_,count:v},y]=yt(O_),x=Math.max(0,v-r.length),S=(0,F.useRef)(null);Jt({key:`f`,ctrlOrMeta:!0},e=>{e.preventDefault(),S.current?.focus(),S.current?.select()});let C=e=>{let t=ge(e);return t!==i&&y(e=>({...e,path:t,offset:0})),t};return(0,I.jsxs)(`div`,{className:`mx-auto grid max-w-(--breakpoint-2xl) gap-2 p-2 lg:grid-cols-[var(--spacing-sidepanel)_1fr_var(--spacing-sidepanel)]`,children:[(0,I.jsx)(`aside`,{className:`flex flex-col`,children:(0,I.jsx)(`div`,{className:`card sticky top-2`,children:(0,I.jsx)(Wt,{installedVersion:n.installedVersion,latestVersion:n.latestVersion})})}),(0,I.jsxs)(`main`,{className:`card`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`p`,{className:`text-secondary-text dark:text-secondary-text-dark py-3 text-center text-sm`,children:`Welcome to Git Truck! Select a repository to visualize.`}),(0,I.jsxs)(l,{className:`sticky top-2 grid grid-flow-col grid-cols-[1fr_1fr_1fr] grid-rows-[auto_auto_auto] gap-2 p-2`,children:[(0,I.jsx)(L_,{ref:S,searchQuery:_,includeDirs:h,onSearch:e=>y(t=>({...t,search:e,offset:0}))},`search-input`+m),(0,I.jsx)(`label`,{className:`label`,htmlFor:`path`,children:`Path`}),(0,I.jsx)(`input`,{name:`path`,id:`path`,defaultValue:i,title:`Browse path`,placeholder:`Path to browse`,className:`input`,onBlur:e=>{e.currentTarget.value!==i&&(e.currentTarget.value=C(e.currentTarget.value))},onChange:e=>{e.stopPropagation()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.currentTarget.value=C(e.currentTarget.value))}},`path-input`+i),t?(0,I.jsx)(`output`,{className:`truncate text-sm text-red-600 dark:text-red-400`,title:t,children:t}):(0,I.jsx)(`output`,{}),(0,I.jsx)(`label`,{htmlFor:`include-dirs`,className:`label w-max`,children:`Include directories`}),(0,I.jsx)(`div`,{className:`flex cursor-pointer items-center gap-2 select-none`,children:(0,I.jsxs)(`label`,{htmlFor:`include-dirs`,children:[(0,I.jsx)(`input`,{type:`checkbox`,id:`include-dirs`,value:`true`,className:`peer sr-only`,name:`include-dirs`,checked:h??!1,onChange:e=>{e.stopPropagation(),y(t=>({...t,"include-dirs":e.target.checked,offset:0}))}}),(0,I.jsx)(N,{path:Ce,size:1,className:`peer-checked:hidden`}),(0,I.jsx)(N,{path:b,size:1,className:`hidden peer-checked:block`})]})}),(0,I.jsx)(`div`,{}),(0,I.jsx)(`div`,{}),(0,I.jsx)(f,{to:`/clear-cache?redirect=${encodeURIComponent(c.pathname+c.search)}`,className:`btn btn--danger max-w-min justify-self-end`,children:`Clear cache`})]})]}),(0,I.jsx)(w_,{className:`px-2`}),(0,I.jsxs)(`div`,{className:`grid w-full grid-cols-[1fr_auto_1fr] items-center gap-2 px-2`,children:[(0,I.jsxs)(`p`,{className:`text-sm`,children:[r.length,` `,r.length<s?`of ${s}`:``,` `,r.length<s&&s!==1||r.length!==1?h?`folders`:`repositories`:h?`folder`:`repository`]}),(0,I.jsx)(I_,{classNames:[`justify-self-center text-sm`,`justify-self-end text-sm`],totalCount:s})]}),(0,I.jsxs)(N_,{className:P({"opacity-50":p.state!==`idle`}),children:[(0,I.jsx)(M_,{label:`Name`,isActive:g===`asc`||g===`desc`,direction:g===`desc`?`desc`:g===`asc`?`asc`:void 0,title:`Sort by name`,onClick:()=>y(e=>({...e,offset:null,sort:g===`asc`?`desc`:`asc`}))}),(0,I.jsx)(M_,{label:`Last Changed`,isActive:g===`least-recent`||g===`most-recent`,direction:g===`most-recent`?`asc`:g===`least-recent`?`desc`:void 0,title:`Sort by ${g===`least-recent`?`most`:`least`} recent (slower than sorting by name)`,onClick:()=>y(e=>({...e,offset:null,sort:g===`most-recent`?`least-recent`:`most-recent`}))}),r.map((e,t)=>(0,I.jsx)(F.Suspense,{fallback:(0,I.jsx)(P_,{entry:{...e,status:`Loading`},status:`Loading`,isAnalyzed:!1}),children:(0,I.jsx)(d,{resolve:a,children:t=>e===null?null:(0,I.jsx)(P_,{entry:e,status:`Success`,isAnalyzed:e.type===`repository`?t.find(t=>t.hash===e.hash)!==void 0:!1},e.path)})},r[t].path)),Array.from({length:x}).map((e,t)=>(0,I.jsx)(F_,{},`directory-placeholder-${t}`))]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center pl-2`,children:[(0,I.jsxs)(`p`,{className:`text-sm`,children:[r.length,` `,r.length<s?`of ${s}`:``,` `,r.length<s&&s!==1||r.length!==1?h?`folders`:`repositories`:h?`folder`:`repository`]}),(0,I.jsx)(I_,{classNames:[`justify-self-center text-sm`,`justify-self-end text-sm`],totalCount:s})]})]})]})});function M_({label:e,isActive:t,direction:n,onClick:r,icon:i,title:a}){let o=i??(n===`asc`?`M19 17H22L18 21L14 17H17V3H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z`:n===`desc`?`M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z`:`M18 21L14 17H17V7H14L18 3L22 7H19V17H22M2 19V17H12V19M2 13V11H9V13M2 7V5H6V7H2Z`);return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":t,title:a??`Sort by ${e}`,className:P(`text-secondary-text dark:text-secondary-text-dark/50 hover:text-primary hover:dark:text-primary text-sm leading-none font-semibold tracking-wider uppercase transition-colors`,`hover:bg-blue-primary/10 dark:hover:bg-blue-primary/20 cursor-pointer rounded px-2 py-1 focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-black dark:focus-visible:outline-white`,{"text-primary dark:text-primary":t}),onClick:r,children:(0,I.jsxs)(`span`,{className:`flex items-center gap-1 leading-none`,children:[(0,I.jsx)(`span`,{className:`leading-none`,children:e}),(0,I.jsx)(N,{path:o,size:.75,className:`shrink-0`})]})})}function N_({children:e,className:t}){return e.length===0?(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(`p`,{children:[`Try running `,(0,I.jsx)(Je,{inline:!0,children:`git-truck`}),` in another folder or provide another path as argument.`]})}):(0,I.jsx)(`div`,{className:P(`row-start-auto grid w-full grid-flow-row grid-cols-[1fr_auto] flex-wrap items-center gap-2`,t),children:e})}function P_({entry:e,status:t,isAnalyzed:n}){let[{search:r,offset:i,...a}]=yt(O_);return(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(f,{to:e.type===`directory`?_(`/browse`)+k_({...a,path:e.path}):_(`/view`)+b_({path:e.path}),prefetch:`none`,"aria-disabled":t===`Error`,className:P(`col-span-2 block w-full rounded px-2 py-1 transition-colors`,`hover:bg-blue-primary/10 dark:hover:bg-blue-primary/20 cursor-pointer`,{"pointer-events-none":t===`Error`}),title:e.path,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.type===`directory`?(0,I.jsx)(N,{path:ut,size:1}):(0,I.jsx)(`div`,{className:P(`size-6 shrink-0 bg-linear-to-bl`,t===`Error`?`from-red-500 to-red-600`:t===`Loading`?`from-yellow-500 to-yellow-600`:n?`from-green-500 to-green-600`:`from-gray-500 to-gray-400`,t===`Loading`&&`animate-pulse`),style:{maskImage:A(Ie),maskRepeat:`no-repeat`,maskSize:`100% 100%`},title:t===`Error`?`Error`:t===`Loading`?`Loading`:n?`Analyzed`:`Not analyzed yet`}),(0,I.jsx)(`span`,{className:`truncate text-base font-medium`,children:e.name})]}),(0,I.jsx)(`span`,{className:`text-secondary-text dark:text-secondary-text-dark text-sm`,children:t===`Error`||!e.lastChanged?`-`:new Date(e.lastChanged*1e3).toLocaleDateString()})]})}),(0,I.jsx)(`hr`,{className:`col-span-full opacity-50 last:hidden`})]})}function F_(){return(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(`div`,{"aria-hidden":`true`,className:`col-span-2 rounded px-2 py-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`size-6 shrink-0`}),(0,I.jsx)(`span`,{className:`invisible text-base font-medium`,children:`Placeholder`})]}),(0,I.jsx)(`span`,{className:`invisible text-sm`,children:`Placeholder`})]})}),(0,I.jsx)(`hr`,{className:`col-span-full opacity-50 last:hidden`})]})}function I_({classNames:e,totalCount:t}){let[{path:n,count:r,offset:i,...a},o]=yt(O_,{shallow:!1}),s=E(O_),c=Math.max(Math.ceil(t/r),1),l=Math.floor(i/r)+1;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:P(`flex items-center gap-2`,e?.[0]),children:[(0,I.jsx)(f,{className:P(`btn btn--primary`,{invisible:i-r<0}),"aria-disabled":i-r<0,to:_(`/browse`)+s({...a,path:n,offset:Math.max(0,i-r),count:r}),title:`Previous page`,children:(0,I.jsx)(N,{path:Lt})}),(0,I.jsxs)(`span`,{className:`whitespace-pre`,children:[`Page `,l,` of `,c]}),(0,I.jsx)(f,{className:P(`btn btn--primary`,{invisible:i+r>=t}),"aria-disabled":i+r>=t,to:_(`/browse`)+s({...a,path:n,offset:i+r,count:r}),title:`Next page`,children:(0,I.jsx)(N,{path:ue})})]}),(0,I.jsx)(`div`,{className:P(``,e?.[1]),children:(0,I.jsxs)(`label`,{className:`flex items-center gap-2 whitespace-pre`,children:[`Per page`,(0,I.jsx)(`select`,{value:r,className:`input`,onChange:e=>o(t=>({...t,count:Number(e.target.value),offset:0})),children:D_.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]})})]})}function L_({searchQuery:e,includeDirs:t,onSearch:n,ref:r}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`label`,{className:`label`,htmlFor:`search`,children:`Search`}),(0,I.jsx)(`input`,{ref:r,id:`search`,name:`search`,type:`search`,className:`input`,placeholder:`Search ${t?`directories`:`repositories`}...`,defaultValue:e??``,onChange:e=>{if(e.stopPropagation(),!e.target.checkValidity())return;let t=e.currentTarget.value;(0,F.startTransition)(()=>{n(t)})}}),(0,I.jsx)(`div`,{})]})}export{Qc as C,iu as S,xu as _,y_ as a,Ql as b,p_ as c,Nu as d,ju as f,_u as g,gu as h,x_ as i,Kg as l,Du as m,A_ as n,b_ as o,ku as p,w_ as r,S_ as s,j_ as t,Bg as u,vu as v,yr as w,hu as x,$l as y};