From 1df66cc00717cd55ce481e12a4a3fa377d09b95a Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Fri, 25 Apr 2025 14:07:08 +0200 Subject: [PATCH] feat(ui): Add ingest limits rings (#16978) --- .../frontend/dist/assets/data-viz-BuFFX-vG.js | 72 ------- .../frontend/dist/assets/data-viz-CL7w-2Lt.js | 72 +++++++ .../dist/assets/date-utils-B7GSU5zA.js | 5 - .../dist/assets/date-utils-D5i7Ep19.js | 5 + .../dist/assets/form-libs-B6JBoFJD.js | 1 - .../dist/assets/form-libs-BC53Arqz.js | 1 + pkg/ui/frontend/dist/assets/index-BbvoJYjW.js | 63 ------ pkg/ui/frontend/dist/assets/index-BbxlzNnT.js | 79 ++++++++ .../dist/assets/query-management-COQdG7OW.js | 1 + .../dist/assets/query-management-D8IQJSUy.js | 1 - .../dist/assets/radix-core-BQsrZC3d.js | 49 +++++ .../dist/assets/radix-core-mDeFS0Pz.js | 49 ----- .../dist/assets/radix-inputs-BPBG_BOm.js | 1 + .../dist/assets/radix-inputs-CUuf_8as.js | 1 - ...t-CuQMCqor.js => radix-layout-CAue-YU5.js} | 2 +- .../dist/assets/radix-navigation-D0pNP4jG.js | 1 + .../dist/assets/radix-navigation-WDVJ59Wc.js | 1 - .../dist/assets/react-core-D_V7s-9r.js | 32 --- .../dist/assets/react-core-YHpNHmmd.js | 17 ++ .../dist/assets/react-router-BDU20MeH.js | 22 ++ .../dist/assets/react-router-CHYnaA34.js | 29 --- .../frontend/dist/assets/style-DI43J1Sp.css | 1 + .../frontend/dist/assets/style-De_mcyPH.css | 1 - .../dist/assets/theme-utils-CNom64Sw.js | 1 - .../dist/assets/theme-utils-DhlUe4T2.js | 1 + .../frontend/dist/assets/ui-icons-BqZLUD1y.js | 191 ++++++++++++++++++ .../frontend/dist/assets/ui-icons-CjYyohUG.js | 191 ------------------ .../frontend/dist/assets/ui-utils-BNSC_Jv-.js | 1 - .../frontend/dist/assets/ui-utils-CrpwsBu-.js | 1 + pkg/ui/frontend/dist/index.html | 30 +-- pkg/ui/frontend/src/hooks/use-ring.ts | 2 + pkg/ui/frontend/src/lib/ring-utils.ts | 12 ++ pkg/ui/frontend/src/types/ring.ts | 2 + 33 files changed, 474 insertions(+), 464 deletions(-) delete mode 100644 pkg/ui/frontend/dist/assets/data-viz-BuFFX-vG.js create mode 100644 pkg/ui/frontend/dist/assets/data-viz-CL7w-2Lt.js delete mode 100644 pkg/ui/frontend/dist/assets/date-utils-B7GSU5zA.js create mode 100644 pkg/ui/frontend/dist/assets/date-utils-D5i7Ep19.js delete mode 100644 pkg/ui/frontend/dist/assets/form-libs-B6JBoFJD.js create mode 100644 pkg/ui/frontend/dist/assets/form-libs-BC53Arqz.js delete mode 100644 pkg/ui/frontend/dist/assets/index-BbvoJYjW.js create mode 100644 pkg/ui/frontend/dist/assets/index-BbxlzNnT.js create mode 100644 pkg/ui/frontend/dist/assets/query-management-COQdG7OW.js delete mode 100644 pkg/ui/frontend/dist/assets/query-management-D8IQJSUy.js create mode 100644 pkg/ui/frontend/dist/assets/radix-core-BQsrZC3d.js delete mode 100644 pkg/ui/frontend/dist/assets/radix-core-mDeFS0Pz.js create mode 100644 pkg/ui/frontend/dist/assets/radix-inputs-BPBG_BOm.js delete mode 100644 pkg/ui/frontend/dist/assets/radix-inputs-CUuf_8as.js rename pkg/ui/frontend/dist/assets/{radix-layout-CuQMCqor.js => radix-layout-CAue-YU5.js} (60%) create mode 100644 pkg/ui/frontend/dist/assets/radix-navigation-D0pNP4jG.js delete mode 100644 pkg/ui/frontend/dist/assets/radix-navigation-WDVJ59Wc.js delete mode 100644 pkg/ui/frontend/dist/assets/react-core-D_V7s-9r.js create mode 100644 pkg/ui/frontend/dist/assets/react-core-YHpNHmmd.js create mode 100644 pkg/ui/frontend/dist/assets/react-router-BDU20MeH.js delete mode 100644 pkg/ui/frontend/dist/assets/react-router-CHYnaA34.js create mode 100644 pkg/ui/frontend/dist/assets/style-DI43J1Sp.css delete mode 100644 pkg/ui/frontend/dist/assets/style-De_mcyPH.css delete mode 100644 pkg/ui/frontend/dist/assets/theme-utils-CNom64Sw.js create mode 100644 pkg/ui/frontend/dist/assets/theme-utils-DhlUe4T2.js create mode 100644 pkg/ui/frontend/dist/assets/ui-icons-BqZLUD1y.js delete mode 100644 pkg/ui/frontend/dist/assets/ui-icons-CjYyohUG.js delete mode 100644 pkg/ui/frontend/dist/assets/ui-utils-BNSC_Jv-.js create mode 100644 pkg/ui/frontend/dist/assets/ui-utils-CrpwsBu-.js diff --git a/pkg/ui/frontend/dist/assets/data-viz-BuFFX-vG.js b/pkg/ui/frontend/dist/assets/data-viz-BuFFX-vG.js deleted file mode 100644 index 7b7076251d..0000000000 --- a/pkg/ui/frontend/dist/assets/data-viz-BuFFX-vG.js +++ /dev/null @@ -1,72 +0,0 @@ -import{c as J}from"./ui-utils-BNSC_Jv-.js";import{e as yi,g as ie,r as L,b as P}from"./react-core-D_V7s-9r.js";var mg=Array.isArray,Be=mg,bg=typeof yi=="object"&&yi&&yi.Object===Object&&yi,Ip=bg,xg=Ip,wg=typeof self=="object"&&self&&self.Object===Object&&self,Og=xg||wg||Function("return this")(),st=Og,Ag=st,Pg=Ag.Symbol,ai=Pg,Rs=ai,kp=Object.prototype,Sg=kp.hasOwnProperty,_g=kp.toString,un=Rs?Rs.toStringTag:void 0;function $g(e){var t=Sg.call(e,un),r=e[un];try{e[un]=void 0;var n=!0}catch{}var i=_g.call(e);return n&&(t?e[un]=r:delete e[un]),i}var Tg=$g,Eg=Object.prototype,jg=Eg.toString;function Mg(e){return jg.call(e)}var Cg=Mg,Ls=ai,Ig=Tg,kg=Cg,Ng="[object Null]",Dg="[object Undefined]",Bs=Ls?Ls.toStringTag:void 0;function Rg(e){return e==null?e===void 0?Dg:Ng:Bs&&Bs in Object(e)?Ig(e):kg(e)}var Pt=Rg;function Lg(e){return e!=null&&typeof e=="object"}var St=Lg,Bg=Pt,Fg=St,Wg="[object Symbol]";function zg(e){return typeof e=="symbol"||Fg(e)&&Bg(e)==Wg}var Kr=zg,Ug=Be,qg=Kr,Hg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gg=/^\w*$/;function Kg(e,t){if(Ug(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||qg(e)?!0:Gg.test(e)||!Hg.test(e)||t!=null&&e in Object(t)}var Sc=Kg;function Xg(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var kt=Xg;const Xr=ie(kt);var Vg=Pt,Yg=kt,Zg="[object AsyncFunction]",Jg="[object Function]",Qg="[object GeneratorFunction]",em="[object Proxy]";function tm(e){if(!Yg(e))return!1;var t=Vg(e);return t==Jg||t==Qg||t==Zg||t==em}var _c=tm;const V=ie(_c);var rm=st,nm=rm["__core-js_shared__"],im=nm,Po=im,Fs=function(){var e=/[^.]+$/.exec(Po&&Po.keys&&Po.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function am(e){return!!Fs&&Fs in e}var om=am,um=Function.prototype,cm=um.toString;function sm(e){if(e!=null){try{return cm.call(e)}catch{}try{return e+""}catch{}}return""}var Np=sm,lm=_c,fm=om,dm=kt,pm=Np,hm=/[\\^$.*+?()[\]{}|]/g,ym=/^\[object .+?Constructor\]$/,vm=Function.prototype,gm=Object.prototype,mm=vm.toString,bm=gm.hasOwnProperty,xm=RegExp("^"+mm.call(bm).replace(hm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wm(e){if(!dm(e)||fm(e))return!1;var t=lm(e)?xm:ym;return t.test(pm(e))}var Om=wm;function Am(e,t){return e==null?void 0:e[t]}var Pm=Am,Sm=Om,_m=Pm;function $m(e,t){var r=_m(e,t);return Sm(r)?r:void 0}var or=$m,Tm=or,Em=Tm(Object,"create"),Ea=Em,Ws=Ea;function jm(){this.__data__=Ws?Ws(null):{},this.size=0}var Mm=jm;function Cm(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Im=Cm,km=Ea,Nm="__lodash_hash_undefined__",Dm=Object.prototype,Rm=Dm.hasOwnProperty;function Lm(e){var t=this.__data__;if(km){var r=t[e];return r===Nm?void 0:r}return Rm.call(t,e)?t[e]:void 0}var Bm=Lm,Fm=Ea,Wm=Object.prototype,zm=Wm.hasOwnProperty;function Um(e){var t=this.__data__;return Fm?t[e]!==void 0:zm.call(t,e)}var qm=Um,Hm=Ea,Gm="__lodash_hash_undefined__";function Km(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Hm&&t===void 0?Gm:t,this}var Xm=Km,Vm=Mm,Ym=Im,Zm=Bm,Jm=qm,Qm=Xm;function Vr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var vb=yb,gb=ja;function mb(e,t){var r=this.__data__,n=gb(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var bb=mb,xb=rb,wb=lb,Ob=pb,Ab=vb,Pb=bb;function Yr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Vt=function(t){return oi(t)&&t.indexOf("%")===t.length-1},R=function(t){return q0(t)&&!ui(t)},Ae=function(t){return R(t)||oi(t)},X0=0,ci=function(t){var r=++X0;return"".concat(t||"").concat(r)},ke=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!R(t)&&!oi(t))return n;var a;if(Vt(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return ui(a)&&(a=n),i&&a>r&&(a=r),a},jt=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},V0=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tx(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Xs={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},gt=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Vs=null,_o=null,Dc=function e(t){if(t===Vs&&Array.isArray(_o))return _o;var r=[];return L.Children.forEach(t,function(n){Q(n)||(B0.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),_o=r,Vs=t,r};function Ve(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return gt(i)}):n=[gt(t)],Dc(e).forEach(function(i){var a=qe(i,"type.displayName")||qe(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function ze(e,t){var r=Ve(e,t);return r[0]}var Ys=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!R(n)||n<=0||!R(i)||i<=0)},rx=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],nx=function(t){return t&&t.type&&oi(t.type)&&rx.indexOf(t.type)>=0},ix=function(t,r,n,i){var a,o=(a=So==null?void 0:So[i])!==null&&a!==void 0?a:[];return!V(t)&&(i&&o.includes(r)||Z0.includes(r))||n&&Nc.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(L.isValidElement(t)&&(i=t.props),!Xr(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;ix((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},eu=function e(t,r){if(t===r)return!0;var n=L.Children.count(t);if(n!==L.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Zs(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sx(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ru(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=cx(e,ux),f=i||{width:r,height:n,x:0,y:0},l=J("recharts-surface",a);return P.createElement("svg",tu({},X(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),P.createElement("title",null,u),P.createElement("desc",null,c),t)}var lx=["children","className"];function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dx(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=P.forwardRef(function(e,t){var r=e.children,n=e.className,i=fx(e,lx),a=J("recharts-layer",n);return P.createElement("g",nu({className:a},X(i,!0),{ref:t}),r)}),nt=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:yx(e,t,r)}var gx=vx,mx="\\ud800-\\udfff",bx="\\u0300-\\u036f",xx="\\ufe20-\\ufe2f",wx="\\u20d0-\\u20ff",Ox=bx+xx+wx,Ax="\\ufe0e\\ufe0f",Px="\\u200d",Sx=RegExp("["+Px+mx+Ox+Ax+"]");function _x(e){return Sx.test(e)}var Hp=_x;function $x(e){return e.split("")}var Tx=$x,Gp="\\ud800-\\udfff",Ex="\\u0300-\\u036f",jx="\\ufe20-\\ufe2f",Mx="\\u20d0-\\u20ff",Cx=Ex+jx+Mx,Ix="\\ufe0e\\ufe0f",kx="["+Gp+"]",iu="["+Cx+"]",au="\\ud83c[\\udffb-\\udfff]",Nx="(?:"+iu+"|"+au+")",Kp="[^"+Gp+"]",Xp="(?:\\ud83c[\\udde6-\\uddff]){2}",Vp="[\\ud800-\\udbff][\\udc00-\\udfff]",Dx="\\u200d",Yp=Nx+"?",Zp="["+Ix+"]?",Rx="(?:"+Dx+"(?:"+[Kp,Xp,Vp].join("|")+")"+Zp+Yp+")*",Lx=Zp+Yp+Rx,Bx="(?:"+[Kp+iu+"?",iu,Xp,Vp,kx].join("|")+")",Fx=RegExp(au+"(?="+au+")|"+Bx+Lx,"g");function Wx(e){return e.match(Fx)||[]}var zx=Wx,Ux=Tx,qx=Hp,Hx=zx;function Gx(e){return qx(e)?Hx(e):Ux(e)}var Kx=Gx,Xx=gx,Vx=Hp,Yx=Kx,Zx=Bp;function Jx(e){return function(t){t=Zx(t);var r=Vx(t)?Yx(t):void 0,n=r?r[0]:t.charAt(0),i=r?Xx(r,1).join(""):t.slice(1);return n[e]()+i}}var Qx=Jx,ew=Qx,tw=ew("toUpperCase"),rw=tw;const qa=ie(rw);function se(e){return function(){return e}}const Jp=Math.cos,Ci=Math.sin,it=Math.sqrt,Ii=Math.PI,Ha=2*Ii,ou=Math.PI,uu=2*ou,Ht=1e-6,nw=uu-Ht;function Qp(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Qp;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iHt)if(!(Math.abs(l*c-s*f)>Ht)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,y=i-u,h=c*c+s*s,v=p*p+y*y,b=Math.sqrt(h),w=Math.sqrt(d),x=a*Math.tan((ou-Math.acos((h+d-v)/(2*b*w)))/2),A=x/w,g=x/b;Math.abs(A-1)>Ht&&this._append`L${t+A*f},${r+A*l}`,this._append`A${a},${a},0,0,${+(l*p>f*y)},${this._x1=t+g*c},${this._y1=r+g*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Ht||Math.abs(this._y1-f)>Ht)&&this._append`L${s},${f}`,n&&(d<0&&(d=d%uu+uu),d>nw?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:d>Ht&&this._append`A${n},${n},0,${+(d>=ou)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Rc(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new aw(t)}function Lc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eh(e){this._context=e}eh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Ga(e){return new eh(e)}function th(e){return e[0]}function rh(e){return e[1]}function nh(e,t){var r=se(!0),n=null,i=Ga,a=null,o=Rc(u);e=typeof e=="function"?e:e===void 0?th:se(e),t=typeof t=="function"?t:t===void 0?rh:se(t);function u(c){var s,f=(c=Lc(c)).length,l,d=!1,p;for(n==null&&(a=i(p=o())),s=0;s<=f;++s)!(s=p;--y)u.point(x[y],A[y]);u.lineEnd(),u.areaEnd()}b&&(x[d]=+e(v,d,l),A[d]=+t(v,d,l),u.point(n?+n(v,d,l):x[d],r?+r(v,d,l):A[d]))}if(w)return u=null,w+""||null}function f(){return nh().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:se(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:se(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:se(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:se(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:se(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:se(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:se(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class ih{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function ow(e){return new ih(e,!0)}function uw(e){return new ih(e,!1)}const Bc={draw(e,t){const r=it(t/Ii);e.moveTo(r,0),e.arc(0,0,r,0,Ha)}},cw={draw(e,t){const r=it(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},ah=it(1/3),sw=ah*2,lw={draw(e,t){const r=it(t/sw),n=r*ah;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},fw={draw(e,t){const r=it(t),n=-r/2;e.rect(n,n,r,r)}},dw=.8908130915292852,oh=Ci(Ii/10)/Ci(7*Ii/10),pw=Ci(Ha/10)*oh,hw=-Jp(Ha/10)*oh,yw={draw(e,t){const r=it(t*dw),n=pw*r,i=hw*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Ha*a/5,u=Jp(o),c=Ci(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},$o=it(3),vw={draw(e,t){const r=-it(t/($o*3));e.moveTo(0,r*2),e.lineTo(-$o*r,-r),e.lineTo($o*r,-r),e.closePath()}},He=-.5,Ge=it(3)/2,cu=1/it(12),gw=(cu/2+1)*3,mw={draw(e,t){const r=it(t/gw),n=r/2,i=r*cu,a=n,o=r*cu+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(He*n-Ge*i,Ge*n+He*i),e.lineTo(He*a-Ge*o,Ge*a+He*o),e.lineTo(He*u-Ge*c,Ge*u+He*c),e.lineTo(He*n+Ge*i,He*i-Ge*n),e.lineTo(He*a+Ge*o,He*o-Ge*a),e.lineTo(He*u+Ge*c,He*c-Ge*u),e.closePath()}};function bw(e,t){let r=null,n=Rc(i);e=typeof e=="function"?e:se(e||Bc),t=typeof t=="function"?t:se(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:se(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:se(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ki(){}function Ni(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function uh(e){this._context=e}uh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ni(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ni(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xw(e){return new uh(e)}function ch(e){this._context=e}ch.prototype={areaStart:ki,areaEnd:ki,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ni(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ww(e){return new ch(e)}function sh(e){this._context=e}sh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ni(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ow(e){return new sh(e)}function lh(e){this._context=e}lh.prototype={areaStart:ki,areaEnd:ki,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Aw(e){return new lh(e)}function Qs(e){return e<0?-1:1}function el(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(Qs(a)+Qs(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function tl(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function To(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Di(e){this._context=e}Di.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:To(this,this._t0,tl(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,To(this,tl(this,r=el(this,e,t)),r);break;default:To(this,this._t0,r=el(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function fh(e){this._context=new dh(e)}(fh.prototype=Object.create(Di.prototype)).point=function(e,t){Di.prototype.point.call(this,t,e)};function dh(e){this._context=e}dh.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Pw(e){return new Di(e)}function Sw(e){return new fh(e)}function ph(e){this._context=e}ph.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=rl(e),i=rl(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function $w(e){return new Ka(e,.5)}function Tw(e){return new Ka(e,0)}function Ew(e){return new Ka(e,1)}function Ar(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function jw(e,t){return e[t]}function Mw(e){const t=[];return t.key=e,t}function Cw(){var e=se([]),t=su,r=Ar,n=jw;function i(a){var o=Array.from(e.apply(this,arguments),Mw),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ww(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var hh={symbolCircle:Bc,symbolCross:cw,symbolDiamond:lw,symbolSquare:fw,symbolStar:yw,symbolTriangle:vw,symbolWye:mw},zw=Math.PI/180,Uw=function(t){var r="symbol".concat(qa(t));return hh[r]||Bc},qw=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*zw;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Hw=function(t,r){hh["symbol".concat(qa(t))]=r},Fc=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=Fw(t,Dw),s=il(il({},c),{},{type:n,size:a,sizeType:u}),f=function(){var v=Uw(n),b=bw().type(v).size(qw(a,u,n));return b()},l=s.className,d=s.cx,p=s.cy,y=X(s,!0);return d===+d&&p===+p&&a===+a?P.createElement("path",lu({},y,{className:J("recharts-symbols",l),transform:"translate(".concat(d,", ").concat(p,")"),d:f()})):null};Fc.registerSymbol=Hw;function Pr(e){"@babel/helpers - typeof";return Pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(e)}function fu(){return fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var w=p.inactive?s:p.color;return P.createElement("li",fu({className:v,style:l,key:"legend-item-".concat(y)},tr(n.props,p,y)),P.createElement(ru,{width:o,height:o,viewBox:f,style:d},n.renderIcon(p)),P.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},h?h(b,p,y):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return P.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])}(L.PureComponent);Sn(Wc,"displayName","Legend");Sn(Wc,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var tO=Ma;function rO(){this.__data__=new tO,this.size=0}var nO=rO;function iO(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var aO=iO;function oO(e){return this.__data__.get(e)}var uO=oO;function cO(e){return this.__data__.has(e)}var sO=cO,lO=Ma,fO=Tc,dO=Ec,pO=200;function hO(e,t){var r=this.__data__;if(r instanceof lO){var n=r.__data__;if(!fO||n.lengthu))return!1;var s=a.get(e),f=a.get(t);if(s&&f)return s==t&&f==e;var l=-1,d=!0,p=r&DO?new CO:void 0;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=F1}var Hc=W1,z1=Pt,U1=Hc,q1=St,H1="[object Arguments]",G1="[object Array]",K1="[object Boolean]",X1="[object Date]",V1="[object Error]",Y1="[object Function]",Z1="[object Map]",J1="[object Number]",Q1="[object Object]",eA="[object RegExp]",tA="[object Set]",rA="[object String]",nA="[object WeakMap]",iA="[object ArrayBuffer]",aA="[object DataView]",oA="[object Float32Array]",uA="[object Float64Array]",cA="[object Int8Array]",sA="[object Int16Array]",lA="[object Int32Array]",fA="[object Uint8Array]",dA="[object Uint8ClampedArray]",pA="[object Uint16Array]",hA="[object Uint32Array]",de={};de[oA]=de[uA]=de[cA]=de[sA]=de[lA]=de[fA]=de[dA]=de[pA]=de[hA]=!0;de[H1]=de[G1]=de[iA]=de[K1]=de[aA]=de[X1]=de[V1]=de[Y1]=de[Z1]=de[J1]=de[Q1]=de[eA]=de[tA]=de[rA]=de[nA]=!1;function yA(e){return q1(e)&&U1(e.length)&&!!de[z1(e)]}var vA=yA;function gA(e){return function(t){return e(t)}}var Sh=gA,Fi={exports:{}};Fi.exports;(function(e,t){var r=Ip,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=u})(Fi,Fi.exports);var mA=Fi.exports,bA=vA,xA=Sh,fl=mA,dl=fl&&fl.isTypedArray,wA=dl?xA(dl):bA,_h=wA,OA=S1,AA=Uc,PA=Be,SA=Ph,_A=qc,$A=_h,TA=Object.prototype,EA=TA.hasOwnProperty;function jA(e,t){var r=PA(e),n=!r&&AA(e),i=!r&&!n&&SA(e),a=!r&&!n&&!i&&$A(e),o=r||n||i||a,u=o?OA(e.length,String):[],c=u.length;for(var s in e)(t||EA.call(e,s))&&!(o&&(s=="length"||i&&(s=="offset"||s=="parent")||a&&(s=="buffer"||s=="byteLength"||s=="byteOffset")||_A(s,c)))&&u.push(s);return u}var MA=jA,CA=Object.prototype;function IA(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||CA;return e===r}var kA=IA;function NA(e,t){return function(r){return e(t(r))}}var $h=NA,DA=$h,RA=DA(Object.keys,Object),LA=RA,BA=kA,FA=LA,WA=Object.prototype,zA=WA.hasOwnProperty;function UA(e){if(!BA(e))return FA(e);var t=[];for(var r in Object(e))zA.call(e,r)&&r!="constructor"&&t.push(r);return t}var qA=UA,HA=_c,GA=Hc;function KA(e){return e!=null&&GA(e.length)&&!HA(e)}var si=KA,XA=MA,VA=qA,YA=si;function ZA(e){return YA(e)?XA(e):VA(e)}var Xa=ZA,JA=p1,QA=A1,eP=Xa;function tP(e){return JA(e,eP,QA)}var rP=tP,pl=rP,nP=1,iP=Object.prototype,aP=iP.hasOwnProperty;function oP(e,t,r,n,i,a){var o=r&nP,u=pl(e),c=u.length,s=pl(t),f=s.length;if(c!=f&&!o)return!1;for(var l=c;l--;){var d=u[l];if(!(o?d in t:aP.call(t,d)))return!1}var p=a.get(e),y=a.get(t);if(p&&y)return p==t&&y==e;var h=!0;a.set(e,t),a.set(t,e);for(var v=o;++l-1}var i_=n_;function a_(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=x_){var s=t?null:m_(e);if(s)return b_(s);o=!1,i=g_,c=new h_}else c=t?[]:u;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function D_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function R_(e){return e.value}function L_(e,t){if(P.isValidElement(e))return P.cloneElement(e,t);if(typeof e=="function")return P.createElement(e,t);t.ref;var r=N_(t,$_);return P.createElement(Wc,r)}var El=1,xr=function(e){function t(){var r;T_(this,t);for(var n=arguments.length,i=new Array(n),a=0;aEl||Math.abs(i.height-this.lastBoundingBox.height)>El)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ft({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,d;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();l={left:((s||0)-p.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();d={top:((f||0)-y.height)/2}}else d=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return ft(ft({},l),d)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=ft(ft({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return P.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(p){n.wrapperNode=p}},L_(a,ft(ft({},this.props),{},{payload:kh(f,s,R_)})))}}],[{key:"getWithHeight",value:function(n,i){var a=ft(ft({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&R(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(L.PureComponent);Va(xr,"displayName","Legend");Va(xr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var jl=ai,B_=Uc,F_=Be,Ml=jl?jl.isConcatSpreadable:void 0;function W_(e){return F_(e)||B_(e)||!!(Ml&&e&&e[Ml])}var z_=W_,U_=Oh,q_=z_;function Rh(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=q_),i||(i=[]);++a0&&r(u)?t>1?Rh(u,t-1,r,n,i):U_(i,u):n||(i[i.length]=u)}return i}var Lh=Rh;function H_(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),u=o.length;u--;){var c=o[e?u:++i];if(r(a[c],c,a)===!1)break}return t}}var G_=H_,K_=G_,X_=K_(),V_=X_,Y_=V_,Z_=Xa;function J_(e,t){return e&&Y_(e,t,Z_)}var Bh=J_,Q_=si;function e$(e,t){return function(r,n){if(r==null)return r;if(!Q_(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&c&&!u&&!s||n&&o&&c||!r&&c||!i)return 1;if(!n&&!a&&!s&&e=u)return c;var s=r[n];return c*(s=="desc"?-1:1)}}return e.index-t.index}var h$=p$,Co=Mc,y$=Cc,v$=lt,g$=Fh,m$=s$,b$=Sh,x$=h$,w$=en,O$=Be;function A$(e,t,r){t.length?t=Co(t,function(a){return O$(a)?function(o){return y$(o,a.length===1?a[0]:a)}:a}):t=[w$];var n=-1;t=Co(t,b$(v$));var i=g$(e,function(a,o,u){var c=Co(t,function(s){return s(a)});return{criteria:c,index:++n,value:a}});return m$(i,function(a,o){return x$(a,o,r)})}var P$=A$;function S$(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var _$=S$,$$=_$,Il=Math.max;function T$(e,t,r){return t=Il(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Il(n.length-t,0),o=Array(a);++i0){if(++t>=L$)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var z$=W$,U$=R$,q$=z$,H$=q$(U$),G$=H$,K$=en,X$=E$,V$=G$;function Y$(e,t){return V$(X$(e,t,K$),e+"")}var Z$=Y$,J$=$c,Q$=si,eT=qc,tT=kt;function rT(e,t,r){if(!tT(r))return!1;var n=typeof t;return(n=="number"?Q$(r)&&eT(t,r.length):n=="string"&&t in r)?J$(r[t],e):!1}var Ya=rT,nT=Lh,iT=P$,aT=Z$,Nl=Ya,oT=aT(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Nl(e,t[0],t[1])?t=[]:r>2&&Nl(t[0],t[1],t[2])&&(t=[t[0]]),iT(e,nT(t,1),[])}),uT=oT;const Xc=ie(uT);function _n(e){"@babel/helpers - typeof";return _n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_n(e)}function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(cn,"-left"),R(r)&&t&&R(t.x)&&r=t.y),"".concat(cn,"-top"),R(n)&&t&&R(t.y)&&nh?Math.max(f,c[n]):Math.max(l,c[n])}function OT(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function AT(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,c=e.viewBox,s,f,l;return o.height>0&&o.width>0&&r?(f=Ll({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),l=Ll({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=OT({translateX:f,translateY:l,useTranslate3d:u})):s=xT,{cssProperties:s,cssClasses:wT({translateX:f,translateY:l,coordinate:r})}}function _r(e){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(e)}function Bl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fl(e){for(var t=1;tWl||Math.abs(n.height-this.state.lastBoundingBox.height)>Wl)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,s=i.children,f=i.coordinate,l=i.hasPayload,d=i.isAnimationActive,p=i.offset,y=i.position,h=i.reverseDirection,v=i.useTranslate3d,b=i.viewBox,w=i.wrapperStyle,x=AT({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:y,reverseDirection:h,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:b}),A=x.cssClasses,g=x.cssProperties,m=Fl(Fl({transition:d&&a?"transform ".concat(u,"ms ").concat(c):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},w);return P.createElement("div",{tabIndex:-1,className:A,style:m,ref:function(S){n.wrapperNode=S}},s)}}])}(L.PureComponent),IT=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},mt={isSsr:IT(),get:function(t){return mt[t]},set:function(t,r){if(typeof t=="string")mt[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){mt[i]=t[i]})}}};function $r(e){"@babel/helpers - typeof";return $r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(e)}function zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ul(e){for(var t=1;t0;return P.createElement(CT,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:d,active:a,coordinate:f,hasPayload:m,offset:p,position:v,reverseDirection:b,useTranslate3d:w,viewBox:x,wrapperStyle:A},UT(s,Ul(Ul({},this.props),{},{payload:g})))}}])}(L.PureComponent);Vc(dt,"displayName","Tooltip");Vc(dt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!mt.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var qT=st,HT=function(){return qT.Date.now()},GT=HT,KT=/\s/;function XT(e){for(var t=e.length;t--&&KT.test(e.charAt(t)););return t}var VT=XT,YT=VT,ZT=/^\s+/;function JT(e){return e&&e.slice(0,YT(e)+1).replace(ZT,"")}var QT=JT,eE=QT,ql=kt,tE=Kr,Hl=NaN,rE=/^[-+]0x[0-9a-f]+$/i,nE=/^0b[01]+$/i,iE=/^0o[0-7]+$/i,aE=parseInt;function oE(e){if(typeof e=="number")return e;if(tE(e))return Hl;if(ql(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ql(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=eE(e);var r=nE.test(e);return r||iE.test(e)?aE(e.slice(2),r?2:8):rE.test(e)?Hl:+e}var Gh=oE,uE=kt,ko=GT,Gl=Gh,cE="Expected a function",sE=Math.max,lE=Math.min;function fE(e,t,r){var n,i,a,o,u,c,s=0,f=!1,l=!1,d=!0;if(typeof e!="function")throw new TypeError(cE);t=Gl(t)||0,uE(r)&&(f=!!r.leading,l="maxWait"in r,a=l?sE(Gl(r.maxWait)||0,t):a,d="trailing"in r?!!r.trailing:d);function p(m){var O=n,S=i;return n=i=void 0,s=m,o=e.apply(S,O),o}function y(m){return s=m,u=setTimeout(b,t),f?p(m):o}function h(m){var O=m-c,S=m-s,_=t-O;return l?lE(_,a-S):_}function v(m){var O=m-c,S=m-s;return c===void 0||O>=t||O<0||l&&S>=a}function b(){var m=ko();if(v(m))return w(m);u=setTimeout(b,h(m))}function w(m){return u=void 0,d&&n?p(m):(n=i=void 0,o)}function x(){u!==void 0&&clearTimeout(u),s=0,n=c=i=u=void 0}function A(){return u===void 0?o:w(ko())}function g(){var m=ko(),O=v(m);if(n=arguments,i=this,c=m,O){if(u===void 0)return y(c);if(l)return clearTimeout(u),u=setTimeout(b,t),p(c)}return u===void 0&&(u=setTimeout(b,t)),o}return g.cancel=x,g.flush=A,g}var Kh=fE;const DW=ie(Kh);var dE=Kh,pE=kt,hE="Expected a function";function yE(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(hE);return pE(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),dE(e,t,{leading:n,maxWait:t,trailing:i})}var vE=yE;const Xh=ie(vE);function Tn(e){"@babel/helpers - typeof";return Tn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(e)}function Kl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bi(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(C=Xh(C,h,{trailing:!0,leading:!1}));var I=new ResizeObserver(C),M=g.current.getBoundingClientRect(),k=M.width,D=M.height;return $(k,D),I.observe(g.current),function(){I.disconnect()}},[$,h]);var T=L.useMemo(function(){var C=_.containerWidth,I=_.containerHeight;if(C<0||I<0)return null;nt(Vt(o)||Vt(c),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,c),nt(!r||r>0,"The aspect(%s) must be greater than zero.",r);var M=Vt(o)?C:o,k=Vt(c)?I:c;r&&r>0&&(M?k=M/r:k&&(M=k*r),d&&k>d&&(k=d)),nt(M>0||k>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,M,k,o,c,f,l,r);var D=!Array.isArray(p)&>(p.type).endsWith("Chart");return P.Children.map(p,function(B){return P.isValidElement(B)?L.cloneElement(B,bi({width:M,height:k},D?{style:bi({height:"100%",width:"100%",maxHeight:k,maxWidth:M},B.props.style)}:{})):B})},[r,p,c,d,l,f,_,o]);return P.createElement("div",{id:v?"".concat(v):void 0,className:J("recharts-responsive-container",b),style:bi(bi({},A),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:d}),ref:g},T)}),Yc=function(t){return null};Yc.displayName="Cell";function En(e){"@babel/helpers - typeof";return En=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},En(e)}function Vl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||mt.isSsr)return{width:0,height:0};var n=jE(r),i=JSON.stringify({text:t,copyStyle:n});if(fr.widthCache[i])return fr.widthCache[i];try{var a=document.getElementById(Yl);a||(a=document.createElement("span"),a.setAttribute("id",Yl),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Au(Au({},EE),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return fr.widthCache[i]=c,++fr.cacheCount>TE&&(fr.cacheCount=0,fr.widthCache={}),c}catch{return{width:0,height:0}}},ME=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function jn(e){"@babel/helpers - typeof";return jn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(e)}function qi(e,t){return NE(e)||kE(e,t)||IE(e,t)||CE()}function CE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IE(e,t){if(e){if(typeof e=="string")return Zl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zl(e,t)}}function Zl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VE(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nf(e,t){return QE(e)||JE(e,t)||ZE(e,t)||YE()}function YE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZE(e,t){if(e){if(typeof e=="string")return af(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return af(e,t)}}function af(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(k,D){var B=D.word,F=D.width,q=k[k.length-1];if(q&&(i==null||a||q.width+F+nD.width?k:D})};if(!f)return p;for(var h="…",v=function(M){var k=l.slice(0,M),D=Jh({breakAll:s,style:c,children:k+h}).wordsWithComputedWidth,B=d(D),F=B.length>o||y(B).width>Number(i);return[F,B]},b=0,w=l.length-1,x=0,A;b<=w&&x<=l.length-1;){var g=Math.floor((b+w)/2),m=g-1,O=v(m),S=nf(O,2),_=S[0],E=S[1],$=v(g),T=nf($,1),C=T[0];if(!_&&!C&&(b=g+1),_&&C&&(w=g-1),!_&&C){A=E;break}x++}return A||p},of=function(t){var r=Q(t)?[]:t.toString().split(Zh);return[{words:r}]},tj=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!mt.isSsr){var c,s,f=Jh({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,d=f.spaceWidth;c=l,s=d}else return of(i);return ej({breakAll:o,children:i,maxLines:u,style:a},c,s,r,n)}return of(i)},uf="#808080",rr=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,c=t.capHeight,s=c===void 0?"0.71em":c,f=t.scaleToFit,l=f===void 0?!1:f,d=t.textAnchor,p=d===void 0?"start":d,y=t.verticalAnchor,h=y===void 0?"end":y,v=t.fill,b=v===void 0?uf:v,w=rf(t,KE),x=L.useMemo(function(){return tj({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:l,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,l,w.style,w.width]),A=w.dx,g=w.dy,m=w.angle,O=w.className,S=w.breakAll,_=rf(w,XE);if(!Ae(n)||!Ae(a))return null;var E=n+(R(A)?A:0),$=a+(R(g)?g:0),T;switch(h){case"start":T=No("calc(".concat(s,")"));break;case"middle":T=No("calc(".concat((x.length-1)/2," * -").concat(u," + (").concat(s," / 2))"));break;default:T=No("calc(".concat(x.length-1," * -").concat(u,")"));break}var C=[];if(l){var I=x[0].width,M=w.width;C.push("scale(".concat((R(M)?M/I:1)/I,")"))}return m&&C.push("rotate(".concat(m,", ").concat(E,", ").concat($,")")),C.length&&(_.transform=C.join(" ")),P.createElement("text",Pu({},X(_,!0),{x:E,y:$,className:J("recharts-text",O),textAnchor:p,fill:b.includes("url")?uf:b}),x.map(function(k,D){var B=k.words.join(S?"":" ");return P.createElement("tspan",{x:E,dy:D===0?T:u,key:"".concat(B,"-").concat(D)},B)}))};function Ct(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function rj(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Zc(e){let t,r,n;e.length!==2?(t=Ct,r=(u,c)=>Ct(e(u),c),n=(u,c)=>e(u)-c):(t=e===Ct||e===rj?e:nj,r=e,n=e);function i(u,c,s=0,f=u.length){if(s>>1;r(u[l],c)<0?s=l+1:f=l}while(s>>1;r(u[l],c)<=0?s=l+1:f=l}while(ss&&n(u[l-1],c)>-n(u[l],c)?l-1:l}return{left:i,center:o,right:a}}function nj(){return 0}function Qh(e){return e===null?NaN:+e}function*ij(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const aj=Zc(Ct),li=aj.right;Zc(Qh).center;class cf extends Map{constructor(t,r=cj){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(sf(this,t))}has(t){return super.has(sf(this,t))}set(t,r){return super.set(oj(this,t),r)}delete(t){return super.delete(uj(this,t))}}function sf({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function oj({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function uj({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function cj(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sj(e=Ct){if(e===Ct)return ey;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function ey(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const lj=Math.sqrt(50),fj=Math.sqrt(10),dj=Math.sqrt(2);function Hi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=lj?10:a>=fj?5:a>=dj?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),c=Math.round(t*s),u/st&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),c=Math.round(t/s),u*st&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(r=n);return r}function ff(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function ty(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?ey:sj(i);n>r;){if(n-r>600){const c=n-r+1,s=t-r+1,f=Math.log(c),l=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*l*(c-l)/c)*(s-c/2<0?-1:1),p=Math.max(r,Math.floor(t-s*l/c+d)),y=Math.min(n,Math.floor(t+(c-s)*l/c+d));ty(e,t,p,y,i)}const a=e[t];let o=r,u=n;for(sn(e,r,t),i(e[n],a)>0&&sn(e,r,n);o0;)--u}i(e[r],a)===0?sn(e,r,u):(++u,sn(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function sn(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function pj(e,t,r){if(e=Float64Array.from(ij(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return ff(e);if(t>=1)return lf(e);var n,i=(n-1)*t,a=Math.floor(i),o=lf(ty(e,a).subarray(0,a+1)),u=ff(e.subarray(a+1));return o+(u-o)*(i-a)}}function hj(e,t,r=Qh){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function yj(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?wi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?wi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gj.exec(e))?new Le(t[1],t[2],t[3],1):(t=mj.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bj.exec(e))?wi(t[1],t[2],t[3],t[4]):(t=xj.exec(e))?wi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wj.exec(e))?mf(t[1],t[2]/100,t[3]/100,1):(t=Oj.exec(e))?mf(t[1],t[2]/100,t[3]/100,t[4]):df.hasOwnProperty(e)?yf(df[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function yf(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function wi(e,t,r,n){return n<=0&&(e=t=r=NaN),new Le(e,t,r,n)}function Sj(e){return e instanceof fi||(e=kn(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function Eu(e,t,r,n){return arguments.length===1?Sj(e):new Le(e,t,r,n??1)}function Le(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Qc(Le,Eu,ny(fi,{brighter(e){return e=e==null?Gi:Math.pow(Gi,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le(Qt(this.r),Qt(this.g),Qt(this.b),Ki(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vf,formatHex:vf,formatHex8:_j,formatRgb:gf,toString:gf}));function vf(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}`}function _j(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}${Yt((isNaN(this.opacity)?1:this.opacity)*255)}`}function gf(){const e=Ki(this.opacity);return`${e===1?"rgb(":"rgba("}${Qt(this.r)}, ${Qt(this.g)}, ${Qt(this.b)}${e===1?")":`, ${e})`}`}function Ki(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yt(e){return e=Qt(e),(e<16?"0":"")+e.toString(16)}function mf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new rt(e,t,r,n)}function iy(e){if(e instanceof rt)return new rt(e.h,e.s,e.l,e.opacity);if(e instanceof fi||(e=kn(e)),!e)return new rt;if(e instanceof rt)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&c<1?0:o,new rt(o,u,c,e.opacity)}function $j(e,t,r,n){return arguments.length===1?iy(e):new rt(e,t,r,n??1)}function rt(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Qc(rt,$j,ny(fi,{brighter(e){return e=e==null?Gi:Math.pow(Gi,e),new rt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new rt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Le(Do(e>=240?e-240:e+120,i,n),Do(e,i,n),Do(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new rt(bf(this.h),Oi(this.s),Oi(this.l),Ki(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ki(this.opacity);return`${e===1?"hsl(":"hsla("}${bf(this.h)}, ${Oi(this.s)*100}%, ${Oi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function bf(e){return e=(e||0)%360,e<0?e+360:e}function Oi(e){return Math.max(0,Math.min(1,e||0))}function Do(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const es=e=>()=>e;function Tj(e,t){return function(r){return e+r*t}}function Ej(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function jj(e){return(e=+e)==1?ay:function(t,r){return r-t?Ej(t,r,e):es(isNaN(t)?r:t)}}function ay(e,t){var r=t-e;return r?Tj(e,r):es(isNaN(e)?t:e)}const xf=function e(t){var r=jj(t);function n(i,a){var o=r((i=Eu(i)).r,(a=Eu(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),s=ay(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=c(f),i.opacity=s(f),i+""}}return n.gamma=e,n}(1);function Mj(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:Xi(n,i)})),r=Ro.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function zj(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?Uj:zj,c=s=null,l}function l(d){return d==null||isNaN(d=+d)?a:(c||(c=u(e.map(n),t,r)))(n(o(d)))}return l.invert=function(d){return o(i((s||(s=u(t,e.map(n),Xi)))(d)))},l.domain=function(d){return arguments.length?(e=Array.from(d,Vi),f()):e.slice()},l.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},l.rangeRound=function(d){return t=Array.from(d),r=ts,f()},l.clamp=function(d){return arguments.length?(o=d?!0:Ne,f()):o!==Ne},l.interpolate=function(d){return arguments.length?(r=d,f()):r},l.unknown=function(d){return arguments.length?(a=d,l):a},function(d,p){return n=d,i=p,f()}}function rs(){return Za()(Ne,Ne)}function qj(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Yi(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Tr(e){return e=Yi(Math.abs(e)),e?e[1]:NaN}function Hj(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Gj(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Kj=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Nn(e){if(!(t=Kj.exec(e)))throw new Error("invalid format: "+e);var t;return new ns({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Nn.prototype=ns.prototype;function ns(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ns.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Xj(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var oy;function Vj(e,t){var r=Yi(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(oy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Yi(e,Math.max(0,t+a-1))[0]}function Of(e,t){var r=Yi(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Af={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:qj,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Of(e*100,t),r:Of,s:Vj,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Pf(e){return e}var Sf=Array.prototype.map,_f=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yj(e){var t=e.grouping===void 0||e.thousands===void 0?Pf:Hj(Sf.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Pf:Gj(Sf.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(l){l=Nn(l);var d=l.fill,p=l.align,y=l.sign,h=l.symbol,v=l.zero,b=l.width,w=l.comma,x=l.precision,A=l.trim,g=l.type;g==="n"?(w=!0,g="g"):Af[g]||(x===void 0&&(x=12),A=!0,g="g"),(v||d==="0"&&p==="=")&&(v=!0,d="0",p="=");var m=h==="$"?r:h==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",O=h==="$"?n:/[%p]/.test(g)?o:"",S=Af[g],_=/[defgprs%]/.test(g);x=x===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function E($){var T=m,C=O,I,M,k;if(g==="c")C=S($)+C,$="";else{$=+$;var D=$<0||1/$<0;if($=isNaN($)?c:S(Math.abs($),x),A&&($=Xj($)),D&&+$==0&&y!=="+"&&(D=!1),T=(D?y==="("?y:u:y==="-"||y==="("?"":y)+T,C=(g==="s"?_f[8+oy/3]:"")+C+(D&&y==="("?")":""),_){for(I=-1,M=$.length;++Ik||k>57){C=(k===46?i+$.slice(I+1):$.slice(I))+C,$=$.slice(0,I);break}}}w&&!v&&($=t($,1/0));var B=T.length+$.length+C.length,F=B>1)+T+$+C+F.slice(B);break;default:$=F+T+$+C;break}return a($)}return E.toString=function(){return l+""},E}function f(l,d){var p=s((l=Nn(l),l.type="f",l)),y=Math.max(-8,Math.min(8,Math.floor(Tr(d)/3)))*3,h=Math.pow(10,-y),v=_f[8+y/3];return function(b){return p(h*b)+v}}return{format:s,formatPrefix:f}}var Ai,is,uy;Zj({thousands:",",grouping:[3],currency:["$",""]});function Zj(e){return Ai=Yj(e),is=Ai.format,uy=Ai.formatPrefix,Ai}function Jj(e){return Math.max(0,-Tr(Math.abs(e)))}function Qj(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tr(t)/3)))*3-Tr(Math.abs(e)))}function eM(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tr(t)-Tr(e))+1}function cy(e,t,r,n){var i=$u(e,t,r),a;switch(n=Nn(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=Qj(i,o))&&(n.precision=a),uy(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=eM(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Jj(i))&&(n.precision=a-(n.type==="%")*2);break}}return is(n)}function Nt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Su(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return cy(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],c,s,f=10;for(u0;){if(s=_u(o,u,r),s===c)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function Zi(){var e=rs();return e.copy=function(){return di(e,Zi())},Je.apply(e,arguments),Nt(e)}function sy(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Vi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return sy(e).unknown(t)},e=arguments.length?Array.from(e,Vi):[0,1],Nt(r)}function ly(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function aM(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Ef(e){return(t,r)=>-e(-t,r)}function as(e){const t=e($f,Tf),r=t.domain;let n=10,i,a;function o(){return i=aM(n),a=iM(n),r()[0]<0?(i=Ef(i),a=Ef(a),e(tM,rM)):e($f,Tf),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const c=r();let s=c[0],f=c[c.length-1];const l=f0){for(;d<=p;++d)for(y=1;yf)break;b.push(h)}}else for(;d<=p;++d)for(y=n-1;y>=1;--y)if(h=d>0?y/a(-d):y*a(d),!(hf)break;b.push(h)}b.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Nn(c)).precision==null&&(c.trim=!0),c=is(c)),u===1/0)return c;const s=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(ly(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function fy(){const e=as(Za()).domain([1,10]);return e.copy=()=>di(e,fy()).base(e.base()),Je.apply(e,arguments),e}function jf(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Mf(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function os(e){var t=1,r=e(jf(t),Mf(t));return r.constant=function(n){return arguments.length?e(jf(t=+n),Mf(t)):t},Nt(r)}function dy(){var e=os(Za());return e.copy=function(){return di(e,dy()).constant(e.constant())},Je.apply(e,arguments)}function Cf(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oM(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function uM(e){return e<0?-e*e:e*e}function us(e){var t=e(Ne,Ne),r=1;function n(){return r===1?e(Ne,Ne):r===.5?e(oM,uM):e(Cf(r),Cf(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Nt(t)}function cs(){var e=us(Za());return e.copy=function(){return di(e,cs()).exponent(e.exponent())},Je.apply(e,arguments),e}function cM(){return cs.apply(null,arguments).exponent(.5)}function If(e){return Math.sign(e)*e*e}function sM(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function py(){var e=rs(),t=[0,1],r=!1,n;function i(a){var o=sM(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(If(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Vi)).map(If)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return py(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Je.apply(i,arguments),Nt(i)}function hy(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return yy().domain([e,t]).range(i).unknown(a)},Je.apply(Nt(o),arguments)}function vy(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[li(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return vy().domain(e).range(t).unknown(r)},Je.apply(i,arguments)}const Lo=new Date,Bo=new Date;function Pe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return c;let s;do c.push(s=new Date(+a)),t(a,u),e(a);while(sPe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Lo.setTime(+a),Bo.setTime(+o),e(Lo),e(Bo),Math.floor(r(Lo,Bo))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Ji=Pe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ji.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Ji);Ji.range;const ht=1e3,Xe=ht*60,yt=Xe*60,xt=yt*24,ss=xt*7,kf=xt*30,Fo=xt*365,Zt=Pe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getUTCSeconds());Zt.range;const ls=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ht)},(e,t)=>{e.setTime(+e+t*Xe)},(e,t)=>(t-e)/Xe,e=>e.getMinutes());ls.range;const fs=Pe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xe)},(e,t)=>(t-e)/Xe,e=>e.getUTCMinutes());fs.range;const ds=Pe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ht-e.getMinutes()*Xe)},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getHours());ds.range;const ps=Pe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*yt)},(e,t)=>(t-e)/yt,e=>e.getUTCHours());ps.range;const pi=Pe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xe)/xt,e=>e.getDate()-1);pi.range;const Ja=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xt,e=>e.getUTCDate()-1);Ja.range;const gy=Pe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xt,e=>Math.floor(e/xt));gy.range;function ur(e){return Pe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Xe)/ss)}const Qa=ur(0),Qi=ur(1),lM=ur(2),fM=ur(3),Er=ur(4),dM=ur(5),pM=ur(6);Qa.range;Qi.range;lM.range;fM.range;Er.range;dM.range;pM.range;function cr(e){return Pe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ss)}const eo=cr(0),ea=cr(1),hM=cr(2),yM=cr(3),jr=cr(4),vM=cr(5),gM=cr(6);eo.range;ea.range;hM.range;yM.range;jr.range;vM.range;gM.range;const hs=Pe(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());hs.range;const ys=Pe(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ys.range;const wt=Pe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());wt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});wt.range;const Ot=Pe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ot.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ot.range;function my(e,t,r,n,i,a){const o=[[Zt,1,ht],[Zt,5,5*ht],[Zt,15,15*ht],[Zt,30,30*ht],[a,1,Xe],[a,5,5*Xe],[a,15,15*Xe],[a,30,30*Xe],[i,1,yt],[i,3,3*yt],[i,6,6*yt],[i,12,12*yt],[n,1,xt],[n,2,2*xt],[r,1,ss],[t,1,kf],[t,3,3*kf],[e,1,Fo]];function u(s,f,l){const d=fv).right(o,d);if(p===o.length)return e.every($u(s/Fo,f/Fo,l));if(p===0)return Ji.every(Math.max($u(s,f,l),1));const[y,h]=o[d/o[p-1][2]53)return null;"w"in N||(N.w=1),"Z"in N?(ee=zo(ln(N.y,0,1)),xe=ee.getUTCDay(),ee=xe>4||xe===0?ea.ceil(ee):ea(ee),ee=Ja.offset(ee,(N.V-1)*7),N.y=ee.getUTCFullYear(),N.m=ee.getUTCMonth(),N.d=ee.getUTCDate()+(N.w+6)%7):(ee=Wo(ln(N.y,0,1)),xe=ee.getDay(),ee=xe>4||xe===0?Qi.ceil(ee):Qi(ee),ee=pi.offset(ee,(N.V-1)*7),N.y=ee.getFullYear(),N.m=ee.getMonth(),N.d=ee.getDate()+(N.w+6)%7)}else("W"in N||"U"in N)&&("w"in N||(N.w="u"in N?N.u%7:"W"in N?1:0),xe="Z"in N?zo(ln(N.y,0,1)).getUTCDay():Wo(ln(N.y,0,1)).getDay(),N.m=0,N.d="W"in N?(N.w+6)%7+N.W*7-(xe+5)%7:N.w+N.U*7-(xe+6)%7);return"Z"in N?(N.H+=N.Z/100|0,N.M+=N.Z%100,zo(N)):Wo(N)}}function S(W,Y,Z,N){for(var ye=0,ee=Y.length,xe=Z.length,we,Re;ye=xe)return-1;if(we=Y.charCodeAt(ye++),we===37){if(we=Y.charAt(ye++),Re=g[we in Nf?Y.charAt(ye++):we],!Re||(N=Re(W,Z,N))<0)return-1}else if(we!=Z.charCodeAt(N++))return-1}return N}function _(W,Y,Z){var N=s.exec(Y.slice(Z));return N?(W.p=f.get(N[0].toLowerCase()),Z+N[0].length):-1}function E(W,Y,Z){var N=p.exec(Y.slice(Z));return N?(W.w=y.get(N[0].toLowerCase()),Z+N[0].length):-1}function $(W,Y,Z){var N=l.exec(Y.slice(Z));return N?(W.w=d.get(N[0].toLowerCase()),Z+N[0].length):-1}function T(W,Y,Z){var N=b.exec(Y.slice(Z));return N?(W.m=w.get(N[0].toLowerCase()),Z+N[0].length):-1}function C(W,Y,Z){var N=h.exec(Y.slice(Z));return N?(W.m=v.get(N[0].toLowerCase()),Z+N[0].length):-1}function I(W,Y,Z){return S(W,t,Y,Z)}function M(W,Y,Z){return S(W,r,Y,Z)}function k(W,Y,Z){return S(W,n,Y,Z)}function D(W){return o[W.getDay()]}function B(W){return a[W.getDay()]}function F(W){return c[W.getMonth()]}function q(W){return u[W.getMonth()]}function G(W){return i[+(W.getHours()>=12)]}function z(W){return 1+~~(W.getMonth()/3)}function K(W){return o[W.getUTCDay()]}function fe(W){return a[W.getUTCDay()]}function ge(W){return c[W.getUTCMonth()]}function Fe(W){return u[W.getUTCMonth()]}function Bt(W){return i[+(W.getUTCHours()>=12)]}function De(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var Y=m(W+="",x);return Y.toString=function(){return W},Y},parse:function(W){var Y=O(W+="",!1);return Y.toString=function(){return W},Y},utcFormat:function(W){var Y=m(W+="",A);return Y.toString=function(){return W},Y},utcParse:function(W){var Y=O(W+="",!0);return Y.toString=function(){return W},Y}}}var Nf={"-":"",_:" ",0:"0"},$e=/^\s*\d+/,AM=/^%/,PM=/[\\^$*+?|[\]().{}]/g;function te(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function _M(e,t,r){var n=$e.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function $M(e,t,r){var n=$e.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function TM(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function EM(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function jM(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Df(e,t,r){var n=$e.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Rf(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function MM(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function CM(e,t,r){var n=$e.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function IM(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Lf(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function kM(e,t,r){var n=$e.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Bf(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function NM(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function DM(e,t,r){var n=$e.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function RM(e,t,r){var n=$e.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function LM(e,t,r){var n=$e.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function BM(e,t,r){var n=AM.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function FM(e,t,r){var n=$e.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function WM(e,t,r){var n=$e.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Ff(e,t){return te(e.getDate(),t,2)}function zM(e,t){return te(e.getHours(),t,2)}function UM(e,t){return te(e.getHours()%12||12,t,2)}function qM(e,t){return te(1+pi.count(wt(e),e),t,3)}function by(e,t){return te(e.getMilliseconds(),t,3)}function HM(e,t){return by(e,t)+"000"}function GM(e,t){return te(e.getMonth()+1,t,2)}function KM(e,t){return te(e.getMinutes(),t,2)}function XM(e,t){return te(e.getSeconds(),t,2)}function VM(e){var t=e.getDay();return t===0?7:t}function YM(e,t){return te(Qa.count(wt(e)-1,e),t,2)}function xy(e){var t=e.getDay();return t>=4||t===0?Er(e):Er.ceil(e)}function ZM(e,t){return e=xy(e),te(Er.count(wt(e),e)+(wt(e).getDay()===4),t,2)}function JM(e){return e.getDay()}function QM(e,t){return te(Qi.count(wt(e)-1,e),t,2)}function eC(e,t){return te(e.getFullYear()%100,t,2)}function tC(e,t){return e=xy(e),te(e.getFullYear()%100,t,2)}function rC(e,t){return te(e.getFullYear()%1e4,t,4)}function nC(e,t){var r=e.getDay();return e=r>=4||r===0?Er(e):Er.ceil(e),te(e.getFullYear()%1e4,t,4)}function iC(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+te(t/60|0,"0",2)+te(t%60,"0",2)}function Wf(e,t){return te(e.getUTCDate(),t,2)}function aC(e,t){return te(e.getUTCHours(),t,2)}function oC(e,t){return te(e.getUTCHours()%12||12,t,2)}function uC(e,t){return te(1+Ja.count(Ot(e),e),t,3)}function wy(e,t){return te(e.getUTCMilliseconds(),t,3)}function cC(e,t){return wy(e,t)+"000"}function sC(e,t){return te(e.getUTCMonth()+1,t,2)}function lC(e,t){return te(e.getUTCMinutes(),t,2)}function fC(e,t){return te(e.getUTCSeconds(),t,2)}function dC(e){var t=e.getUTCDay();return t===0?7:t}function pC(e,t){return te(eo.count(Ot(e)-1,e),t,2)}function Oy(e){var t=e.getUTCDay();return t>=4||t===0?jr(e):jr.ceil(e)}function hC(e,t){return e=Oy(e),te(jr.count(Ot(e),e)+(Ot(e).getUTCDay()===4),t,2)}function yC(e){return e.getUTCDay()}function vC(e,t){return te(ea.count(Ot(e)-1,e),t,2)}function gC(e,t){return te(e.getUTCFullYear()%100,t,2)}function mC(e,t){return e=Oy(e),te(e.getUTCFullYear()%100,t,2)}function bC(e,t){return te(e.getUTCFullYear()%1e4,t,4)}function xC(e,t){var r=e.getUTCDay();return e=r>=4||r===0?jr(e):jr.ceil(e),te(e.getUTCFullYear()%1e4,t,4)}function wC(){return"+0000"}function zf(){return"%"}function Uf(e){return+e}function qf(e){return Math.floor(+e/1e3)}var dr,Ay,Py;OC({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function OC(e){return dr=OM(e),Ay=dr.format,dr.parse,Py=dr.utcFormat,dr.utcParse,dr}function AC(e){return new Date(e)}function PC(e){return e instanceof Date?+e:+new Date(+e)}function vs(e,t,r,n,i,a,o,u,c,s){var f=rs(),l=f.invert,d=f.domain,p=s(".%L"),y=s(":%S"),h=s("%I:%M"),v=s("%I %p"),b=s("%a %d"),w=s("%b %d"),x=s("%B"),A=s("%Y");function g(m){return(c(m)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>pj(e,a/n))},r.copy=function(){return Ty(t).domain(e)},_t.apply(r,arguments)}function ro(){var e=0,t=.5,r=1,n=1,i,a,o,u,c,s=Ne,f,l=!1,d;function p(h){return isNaN(h=+h)?d:(h=.5+((h=+f(h))-a)*(n*ht}var Cy=MC,CC=no,IC=Cy,kC=en;function NC(e){return e&&e.length?CC(e,kC,IC):void 0}var DC=NC;const io=ie(DC);function RC(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};U.decimalPlaces=U.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*pe;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};U.dividedBy=U.div=function(e){return bt(this,new this.constructor(e))};U.dividedToIntegerBy=U.idiv=function(e){var t=this,r=t.constructor;return ue(bt(t,new r(e),0,1),r.precision)};U.equals=U.eq=function(e){return!this.cmp(e)};U.exponent=function(){return be(this)};U.greaterThan=U.gt=function(e){return this.cmp(e)>0};U.greaterThanOrEqualTo=U.gte=function(e){return this.cmp(e)>=0};U.isInteger=U.isint=function(){return this.e>this.d.length-2};U.isNegative=U.isneg=function(){return this.s<0};U.isPositive=U.ispos=function(){return this.s>0};U.isZero=function(){return this.s===0};U.lessThan=U.lt=function(e){return this.cmp(e)<0};U.lessThanOrEqualTo=U.lte=function(e){return this.cmp(e)<1};U.logarithm=U.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ue))throw Error(Ye+"NaN");if(r.s<1)throw Error(Ye+(r.s?"NaN":"-Infinity"));return r.eq(Ue)?new n(0):(he=!1,t=bt(Dn(r,a),Dn(e,a),a),he=!0,ue(t,i))};U.minus=U.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ry(t,e):Ny(t,(e.s=-e.s,e))};U.modulo=U.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ye+"NaN");return r.s?(he=!1,t=bt(r,e,0,1).times(e),he=!0,r.minus(t)):ue(new n(r),i)};U.naturalExponential=U.exp=function(){return Dy(this)};U.naturalLogarithm=U.ln=function(){return Dn(this)};U.negated=U.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};U.plus=U.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ny(t,e):Ry(t,(e.s=-e.s,e))};U.precision=U.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(er+e);if(t=be(i)+1,n=i.d.length-1,r=n*pe+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};U.squareRoot=U.sqrt=function(){var e,t,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(Ye+"NaN")}for(e=be(u),he=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=at(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=nn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(bt(u,a,o+2)).times(.5),at(a.d).slice(0,o)===(t=at(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ue(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return he=!0,ue(n,r)};U.times=U.mul=function(e){var t,r,n,i,a,o,u,c,s,f=this,l=f.constructor,d=f.d,p=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,c=d.length,s=p.length,c=0;){for(t=0,i=c+n;i>n;)u=a[i]+p[n]*d[i-n-1]+t,a[i--]=u%Se|0,t=u/Se|0;a[i]=(a[i]+t)%Se|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,he?ue(e,l.precision):e};U.toDecimalPlaces=U.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ct(e,0,rn),t===void 0?t=n.rounding:ct(t,0,8),ue(r,e+be(r)+1,t))};U.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=nr(n,!0):(ct(e,0,rn),t===void 0?t=i.rounding:ct(t,0,8),n=ue(new i(n),e+1,t),r=nr(n,!0,e+1)),r};U.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?nr(i):(ct(e,0,rn),t===void 0?t=a.rounding:ct(t,0,8),n=ue(new a(i),e+be(i)+1,t),r=nr(n.abs(),!1,e+be(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};U.toInteger=U.toint=function(){var e=this,t=e.constructor;return ue(new t(e),be(e)+1,t.rounding)};U.toNumber=function(){return+this};U.toPower=U.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,s=12,f=+(e=new c(e));if(!e.s)return new c(Ue);if(u=new c(u),!u.s){if(e.s<1)throw Error(Ye+"Infinity");return u}if(u.eq(Ue))return u;if(n=c.precision,e.eq(Ue))return ue(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=ky){for(i=new c(Ue),t=Math.ceil(n/pe+4),he=!1;r%2&&(i=i.times(u),Kf(i.d,t)),r=nn(r/2),r!==0;)u=u.times(u),Kf(u.d,t);return he=!0,e.s<0?new c(Ue).div(i):ue(i,n)}}else if(a<0)throw Error(Ye+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,he=!1,i=e.times(Dn(u,n+s)),he=!0,i=Dy(i),i.s=a,i};U.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=be(i),n=nr(i,r<=a.toExpNeg||r>=a.toExpPos)):(ct(e,1,rn),t===void 0?t=a.rounding:ct(t,0,8),i=ue(new a(i),e,t),r=be(i),n=nr(i,e<=r||r<=a.toExpNeg,e)),n};U.toSignificantDigits=U.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ct(e,1,rn),t===void 0?t=n.rounding:ct(t,0,8)),ue(new n(r),e,t)};U.toString=U.valueOf=U.val=U.toJSON=U[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=be(e),r=e.constructor;return nr(e,t<=r.toExpNeg||t>=r.toExpPos)};function Ny(e,t){var r,n,i,a,o,u,c,s,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),he?ue(t,l):t;if(c=e.d,s=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=s.length):(n=s,i=o,u=c.length),o=Math.ceil(l/pe),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=s.length,u-a<0&&(a=u,n=s,s=c,c=n),r=0;a;)r=(c[--a]=c[a]+s[a]+r)/Se|0,c[a]%=Se;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return t.d=c,t.e=i,he?ue(t,l):t}function ct(e,t,r){if(e!==~~e||er)throw Error(er+e)}function at(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=c=0;ui[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,c,s,f,l,d,p,y,h,v,b,w,x,A,g,m,O,S,_=n.constructor,E=n.s==i.s?1:-1,$=n.d,T=i.d;if(!n.s)return new _(n);if(!i.s)throw Error(Ye+"Division by zero");for(c=n.e-i.e,O=T.length,g=$.length,p=new _(E),y=p.d=[],s=0;T[s]==($[s]||0);)++s;if(T[s]>($[s]||0)&&--c,a==null?w=a=_.precision:o?w=a+(be(n)-be(i))+1:w=a,w<0)return new _(0);if(w=w/pe+2|0,s=0,O==1)for(f=0,T=T[0],w++;(s1&&(T=e(T,f),$=e($,f),O=T.length,g=$.length),A=O,h=$.slice(0,O),v=h.length;v=Se/2&&++m;do f=0,u=t(T,h,O,v),u<0?(b=h[0],O!=v&&(b=b*Se+(h[1]||0)),f=b/m|0,f>1?(f>=Se&&(f=Se-1),l=e(T,f),d=l.length,v=h.length,u=t(l,h,d,v),u==1&&(f--,r(l,O16)throw Error(bs+be(e));if(!e.s)return new f(Ue);for(t==null?(he=!1,u=l):u=t,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(Kt(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new f(Ue),f.precision=u;;){if(i=ue(i.times(e),u),r=r.times(++c),o=a.plus(bt(i,r,u)),at(o.d).slice(0,u)===at(a.d).slice(0,u)){for(;s--;)a=ue(a.times(a),u);return f.precision=l,t==null?(he=!0,ue(a,l)):a}a=o}}function be(e){for(var t=e.e*pe,r=e.d[0];r>=10;r/=10)t++;return t}function Uo(e,t,r){if(t>e.LN10.sd())throw he=!0,r&&(e.precision=r),Error(Ye+"LN10 precision limit exceeded");return ue(new e(e.LN10),t)}function Et(e){for(var t="";e--;)t+="0";return t}function Dn(e,t){var r,n,i,a,o,u,c,s,f,l=1,d=10,p=e,y=p.d,h=p.constructor,v=h.precision;if(p.s<1)throw Error(Ye+(p.s?"NaN":"-Infinity"));if(p.eq(Ue))return new h(0);if(t==null?(he=!1,s=v):s=t,p.eq(10))return t==null&&(he=!0),Uo(h,s);if(s+=d,h.precision=s,r=at(y),n=r.charAt(0),a=be(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=at(p.d),n=r.charAt(0),l++;a=be(p),n>1?(p=new h("0."+r),a++):p=new h(n+"."+r.slice(1))}else return c=Uo(h,s+2,v).times(a+""),p=Dn(new h(n+"."+r.slice(1)),s-d).plus(c),h.precision=v,t==null?(he=!0,ue(p,v)):p;for(u=o=p=bt(p.minus(Ue),p.plus(Ue),s),f=ue(p.times(p),s),i=3;;){if(o=ue(o.times(f),s),c=u.plus(bt(o,new h(i),s)),at(c.d).slice(0,s)===at(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Uo(h,s+2,v).times(a+""))),u=bt(u,new h(l),s),h.precision=v,t==null?(he=!0,ue(u,v)):u;u=c,i+=2}}function Gf(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=nn(r/pe),e.d=[],n=(r+1)%pe,r<0&&(n+=pe),nta||e.e<-ta))throw Error(bs+r)}else e.s=0,e.e=0,e.d=[0];return e}function ue(e,t,r){var n,i,a,o,u,c,s,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=pe,i=t,s=l[f=0];else{if(f=Math.ceil((n+1)/pe),a=l.length,f>=a)return e;for(s=a=l[f],o=1;a>=10;a/=10)o++;n%=pe,i=n-pe+o}if(r!==void 0&&(a=Kt(10,o-i-1),u=s/a%10|0,c=t<0||l[f+1]!==void 0||s%a,c=r<4?(u||c)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?s/Kt(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return c?(a=be(e),l.length=1,t=t-a-1,l[0]=Kt(10,(pe-t%pe)%pe),e.e=nn(-t/pe)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Kt(10,pe-n),l[f]=i>0?(s/Kt(10,o-i)%Kt(10,i)|0)*a:0),c)for(;;)if(f==0){(l[0]+=a)==Se&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=Se)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(he&&(e.e>ta||e.e<-ta))throw Error(bs+be(e));return e}function Ry(e,t){var r,n,i,a,o,u,c,s,f,l,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),he?ue(t,p):t;if(c=e.d,l=t.d,n=t.e,s=e.e,c=c.slice(),o=s-n,o){for(f=o<0,f?(r=c,o=-o,u=l.length):(r=l,n=s,u=c.length),i=Math.max(Math.ceil(p/pe),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=l.length,f=i0;--i)c[u++]=0;for(i=l.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Et(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Et(-i-1)+a,r&&(n=r-o)>0&&(a+=Et(n))):i>=o?(a+=Et(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Et(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Et(n))),e.s<0?"-"+a:a}function Kf(e,t){if(e.length>t)return e.length=t,!0}function Ly(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(er+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Gf(o,a.toString())}else if(typeof a!="string")throw Error(er+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,iI.test(a))Gf(o,a);else throw Error(er+a)}if(i.prototype=U,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Ly,i.config=i.set=aI,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(er+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(er+r+": "+n);return this}var xs=Ly(nI);Ue=new xs(1);const oe=xs;function oI(e){return lI(e)||sI(e)||cI(e)||uI()}function uI(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cI(e,t){if(e){if(typeof e=="string")return Cu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cu(e,t)}}function sI(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function lI(e){if(Array.isArray(e))return Cu(e)}function Cu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,Xf(function(){for(var u=arguments.length,c=new Array(u),s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function SI(e){if(Array.isArray(e))return e}function Uy(e){var t=Rn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function qy(e,t,r){if(e.lte(0))return new oe(0);var n=co.getDigitCount(e.toNumber()),i=new oe(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new oe(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=u.mul(i);return t?c:new oe(Math.ceil(c))}function _I(e,t,r){var n=1,i=new oe(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new oe(10).pow(co.getDigitCount(e)-1),i=new oe(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new oe(Math.floor(e)))}else e===0?i=new oe(Math.floor((t-1)/2)):r||(i=new oe(Math.floor(e)));var o=Math.floor((t-1)/2),u=hI(pI(function(c){return i.add(new oe(c-o).mul(n)).toNumber()}),Iu);return u(0,t)}function Hy(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new oe(0),tickMin:new oe(0),tickMax:new oe(0)};var a=qy(new oe(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new oe(0):(o=new oe(e).add(t).div(2),o=o.sub(new oe(o).mod(a)));var u=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new oe(t).sub(o).div(a).toNumber()),s=u+c+1;return s>r?Hy(e,t,r,n,i+1):(s0?c+(r-s):c,u=t>0?u:u+(r-s)),{step:a,tickMin:o.sub(new oe(u).mul(a)),tickMax:o.add(new oe(c).mul(a))})}function $I(e){var t=Rn(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=Uy([r,n]),c=Rn(u,2),s=c[0],f=c[1];if(s===-1/0||f===1/0){var l=f===1/0?[s].concat(Nu(Iu(0,i-1).map(function(){return 1/0}))):[].concat(Nu(Iu(0,i-1).map(function(){return-1/0})),[f]);return r>n?ku(l):l}if(s===f)return _I(s,i,a);var d=Hy(s,f,o,a),p=d.step,y=d.tickMin,h=d.tickMax,v=co.rangeStep(y,h.add(new oe(.1).mul(p)),p);return r>n?ku(v):v}function TI(e,t){var r=Rn(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Uy([n,i]),u=Rn(o,2),c=u[0],s=u[1];if(c===-1/0||s===1/0)return[n,i];if(c===s)return[c];var f=Math.max(t,2),l=qy(new oe(s).sub(c).div(f-1),a,0),d=[].concat(Nu(co.rangeStep(new oe(c),new oe(s).sub(new oe(.99).mul(l)),l)),[s]);return n>i?ku(d):d}var EI=Wy($I),jI=Wy(TI),MI="Invariant failed";function ir(e,t){throw new Error(MI)}var CI=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function FI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WI(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,s=0;s0?i[s-1].coordinate:i[u-1].coordinate,l=i[s].coordinate,d=s>=u-1?i[0].coordinate:i[s+1].coordinate,p=void 0;if(Ie(l-f)!==Ie(d-l)){var y=[];if(Ie(d-l)===Ie(c[1]-c[0])){p=d;var h=l+c[1]-c[0];y[0]=Math.min(h,(h+f)/2),y[1]=Math.max(h,(h+f)/2)}else{p=f;var v=d+c[1]-c[0];y[0]=Math.min(l,(v+l)/2),y[1]=Math.max(l,(v+l)/2)}var b=[Math.min(l,(p+l)/2),Math.max(l,(p+l)/2)];if(t>b[0]&&t<=b[1]||t>=y[0]&&t<=y[1]){o=i[s].index;break}}else{var w=Math.min(f,d),x=Math.max(f,d);if(t>(w+l)/2&&t<=(x+l)/2){o=i[s].index;break}}}else for(var A=0;A0&&A(n[A].coordinate+n[A-1].coordinate)/2&&t<=(n[A].coordinate+n[A+1].coordinate)/2||A===u-1&&t>(n[A].coordinate+n[A-1].coordinate)/2){o=n[A].index;break}return o},ws=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?ve(ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,u=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:u;break;default:c=u;break}return c},ik=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),c=0,s=u.length;c=0});if(b&&b.length){var w=b[0].type.defaultProps,x=w!==void 0?ve(ve({},w),b[0].props):b[0].props,A=x.barSize,g=x[v];o[g]||(o[g]=[]);var m=Q(A)?r:A;o[g].push({item:b[0],stackList:b.slice(1),barSize:Q(m)?void 0:ke(m,n,0)})}}return o},ak=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,u=t.maxBarSize,c=o.length;if(c<1)return null;var s=ke(r,i,0,!0),f,l=[];if(o[0].barSize===+o[0].barSize){var d=!1,p=i/c,y=o.reduce(function(A,g){return A+g.barSize||0},0);y+=(c-1)*s,y>=i&&(y-=(c-1)*s,s=0),y>=i&&p>0&&(d=!0,p*=.9,y=c*p);var h=(i-y)/2>>0,v={offset:h-s,size:0};f=o.reduce(function(A,g){var m={item:g.item,position:{offset:v.offset+v.size+s,size:d?p:g.barSize}},O=[].concat(Zf(A),[m]);return v=O[O.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(S){O.push({item:S,position:v})}),O},l)}else{var b=ke(n,i,0,!0);i-2*b-(c-1)*s<=0&&(s=0);var w=(i-2*b-(c-1)*s)/c;w>1&&(w>>=0);var x=u===+u?Math.min(w,u):w;f=o.reduce(function(A,g,m){var O=[].concat(Zf(A),[{item:g.item,position:{offset:b+(w+s)*m+(w-x)/2,size:x}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(S){O.push({item:S,position:O[O.length-1].position})}),O},l)}return f},ok=function(t,r,n,i){var a=n.children,o=n.width,u=n.margin,c=o-(u.left||0)-(u.right||0),s=Vy({children:a,legendWidth:c});if(s){var f=i||{},l=f.width,d=f.height,p=s.align,y=s.verticalAlign,h=s.layout;if((h==="vertical"||h==="horizontal"&&y==="middle")&&p!=="center"&&R(t[p]))return ve(ve({},t),{},Or({},p,t[p]+(l||0)));if((h==="horizontal"||h==="vertical"&&p==="center")&&y!=="middle"&&R(t[y]))return ve(ve({},t),{},Or({},y,t[y]+(d||0)))}return t},uk=function(t,r,n){return Q(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Yy=function(t,r,n,i,a){var o=r.props.children,u=Ve(o,so).filter(function(s){return uk(i,a,s.props.direction)});if(u&&u.length){var c=u.map(function(s){return s.props.dataKey});return t.reduce(function(s,f){var l=Me(f,n);if(Q(l))return s;var d=Array.isArray(l)?[ao(l),io(l)]:[l,l],p=c.reduce(function(y,h){var v=Me(f,h,0),b=d[0]-Math.abs(Array.isArray(v)?v[0]:v),w=d[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(b,y[0]),Math.max(w,y[1])]},[1/0,-1/0]);return[Math.min(p[0],s[0]),Math.max(p[1],s[1])]},[1/0,-1/0])}return null},ck=function(t,r,n,i,a){var o=r.map(function(u){return Yy(t,u,n,a,i)}).filter(function(u){return!Q(u)});return o&&o.length?o.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]):null},Zy=function(t,r,n,i,a){var o=r.map(function(c){var s=c.props.dataKey;return n==="number"&&s&&Yy(t,c,s,i)||xn(t,s,n,a)});if(n==="number")return o.reduce(function(c,s){return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]);var u={};return o.reduce(function(c,s){for(var f=0,l=s.length;f=2?Ie(u[0]-u[1])*2*s:s,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(l){var d=a?a.indexOf(l):l;return{coordinate:i(d)+s,value:l,offset:s}});return f.filter(function(l){return!ui(l.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(l,d){return{coordinate:i(l)+s,value:l,index:d,offset:s}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(l){return{coordinate:i(l)+s,value:l,offset:s}}):i.domain().map(function(l,d){return{coordinate:i(l)+s,value:a?a[l]:l,index:d,offset:s}})},qo=new WeakMap,Pi=function(t,r){if(typeof r!="function")return t;qo.has(t)||qo.set(t,new WeakMap);var n=qo.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},ev=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,u=t.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:Mn(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:Zi(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:bn(),realScaleType:"point"}:a==="category"?{scale:Mn(),realScaleType:"band"}:{scale:Zi(),realScaleType:"linear"};if(oi(i)){var c="scale".concat(qa(i));return{scale:(Hf[c]||bn)(),realScaleType:Hf[c]?c:"point"}}return V(i)?{scale:i}:{scale:bn(),realScaleType:"point"}},Qf=1e-4,tv=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-Qf,o=Math.max(i[0],i[1])+Qf,u=t(r[0]),c=t(r[n-1]);(uo||co)&&t.domain([r[0],r[n-1]])}},sk=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+c,a=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+c,o=t[u][n][1])}},dk=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+u,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},pk={sign:fk,expand:Iw,none:Ar,silhouette:kw,wiggle:Nw,positive:dk},hk=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=pk[n],o=Cw().keys(i).value(function(u,c){return+Me(u,c,0)}).order(su).offset(a);return o(t)},yk=function(t,r,n,i,a,o){if(!t)return null;var u=o?r.reverse():r,c={},s=u.reduce(function(l,d){var p,y=(p=d.type)!==null&&p!==void 0&&p.defaultProps?ve(ve({},d.type.defaultProps),d.props):d.props,h=y.stackId,v=y.hide;if(v)return l;var b=y[n],w=l[b]||{hasStack:!1,stackGroups:{}};if(Ae(h)){var x=w.stackGroups[h]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(d),w.hasStack=!0,w.stackGroups[h]=x}else w.stackGroups[ci("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[d]};return ve(ve({},l),{},Or({},b,w))},c),f={};return Object.keys(s).reduce(function(l,d){var p=s[d];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(h,v){var b=p.stackGroups[v];return ve(ve({},h),{},Or({},v,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:hk(t,b.items,a)}))},y)}return ve(ve({},l),{},Or({},d,p))},f)},rv=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var s=t.domain();if(!s.length)return null;var f=EI(s,a,u);return t.domain([ao(f),io(f)]),{niceTicks:f}}if(a&&i==="number"){var l=t.domain(),d=jI(l,a,u);return{niceTicks:d}}return null},ed=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var c=Me(o,r.dataKey,r.domain[u]);return Q(c)?null:r.scale(c)-a/2+i},vk=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},gk=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ve(ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ae(a)){var o=r[a];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},mk=function(t){return t.reduce(function(r,n){return[ao(n.concat([r[0]]).filter(R)),io(n.concat([r[1]]).filter(R))]},[1/0,-1/0])},nv=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],u=o.stackedData,c=u.reduce(function(s,f){var l=mk(f.slice(r,n+1));return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},td=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,rd=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Bu=function(t,r,n){if(V(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(R(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(td.test(t[0])){var a=+td.exec(t[0])[1];i[0]=r[0]-a}else V(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(R(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(rd.test(t[1])){var o=+rd.exec(t[1])[1];i[1]=r[1]+o}else V(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},ia=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Xc(r,function(l){return l.coordinate}),o=1/0,u=1,c=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},$k=function(t,r,n,i,a){var o=t.width,u=t.height,c=t.startAngle,s=t.endAngle,f=ke(t.cx,o,o/2),l=ke(t.cy,u,u/2),d=ov(o,u,n),p=ke(t.innerRadius,d,0),y=ke(t.outerRadius,d,d*.8),h=Object.keys(r);return h.reduce(function(v,b){var w=r[b],x=w.domain,A=w.reversed,g;if(Q(w.range))i==="angleAxis"?g=[c,s]:i==="radiusAxis"&&(g=[p,y]),A&&(g=[g[1],g[0]]);else{g=w.range;var m=g,O=wk(m,2);c=O[0],s=O[1]}var S=ev(w,a),_=S.realScaleType,E=S.scale;E.domain(x).range(g),tv(E);var $=rv(E,pt(pt({},w),{},{realScaleType:_})),T=pt(pt(pt({},w),$),{},{range:g,radius:y,realScaleType:_,scale:E,cx:f,cy:l,innerRadius:p,outerRadius:y,startAngle:c,endAngle:s});return pt(pt({},v),{},av({},b,T))},{})},Tk=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},Ek=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,u=Tk({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var c=(n-a)/u,s=Math.acos(c);return i>o&&(s=2*Math.PI-s),{radius:u,angle:_k(s),angleInRadian:s}},jk=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},Mk=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return t+u*360},od=function(t,r){var n=t.x,i=t.y,a=Ek({x:n,y:i},r),o=a.radius,u=a.angle,c=r.innerRadius,s=r.outerRadius;if(os)return!1;if(o===0)return!0;var f=jk(r),l=f.startAngle,d=f.endAngle,p=u,y;if(l<=d){for(;p>d;)p-=360;for(;p=l&&p<=d}else{for(;p>l;)p-=360;for(;p=d&&p<=l}return y?pt(pt({},r),{},{radius:o,angle:Mk(p,r)}):null},uv=function(t){return!L.isValidElement(t)&&!V(t)&&typeof t!="boolean"?t.className:""};function Wn(e){"@babel/helpers - typeof";return Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(e)}var Ck=["offset"];function Ik(e){return Rk(e)||Dk(e)||Nk(e)||kk()}function kk(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nk(e,t){if(e){if(typeof e=="string")return Fu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fu(e,t)}}function Dk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rk(e){if(Array.isArray(e))return Fu(e)}function Fu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bk(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ud(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t=0?1:-1,x,A;i==="insideStart"?(x=p+w*o,A=h):i==="insideEnd"?(x=y-w*o,A=!h):i==="end"&&(x=y+w*o,A=h),A=b<=0?A:!A;var g=le(s,f,v,x),m=le(s,f,v,x+(A?1:-1)*359),O="M".concat(g.x,",").concat(g.y,` - A`).concat(v,",").concat(v,",0,1,").concat(A?0:1,`, - `).concat(m.x,",").concat(m.y),S=Q(t.id)?ci("recharts-radial-line-"):t.id;return P.createElement("text",zn({},n,{dominantBaseline:"central",className:J("recharts-radial-bar-label",u)}),P.createElement("defs",null,P.createElement("path",{id:S,d:O})),P.createElement("textPath",{xlinkHref:"#".concat(S)},r))},Gk=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,u=a.cy,c=a.innerRadius,s=a.outerRadius,f=a.startAngle,l=a.endAngle,d=(f+l)/2;if(i==="outside"){var p=le(o,u,s+n,d),y=p.x,h=p.y;return{x:y,y:h,textAnchor:y>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var v=(c+s)/2,b=le(o,u,v,d),w=b.x,x=b.y;return{x:w,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Kk=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,u=o.x,c=o.y,s=o.width,f=o.height,l=f>=0?1:-1,d=l*i,p=l>0?"end":"start",y=l>0?"start":"end",h=s>=0?1:-1,v=h*i,b=h>0?"end":"start",w=h>0?"start":"end";if(a==="top"){var x={x:u+s/2,y:c-l*i,textAnchor:"middle",verticalAnchor:p};return Oe(Oe({},x),n?{height:Math.max(c-n.y,0),width:s}:{})}if(a==="bottom"){var A={x:u+s/2,y:c+f+d,textAnchor:"middle",verticalAnchor:y};return Oe(Oe({},A),n?{height:Math.max(n.y+n.height-(c+f),0),width:s}:{})}if(a==="left"){var g={x:u-v,y:c+f/2,textAnchor:b,verticalAnchor:"middle"};return Oe(Oe({},g),n?{width:Math.max(g.x-n.x,0),height:f}:{})}if(a==="right"){var m={x:u+s+v,y:c+f/2,textAnchor:w,verticalAnchor:"middle"};return Oe(Oe({},m),n?{width:Math.max(n.x+n.width-m.x,0),height:f}:{})}var O=n?{width:s,height:f}:{};return a==="insideLeft"?Oe({x:u+v,y:c+f/2,textAnchor:w,verticalAnchor:"middle"},O):a==="insideRight"?Oe({x:u+s-v,y:c+f/2,textAnchor:b,verticalAnchor:"middle"},O):a==="insideTop"?Oe({x:u+s/2,y:c+d,textAnchor:"middle",verticalAnchor:y},O):a==="insideBottom"?Oe({x:u+s/2,y:c+f-d,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?Oe({x:u+v,y:c+d,textAnchor:w,verticalAnchor:y},O):a==="insideTopRight"?Oe({x:u+s-v,y:c+d,textAnchor:b,verticalAnchor:y},O):a==="insideBottomLeft"?Oe({x:u+v,y:c+f-d,textAnchor:w,verticalAnchor:p},O):a==="insideBottomRight"?Oe({x:u+s-v,y:c+f-d,textAnchor:b,verticalAnchor:p},O):Xr(a)&&(R(a.x)||Vt(a.x))&&(R(a.y)||Vt(a.y))?Oe({x:u+ke(a.x,s),y:c+ke(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):Oe({x:u+s/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Xk=function(t){return"cx"in t&&R(t.cx)};function _e(e){var t=e.offset,r=t===void 0?5:t,n=Lk(e,Ck),i=Oe({offset:r},n),a=i.viewBox,o=i.position,u=i.value,c=i.children,s=i.content,f=i.className,l=f===void 0?"":f,d=i.textBreakAll;if(!a||Q(u)&&Q(c)&&!L.isValidElement(s)&&!V(s))return null;if(L.isValidElement(s))return L.cloneElement(s,i);var p;if(V(s)){if(p=L.createElement(s,i),L.isValidElement(p))return p}else p=Uk(i);var y=Xk(a),h=X(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Hk(i,p,h);var v=y?Gk(i):Kk(i);return P.createElement(rr,zn({className:J("recharts-label",l)},h,v,{breakAll:d}),p)}_e.displayName="Label";var cv=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,u=t.r,c=t.radius,s=t.innerRadius,f=t.outerRadius,l=t.x,d=t.y,p=t.top,y=t.left,h=t.width,v=t.height,b=t.clockWise,w=t.labelViewBox;if(w)return w;if(R(h)&&R(v)){if(R(l)&&R(d))return{x:l,y:d,width:h,height:v};if(R(p)&&R(y))return{x:p,y,width:h,height:v}}return R(l)&&R(d)?{x:l,y:d,width:0,height:0}:R(r)&&R(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:s||0,outerRadius:f||c||u||0,clockWise:b}:t.viewBox?t.viewBox:{}},Vk=function(t,r){return t?t===!0?P.createElement(_e,{key:"label-implicit",viewBox:r}):Ae(t)?P.createElement(_e,{key:"label-implicit",viewBox:r,value:t}):L.isValidElement(t)?t.type===_e?L.cloneElement(t,{key:"label-implicit",viewBox:r}):P.createElement(_e,{key:"label-implicit",content:t,viewBox:r}):V(t)?P.createElement(_e,{key:"label-implicit",content:t,viewBox:r}):Xr(t)?P.createElement(_e,zn({viewBox:r},t,{key:"label-implicit"})):null:null},Yk=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=cv(t),o=Ve(i,_e).map(function(c,s){return L.cloneElement(c,{viewBox:r||a,key:"label-".concat(s)})});if(!n)return o;var u=Vk(t.label,r||a);return[u].concat(Ik(o))};_e.parseViewBox=cv;_e.renderCallByParent=Yk;function Zk(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Jk=Zk;const Qk=ie(Jk);function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}var e2=["valueAccessor"],t2=["data","dataKey","clockWise","id","textBreakAll"];function r2(e){return o2(e)||a2(e)||i2(e)||n2()}function n2(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i2(e,t){if(e){if(typeof e=="string")return Wu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wu(e,t)}}function a2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o2(e){if(Array.isArray(e))return Wu(e)}function Wu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l2(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var f2=function(t){return Array.isArray(t.value)?Qk(t.value):t.value};function It(e){var t=e.valueAccessor,r=t===void 0?f2:t,n=ld(e,e2),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,c=n.textBreakAll,s=ld(n,t2);return!i||!i.length?null:P.createElement(ne,{className:"recharts-label-list"},i.map(function(f,l){var d=Q(a)?r(f,l):Me(f&&f.payload,a),p=Q(u)?{}:{id:"".concat(u,"-").concat(l)};return P.createElement(_e,oa({},X(f,!0),s,p,{parentViewBox:f.parentViewBox,value:d,textBreakAll:c,viewBox:_e.parseViewBox(Q(o)?f:sd(sd({},f),{},{clockWise:o})),key:"label-".concat(l),index:l}))}))}It.displayName="LabelList";function d2(e,t){return e?e===!0?P.createElement(It,{key:"labelList-implicit",data:t}):P.isValidElement(e)||V(e)?P.createElement(It,{key:"labelList-implicit",data:t,content:e}):Xr(e)?P.createElement(It,oa({data:t},e,{key:"labelList-implicit"})):null:null}function p2(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ve(n,It).map(function(o,u){return L.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=d2(e.label,t);return[a].concat(r2(i))}It.renderCallByParent=p2;function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>s),`, - `).concat(l.x,",").concat(l.y,` - `);if(i>0){var p=le(r,n,i,o),y=le(r,n,i,s);d+="L ".concat(y.x,",").concat(y.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(c)>180),",").concat(+(o<=s),`, - `).concat(p.x,",").concat(p.y," Z")}else d+="L ".concat(r,",").concat(n," Z");return d},m2=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,c=t.cornerIsExternal,s=t.startAngle,f=t.endAngle,l=Ie(f-s),d=Si({cx:r,cy:n,radius:a,angle:s,sign:l,cornerRadius:o,cornerIsExternal:c}),p=d.circleTangency,y=d.lineTangency,h=d.theta,v=Si({cx:r,cy:n,radius:a,angle:f,sign:-l,cornerRadius:o,cornerIsExternal:c}),b=v.circleTangency,w=v.lineTangency,x=v.theta,A=c?Math.abs(s-f):Math.abs(s-f)-h-x;if(A<0)return u?"M ".concat(y.x,",").concat(y.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):sv({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:s,endAngle:f});var g="M ".concat(y.x,",").concat(y.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(p.x,",").concat(p.y,` - A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(l<0),",").concat(b.x,",").concat(b.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(w.x,",").concat(w.y,` - `);if(i>0){var m=Si({cx:r,cy:n,radius:i,angle:s,sign:l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),O=m.circleTangency,S=m.lineTangency,_=m.theta,E=Si({cx:r,cy:n,radius:i,angle:f,sign:-l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),$=E.circleTangency,T=E.lineTangency,C=E.theta,I=c?Math.abs(s-f):Math.abs(s-f)-_-C;if(I<0&&o===0)return"".concat(g,"L").concat(r,",").concat(n,"Z");g+="L".concat(T.x,",").concat(T.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat($.x,",").concat($.y,` - A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(l>0),",").concat(O.x,",").concat(O.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(S.x,",").concat(S.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},b2={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},lv=function(t){var r=dd(dd({},b2),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,c=r.forceCornerRadius,s=r.cornerIsExternal,f=r.startAngle,l=r.endAngle,d=r.className;if(o0&&Math.abs(f-l)<360?v=m2({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(h,y/2),forceCornerRadius:c,cornerIsExternal:s,startAngle:f,endAngle:l}):v=sv({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:l}),P.createElement("path",zu({},X(r,!0),{className:p,d:v,role:"img"}))};function Hn(e){"@babel/helpers - typeof";return Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(e)}function Uu(){return Uu=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function L2(e,t){return sr(e.getTime(),t.getTime())}function B2(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function F2(e,t){return e===t}function xd(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,u,c=0;(o=a.next())&&!o.done;){for(var s=t.entries(),f=!1,l=0;(u=s.next())&&!u.done;){if(i[l]){l++;continue}var d=o.value,p=u.value;if(r.equals(d[0],p[0],c,l,e,t,r)&&r.equals(d[1],p[1],d[0],p[0],e,t,r)){f=i[l]=!0;break}l++}if(!f)return!1;c++}return!0}var W2=sr;function z2(e,t,r){var n=bd(e),i=n.length;if(bd(t).length!==i)return!1;for(;i-- >0;)if(!hv(e,t,r,n[i]))return!1;return!0}function yn(e,t,r){var n=gd(e),i=n.length;if(gd(t).length!==i)return!1;for(var a,o,u;i-- >0;)if(a=n[i],!hv(e,t,r,a)||(o=md(e,a),u=md(t,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function U2(e,t){return sr(e.valueOf(),t.valueOf())}function q2(e,t){return e.source===t.source&&e.flags===t.flags}function wd(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,u;(o=a.next())&&!o.done;){for(var c=t.values(),s=!1,f=0;(u=c.next())&&!u.done;){if(!i[f]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){s=i[f]=!0;break}f++}if(!s)return!1}return!0}function H2(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function G2(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function hv(e,t,r,n){return(n===D2||n===N2||n===k2)&&(e.$$typeof||t.$$typeof)?!0:I2(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var K2="[object Arguments]",X2="[object Boolean]",V2="[object Date]",Y2="[object Error]",Z2="[object Map]",J2="[object Number]",Q2="[object Object]",eN="[object RegExp]",tN="[object Set]",rN="[object String]",nN="[object URL]",iN=Array.isArray,Od=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Ad=Object.assign,aN=Object.prototype.toString.call.bind(Object.prototype.toString);function oN(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,u=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,s=e.areRegExpsEqual,f=e.areSetsEqual,l=e.areTypedArraysEqual,d=e.areUrlsEqual;return function(y,h,v){if(y===h)return!0;if(y==null||h==null)return!1;var b=typeof y;if(b!==typeof h)return!1;if(b!=="object")return b==="number"?o(y,h,v):b==="function"?i(y,h,v):!1;var w=y.constructor;if(w!==h.constructor)return!1;if(w===Object)return u(y,h,v);if(iN(y))return t(y,h,v);if(Od!=null&&Od(y))return l(y,h,v);if(w===Date)return r(y,h,v);if(w===RegExp)return s(y,h,v);if(w===Map)return a(y,h,v);if(w===Set)return f(y,h,v);var x=aN(y);return x===V2?r(y,h,v):x===eN?s(y,h,v):x===Z2?a(y,h,v):x===tN?f(y,h,v):x===Q2?typeof y.then!="function"&&typeof h.then!="function"&&u(y,h,v):x===nN?d(y,h,v):x===Y2?n(y,h,v):x===K2?u(y,h,v):x===X2||x===J2||x===rN?c(y,h,v):!1}}function uN(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?yn:R2,areDatesEqual:L2,areErrorsEqual:B2,areFunctionsEqual:F2,areMapsEqual:n?vd(xd,yn):xd,areNumbersEqual:W2,areObjectsEqual:n?yn:z2,arePrimitiveWrappersEqual:U2,areRegExpsEqual:q2,areSetsEqual:n?vd(wd,yn):wd,areTypedArraysEqual:n?yn:H2,areUrlsEqual:G2};if(r&&(i=Ad({},i,r(i))),t){var a=$i(i.areArraysEqual),o=$i(i.areMapsEqual),u=$i(i.areObjectsEqual),c=$i(i.areSetsEqual);i=Ad({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:u,areSetsEqual:c})}return i}function cN(e){return function(t,r,n,i,a,o,u){return e(t,r,u)}}function sN(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,s){var f=n(),l=f.cache,d=l===void 0?t?new WeakMap:void 0:l,p=f.meta;return r(c,s,{cache:d,equals:i,meta:p,strict:a})};if(t)return function(c,s){return r(c,s,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,s){return r(c,s,o)}}var lN=Rt();Rt({strict:!0});Rt({circular:!0});Rt({circular:!0,strict:!0});Rt({createInternalComparator:function(){return sr}});Rt({strict:!0,createInternalComparator:function(){return sr}});Rt({circular:!0,createInternalComparator:function(){return sr}});Rt({circular:!0,createInternalComparator:function(){return sr},strict:!0});function Rt(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,u=uN(e),c=oN(u),s=n?n(c):cN(c);return sN({circular:r,comparator:c,createState:i,equals:s,strict:o})}function fN(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Pd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):fN(i)};requestAnimationFrame(n)}function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function dN(e){return vN(e)||yN(e)||hN(e)||pN()}function pN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hN(e,t){if(e){if(typeof e=="string")return Sd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sd(e,t)}}function Sd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},h=function(b){for(var w=b>1?1:b,x=w,A=0;A<8;++A){var g=l(x)-w,m=p(x);if(Math.abs(g-w)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?17:o,c=function(f,l,d){var p=-(f-l)*n,y=d*a,h=d+(p-y)*u/1e3,v=d*u/1e3+f;return Math.abs(v-l)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KN(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function Ho(e){return ZN(e)||YN(e)||VN(e)||XN()}function XN(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VN(e,t){if(e){if(typeof e=="string")return Yu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yu(e,t)}}function YN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZN(e){if(Array.isArray(e))return Yu(e)}function Yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"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 sa(e){return sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sa(e)}var At=function(e){rD(r,e);var t=nD(r);function r(n,i){var a;JN(this,r),a=t.call(this,n,i);var o=a.props,u=o.isActive,c=o.attributeName,s=o.from,f=o.to,l=o.steps,d=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Qu(a)),a.changeStyle=a.changeStyle.bind(Qu(a)),!u||p<=0)return a.state={style:{}},typeof d=="function"&&(a.state={style:f}),Ju(a);if(l&&l.length)a.state={style:l[0].style};else if(s){if(typeof d=="function")return a.state={style:s},Ju(a);a.state={style:c?gn({},c,s):s}}else a.state={style:{}};return a}return eD(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,c=a.attributeName,s=a.shouldReAnimate,f=a.to,l=a.from,d=this.state.style;if(u){if(!o){var p={style:c?gn({},c,f):f};this.state&&d&&(c&&d[c]!==f||!c&&d!==f)&&this.setState(p);return}if(!(lN(i.to,f)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var h=y||s?l:i.to;if(this.state&&d){var v={style:c?gn({},c,h):h};(c&&d[c]!==h||!c&&d!==h)&&this.setState(v)}this.runAnimation(et(et({},this.props),{},{from:h,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,c=i.duration,s=i.easing,f=i.begin,l=i.onAnimationEnd,d=i.onAnimationStart,p=qN(o,u,IN(s),c,this.changeStyle),y=function(){a.stopJSAnimation=p()};this.manager.start([d,f,y,c,l])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,c=i.onAnimationStart,s=o[0],f=s.style,l=s.duration,d=l===void 0?0:l,p=function(h,v,b){if(b===0)return h;var w=v.duration,x=v.easing,A=x===void 0?"ease":x,g=v.style,m=v.properties,O=v.onAnimationEnd,S=b>0?o[b-1]:v,_=m||Object.keys(g);if(typeof A=="function"||A==="spring")return[].concat(Ho(h),[a.runJSAnimation.bind(a,{from:S.style,to:g,duration:w,easing:A}),w]);var E=Td(_,w,A),$=et(et(et({},S.style),g),{},{transition:E});return[].concat(Ho(h),[$,w,O]).filter(wN)};return this.manager.start([c].concat(Ho(o.reduce(p,[f,Math.max(d,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=gN());var a=i.begin,o=i.duration,u=i.attributeName,c=i.to,s=i.easing,f=i.onAnimationStart,l=i.onAnimationEnd,d=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof s=="function"||typeof p=="function"||s==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var h=u?gn({},u,c):c,v=Td(Object.keys(h),o,s);y.start([f,a,et(et({},h),{},{transition:v}),o,l])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=GN(i,HN),s=L.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!u||s===0||o<=0)return a;var l=function(p){var y=p.props,h=y.style,v=h===void 0?{}:h,b=y.className,w=L.cloneElement(p,et(et({},c),{},{style:et(et({},v),f),className:b}));return w};return s===1?l(L.Children.only(a)):P.createElement("div",null,L.Children.map(a,function(d){return l(d)}))}}]),r}(L.PureComponent);At.displayName="Animate";At.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};At.propTypes={from:re.oneOfType([re.object,re.string]),to:re.oneOfType([re.object,re.string]),attributeName:re.string,duration:re.number,begin:re.number,easing:re.oneOfType([re.string,re.func]),steps:re.arrayOf(re.shape({duration:re.number.isRequired,style:re.object.isRequired,easing:re.oneOfType([re.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),re.func]),properties:re.arrayOf("string"),onAnimationEnd:re.func})),children:re.oneOfType([re.node,re.func]),isActive:re.bool,canBegin:re.bool,onAnimationEnd:re.func,shouldReAnimate:re.bool,onAnimationStart:re.func,onAnimationReStart:re.func};function Xn(e){"@babel/helpers - typeof";return Xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(e)}function la(){return la=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,s=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var l=[0,0,0,0],d=0,p=4;do?o:a[d];f="M".concat(t,",").concat(r+u*l[0]),l[0]>0&&(f+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(s,",").concat(t+c*l[0],",").concat(r)),f+="L ".concat(t+n-c*l[1],",").concat(r),l[1]>0&&(f+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(s,`, - `).concat(t+n,",").concat(r+u*l[1])),f+="L ".concat(t+n,",").concat(r+i-u*l[2]),l[2]>0&&(f+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(s,`, - `).concat(t+n-c*l[2],",").concat(r+i)),f+="L ".concat(t+c*l[3],",").concat(r+i),l[3]>0&&(f+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(s,`, - `).concat(t,",").concat(r+i-u*l[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var y=Math.min(o,a);f="M ".concat(t,",").concat(r+u*y,` - A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+c*y,",").concat(r,` - L `).concat(t+n-c*y,",").concat(r,` - A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n,",").concat(r+u*y,` - L `).concat(t+n,",").concat(r+i-u*y,` - A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n-c*y,",").concat(r+i,` - L `).concat(t+c*y,",").concat(r+i,` - A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t,",").concat(r+i-u*y," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},pD=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,u=r.width,c=r.height;if(Math.abs(u)>0&&Math.abs(c)>0){var s=Math.min(a,a+u),f=Math.max(a,a+u),l=Math.min(o,o+c),d=Math.max(o,o+c);return n>=s&&n<=f&&i>=l&&i<=d}return!1},hD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Os=function(t){var r=Dd(Dd({},hD),t),n=L.useRef(),i=L.useState(-1),a=aD(i,2),o=a[0],u=a[1];L.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var A=n.current.getTotalLength();A&&u(A)}catch{}},[]);var c=r.x,s=r.y,f=r.width,l=r.height,d=r.radius,p=r.className,y=r.animationEasing,h=r.animationDuration,v=r.animationBegin,b=r.isAnimationActive,w=r.isUpdateAnimationActive;if(c!==+c||s!==+s||f!==+f||l!==+l||f===0||l===0)return null;var x=J("recharts-rectangle",p);return w?P.createElement(At,{canBegin:o>0,from:{width:f,height:l,x:c,y:s},to:{width:f,height:l,x:c,y:s},duration:h,animationEasing:y,isActive:w},function(A){var g=A.width,m=A.height,O=A.x,S=A.y;return P.createElement(At,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:h,isActive:b,easing:y},P.createElement("path",la({},X(r,!0),{className:x,d:Rd(O,S,g,m,d),ref:n})))}):P.createElement("path",la({},X(r,!0),{className:x,d:Rd(c,s,f,l,d)}))},yD=["points","className","baseLinePoints","connectNulls"];function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ld(e){return wD(e)||xD(e)||bD(e)||mD()}function mD(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bD(e,t){if(e){if(typeof e=="string")return ec(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ec(e,t)}}function xD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wD(e){if(Array.isArray(e))return ec(e)}function ec(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Bd(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Bd(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},On=function(t,r){var n=OD(t);r&&(n=[n.reduce(function(a,o){return[].concat(Ld(a),Ld(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,u,c){return"".concat(o).concat(c===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},AD=function(t,r,n){var i=On(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(On(r.reverse(),n).slice(1))},PD=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=vD(t,yD);if(!r||!r.length)return null;var u=J("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",s=AD(r,i,a);return P.createElement("g",{className:u},P.createElement("path",yr({},X(o,!0),{fill:s.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:s})),c?P.createElement("path",yr({},X(o,!0),{fill:"none",d:On(r,a)})):null,c?P.createElement("path",yr({},X(o,!0),{fill:"none",d:On(i,a)})):null)}var f=On(r,a);return P.createElement("path",yr({},X(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:u,d:f}))};function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var CD=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},ID=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,u=o===void 0?0:o,c=t.left,s=c===void 0?0:c,f=t.width,l=f===void 0?0:f,d=t.height,p=d===void 0?0:d,y=t.className,h=jD(t,SD),v=_D({x:n,y:a,top:u,left:s,width:l,height:p},h);return!R(n)||!R(a)||!R(l)||!R(p)||!R(u)||!R(s)?null:P.createElement("path",rc({},X(v,!0),{className:J("recharts-cross",y),d:CD(n,a,l,p,u,s)}))},kD=no,ND=Cy,DD=lt;function RD(e,t){return e&&e.length?kD(e,DD(t),ND):void 0}var LD=RD;const BD=ie(LD);var FD=no,WD=lt,zD=Iy;function UD(e,t){return e&&e.length?FD(e,WD(t),zD):void 0}var qD=UD;const HD=ie(qD);var GD=["cx","cy","angle","ticks","axisLine"],KD=["ticks","tick","angle","tickFormatter","stroke"];function Ir(e){"@babel/helpers - typeof";return Ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(e)}function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ud(e,t){for(var r=0;rlR?o=i==="outer"?"start":"end":a<-1e-5?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,u=n.axisLine,c=n.axisLineType,s=qt(qt({},X(this.props,!1)),{},{fill:"none"},X(u,!1));if(c==="circle")return P.createElement(As,Xt({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:a,r:o}));var f=this.props.ticks,l=f.map(function(d){return le(i,a,o,d.coordinate)});return P.createElement(PD,Xt({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,u=i.tickLine,c=i.tickFormatter,s=i.stroke,f=X(this.props,!1),l=X(o,!1),d=qt(qt({},f),{},{fill:"none"},X(u,!1)),p=a.map(function(y,h){var v=n.getTickLineCoord(y),b=n.getTickTextAnchor(y),w=qt(qt(qt({textAnchor:b},f),{},{stroke:"none",fill:s},l),{},{index:h,payload:y,x:v.x2,y:v.y2});return P.createElement(ne,Xt({className:J("recharts-polar-angle-axis-tick",uv(o)),key:"tick-".concat(y.coordinate)},tr(n.props,y,h)),u&&P.createElement("line",Xt({className:"recharts-polar-angle-axis-tick-line"},d,v)),o&&t.renderTickItem(o,w,c?c(y.value,h):y.value))});return P.createElement(ne,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:P.createElement(ne,{className:J("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return P.isValidElement(n)?o=P.cloneElement(n,i):V(n)?o=n(i):o=P.createElement(rr,Xt({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(L.PureComponent);po(ho,"displayName","PolarAngleAxis");po(ho,"axisType","angleAxis");po(ho,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var fR=$h,dR=fR(Object.getPrototypeOf,Object),pR=dR,hR=Pt,yR=pR,vR=St,gR="[object Object]",mR=Function.prototype,bR=Object.prototype,Sv=mR.toString,xR=bR.hasOwnProperty,wR=Sv.call(Object);function OR(e){if(!vR(e)||hR(e)!=gR)return!1;var t=yR(e);if(t===null)return!0;var r=xR.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sv.call(r)==wR}var AR=OR;const PR=ie(AR);var SR=Pt,_R=St,$R="[object Boolean]";function TR(e){return e===!0||e===!1||_R(e)&&SR(e)==$R}var ER=TR;const jR=ie(ER);function Yn(e){"@babel/helpers - typeof";return Yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(e)}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:d,x:c,y:s},to:{upperWidth:f,lowerWidth:l,height:d,x:c,y:s},duration:h,animationEasing:y,isActive:b},function(x){var A=x.upperWidth,g=x.lowerWidth,m=x.height,O=x.x,S=x.y;return P.createElement(At,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:h,easing:y},P.createElement("path",pa({},X(r,!0),{className:w,d:Vd(O,S,A,g,m),ref:n})))}):P.createElement("g",null,P.createElement("path",pa({},X(r,!0),{className:w,d:Vd(c,s,f,l,d)})))},WR=["option","shapeType","propTransformer","activeClassName","isActive"];function Zn(e){"@babel/helpers - typeof";return Zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(e)}function zR(e,t){if(e==null)return{};var r=UR(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function UR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Yd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ha(e){for(var t=1;t0?qe(x,"paddingAngle",0):0;if(g){var O=Tt(g.endAngle-g.startAngle,x.endAngle-x.startAngle),S=ce(ce({},x),{},{startAngle:w+m,endAngle:w+O(h)+m});v.push(S),w=S.endAngle}else{var _=x.endAngle,E=x.startAngle,$=Tt(0,_-E),T=$(h),C=ce(ce({},x),{},{startAngle:w+m,endAngle:w+T+m});v.push(C),w=C.endAngle}}),P.createElement(ne,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!oo(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,u=i.className,c=i.label,s=i.cx,f=i.cy,l=i.innerRadius,d=i.outerRadius,p=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!R(s)||!R(f)||!R(l)||!R(d))return null;var h=J("recharts-pie",u);return P.createElement(ne,{tabIndex:this.props.rootTabIndex,className:h,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),_e.renderCallByParent(this.props,null,!1),(!p||y)&&It.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?w:w-1)*c,A=v-w*p-x,g=i.reduce(function(S,_){var E=Me(_,b,0);return S+(R(E)?E:0)},0),m;if(g>0){var O;m=i.map(function(S,_){var E=Me(S,b,0),$=Me(S,f,_),T=(R(E)?E:0)/g,C;_?C=O.endAngle+Ie(h)*c*(E!==0?1:0):C=o;var I=C+Ie(h)*((E!==0?p:0)+T*A),M=(C+I)/2,k=(y.innerRadius+y.outerRadius)/2,D=[{name:$,value:E,payload:S,dataKey:b,type:d}],B=le(y.cx,y.cy,k,M);return O=ce(ce(ce({percent:T,cornerRadius:a,name:$,tooltipPayload:D,midAngle:M,middleRadius:k,tooltipPosition:B},S),y),{},{value:Me(S,b),startAngle:C,endAngle:I,payload:S,paddingAngle:Ie(h)*c}),O})}return ce(ce({},y),{},{sectors:m,data:i})});var lL=Math.ceil,fL=Math.max;function dL(e,t,r,n){for(var i=-1,a=fL(lL((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var pL=dL,hL=Gh,yL=1/0,vL=17976931348623157e292;function gL(e){if(!e)return e===0?e:0;if(e=hL(e),e===yL||e===-1/0){var t=e<0?-1:1;return t*vL}return e===e?e:0}var Ev=gL,mL=pL,bL=Ya,Go=Ev;function xL(e){return function(t,r,n){return n&&typeof n!="number"&&bL(t,r,n)&&(r=n=void 0),t=Go(t),r===void 0?(r=t,t=0):r=Go(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),We(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o==null||o({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),We(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),We(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),We(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),We(n,"handleSlideDragStart",function(i){var a=ip(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return kL(t,e),jL(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,c=u.gap,s=u.data,f=s.length-1,l=Math.min(i,a),d=Math.max(i,a),p=t.getIndexInRange(o,l),y=t.getIndexInRange(o,d);return{startIndex:p-p%c,endIndex:y===f?f:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,c=Me(a[n],u,n);return V(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,c=this.props,s=c.x,f=c.width,l=c.travellerWidth,d=c.startIndex,p=c.endIndex,y=c.onChange,h=n.pageX-a;h>0?h=Math.min(h,s+f-l-u,s+f-l-o):h<0&&(h=Math.max(h,s-o,s-u));var v=this.getIndex({startX:o+h,endX:u+h});(v.startIndex!==d||v.endIndex!==p)&&y&&y(v),this.setState({startX:o+h,endX:u+h,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=ip(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,c=i.startX,s=this.state[o],f=this.props,l=f.x,d=f.width,p=f.travellerWidth,y=f.onChange,h=f.gap,v=f.data,b={startX:this.state.startX,endX:this.state.endX},w=n.pageX-a;w>0?w=Math.min(w,l+d-p-s):w<0&&(w=Math.max(w,l-s)),b[o]=s+w;var x=this.getIndex(b),A=x.startIndex,g=x.endIndex,m=function(){var S=v.length-1;return o==="startX"&&(u>c?A%h===0:g%h===0)||uc?g%h===0:A%h===0)||u>c&&g===S};this.setState(We(We({},o,s+w),"brushMoveStartX",n.pageX),function(){y&&m()&&y(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,c=o.startX,s=o.endX,f=this.state[i],l=u.indexOf(f);if(l!==-1){var d=l+n;if(!(d===-1||d>=u.length)){var p=u[d];i==="startX"&&p>=s||i==="endX"&&p<=c||this.setState(We({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.fill,s=n.stroke;return P.createElement("rect",{stroke:s,fill:c,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.data,s=n.children,f=n.padding,l=L.Children.only(s);return l?P.cloneElement(l,{x:i,y:a,width:o,height:u,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,c=this.props,s=c.y,f=c.travellerWidth,l=c.height,d=c.traveller,p=c.ariaLabel,y=c.data,h=c.startIndex,v=c.endIndex,b=Math.max(n,this.props.x),w=Ko(Ko({},X(this.props,!1)),{},{x:b,y:s,width:f,height:l}),x=p||"Min value: ".concat((a=y[h])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[v])===null||o===void 0?void 0:o.name);return P.createElement(ne,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),u.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(d,w))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,c=a.stroke,s=a.travellerWidth,f=Math.min(n,i)+s,l=Math.max(Math.abs(i-n)-s,0);return P.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:l,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,c=n.travellerWidth,s=n.stroke,f=this.state,l=f.startX,d=f.endX,p=5,y={pointerEvents:"none",fill:s};return P.createElement(ne,{className:"recharts-brush-texts"},P.createElement(rr,ga({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,d)-p,y:o+u/2},y),this.getTextOfTick(i)),P.createElement(rr,ga({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,d)+c+p,y:o+u/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,c=n.y,s=n.width,f=n.height,l=n.alwaysShowText,d=this.state,p=d.startX,y=d.endX,h=d.isTextActive,v=d.isSlideMoving,b=d.isTravellerMoving,w=d.isTravellerFocused;if(!i||!i.length||!R(u)||!R(c)||!R(s)||!R(f)||s<=0||f<=0)return null;var x=J("recharts-brush",a),A=P.Children.count(o)===1,g=TL("userSelect","none");return P.createElement(ne,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(h||v||b||w||l)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,c=n.stroke,s=Math.floor(a+u/2)-1;return P.createElement(P.Fragment,null,P.createElement("rect",{x:i,y:a,width:o,height:u,fill:c,stroke:"none"}),P.createElement("line",{x1:i+1,y1:s,x2:i+o-1,y2:s,fill:"none",stroke:"#fff"}),P.createElement("line",{x1:i+1,y1:s+2,x2:i+o-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return P.isValidElement(n)?a=P.cloneElement(n,i):V(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,c=n.travellerWidth,s=n.updateId,f=n.startIndex,l=n.endIndex;if(a!==i.prevData||s!==i.prevUpdateId)return Ko({prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o},a&&a.length?DL({data:a,width:o,x:u,travellerWidth:c,startIndex:f,endIndex:l}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([u,u+o-c]);var d=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var c=Math.floor((o+u)/2);n[c]>i?u=c:o=c}return i>=n[u]?u:o}}])}(L.PureComponent);We(Rr,"displayName","Brush");We(Rr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var RL=Kc;function LL(e,t){var r;return RL(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var BL=LL,FL=bh,WL=lt,zL=BL,UL=Be,qL=Ya;function HL(e,t,r){var n=UL(e)?FL:zL;return r&&qL(e,t,r)&&(t=void 0),n(e,WL(t))}var GL=HL;const KL=ie(GL);var ut=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},ap=Wh;function XL(e,t,r){t=="__proto__"&&ap?ap(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var VL=XL,YL=VL,ZL=Bh,JL=lt;function QL(e,t){var r={};return t=JL(t),ZL(e,function(n,i,a){YL(r,i,t(n,i,a))}),r}var eB=QL;const tB=ie(eB);function rB(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xB(e,t){var r=e.x,n=e.y,i=mB(e,hB),a="".concat(r),o=parseInt(a,10),u="".concat(n),c=parseInt(u,10),s="".concat(t.height||i.height),f=parseInt(s,10),l="".concat(t.width||i.width),d=parseInt(l,10);return vn(vn(vn(vn(vn({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:d,name:t.name,radius:t.radius})}function up(e){return P.createElement(_v,uc({shapeType:"rectangle",propTransformer:xB,activeClassName:"recharts-active-bar"},e))}var wB=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=typeof n=="number";return a?t(n,i):(a||ir(),r)}},OB=["value","background"],kv;function Lr(e){"@babel/helpers - typeof";return Lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}function AB(e,t){if(e==null)return{};var r=PB(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ba(){return ba=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(M)0&&Math.abs(I)0&&(C=Math.min((fe||0)-(I[ge-1]||0),C))}),Number.isFinite(C)){var M=C/T,k=h.layout==="vertical"?n.height:n.width;if(h.padding==="gap"&&(O=M*k/2),h.padding==="no-gap"){var D=ke(t.barCategoryGap,M*k),B=M*k/2;O=B-D-(B-D)/k*D}}}i==="xAxis"?S=[n.left+(x.left||0)+(O||0),n.left+n.width-(x.right||0)-(O||0)]:i==="yAxis"?S=c==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(O||0),n.top+n.height-(x.bottom||0)-(O||0)]:S=h.range,g&&(S=[S[1],S[0]]);var F=ev(h,a,d),q=F.scale,G=F.realScaleType;q.domain(b).range(S),tv(q);var z=rv(q,tt(tt({},h),{},{realScaleType:G}));i==="xAxis"?($=v==="top"&&!A||v==="bottom"&&A,_=n.left,E=l[m]-$*h.height):i==="yAxis"&&($=v==="left"&&!A||v==="right"&&A,_=l[m]-$*h.width,E=n.top);var K=tt(tt(tt({},h),z),{},{realScaleType:G,x:_,y:E,scale:q,width:i==="xAxis"?n.width:h.width,height:i==="yAxis"?n.height:h.height});return K.bandSize=ia(K,z),!h.hide&&i==="xAxis"?l[m]+=($?-1:1)*K.height:h.hide||(l[m]+=($?-1:1)*K.width),tt(tt({},p),{},go({},y,K))},{})},Lv=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},DB=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return Lv({x:r,y:n},{x:i,y:a})},Bv=function(){function e(t){CB(this,e),this.scale=t}return IB(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();go(Bv,"EPS",1e-4);var Ps=function(t){var r=Object.keys(t).reduce(function(n,i){return tt(tt({},n),{},go({},i,Bv.create(t[i])))},{});return tt(tt({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return tB(i,function(c,s){return r[s].apply(c,{bandAware:o,position:u})})},isInRange:function(i){return Iv(i,function(a,o){return r[o].isInRange(a)})}})};function RB(e){return(e%180+180)%180}var LB=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=RB(i),o=a*Math.PI/180,u=Math.atan(n/r),c=o>u&&o-1?i[a?t[o]:o]:void 0}}var UB=zB,qB=Ev;function HB(e){var t=qB(e),r=t%1;return t===t?r?t-r:t:0}var GB=HB,KB=Ih,XB=lt,VB=GB,YB=Math.max;function ZB(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:VB(r);return i<0&&(i=YB(n+i,0)),KB(e,XB(t),i)}var JB=ZB,QB=UB,eF=JB,tF=QB(eF),rF=tF;const nF=ie(rF);var iF=e0(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Ss=L.createContext(void 0),_s=L.createContext(void 0),Fv=L.createContext(void 0),Wv=L.createContext({}),zv=L.createContext(void 0),Uv=L.createContext(0),qv=L.createContext(0),dp=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,u=t.children,c=t.width,s=t.height,f=iF(a);return P.createElement(Ss.Provider,{value:n},P.createElement(_s.Provider,{value:i},P.createElement(Wv.Provider,{value:a},P.createElement(Fv.Provider,{value:f},P.createElement(zv.Provider,{value:o},P.createElement(Uv.Provider,{value:s},P.createElement(qv.Provider,{value:c},u)))))))},aF=function(){return L.useContext(zv)},Hv=function(t){var r=L.useContext(Ss);r==null&&ir();var n=r[t];return n==null&&ir(),n},oF=function(){var t=L.useContext(Ss);return jt(t)},uF=function(){var t=L.useContext(_s),r=nF(t,function(n){return Iv(n.domain,Number.isFinite)});return r||jt(t)},Gv=function(t){var r=L.useContext(_s);r==null&&ir();var n=r[t];return n==null&&ir(),n},cF=function(){var t=L.useContext(Fv);return t},sF=function(){return L.useContext(Wv)},$s=function(){return L.useContext(qv)},Ts=function(){return L.useContext(Uv)};function Br(e){"@babel/helpers - typeof";return Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(e)}function lF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fF(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function GF(e,t){return Qv(e,t+1)}function KF(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,c=0,s=1,f=o,l=function(){var y=n==null?void 0:n[c];if(y===void 0)return{v:Qv(n,s)};var h=c,v,b=function(){return v===void 0&&(v=r(y,h)),v},w=y.coordinate,x=c===0||Pa(e,w,b,f,u);x||(c=0,f=o,s+=1),x&&(f=w+e*(b()/2+i),c+=s)},d;s<=a.length;)if(d=l(),d)return d.v;return[]}function ri(e){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(e)}function xp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t0?p.coordinate-v*e:p.coordinate})}else a[d]=p=Ee(Ee({},p),{},{tickCoord:p.coordinate});var b=Pa(e,p.tickCoord,h,u,c);b&&(c=p.tickCoord-e*(h()/2+i),a[d]=Ee(Ee({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)s(f);return a}function JF(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,c=t.start,s=t.end;if(a){var f=n[u-1],l=r(f,u-1),d=e*(f.coordinate+e*l/2-s);o[u-1]=f=Ee(Ee({},f),{},{tickCoord:d>0?f.coordinate-d*e:f.coordinate});var p=Pa(e,f.tickCoord,function(){return l},c,s);p&&(s=f.tickCoord-e*(l/2+i),o[u-1]=Ee(Ee({},f),{},{isShow:!0}))}for(var y=a?u-1:u,h=function(w){var x=o[w],A,g=function(){return A===void 0&&(A=r(x,w)),A};if(w===0){var m=e*(x.coordinate-e*g()/2-c);o[w]=x=Ee(Ee({},x),{},{tickCoord:m<0?x.coordinate-m*e:x.coordinate})}else o[w]=x=Ee(Ee({},x),{},{tickCoord:x.coordinate});var O=Pa(e,x.tickCoord,g,c,s);O&&(c=x.tickCoord+e*(g()/2+i),o[w]=Ee(Ee({},x),{},{isShow:!0}))},v=0;v=2?Ie(i[1].coordinate-i[0].coordinate):1,b=HF(a,v,p);return c==="equidistantPreserveStart"?KF(v,b,h,i,o):(c==="preserveStart"||c==="preserveStartEnd"?d=JF(v,b,h,i,o,c==="preserveStartEnd"):d=ZF(v,b,h,i,o),d.filter(function(w){return w.isShow}))}var QF=["viewBox"],e3=["viewBox"],t3=["ticks"];function zr(e){"@babel/helpers - typeof";return zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(e)}function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function r3(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function n3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Op(e,t){for(var r=0;r0?c(this.props):c(p)),o<=0||u<=0||!y||!y.length?null:P.createElement(ne,{className:J("recharts-cartesian-axis",s),ref:function(v){n.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),_e.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return P.isValidElement(n)?o=P.cloneElement(n,i):V(n)?o=n(i):o=P.createElement(rr,gr({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(L.Component);Cs(on,"displayName","CartesianAxis");Cs(on,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var l3=["x1","y1","x2","y2","key"],f3=["offset"];function ar(e){"@babel/helpers - typeof";return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ar(e)}function Ap(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function je(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y3(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var v3=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,u=t.height,c=t.ry;return P.createElement("rect",{x:i,y:a,ry:c,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function rg(e,t){var r;if(P.isValidElement(e))r=P.cloneElement(e,t);else if(V(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,u=t.key,c=Pp(t,l3),s=X(c,!1);s.offset;var f=Pp(s,f3);r=P.createElement("line",Jt({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:u}))}return r}function g3(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=je(je({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(c),index:c});return rg(i,s)});return P.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function m3(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=je(je({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(c),index:c});return rg(i,s)});return P.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function b3(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,u=e.horizontalPoints,c=e.horizontal,s=c===void 0?!0:c;if(!s||!t||!t.length)return null;var f=u.map(function(d){return Math.round(d+i-i)}).sort(function(d,p){return d-p});i!==f[0]&&f.unshift(0);var l=f.map(function(d,p){var y=!f[p+1],h=y?i+o-d:f[p+1]-d;if(h<=0)return null;var v=p%t.length;return P.createElement("rect",{key:"react-".concat(p),y:d,x:n,height:h,width:a,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function x3(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,u=e.width,c=e.height,s=e.verticalPoints;if(!r||!n||!n.length)return null;var f=s.map(function(d){return Math.round(d+a-a)}).sort(function(d,p){return d-p});a!==f[0]&&f.unshift(0);var l=f.map(function(d,p){var y=!f[p+1],h=y?a+u-d:f[p+1]-d;if(h<=0)return null;var v=p%n.length;return P.createElement("rect",{key:"react-".concat(p),x:d,y:o,width:h,height:c,stroke:"none",fill:n[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return P.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var w3=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return Qy(Ms(je(je(je({},on.defaultProps),n),{},{ticks:vt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},O3=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return Qy(Ms(je(je(je({},on.defaultProps),n),{},{ticks:vt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},pr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function A3(e){var t,r,n,i,a,o,u=$s(),c=Ts(),s=sF(),f=je(je({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:pr.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:pr.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:pr.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:pr.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:pr.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:pr.verticalFill,x:R(e.x)?e.x:s.left,y:R(e.y)?e.y:s.top,width:R(e.width)?e.width:s.width,height:R(e.height)?e.height:s.height}),l=f.x,d=f.y,p=f.width,y=f.height,h=f.syncWithTicks,v=f.horizontalValues,b=f.verticalValues,w=oF(),x=uF();if(!R(p)||p<=0||!R(y)||y<=0||!R(l)||l!==+l||!R(d)||d!==+d)return null;var A=f.verticalCoordinatesGenerator||w3,g=f.horizontalCoordinatesGenerator||O3,m=f.horizontalPoints,O=f.verticalPoints;if((!m||!m.length)&&V(g)){var S=v&&v.length,_=g({yAxis:x?je(je({},x),{},{ticks:S?v:x.ticks}):void 0,width:u,height:c,offset:s},S?!0:h);nt(Array.isArray(_),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ar(_),"]")),Array.isArray(_)&&(m=_)}if((!O||!O.length)&&V(A)){var E=b&&b.length,$=A({xAxis:w?je(je({},w),{},{ticks:E?b:w.ticks}):void 0,width:u,height:c,offset:s},E?!0:h);nt(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ar($),"]")),Array.isArray($)&&(O=$)}return P.createElement("g",{className:"recharts-cartesian-grid"},P.createElement(v3,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),P.createElement(g3,Jt({},f,{offset:s,horizontalPoints:m,xAxis:w,yAxis:x})),P.createElement(m3,Jt({},f,{offset:s,verticalPoints:O,xAxis:w,yAxis:x})),P.createElement(b3,Jt({},f,{horizontalPoints:m})),P.createElement(x3,Jt({},f,{verticalPoints:O})))}A3.displayName="CartesianGrid";function Ur(e){"@babel/helpers - typeof";return Ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(e)}function P3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S3(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pW(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&R(i)&&R(a)?t.slice(i,a+1):[]};function vg(e){return e==="number"?[0,"auto"]:void 0}var Pc=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=Oo(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var p=l===void 0?u:l;d=Jo(p,o.dataKey,i)}else d=l&&l[n]||u[n];return d?[].concat(Gr(c),[iv(s,d)]):c},[])},jp=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=SW(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=nk(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,d=Pc(t,r,f,l),p=_W(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:d,activeCoordinate:p}}return null},$W=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,d=t.stackOffset,p=Jy(f,a);return n.reduce(function(y,h){var v,b=h.type.defaultProps!==void 0?j(j({},h.type.defaultProps),h.props):h.props,w=b.type,x=b.dataKey,A=b.allowDataOverflow,g=b.allowDuplicatedCategory,m=b.scale,O=b.ticks,S=b.includeHidden,_=b[o];if(y[_])return y;var E=Oo(t.data,{graphicalItems:i.filter(function(z){var K,fe=o in z.props?z.props[o]:(K=z.type.defaultProps)===null||K===void 0?void 0:K[o];return fe===_}),dataStartIndex:c,dataEndIndex:s}),$=E.length,T,C,I;Q3(b.domain,A,w)&&(T=Bu(b.domain,null,A),p&&(w==="number"||m!=="auto")&&(I=xn(E,x,"category")));var M=vg(w);if(!T||T.length===0){var k,D=(k=b.domain)!==null&&k!==void 0?k:M;if(x){if(T=xn(E,x,w),w==="category"&&p){var B=V0(T);g&&B?(C=T,T=va(0,$)):g||(T=nd(D,T,h).reduce(function(z,K){return z.indexOf(K)>=0?z:[].concat(Gr(z),[K])},[]))}else if(w==="category")g?T=T.filter(function(z){return z!==""&&!Q(z)}):T=nd(D,T,h).reduce(function(z,K){return z.indexOf(K)>=0||K===""||Q(K)?z:[].concat(Gr(z),[K])},[]);else if(w==="number"){var F=ck(E,i.filter(function(z){var K,fe,ge=o in z.props?z.props[o]:(K=z.type.defaultProps)===null||K===void 0?void 0:K[o],Fe="hide"in z.props?z.props.hide:(fe=z.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return ge===_&&(S||!Fe)}),x,a,f);F&&(T=F)}p&&(w==="number"||m!=="auto")&&(I=xn(E,x,"category"))}else p?T=va(0,$):u&&u[_]&&u[_].hasStack&&w==="number"?T=d==="expand"?[0,1]:nv(u[_].stackGroups,c,s):T=Zy(E,i.filter(function(z){var K=o in z.props?z.props[o]:z.type.defaultProps[o],fe="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return K===_&&(S||!fe)}),w,f,!0);if(w==="number")T=wc(l,T,_,a,O),D&&(T=Bu(D,T,A));else if(w==="category"&&D){var q=D,G=T.every(function(z){return q.indexOf(z)>=0});G&&(T=q)}}return j(j({},y),{},H({},_,j(j({},b),{},{axisType:a,domain:T,categoricalDomain:I,duplicateDomain:C,originalDomain:(v=b.domain)!==null&&v!==void 0?v:M,isCategorical:p,layout:f})))},{})},TW=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,d=Oo(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),p=d.length,y=Jy(f,a),h=-1;return n.reduce(function(v,b){var w=b.type.defaultProps!==void 0?j(j({},b.type.defaultProps),b.props):b.props,x=w[o],A=vg("number");if(!v[x]){h++;var g;return y?g=va(0,p):u&&u[x]&&u[x].hasStack?(g=nv(u[x].stackGroups,c,s),g=wc(l,g,x,a)):(g=Bu(A,Zy(d,n.filter(function(m){var O,S,_=o in m.props?m.props[o]:(O=m.type.defaultProps)===null||O===void 0?void 0:O[o],E="hide"in m.props?m.props.hide:(S=m.type.defaultProps)===null||S===void 0?void 0:S.hide;return _===x&&!E}),"number",f),i.defaultProps.allowDataOverflow),g=wc(l,g,x,a)),j(j({},v),{},H({},x,j(j({axisType:a},i.defaultProps),{},{hide:!0,orientation:qe(AW,"".concat(a,".").concat(h%2),null),domain:g,originalDomain:A,isCategorical:y,layout:f})))}return v},{})},EW=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),d=Ve(f,a),p={};return d.length?p=$W(t,{axes:d,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(p=TW(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),p},jW=function(t){var r=jt(t),n=vt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Xc(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:ia(r,n)}},Mp=function(t){var r=t.children,n=t.defaultShowTooltip,i=ze(r,Rr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},MW=function(t){return!t||!t.length?!1:t.some(function(r){var n=gt(r&&r.type);return n&&n.indexOf("Bar")>=0})},Cp=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},CW=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,d=n.margin||{},p=ze(l,Rr),y=ze(l,xr),h=Object.keys(c).reduce(function(g,m){var O=c[m],S=O.orientation;return!O.mirror&&!O.hide?j(j({},g),{},H({},S,g[S]+O.width)):g},{left:d.left||0,right:d.right||0}),v=Object.keys(o).reduce(function(g,m){var O=o[m],S=O.orientation;return!O.mirror&&!O.hide?j(j({},g),{},H({},S,qe(g,"".concat(S))+O.height)):g},{top:d.top||0,bottom:d.bottom||0}),b=j(j({},v),h),w=b.bottom;p&&(b.bottom+=p.props.height||Rr.defaultProps.height),y&&r&&(b=ok(b,i,n,r));var x=s-b.left-b.right,A=f-b.top-b.bottom;return j(j({brushBottom:w},b),{},{width:Math.max(x,0),height:Math.max(A,0)})},IW=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},gg=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,d=function(b,w){var x=w.graphicalItems,A=w.stackGroups,g=w.offset,m=w.updateId,O=w.dataStartIndex,S=w.dataEndIndex,_=b.barSize,E=b.layout,$=b.barGap,T=b.barCategoryGap,C=b.maxBarSize,I=Cp(E),M=I.numericAxisName,k=I.cateAxisName,D=MW(x),B=[];return x.forEach(function(F,q){var G=Oo(b.data,{graphicalItems:[F],dataStartIndex:O,dataEndIndex:S}),z=F.type.defaultProps!==void 0?j(j({},F.type.defaultProps),F.props):F.props,K=z.dataKey,fe=z.maxBarSize,ge=z["".concat(M,"Id")],Fe=z["".concat(k,"Id")],Bt={},De=c.reduce(function(Ft,Wt){var Ao=w["".concat(Wt.axisType,"Map")],Ns=z["".concat(Wt.axisType,"Id")];Ao&&Ao[Ns]||Wt.axisType==="zAxis"||ir();var Ds=Ao[Ns];return j(j({},Ft),{},H(H({},Wt.axisType,Ds),"".concat(Wt.axisType,"Ticks"),vt(Ds)))},Bt),W=De[k],Y=De["".concat(k,"Ticks")],Z=A&&A[ge]&&A[ge].hasStack&&gk(F,A[ge].stackGroups),N=gt(F.type).indexOf("Bar")>=0,ye=ia(W,Y),ee=[],xe=D&&ik({barSize:_,stackGroups:A,totalSize:IW(De,k)});if(N){var we,Re,$t=Q(fe)?C:fe,lr=(we=(Re=ia(W,Y,!0))!==null&&Re!==void 0?Re:$t)!==null&&we!==void 0?we:0;ee=ak({barGap:$,barCategoryGap:T,bandSize:lr!==ye?lr:ye,sizeList:xe[Fe],maxBarSize:$t}),lr!==ye&&(ee=ee.map(function(Ft){return j(j({},Ft),{},{position:j(j({},Ft.position),{},{offset:Ft.position.offset-lr/2})})}))}var hi=F&&F.type&&F.type.getComposedData;hi&&B.push({props:j(j({},hi(j(j({},De),{},{displayedData:G,props:b,dataKey:K,item:F,bandSize:ye,barPosition:ee,offset:g,stackedData:Z,layout:E,dataStartIndex:O,dataEndIndex:S}))),{},H(H(H({key:F.key||"item-".concat(q)},M,De[M]),k,De[k]),"animationId",m)),childIndex:ox(F,b.children),item:F})}),B},p=function(b,w){var x=b.props,A=b.dataStartIndex,g=b.dataEndIndex,m=b.updateId;if(!Ys({props:x}))return null;var O=x.children,S=x.layout,_=x.stackOffset,E=x.data,$=x.reverseStackOrder,T=Cp(S),C=T.numericAxisName,I=T.cateAxisName,M=Ve(O,n),k=yk(E,M,"".concat(C,"Id"),"".concat(I,"Id"),_,$),D=c.reduce(function(z,K){var fe="".concat(K.axisType,"Map");return j(j({},z),{},H({},fe,EW(x,j(j({},K),{},{graphicalItems:M,stackGroups:K.axisType===C&&k,dataStartIndex:A,dataEndIndex:g}))))},{}),B=CW(j(j({},D),{},{props:x,graphicalItems:M}),w==null?void 0:w.legendBBox);Object.keys(D).forEach(function(z){D[z]=f(x,D[z],B,z.replace("Map",""),r)});var F=D["".concat(I,"Map")],q=jW(F),G=d(x,j(j({},D),{},{dataStartIndex:A,dataEndIndex:g,updateId:m,graphicalItems:M,stackGroups:k,offset:B}));return j(j({formattedGraphicalItems:G,graphicalItems:M,offset:B,stackGroups:k},q),D)},y=function(v){function b(w){var x,A,g;return dW(this,b),g=yW(this,b,[w]),H(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),H(g,"accessibilityManager",new J3),H(g,"handleLegendBBoxUpdate",function(m){if(m){var O=g.state,S=O.dataStartIndex,_=O.dataEndIndex,E=O.updateId;g.setState(j({legendBBox:m},p({props:g.props,dataStartIndex:S,dataEndIndex:_,updateId:E},j(j({},g.state),{},{legendBBox:m}))))}}),H(g,"handleReceiveSyncEvent",function(m,O,S){if(g.props.syncId===m){if(S===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(O)}}),H(g,"handleBrushChange",function(m){var O=m.startIndex,S=m.endIndex;if(O!==g.state.dataStartIndex||S!==g.state.dataEndIndex){var _=g.state.updateId;g.setState(function(){return j({dataStartIndex:O,dataEndIndex:S},p({props:g.props,dataStartIndex:O,dataEndIndex:S,updateId:_},g.state))}),g.triggerSyncEvent({dataStartIndex:O,dataEndIndex:S})}}),H(g,"handleMouseEnter",function(m){var O=g.getMouseInfo(m);if(O){var S=j(j({},O),{},{isTooltipActive:!0});g.setState(S),g.triggerSyncEvent(S);var _=g.props.onMouseEnter;V(_)&&_(S,m)}}),H(g,"triggeredAfterMouseMove",function(m){var O=g.getMouseInfo(m),S=O?j(j({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(S),g.triggerSyncEvent(S);var _=g.props.onMouseMove;V(_)&&_(S,m)}),H(g,"handleItemMouseEnter",function(m){g.setState(function(){return{isTooltipActive:!0,activeItem:m,activePayload:m.tooltipPayload,activeCoordinate:m.tooltipPosition||{x:m.cx,y:m.cy}}})}),H(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),H(g,"handleMouseMove",function(m){m.persist(),g.throttleTriggeredAfterMouseMove(m)}),H(g,"handleMouseLeave",function(m){g.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};g.setState(O),g.triggerSyncEvent(O);var S=g.props.onMouseLeave;V(S)&&S(O,m)}),H(g,"handleOuterEvent",function(m){var O=ax(m),S=qe(g.props,"".concat(O));if(O&&V(S)){var _,E;/.*touch.*/i.test(O)?E=g.getMouseInfo(m.changedTouches[0]):E=g.getMouseInfo(m),S((_=E)!==null&&_!==void 0?_:{},m)}}),H(g,"handleClick",function(m){var O=g.getMouseInfo(m);if(O){var S=j(j({},O),{},{isTooltipActive:!0});g.setState(S),g.triggerSyncEvent(S);var _=g.props.onClick;V(_)&&_(S,m)}}),H(g,"handleMouseDown",function(m){var O=g.props.onMouseDown;if(V(O)){var S=g.getMouseInfo(m);O(S,m)}}),H(g,"handleMouseUp",function(m){var O=g.props.onMouseUp;if(V(O)){var S=g.getMouseInfo(m);O(S,m)}}),H(g,"handleTouchMove",function(m){m.changedTouches!=null&&m.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(m.changedTouches[0])}),H(g,"handleTouchStart",function(m){m.changedTouches!=null&&m.changedTouches.length>0&&g.handleMouseDown(m.changedTouches[0])}),H(g,"handleTouchEnd",function(m){m.changedTouches!=null&&m.changedTouches.length>0&&g.handleMouseUp(m.changedTouches[0])}),H(g,"handleDoubleClick",function(m){var O=g.props.onDoubleClick;if(V(O)){var S=g.getMouseInfo(m);O(S,m)}}),H(g,"handleContextMenu",function(m){var O=g.props.onContextMenu;if(V(O)){var S=g.getMouseInfo(m);O(S,m)}}),H(g,"triggerSyncEvent",function(m){g.props.syncId!==void 0&&Vo.emit(Yo,g.props.syncId,m,g.eventEmitterSymbol)}),H(g,"applySyncEvent",function(m){var O=g.props,S=O.layout,_=O.syncMethod,E=g.state.updateId,$=m.dataStartIndex,T=m.dataEndIndex;if(m.dataStartIndex!==void 0||m.dataEndIndex!==void 0)g.setState(j({dataStartIndex:$,dataEndIndex:T},p({props:g.props,dataStartIndex:$,dataEndIndex:T,updateId:E},g.state)));else if(m.activeTooltipIndex!==void 0){var C=m.chartX,I=m.chartY,M=m.activeTooltipIndex,k=g.state,D=k.offset,B=k.tooltipTicks;if(!D)return;if(typeof _=="function")M=_(B,m);else if(_==="value"){M=-1;for(var F=0;F=0){var Z,N;if(C.dataKey&&!C.allowDuplicatedCategory){var ye=typeof C.dataKey=="function"?Y:"payload.".concat(C.dataKey.toString());Z=Jo(F,ye,M),N=q&&G&&Jo(G,ye,M)}else Z=F==null?void 0:F[I],N=q&&G&&G[I];if(Fe||ge){var ee=m.props.activeIndex!==void 0?m.props.activeIndex:I;return[L.cloneElement(m,j(j(j({},_.props),De),{},{activeIndex:ee})),null,null]}if(!Q(Z))return[W].concat(Gr(g.renderActivePoints({item:_,activePoint:Z,basePoint:N,childIndex:I,isRange:q})))}else{var xe,we=(xe=g.getItemByXY(g.state.activeCoordinate))!==null&&xe!==void 0?xe:{graphicalItem:W},Re=we.graphicalItem,$t=Re.item,lr=$t===void 0?m:$t,hi=Re.childIndex,Ft=j(j(j({},_.props),De),{},{activeIndex:hi});return[L.cloneElement(lr,Ft),null,null]}return q?[W,null,null]:[W,null]}),H(g,"renderCustomized",function(m,O,S){return L.cloneElement(m,j(j({key:"recharts-customized-".concat(S)},g.props),g.state))}),H(g,"renderMap",{CartesianGrid:{handler:Ei,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:Ei},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:Ei},YAxis:{handler:Ei},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((x=w.id)!==null&&x!==void 0?x:ci("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=Xh(g.triggeredAfterMouseMove,(A=w.throttleDelay)!==null&&A!==void 0?A:1e3/60),g.state={},g}return mW(b,v),hW(b,[{key:"componentDidMount",value:function(){var x,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,A=x.children,g=x.data,m=x.height,O=x.layout,S=ze(A,dt);if(S){var _=S.props.defaultIndex;if(!(typeof _!="number"||_<0||_>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[_]&&this.state.tooltipTicks[_].value,$=Pc(this.state,g,_,E),T=this.state.tooltipTicks[_].coordinate,C=(this.state.offset.top+m)/2,I=O==="horizontal",M=I?{x:T,y:C}:{y:T,x:C},k=this.state.formattedGraphicalItems.find(function(B){var F=B.item;return F.type.name==="Scatter"});k&&(M=j(j({},M),k.props.points[_].tooltipPosition),$=k.props.points[_].tooltipPayload);var D={activeTooltipIndex:_,isTooltipActive:!0,activeLabel:E,activePayload:$,activeCoordinate:M};this.setState(D),this.renderCursor(S),this.accessibilityManager.setIndex(_)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var g,m;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(m=this.props.margin.top)!==null&&m!==void 0?m:0}})}return null}},{key:"componentDidUpdate",value:function(x){eu([ze(x.children,dt)],[ze(this.props.children,dt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=ze(this.props.children,dt);if(x&&typeof x.props.shared=="boolean"){var A=x.props.shared?"axis":"item";return u.indexOf(A)>=0?A:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var A=this.container,g=A.getBoundingClientRect(),m=ME(g),O={chartX:Math.round(x.pageX-m.left),chartY:Math.round(x.pageY-m.top)},S=g.width/A.offsetWidth||1,_=this.inRange(O.chartX,O.chartY,S);if(!_)return null;var E=this.state,$=E.xAxisMap,T=E.yAxisMap,C=this.getTooltipEventType();if(C!=="axis"&&$&&T){var I=jt($).scale,M=jt(T).scale,k=I&&I.invert?I.invert(O.chartX):null,D=M&&M.invert?M.invert(O.chartY):null;return j(j({},O),{},{xValue:k,yValue:D})}var B=jp(this.state,this.props.data,this.props.layout,_);return B?j(j({},O),B):null}},{key:"inRange",value:function(x,A){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,m=this.props.layout,O=x/g,S=A/g;if(m==="horizontal"||m==="vertical"){var _=this.state.offset,E=O>=_.left&&O<=_.left+_.width&&S>=_.top&&S<=_.top+_.height;return E?{x:O,y:S}:null}var $=this.state,T=$.angleAxisMap,C=$.radiusAxisMap;if(T&&C){var I=jt(T);return od({x:O,y:S},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,A=this.getTooltipEventType(),g=ze(x,dt),m={};g&&A==="axis"&&(g.props.trigger==="click"?m={onClick:this.handleClick}:m={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Mi(this.props,this.handleOuterEvent);return j(j({},O),m)}},{key:"addListener",value:function(){Vo.on(Yo,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Vo.removeListener(Yo,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,A,g){for(var m=this.state.formattedGraphicalItems,O=0,S=m.length;O-1}return Io=t,Io}var ko,fh;function uO(){if(fh)return ko;fh=1;var e=ba();function t(r,n){var i=this.__data__,a=e(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return ko=t,ko}var Ro,dh;function xa(){if(dh)return Ro;dh=1;var e=nO(),t=iO(),r=aO(),n=oO(),i=uO();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u0?1:-1},Gt=function(t){return Qn(t)&&t.indexOf("%")===t.length-1},D=function(t){return MO(t)&&!ei(t)},Oe=function(t){return D(t)||Qn(t)},$O=0,ti=function(t){var r=++$O;return"".concat(t||"").concat(r)},Ie=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!D(t)&&!Qn(t))return n;var a;if(Gt(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return ei(a)&&(a=n),i&&a>r&&(a=r),a},Et=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},CO=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qO(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Bh={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},vt=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Fh=null,uu=null,If=function e(t){if(t===Fh&&Array.isArray(uu))return uu;var r=[];return q.Children.forEach(t,function(n){Q(n)||(PO.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),uu=r,Fh=t,r};function Ve(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return vt(i)}):n=[vt(t)],If(e).forEach(function(i){var a=ze(i,"type.displayName")||ze(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Fe(e,t){var r=Ve(e,t);return r[0]}var Wh=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!D(n)||n<=0||!D(i)||i<=0)},LO=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],BO=function(t){return t&&t.type&&Qn(t.type)&&LO.indexOf(t.type)>=0},FO=function(t,r,n,i){var a,o=(a=ou==null?void 0:ou[i])!==null&&a!==void 0?a:[];return!X(t)&&(i&&o.includes(r)||kO.includes(r))||n&&Cf.includes(r)},V=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(q.isValidElement(t)&&(i=t.props),!Hr(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;FO((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},ol=function e(t,r){if(t===r)return!0;var n=q.Children.count(t);if(n!==q.Children.count(r))return!1;if(n===0)return!0;if(n===1)return zh(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function GO(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cl(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,u=e.title,c=e.desc,s=HO(e,UO),f=i||{width:r,height:n,x:0,y:0},l=J("recharts-surface",a);return S.createElement("svg",ul({},V(s,!0,"svg"),{className:l,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),S.createElement("title",null,u),S.createElement("desc",null,c),t)}var KO=["children","className"];function sl(){return sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XO(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ie=S.forwardRef(function(e,t){var r=e.children,n=e.className,i=VO(e,KO),a=J("recharts-layer",n);return S.createElement("g",sl({className:a},V(i,!0),{ref:t}),r)}),tt=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;aa?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i=a?r:e(r,n,i)}return su=t,su}var lu,Kh;function kb(){if(Kh)return lu;Kh=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+i+a+"]");function c(s){return u.test(s)}return lu=c,lu}var fu,Vh;function JO(){if(Vh)return fu;Vh=1;function e(t){return t.split("")}return fu=e,fu}var du,Xh;function QO(){if(Xh)return du;Xh=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,a="\\ufe0e\\ufe0f",o="["+e+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",s="(?:"+u+"|"+c+")",f="[^"+e+"]",l="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",y=s+"?",v="["+a+"]?",h="(?:"+p+"(?:"+[f,l,d].join("|")+")"+v+y+")*",b=v+y+h,x="(?:"+[f+u+"?",u,l,d,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+x+b,"g");function O(m){return m.match(w)||[]}return du=O,du}var hu,Yh;function e_(){if(Yh)return hu;Yh=1;var e=JO(),t=kb(),r=QO();function n(i){return t(i)?r(i):e(i)}return hu=n,hu}var pu,Zh;function t_(){if(Zh)return pu;Zh=1;var e=ZO(),t=kb(),r=e_(),n=Mb();function i(a){return function(o){o=n(o);var u=t(o)?r(o):void 0,c=u?u[0]:o.charAt(0),s=u?e(u,1).join(""):o.slice(1);return c[a]()+s}}return pu=i,pu}var vu,Jh;function r_(){if(Jh)return vu;Jh=1;var e=t_(),t=e("toUpperCase");return vu=t,vu}var n_=r_();const _a=oe(n_);function se(e){return function(){return e}}const Rb=Math.cos,Ai=Math.sin,rt=Math.sqrt,Si=Math.PI,Aa=2*Si,ll=Math.PI,fl=2*ll,zt=1e-6,i_=fl-zt;function Nb(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Nb;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;izt)if(!(Math.abs(l*c-s*f)>zt)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,y=i-u,v=c*c+s*s,h=p*p+y*y,b=Math.sqrt(v),x=Math.sqrt(d),w=a*Math.tan((ll-Math.acos((v+d-h)/(2*b*x)))/2),O=w/x,m=w/b;Math.abs(O-1)>zt&&this._append`L${t+O*f},${r+O*l}`,this._append`A${a},${a},0,0,${+(l*p>f*y)},${this._x1=t+m*c},${this._y1=r+m*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),s=t+u,f=r+c,l=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>zt||Math.abs(this._y1-f)>zt)&&this._append`L${s},${f}`,n&&(d<0&&(d=d%fl+fl),d>i_?this._append`A${n},${n},0,1,${l},${t-u},${r-c}A${n},${n},0,1,${l},${this._x1=s},${this._y1=f}`:d>zt&&this._append`A${n},${n},0,${+(d>=ll)},${l},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function kf(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new o_(t)}function Rf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Db(e){this._context=e}Db.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Sa(e){return new Db(e)}function qb(e){return e[0]}function Lb(e){return e[1]}function Bb(e,t){var r=se(!0),n=null,i=Sa,a=null,o=kf(u);e=typeof e=="function"?e:e===void 0?qb:se(e),t=typeof t=="function"?t:t===void 0?Lb:se(t);function u(c){var s,f=(c=Rf(c)).length,l,d=!1,p;for(n==null&&(a=i(p=o())),s=0;s<=f;++s)!(s=p;--y)u.point(w[y],O[y]);u.lineEnd(),u.areaEnd()}b&&(w[d]=+e(h,d,l),O[d]=+t(h,d,l),u.point(n?+n(h,d,l):w[d],r?+r(h,d,l):O[d]))}if(x)return u=null,x+""||null}function f(){return Bb().defined(i).curve(o).context(a)}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:se(+l),n=null,s):e},s.x0=function(l){return arguments.length?(e=typeof l=="function"?l:se(+l),s):e},s.x1=function(l){return arguments.length?(n=l==null?null:typeof l=="function"?l:se(+l),s):n},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:se(+l),r=null,s):t},s.y0=function(l){return arguments.length?(t=typeof l=="function"?l:se(+l),s):t},s.y1=function(l){return arguments.length?(r=l==null?null:typeof l=="function"?l:se(+l),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(l){return arguments.length?(i=typeof l=="function"?l:se(!!l),s):i},s.curve=function(l){return arguments.length?(o=l,a!=null&&(u=o(a)),s):o},s.context=function(l){return arguments.length?(l==null?a=u=null:u=o(a=l),s):a},s}class Fb{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function u_(e){return new Fb(e,!0)}function c_(e){return new Fb(e,!1)}const Nf={draw(e,t){const r=rt(t/Si);e.moveTo(r,0),e.arc(0,0,r,0,Aa)}},s_={draw(e,t){const r=rt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Wb=rt(1/3),l_=Wb*2,f_={draw(e,t){const r=rt(t/l_),n=r*Wb;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},d_={draw(e,t){const r=rt(t),n=-r/2;e.rect(n,n,r,r)}},h_=.8908130915292852,zb=Ai(Si/10)/Ai(7*Si/10),p_=Ai(Aa/10)*zb,v_=-Rb(Aa/10)*zb,y_={draw(e,t){const r=rt(t*h_),n=p_*r,i=v_*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Aa*a/5,u=Rb(o),c=Ai(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*i,c*n+u*i)}e.closePath()}},yu=rt(3),m_={draw(e,t){const r=-rt(t/(yu*3));e.moveTo(0,r*2),e.lineTo(-yu*r,-r),e.lineTo(yu*r,-r),e.closePath()}},Ue=-.5,He=rt(3)/2,dl=1/rt(12),g_=(dl/2+1)*3,b_={draw(e,t){const r=rt(t/g_),n=r/2,i=r*dl,a=n,o=r*dl+r,u=-a,c=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(u,c),e.lineTo(Ue*n-He*i,He*n+Ue*i),e.lineTo(Ue*a-He*o,He*a+Ue*o),e.lineTo(Ue*u-He*c,He*u+Ue*c),e.lineTo(Ue*n+He*i,Ue*i-He*n),e.lineTo(Ue*a+He*o,Ue*o-He*a),e.lineTo(Ue*u+He*c,Ue*c-He*u),e.closePath()}};function x_(e,t){let r=null,n=kf(i);e=typeof e=="function"?e:se(e||Nf),t=typeof t=="function"?t:se(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:se(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:se(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Pi(){}function Ti(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Ub(e){this._context=e}Ub.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ti(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ti(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function w_(e){return new Ub(e)}function Hb(e){this._context=e}Hb.prototype={areaStart:Pi,areaEnd:Pi,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ti(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function O_(e){return new Hb(e)}function Gb(e){this._context=e}Gb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ti(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function __(e){return new Gb(e)}function Kb(e){this._context=e}Kb.prototype={areaStart:Pi,areaEnd:Pi,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function A_(e){return new Kb(e)}function Qh(e){return e<0?-1:1}function ep(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(Qh(a)+Qh(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function tp(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function mu(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Ei(e){this._context=e}Ei.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:mu(this,this._t0,tp(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,mu(this,tp(this,r=ep(this,e,t)),r);break;default:mu(this,this._t0,r=ep(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Vb(e){this._context=new Xb(e)}(Vb.prototype=Object.create(Ei.prototype)).point=function(e,t){Ei.prototype.point.call(this,t,e)};function Xb(e){this._context=e}Xb.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function S_(e){return new Ei(e)}function P_(e){return new Vb(e)}function Yb(e){this._context=e}Yb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=rp(e),i=rp(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function E_(e){return new Pa(e,.5)}function j_(e){return new Pa(e,0)}function M_(e){return new Pa(e,1)}function xr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function $_(e,t){return e[t]}function C_(e){const t=[];return t.key=e,t}function I_(){var e=se([]),t=hl,r=xr,n=$_;function i(a){var o=Array.from(e.apply(this,arguments),C_),u,c=o.length,s=-1,f;for(const l of a)for(u=0,++s;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function W_(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Zb={symbolCircle:Nf,symbolCross:s_,symbolDiamond:f_,symbolSquare:d_,symbolStar:y_,symbolTriangle:m_,symbolWye:b_},z_=Math.PI/180,U_=function(t){var r="symbol".concat(_a(t));return Zb[r]||Nf},H_=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*z_;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},G_=function(t,r){Zb["symbol".concat(_a(t))]=r},Df=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,u=o===void 0?"area":o,c=F_(t,D_),s=ip(ip({},c),{},{type:n,size:a,sizeType:u}),f=function(){var h=U_(n),b=x_().type(h).size(H_(a,u,n));return b()},l=s.className,d=s.cx,p=s.cy,y=V(s,!0);return d===+d&&p===+p&&a===+a?S.createElement("path",pl({},y,{className:J("recharts-symbols",l),transform:"translate(".concat(d,", ").concat(p,")"),d:f()})):null};Df.registerSymbol=G_;function wr(e){"@babel/helpers - typeof";return wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wr(e)}function vl(){return vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=p.inactive?s:p.color;return S.createElement("li",vl({className:h,style:l,key:"legend-item-".concat(y)},Jt(n.props,p,y)),S.createElement(cl,{width:o,height:o,viewBox:f,style:d},n.renderIcon(p)),S.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(b,p,y):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])}(q.PureComponent);gn(qf,"displayName","Legend");gn(qf,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var gu,op;function r1(){if(op)return gu;op=1;var e=xa();function t(){this.__data__=new e,this.size=0}return gu=t,gu}var bu,up;function n1(){if(up)return bu;up=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return bu=e,bu}var xu,cp;function i1(){if(cp)return xu;cp=1;function e(t){return this.__data__.get(t)}return xu=e,xu}var wu,sp;function a1(){if(sp)return wu;sp=1;function e(t){return this.__data__.has(t)}return wu=e,wu}var Ou,lp;function o1(){if(lp)return Ou;lp=1;var e=xa(),t=Ef(),r=jf(),n=200;function i(a,o){var u=this.__data__;if(u instanceof e){var c=u.__data__;if(!t||c.lengthp))return!1;var v=l.get(o),h=l.get(u);if(v&&h)return v==u&&h==o;var b=-1,x=!0,w=c&i?new e:void 0;for(l.set(o,u),l.set(u,o);++b-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Uu=t,Uu}var Hu,kp;function b1(){if(kp)return Hu;kp=1;var e=Ot(),t=Wf(),r=_t(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",s="[object Map]",f="[object Number]",l="[object Object]",d="[object RegExp]",p="[object Set]",y="[object String]",v="[object WeakMap]",h="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",m="[object Int16Array]",g="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",T="[object Uint16Array]",M="[object Uint32Array]",P={};P[x]=P[w]=P[O]=P[m]=P[g]=P[_]=P[A]=P[T]=P[M]=!0,P[n]=P[i]=P[h]=P[a]=P[b]=P[o]=P[u]=P[c]=P[s]=P[f]=P[l]=P[d]=P[p]=P[y]=P[v]=!1;function E(j){return r(j)&&t(j.length)&&!!P[e(j)]}return Hu=E,Hu}var Gu,Rp;function u0(){if(Rp)return Gu;Rp=1;function e(t){return function(r){return t(r)}}return Gu=e,Gu}var sn={exports:{}};sn.exports;var Np;function x1(){return Np||(Np=1,function(e,t){var r=Tb(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,u=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=u}(sn,sn.exports)),sn.exports}var Ku,Dp;function c0(){if(Dp)return Ku;Dp=1;var e=b1(),t=u0(),r=x1(),n=r&&r.isTypedArray,i=n?t(n):e;return Ku=i,Ku}var Vu,qp;function w1(){if(qp)return Vu;qp=1;var e=y1(),t=Bf(),r=qe(),n=o0(),i=Ff(),a=c0(),o=Object.prototype,u=o.hasOwnProperty;function c(s,f){var l=r(s),d=!l&&t(s),p=!l&&!d&&n(s),y=!l&&!d&&!p&&a(s),v=l||d||p||y,h=v?e(s.length,String):[],b=h.length;for(var x in s)(f||u.call(s,x))&&!(v&&(x=="length"||p&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,b)))&&h.push(x);return h}return Vu=c,Vu}var Xu,Lp;function O1(){if(Lp)return Xu;Lp=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return Xu=t,Xu}var Yu,Bp;function s0(){if(Bp)return Yu;Bp=1;function e(t,r){return function(n){return t(r(n))}}return Yu=e,Yu}var Zu,Fp;function _1(){if(Fp)return Zu;Fp=1;var e=s0(),t=e(Object.keys,Object);return Zu=t,Zu}var Ju,Wp;function A1(){if(Wp)return Ju;Wp=1;var e=O1(),t=_1(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return Ju=i,Ju}var Qu,zp;function ri(){if(zp)return Qu;zp=1;var e=Pf(),t=Wf();function r(n){return n!=null&&t(n.length)&&!e(n)}return Qu=r,Qu}var ec,Up;function Ta(){if(Up)return ec;Up=1;var e=w1(),t=A1(),r=ri();function n(i){return r(i)?e(i):t(i)}return ec=n,ec}var tc,Hp;function S1(){if(Hp)return tc;Hp=1;var e=d1(),t=v1(),r=Ta();function n(i){return e(i,r,t)}return tc=n,tc}var rc,Gp;function P1(){if(Gp)return rc;Gp=1;var e=S1(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,c,s,f){var l=u&t,d=e(a),p=d.length,y=e(o),v=y.length;if(p!=v&&!l)return!1;for(var h=p;h--;){var b=d[h];if(!(l?b in o:n.call(o,b)))return!1}var x=f.get(a),w=f.get(o);if(x&&w)return x==o&&w==a;var O=!0;f.set(a,o),f.set(o,a);for(var m=l;++h-1}return Ec=t,Ec}var jc,bv;function G1(){if(bv)return jc;bv=1;function e(t,r,n){for(var i=-1,a=t==null?0:t.length;++i=o){var b=s?null:i(c);if(b)return a(b);y=!1,d=n,h=new e}else h=s?[]:v;e:for(;++l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cA(e){return e.value}function sA(e,t){if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return S.createElement(e,t);t.ref;var r=oA(t,J1);return S.createElement(qf,r)}var Tv=1,mr=function(e){function t(){var r;Q1(this,t);for(var n=arguments.length,i=new Array(n),a=0;aTv||Math.abs(i.height-this.lastBoundingBox.height)>Tv)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?st({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,s=i.chartWidth,f=i.chartHeight,l,d;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();l={left:((s||0)-p.width)/2}}else l=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var y=this.getBBoxSnapshot();d={top:((f||0)-y.height)/2}}else d=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return st(st({},l),d)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,s=i.payloadUniqBy,f=i.payload,l=st(st({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return S.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(p){n.wrapperNode=p}},sA(a,st(st({},this.props),{},{payload:p0(f,s,cA)})))}}],[{key:"getWithHeight",value:function(n,i){var a=st(st({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&D(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(q.PureComponent);Ea(mr,"displayName","Legend");Ea(mr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var kc,Ev;function lA(){if(Ev)return kc;Ev=1;var e=Jn(),t=Bf(),r=qe(),n=e?e.isConcatSpreadable:void 0;function i(a){return r(a)||t(a)||!!(n&&a&&a[n])}return kc=i,kc}var Rc,jv;function m0(){if(jv)return Rc;jv=1;var e=a0(),t=lA();function r(n,i,a,o,u){var c=-1,s=n.length;for(a||(a=t),u||(u=[]);++c0&&a(f)?i>1?r(f,i-1,a,o,u):e(u,f):o||(u[u.length]=f)}return u}return Rc=r,Rc}var Nc,Mv;function fA(){if(Mv)return Nc;Mv=1;function e(t){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var s=u[t?c:++a];if(n(o[s],s,o)===!1)break}return r}}return Nc=e,Nc}var Dc,$v;function dA(){if($v)return Dc;$v=1;var e=fA(),t=e();return Dc=t,Dc}var qc,Cv;function g0(){if(Cv)return qc;Cv=1;var e=dA(),t=Ta();function r(n,i){return n&&e(n,i,t)}return qc=r,qc}var Lc,Iv;function hA(){if(Iv)return Lc;Iv=1;var e=ri();function t(r,n){return function(i,a){if(i==null)return i;if(!e(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++un||u&&c&&f&&!s&&!l||a&&c&&f||!i&&f||!o)return 1;if(!a&&!u&&!l&&r=s)return f;var l=i[a];return f*(l=="desc"?-1:1)}}return r.index-n.index}return Uc=t,Uc}var Hc,Lv;function mA(){if(Lv)return Hc;Lv=1;var e=Mf(),t=$f(),r=ct(),n=b0(),i=pA(),a=u0(),o=yA(),u=Gr(),c=qe();function s(f,l,d){l.length?l=e(l,function(v){return c(v)?function(h){return t(h,v.length===1?v[0]:v)}:v}):l=[u];var p=-1;l=e(l,a(r));var y=n(f,function(v,h,b){var x=e(l,function(w){return w(v)});return{criteria:x,index:++p,value:v}});return i(y,function(v,h){return o(v,h,d)})}return Hc=s,Hc}var Gc,Bv;function gA(){if(Bv)return Gc;Bv=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Gc=e,Gc}var Kc,Fv;function bA(){if(Fv)return Kc;Fv=1;var e=gA(),t=Math.max;function r(n,i,a){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=t(o.length-i,0),s=Array(c);++u0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Zc=n,Zc}var Jc,Gv;function _A(){if(Gv)return Jc;Gv=1;var e=wA(),t=OA(),r=t(e);return Jc=r,Jc}var Qc,Kv;function AA(){if(Kv)return Qc;Kv=1;var e=Gr(),t=bA(),r=_A();function n(i,a){return r(t(i,a,e),i+"")}return Qc=n,Qc}var es,Vv;function ja(){if(Vv)return es;Vv=1;var e=Tf(),t=ri(),r=Ff(),n=Ct();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?t(u)&&r(o,u.length):c=="string"&&o in u)?e(u[o],a):!1}return es=i,es}var ts,Xv;function SA(){if(Xv)return ts;Xv=1;var e=m0(),t=mA(),r=AA(),n=ja(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return ts=i,ts}var PA=SA();const Hf=oe(PA);function bn(e){"@babel/helpers - typeof";return bn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bn(e)}function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Jr,"-left"),D(r)&&t&&D(t.x)&&r=t.y),"".concat(Jr,"-top"),D(n)&&t&&D(t.y)&&nv?Math.max(f,c[n]):Math.max(l,c[n])}function FA(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function WA(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,c=e.viewBox,s,f,l;return o.height>0&&o.width>0&&r?(f=Jv({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),l=Jv({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=FA({translateX:f,translateY:l,useTranslate3d:u})):s=LA,{cssProperties:s,cssClasses:BA({translateX:f,translateY:l,coordinate:r})}}function _r(e){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(e)}function Qv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ey(e){for(var t=1;tty||Math.abs(n.height-this.state.lastBoundingBox.height)>ty)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,s=i.children,f=i.coordinate,l=i.hasPayload,d=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,h=i.useTranslate3d,b=i.viewBox,x=i.wrapperStyle,w=WA({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:h,viewBox:b}),O=w.cssClasses,m=w.cssProperties,g=ey(ey({transition:d&&a?"transform ".concat(u,"ms ").concat(c):void 0},m),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&l?"visible":"hidden",position:"absolute",top:0,left:0},x);return S.createElement("div",{tabIndex:-1,className:O,style:g,ref:function(A){n.wrapperNode=A}},s)}}])}(q.PureComponent),JA=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},yt={isSsr:JA(),get:function(t){return yt[t]},set:function(t,r){if(typeof t=="string")yt[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){yt[i]=t[i]})}}};function Ar(e){"@babel/helpers - typeof";return Ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(e)}function ry(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ny(e){for(var t=1;t0;return S.createElement(ZA,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:d,active:a,coordinate:f,hasPayload:g,offset:p,position:h,reverseDirection:b,useTranslate3d:x,viewBox:w,wrapperStyle:O},cS(s,ny(ny({},this.props),{},{payload:m})))}}])}(q.PureComponent);Gf(lt,"displayName","Tooltip");Gf(lt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!yt.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var ns,iy;function sS(){if(iy)return ns;iy=1;var e=ut(),t=function(){return e.Date.now()};return ns=t,ns}var is,ay;function lS(){if(ay)return is;ay=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return is=t,is}var as,oy;function fS(){if(oy)return as;oy=1;var e=lS(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return as=r,as}var os,uy;function S0(){if(uy)return os;uy=1;var e=fS(),t=Ct(),r=Ur(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function c(s){if(typeof s=="number")return s;if(r(s))return n;if(t(s)){var f=typeof s.valueOf=="function"?s.valueOf():s;s=t(f)?f+"":f}if(typeof s!="string")return s===0?s:+s;s=e(s);var l=a.test(s);return l||o.test(s)?u(s.slice(2),l?2:8):i.test(s)?n:+s}return os=c,os}var us,cy;function dS(){if(cy)return us;cy=1;var e=Ct(),t=sS(),r=S0(),n="Expected a function",i=Math.max,a=Math.min;function o(u,c,s){var f,l,d,p,y,v,h=0,b=!1,x=!1,w=!0;if(typeof u!="function")throw new TypeError(n);c=r(c)||0,e(s)&&(b=!!s.leading,x="maxWait"in s,d=x?i(r(s.maxWait)||0,c):d,w="trailing"in s?!!s.trailing:w);function O(j){var I=f,$=l;return f=l=void 0,h=j,p=u.apply($,I),p}function m(j){return h=j,y=setTimeout(A,c),b?O(j):p}function g(j){var I=j-v,$=j-h,k=c-I;return x?a(k,d-$):k}function _(j){var I=j-v,$=j-h;return v===void 0||I>=c||I<0||x&&$>=d}function A(){var j=t();if(_(j))return T(j);y=setTimeout(A,g(j))}function T(j){return y=void 0,w&&f?O(j):(f=l=void 0,p)}function M(){y!==void 0&&clearTimeout(y),h=0,f=v=l=y=void 0}function P(){return y===void 0?p:T(t())}function E(){var j=t(),I=_(j);if(f=arguments,l=this,v=j,I){if(y===void 0)return m(v);if(x)return clearTimeout(y),y=setTimeout(A,c),O(v)}return y===void 0&&(y=setTimeout(A,c)),p}return E.cancel=M,E.flush=P,E}return us=o,us}var cs,sy;function hS(){if(sy)return cs;sy=1;var e=dS(),t=Ct(),r="Expected a function";function n(i,a,o){var u=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:u,maxWait:a,trailing:c})}return cs=n,cs}var pS=hS();const P0=oe(pS);function wn(e){"@babel/helpers - typeof";return wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(e)}function ly(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fi(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(j=P0(j,v,{trailing:!0,leading:!1}));var I=new ResizeObserver(j),$=m.current.getBoundingClientRect(),k=$.width,N=$.height;return P(k,N),I.observe(m.current),function(){I.disconnect()}},[P,v]);var E=q.useMemo(function(){var j=T.containerWidth,I=T.containerHeight;if(j<0||I<0)return null;tt(Gt(o)||Gt(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,c),tt(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=Gt(o)?j:o,k=Gt(c)?I:c;r&&r>0&&($?k=$/r:k&&($=k*r),d&&k>d&&(k=d)),tt($>0||k>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,$,k,o,c,f,l,r);var N=!Array.isArray(p)&&vt(p.type).endsWith("Chart");return S.Children.map(p,function(L){return S.isValidElement(L)?q.cloneElement(L,fi({width:$,height:k},N?{style:fi({height:"100%",width:"100%",maxHeight:k,maxWidth:$},L.props.style)}:{})):L})},[r,p,c,d,l,f,T,o]);return S.createElement("div",{id:h?"".concat(h):void 0,className:J("recharts-responsive-container",b),style:fi(fi({},O),{},{width:o,height:c,minWidth:f,minHeight:l,maxHeight:d}),ref:m},E)}),Kf=function(t){return null};Kf.displayName="Cell";function On(e){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(e)}function dy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ol(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||yt.isSsr)return{width:0,height:0};var n=ES(r),i=JSON.stringify({text:t,copyStyle:n});if(cr.widthCache[i])return cr.widthCache[i];try{var a=document.getElementById(hy);a||(a=document.createElement("span"),a.setAttribute("id",hy),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Ol(Ol({},TS),n);Object.assign(a.style,o),a.textContent="".concat(t);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return cr.widthCache[i]=c,++cr.cacheCount>PS&&(cr.cacheCount=0,cr.widthCache={}),c}catch{return{width:0,height:0}}},jS=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function _n(e){"@babel/helpers - typeof";return _n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_n(e)}function Ii(e,t){return IS(e)||CS(e,t)||$S(e,t)||MS()}function MS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $S(e,t){if(e){if(typeof e=="string")return py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return py(e,t)}}function py(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KS(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xy(e,t){return ZS(e)||YS(e,t)||XS(e,t)||VS()}function VS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XS(e,t){if(e){if(typeof e=="string")return wy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wy(e,t)}}function wy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(k,N){var L=N.word,B=N.width,U=k[k.length-1];if(U&&(i==null||a||U.width+B+nN.width?k:N})};if(!f)return p;for(var v="…",h=function($){var k=l.slice(0,$),N=M0({breakAll:s,style:c,children:k+v}).wordsWithComputedWidth,L=d(N),B=L.length>o||y(L).width>Number(i);return[B,L]},b=0,x=l.length-1,w=0,O;b<=x&&w<=l.length-1;){var m=Math.floor((b+x)/2),g=m-1,_=h(g),A=xy(_,2),T=A[0],M=A[1],P=h(m),E=xy(P,1),j=E[0];if(!T&&!j&&(b=m+1),T&&j&&(x=m-1),!T&&j){O=M;break}w++}return O||p},Oy=function(t){var r=Q(t)?[]:t.toString().split(j0);return[{words:r}]},QS=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!yt.isSsr){var c,s,f=M0({breakAll:o,children:i,style:a});if(f){var l=f.wordsWithComputedWidth,d=f.spaceWidth;c=l,s=d}else return Oy(i);return JS({breakAll:o,children:i,maxLines:u,style:a},c,s,r,n)}return Oy(i)},_y="#808080",Qt=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,u=o===void 0?"1em":o,c=t.capHeight,s=c===void 0?"0.71em":c,f=t.scaleToFit,l=f===void 0?!1:f,d=t.textAnchor,p=d===void 0?"start":d,y=t.verticalAnchor,v=y===void 0?"end":y,h=t.fill,b=h===void 0?_y:h,x=by(t,HS),w=q.useMemo(function(){return QS({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:l,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,l,x.style,x.width]),O=x.dx,m=x.dy,g=x.angle,_=x.className,A=x.breakAll,T=by(x,GS);if(!Oe(n)||!Oe(a))return null;var M=n+(D(O)?O:0),P=a+(D(m)?m:0),E;switch(v){case"start":E=ss("calc(".concat(s,")"));break;case"middle":E=ss("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(s," / 2))"));break;default:E=ss("calc(".concat(w.length-1," * -").concat(u,")"));break}var j=[];if(l){var I=w[0].width,$=x.width;j.push("scale(".concat((D($)?$/I:1)/I,")"))}return g&&j.push("rotate(".concat(g,", ").concat(M,", ").concat(P,")")),j.length&&(T.transform=j.join(" ")),S.createElement("text",_l({},V(T,!0),{x:M,y:P,className:J("recharts-text",_),textAnchor:p,fill:b.includes("url")?_y:b}),w.map(function(k,N){var L=k.words.join(A?"":" ");return S.createElement("tspan",{x:M,dy:N===0?E:u,key:"".concat(L,"-").concat(N)},L)}))};function Mt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function eP(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Vf(e){let t,r,n;e.length!==2?(t=Mt,r=(u,c)=>Mt(e(u),c),n=(u,c)=>e(u)-c):(t=e===Mt||e===eP?e:tP,r=e,n=e);function i(u,c,s=0,f=u.length){if(s>>1;r(u[l],c)<0?s=l+1:f=l}while(s>>1;r(u[l],c)<=0?s=l+1:f=l}while(ss&&n(u[l-1],c)>-n(u[l],c)?l-1:l}return{left:i,center:o,right:a}}function tP(){return 0}function $0(e){return e===null?NaN:+e}function*rP(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const nP=Vf(Mt),ni=nP.right;Vf($0).center;class Ay extends Map{constructor(t,r=oP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Sy(this,t))}has(t){return super.has(Sy(this,t))}set(t,r){return super.set(iP(this,t),r)}delete(t){return super.delete(aP(this,t))}}function Sy({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function iP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function aP({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function oP(e){return e!==null&&typeof e=="object"?e.valueOf():e}function uP(e=Mt){if(e===Mt)return C0;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function C0(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const cP=Math.sqrt(50),sP=Math.sqrt(10),lP=Math.sqrt(2);function ki(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=cP?10:a>=sP?5:a>=lP?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(e*s),c=Math.round(t*s),u/st&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(e/s),c=Math.round(t/s),u*st&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(r=n);return r}function Ty(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function I0(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?C0:uP(i);n>r;){if(n-r>600){const c=n-r+1,s=t-r+1,f=Math.log(c),l=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*l*(c-l)/c)*(s-c/2<0?-1:1),p=Math.max(r,Math.floor(t-s*l/c+d)),y=Math.min(n,Math.floor(t+(c-s)*l/c+d));I0(e,t,p,y,i)}const a=e[t];let o=r,u=n;for(Qr(e,r,t),i(e[n],a)>0&&Qr(e,r,n);o0;)--u}i(e[r],a)===0?Qr(e,r,u):(++u,Qr(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Qr(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function fP(e,t,r){if(e=Float64Array.from(rP(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Ty(e);if(t>=1)return Py(e);var n,i=(n-1)*t,a=Math.floor(i),o=Py(I0(e,a).subarray(0,a+1)),u=Ty(e.subarray(a+1));return o+(u-o)*(i-a)}}function dP(e,t,r=$0){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function hP(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?hi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?hi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vP.exec(e))?new De(t[1],t[2],t[3],1):(t=yP.exec(e))?new De(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mP.exec(e))?hi(t[1],t[2],t[3],t[4]):(t=gP.exec(e))?hi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bP.exec(e))?ky(t[1],t[2]/100,t[3]/100,1):(t=xP.exec(e))?ky(t[1],t[2]/100,t[3]/100,t[4]):Ey.hasOwnProperty(e)?$y(Ey[e]):e==="transparent"?new De(NaN,NaN,NaN,0):null}function $y(e){return new De(e>>16&255,e>>8&255,e&255,1)}function hi(e,t,r,n){return n<=0&&(e=t=r=NaN),new De(e,t,r,n)}function _P(e){return e instanceof ii||(e=Tn(e)),e?(e=e.rgb(),new De(e.r,e.g,e.b,e.opacity)):new De}function El(e,t,r,n){return arguments.length===1?_P(e):new De(e,t,r,n??1)}function De(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Yf(De,El,R0(ii,{brighter(e){return e=e==null?Ri:Math.pow(Ri,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sn:Math.pow(Sn,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new De(Yt(this.r),Yt(this.g),Yt(this.b),Ni(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cy,formatHex:Cy,formatHex8:AP,formatRgb:Iy,toString:Iy}));function Cy(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}`}function AP(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}${Kt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Iy(){const e=Ni(this.opacity);return`${e===1?"rgb(":"rgba("}${Yt(this.r)}, ${Yt(this.g)}, ${Yt(this.b)}${e===1?")":`, ${e})`}`}function Ni(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kt(e){return e=Yt(e),(e<16?"0":"")+e.toString(16)}function ky(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new et(e,t,r,n)}function N0(e){if(e instanceof et)return new et(e.h,e.s,e.l,e.opacity);if(e instanceof ii||(e=Tn(e)),!e)return new et;if(e instanceof et)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&c<1?0:o,new et(o,u,c,e.opacity)}function SP(e,t,r,n){return arguments.length===1?N0(e):new et(e,t,r,n??1)}function et(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Yf(et,SP,R0(ii,{brighter(e){return e=e==null?Ri:Math.pow(Ri,e),new et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sn:Math.pow(Sn,e),new et(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new De(ls(e>=240?e-240:e+120,i,n),ls(e,i,n),ls(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new et(Ry(this.h),pi(this.s),pi(this.l),Ni(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ni(this.opacity);return`${e===1?"hsl(":"hsla("}${Ry(this.h)}, ${pi(this.s)*100}%, ${pi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ry(e){return e=(e||0)%360,e<0?e+360:e}function pi(e){return Math.max(0,Math.min(1,e||0))}function ls(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Zf=e=>()=>e;function PP(e,t){return function(r){return e+r*t}}function TP(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function EP(e){return(e=+e)==1?D0:function(t,r){return r-t?TP(t,r,e):Zf(isNaN(t)?r:t)}}function D0(e,t){var r=t-e;return r?PP(e,r):Zf(isNaN(e)?t:e)}const Ny=function e(t){var r=EP(t);function n(i,a){var o=r((i=El(i)).r,(a=El(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),s=D0(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=c(f),i.opacity=s(f),i+""}}return n.gamma=e,n}(1);function jP(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:Di(n,i)})),r=fs.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function BP(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?FP:BP,c=s=null,l}function l(d){return d==null||isNaN(d=+d)?a:(c||(c=u(e.map(n),t,r)))(n(o(d)))}return l.invert=function(d){return o(i((s||(s=u(t,e.map(n),Di)))(d)))},l.domain=function(d){return arguments.length?(e=Array.from(d,qi),f()):e.slice()},l.range=function(d){return arguments.length?(t=Array.from(d),f()):t.slice()},l.rangeRound=function(d){return t=Array.from(d),r=Jf,f()},l.clamp=function(d){return arguments.length?(o=d?!0:ke,f()):o!==ke},l.interpolate=function(d){return arguments.length?(r=d,f()):r},l.unknown=function(d){return arguments.length?(a=d,l):a},function(d,p){return n=d,i=p,f()}}function Qf(){return Ma()(ke,ke)}function WP(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Li(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Sr(e){return e=Li(Math.abs(e)),e?e[1]:NaN}function zP(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function UP(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var HP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function En(e){if(!(t=HP.exec(e)))throw new Error("invalid format: "+e);var t;return new ed({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}En.prototype=ed.prototype;function ed(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ed.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function GP(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var q0;function KP(e,t){var r=Li(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(q0=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Li(e,Math.max(0,t+a-1))[0]}function qy(e,t){var r=Li(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Ly={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:WP,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qy(e*100,t),r:qy,s:KP,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function By(e){return e}var Fy=Array.prototype.map,Wy=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function VP(e){var t=e.grouping===void 0||e.thousands===void 0?By:zP(Fy.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?By:UP(Fy.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(l){l=En(l);var d=l.fill,p=l.align,y=l.sign,v=l.symbol,h=l.zero,b=l.width,x=l.comma,w=l.precision,O=l.trim,m=l.type;m==="n"?(x=!0,m="g"):Ly[m]||(w===void 0&&(w=12),O=!0,m="g"),(h||d==="0"&&p==="=")&&(h=!0,d="0",p="=");var g=v==="$"?r:v==="#"&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",_=v==="$"?n:/[%p]/.test(m)?o:"",A=Ly[m],T=/[defgprs%]/.test(m);w=w===void 0?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(P){var E=g,j=_,I,$,k;if(m==="c")j=A(P)+j,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?c:A(Math.abs(P),w),O&&(P=GP(P)),N&&+P==0&&y!=="+"&&(N=!1),E=(N?y==="("?y:u:y==="-"||y==="("?"":y)+E,j=(m==="s"?Wy[8+q0/3]:"")+j+(N&&y==="("?")":""),T){for(I=-1,$=P.length;++I<$;)if(k=P.charCodeAt(I),48>k||k>57){j=(k===46?i+P.slice(I+1):P.slice(I))+j,P=P.slice(0,I);break}}}x&&!h&&(P=t(P,1/0));var L=E.length+P.length+j.length,B=L>1)+E+P+j+B.slice(L);break;default:P=B+E+P+j;break}return a(P)}return M.toString=function(){return l+""},M}function f(l,d){var p=s((l=En(l),l.type="f",l)),y=Math.max(-8,Math.min(8,Math.floor(Sr(d)/3)))*3,v=Math.pow(10,-y),h=Wy[8+y/3];return function(b){return p(v*b)+h}}return{format:s,formatPrefix:f}}var vi,td,L0;XP({thousands:",",grouping:[3],currency:["$",""]});function XP(e){return vi=VP(e),td=vi.format,L0=vi.formatPrefix,vi}function YP(e){return Math.max(0,-Sr(Math.abs(e)))}function ZP(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sr(t)/3)))*3-Sr(Math.abs(e)))}function JP(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Sr(t)-Sr(e))+1}function B0(e,t,r,n){var i=Pl(e,t,r),a;switch(n=En(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=ZP(i,o))&&(n.precision=a),L0(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=JP(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=YP(i))&&(n.precision=a-(n.type==="%")*2);break}}return td(n)}function It(e){var t=e.domain;return e.ticks=function(r){var n=t();return Al(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return B0(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],c,s,f=10;for(u0;){if(s=Sl(o,u,r),s===c)return n[i]=o,n[a]=u,t(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function Bi(){var e=Qf();return e.copy=function(){return ai(e,Bi())},Ye.apply(e,arguments),It(e)}function F0(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,qi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return F0(e).unknown(t)},e=arguments.length?Array.from(e,qi):[0,1],It(r)}function W0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function nT(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Hy(e){return(t,r)=>-e(-t,r)}function rd(e){const t=e(zy,Uy),r=t.domain;let n=10,i,a;function o(){return i=nT(n),a=rT(n),r()[0]<0?(i=Hy(i),a=Hy(a),e(QP,eT)):e(zy,Uy),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const c=r();let s=c[0],f=c[c.length-1];const l=f0){for(;d<=p;++d)for(y=1;yf)break;b.push(v)}}else for(;d<=p;++d)for(y=n-1;y>=1;--y)if(v=d>0?y/a(-d):y*a(d),!(vf)break;b.push(v)}b.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=En(c)).precision==null&&(c.trim=!0),c=td(c)),u===1/0)return c;const s=Math.max(1,n*u/t.ticks().length);return f=>{let l=f/a(Math.round(i(f)));return l*nr(W0(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function z0(){const e=rd(Ma()).domain([1,10]);return e.copy=()=>ai(e,z0()).base(e.base()),Ye.apply(e,arguments),e}function Gy(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Ky(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function nd(e){var t=1,r=e(Gy(t),Ky(t));return r.constant=function(n){return arguments.length?e(Gy(t=+n),Ky(t)):t},It(r)}function U0(){var e=nd(Ma());return e.copy=function(){return ai(e,U0()).constant(e.constant())},Ye.apply(e,arguments)}function Vy(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function iT(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function aT(e){return e<0?-e*e:e*e}function id(e){var t=e(ke,ke),r=1;function n(){return r===1?e(ke,ke):r===.5?e(iT,aT):e(Vy(r),Vy(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},It(t)}function ad(){var e=id(Ma());return e.copy=function(){return ai(e,ad()).exponent(e.exponent())},Ye.apply(e,arguments),e}function oT(){return ad.apply(null,arguments).exponent(.5)}function Xy(e){return Math.sign(e)*e*e}function uT(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function H0(){var e=Qf(),t=[0,1],r=!1,n;function i(a){var o=uT(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Xy(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,qi)).map(Xy)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return H0(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Ye.apply(i,arguments),It(i)}function G0(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return K0().domain([e,t]).range(i).unknown(a)},Ye.apply(It(o),arguments)}function V0(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[ni(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return V0().domain(e).range(t).unknown(r)},Ye.apply(i,arguments)}const ds=new Date,hs=new Date;function _e(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return c;let s;do c.push(s=new Date(+a)),t(a,u),e(a);while(s_e(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(ds.setTime(+a),hs.setTime(+o),e(ds),e(hs),Math.floor(r(ds,hs))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Fi=_e(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Fi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_e(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Fi);Fi.range;const dt=1e3,Ke=dt*60,ht=Ke*60,gt=ht*24,od=gt*7,Yy=gt*30,ps=gt*365,Vt=_e(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*dt)},(e,t)=>(t-e)/dt,e=>e.getUTCSeconds());Vt.range;const ud=_e(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dt)},(e,t)=>{e.setTime(+e+t*Ke)},(e,t)=>(t-e)/Ke,e=>e.getMinutes());ud.range;const cd=_e(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ke)},(e,t)=>(t-e)/Ke,e=>e.getUTCMinutes());cd.range;const sd=_e(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dt-e.getMinutes()*Ke)},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getHours());sd.range;const ld=_e(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ht)},(e,t)=>(t-e)/ht,e=>e.getUTCHours());ld.range;const oi=_e(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ke)/gt,e=>e.getDate()-1);oi.range;const $a=_e(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/gt,e=>e.getUTCDate()-1);$a.range;const X0=_e(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/gt,e=>Math.floor(e/gt));X0.range;function ir(e){return _e(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ke)/od)}const Ca=ir(0),Wi=ir(1),cT=ir(2),sT=ir(3),Pr=ir(4),lT=ir(5),fT=ir(6);Ca.range;Wi.range;cT.range;sT.range;Pr.range;lT.range;fT.range;function ar(e){return _e(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/od)}const Ia=ar(0),zi=ar(1),dT=ar(2),hT=ar(3),Tr=ar(4),pT=ar(5),vT=ar(6);Ia.range;zi.range;dT.range;hT.range;Tr.range;pT.range;vT.range;const fd=_e(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());fd.range;const dd=_e(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());dd.range;const bt=_e(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());bt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_e(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});bt.range;const xt=_e(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());xt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_e(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});xt.range;function Y0(e,t,r,n,i,a){const o=[[Vt,1,dt],[Vt,5,5*dt],[Vt,15,15*dt],[Vt,30,30*dt],[a,1,Ke],[a,5,5*Ke],[a,15,15*Ke],[a,30,30*Ke],[i,1,ht],[i,3,3*ht],[i,6,6*ht],[i,12,12*ht],[n,1,gt],[n,2,2*gt],[r,1,od],[t,1,Yy],[t,3,3*Yy],[e,1,ps]];function u(s,f,l){const d=fh).right(o,d);if(p===o.length)return e.every(Pl(s/ps,f/ps,l));if(p===0)return Fi.every(Math.max(Pl(s,f,l),1));const[y,v]=o[d/o[p-1][2]53)return null;"w"in R||(R.w=1),"Z"in R?(ee=ys(en(R.y,0,1)),be=ee.getUTCDay(),ee=be>4||be===0?zi.ceil(ee):zi(ee),ee=$a.offset(ee,(R.V-1)*7),R.y=ee.getUTCFullYear(),R.m=ee.getUTCMonth(),R.d=ee.getUTCDate()+(R.w+6)%7):(ee=vs(en(R.y,0,1)),be=ee.getDay(),ee=be>4||be===0?Wi.ceil(ee):Wi(ee),ee=oi.offset(ee,(R.V-1)*7),R.y=ee.getFullYear(),R.m=ee.getMonth(),R.d=ee.getDate()+(R.w+6)%7)}else("W"in R||"U"in R)&&("w"in R||(R.w="u"in R?R.u%7:"W"in R?1:0),be="Z"in R?ys(en(R.y,0,1)).getUTCDay():vs(en(R.y,0,1)).getDay(),R.m=0,R.d="W"in R?(R.w+6)%7+R.W*7-(be+5)%7:R.w+R.U*7-(be+6)%7);return"Z"in R?(R.H+=R.Z/100|0,R.M+=R.Z%100,ys(R)):vs(R)}}function A(F,Y,Z,R){for(var pe=0,ee=Y.length,be=Z.length,xe,Ne;pe=be)return-1;if(xe=Y.charCodeAt(pe++),xe===37){if(xe=Y.charAt(pe++),Ne=m[xe in Zy?Y.charAt(pe++):xe],!Ne||(R=Ne(F,Z,R))<0)return-1}else if(xe!=Z.charCodeAt(R++))return-1}return R}function T(F,Y,Z){var R=s.exec(Y.slice(Z));return R?(F.p=f.get(R[0].toLowerCase()),Z+R[0].length):-1}function M(F,Y,Z){var R=p.exec(Y.slice(Z));return R?(F.w=y.get(R[0].toLowerCase()),Z+R[0].length):-1}function P(F,Y,Z){var R=l.exec(Y.slice(Z));return R?(F.w=d.get(R[0].toLowerCase()),Z+R[0].length):-1}function E(F,Y,Z){var R=b.exec(Y.slice(Z));return R?(F.m=x.get(R[0].toLowerCase()),Z+R[0].length):-1}function j(F,Y,Z){var R=v.exec(Y.slice(Z));return R?(F.m=h.get(R[0].toLowerCase()),Z+R[0].length):-1}function I(F,Y,Z){return A(F,t,Y,Z)}function $(F,Y,Z){return A(F,r,Y,Z)}function k(F,Y,Z){return A(F,n,Y,Z)}function N(F){return o[F.getDay()]}function L(F){return a[F.getDay()]}function B(F){return c[F.getMonth()]}function U(F){return u[F.getMonth()]}function G(F){return i[+(F.getHours()>=12)]}function W(F){return 1+~~(F.getMonth()/3)}function K(F){return o[F.getUTCDay()]}function fe(F){return a[F.getUTCDay()]}function ye(F){return c[F.getUTCMonth()]}function Le(F){return u[F.getUTCMonth()]}function Dt(F){return i[+(F.getUTCHours()>=12)]}function Re(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var Y=g(F+="",w);return Y.toString=function(){return F},Y},parse:function(F){var Y=_(F+="",!1);return Y.toString=function(){return F},Y},utcFormat:function(F){var Y=g(F+="",O);return Y.toString=function(){return F},Y},utcParse:function(F){var Y=_(F+="",!0);return Y.toString=function(){return F},Y}}}var Zy={"-":"",_:" ",0:"0"},Pe=/^\s*\d+/,wT=/^%/,OT=/[\\^$*+?|[\]().{}]/g;function te(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function AT(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function ST(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function PT(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function TT(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function ET(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Jy(e,t,r){var n=Pe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Qy(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function jT(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function MT(e,t,r){var n=Pe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function $T(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function em(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function CT(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tm(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function IT(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function kT(e,t,r){var n=Pe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function RT(e,t,r){var n=Pe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function NT(e,t,r){var n=Pe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function DT(e,t,r){var n=wT.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function qT(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function LT(e,t,r){var n=Pe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rm(e,t){return te(e.getDate(),t,2)}function BT(e,t){return te(e.getHours(),t,2)}function FT(e,t){return te(e.getHours()%12||12,t,2)}function WT(e,t){return te(1+oi.count(bt(e),e),t,3)}function Z0(e,t){return te(e.getMilliseconds(),t,3)}function zT(e,t){return Z0(e,t)+"000"}function UT(e,t){return te(e.getMonth()+1,t,2)}function HT(e,t){return te(e.getMinutes(),t,2)}function GT(e,t){return te(e.getSeconds(),t,2)}function KT(e){var t=e.getDay();return t===0?7:t}function VT(e,t){return te(Ca.count(bt(e)-1,e),t,2)}function J0(e){var t=e.getDay();return t>=4||t===0?Pr(e):Pr.ceil(e)}function XT(e,t){return e=J0(e),te(Pr.count(bt(e),e)+(bt(e).getDay()===4),t,2)}function YT(e){return e.getDay()}function ZT(e,t){return te(Wi.count(bt(e)-1,e),t,2)}function JT(e,t){return te(e.getFullYear()%100,t,2)}function QT(e,t){return e=J0(e),te(e.getFullYear()%100,t,2)}function eE(e,t){return te(e.getFullYear()%1e4,t,4)}function tE(e,t){var r=e.getDay();return e=r>=4||r===0?Pr(e):Pr.ceil(e),te(e.getFullYear()%1e4,t,4)}function rE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+te(t/60|0,"0",2)+te(t%60,"0",2)}function nm(e,t){return te(e.getUTCDate(),t,2)}function nE(e,t){return te(e.getUTCHours(),t,2)}function iE(e,t){return te(e.getUTCHours()%12||12,t,2)}function aE(e,t){return te(1+$a.count(xt(e),e),t,3)}function Q0(e,t){return te(e.getUTCMilliseconds(),t,3)}function oE(e,t){return Q0(e,t)+"000"}function uE(e,t){return te(e.getUTCMonth()+1,t,2)}function cE(e,t){return te(e.getUTCMinutes(),t,2)}function sE(e,t){return te(e.getUTCSeconds(),t,2)}function lE(e){var t=e.getUTCDay();return t===0?7:t}function fE(e,t){return te(Ia.count(xt(e)-1,e),t,2)}function ex(e){var t=e.getUTCDay();return t>=4||t===0?Tr(e):Tr.ceil(e)}function dE(e,t){return e=ex(e),te(Tr.count(xt(e),e)+(xt(e).getUTCDay()===4),t,2)}function hE(e){return e.getUTCDay()}function pE(e,t){return te(zi.count(xt(e)-1,e),t,2)}function vE(e,t){return te(e.getUTCFullYear()%100,t,2)}function yE(e,t){return e=ex(e),te(e.getUTCFullYear()%100,t,2)}function mE(e,t){return te(e.getUTCFullYear()%1e4,t,4)}function gE(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Tr(e):Tr.ceil(e),te(e.getUTCFullYear()%1e4,t,4)}function bE(){return"+0000"}function im(){return"%"}function am(e){return+e}function om(e){return Math.floor(+e/1e3)}var sr,tx,rx;xE({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function xE(e){return sr=xT(e),tx=sr.format,sr.parse,rx=sr.utcFormat,sr.utcParse,sr}function wE(e){return new Date(e)}function OE(e){return e instanceof Date?+e:+new Date(+e)}function hd(e,t,r,n,i,a,o,u,c,s){var f=Qf(),l=f.invert,d=f.domain,p=s(".%L"),y=s(":%S"),v=s("%I:%M"),h=s("%I %p"),b=s("%a %d"),x=s("%b %d"),w=s("%B"),O=s("%Y");function m(g){return(c(g)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>fP(e,a/n))},r.copy=function(){return ox(t).domain(e)},At.apply(r,arguments)}function Ra(){var e=0,t=.5,r=1,n=1,i,a,o,u,c,s=ke,f,l=!1,d;function p(v){return isNaN(v=+v)?d:(v=.5+((v=+f(v))-a)*(n*vr}return gs=e,gs}var bs,lm;function TE(){if(lm)return bs;lm=1;var e=Na(),t=lx(),r=Gr();function n(i){return i&&i.length?e(i,r,t):void 0}return bs=n,bs}var EE=TE();const Da=oe(EE);var xs,fm;function fx(){if(fm)return xs;fm=1;function e(t,r){return te.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};z.decimalPlaces=z.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*de;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};z.dividedBy=z.div=function(e){return mt(this,new this.constructor(e))};z.dividedToIntegerBy=z.idiv=function(e){var t=this,r=t.constructor;return ue(mt(t,new r(e),0,1),r.precision)};z.equals=z.eq=function(e){return!this.cmp(e)};z.exponent=function(){return ge(this)};z.greaterThan=z.gt=function(e){return this.cmp(e)>0};z.greaterThanOrEqualTo=z.gte=function(e){return this.cmp(e)>=0};z.isInteger=z.isint=function(){return this.e>this.d.length-2};z.isNegative=z.isneg=function(){return this.s<0};z.isPositive=z.ispos=function(){return this.s>0};z.isZero=function(){return this.s===0};z.lessThan=z.lt=function(e){return this.cmp(e)<0};z.lessThanOrEqualTo=z.lte=function(e){return this.cmp(e)<1};z.logarithm=z.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(We))throw Error(Xe+"NaN");if(r.s<1)throw Error(Xe+(r.s?"NaN":"-Infinity"));return r.eq(We)?new n(0):(he=!1,t=mt(jn(r,a),jn(e,a),a),he=!0,ue(t,i))};z.minus=z.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vx(t,e):hx(t,(e.s=-e.s,e))};z.modulo=z.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Xe+"NaN");return r.s?(he=!1,t=mt(r,e,0,1).times(e),he=!0,r.minus(t)):ue(new n(r),i)};z.naturalExponential=z.exp=function(){return px(this)};z.naturalLogarithm=z.ln=function(){return jn(this)};z.negated=z.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};z.plus=z.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?hx(t,e):vx(t,(e.s=-e.s,e))};z.precision=z.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Zt+e);if(t=ge(i)+1,n=i.d.length-1,r=n*de+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};z.squareRoot=z.sqrt=function(){var e,t,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(Xe+"NaN")}for(e=ge(u),he=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=nt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xr((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(mt(u,a,o+2)).times(.5),nt(a.d).slice(0,o)===(t=nt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ue(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return he=!0,ue(n,r)};z.times=z.mul=function(e){var t,r,n,i,a,o,u,c,s,f=this,l=f.constructor,d=f.d,p=(e=new l(e)).d;if(!f.s||!e.s)return new l(0);for(e.s*=f.s,r=f.e+e.e,c=d.length,s=p.length,c=0;){for(t=0,i=c+n;i>n;)u=a[i]+p[n]*d[i-n-1]+t,a[i--]=u%Ae|0,t=u/Ae|0;a[i]=(a[i]+t)%Ae|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,he?ue(e,l.precision):e};z.toDecimalPlaces=z.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ot(e,0,Vr),t===void 0?t=n.rounding:ot(t,0,8),ue(r,e+ge(r)+1,t))};z.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=er(n,!0):(ot(e,0,Vr),t===void 0?t=i.rounding:ot(t,0,8),n=ue(new i(n),e+1,t),r=er(n,!0,e+1)),r};z.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?er(i):(ot(e,0,Vr),t===void 0?t=a.rounding:ot(t,0,8),n=ue(new a(i),e+ge(i)+1,t),r=er(n.abs(),!1,e+ge(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};z.toInteger=z.toint=function(){var e=this,t=e.constructor;return ue(new t(e),ge(e)+1,t.rounding)};z.toNumber=function(){return+this};z.toPower=z.pow=function(e){var t,r,n,i,a,o,u=this,c=u.constructor,s=12,f=+(e=new c(e));if(!e.s)return new c(We);if(u=new c(u),!u.s){if(e.s<1)throw Error(Xe+"Infinity");return u}if(u.eq(We))return u;if(n=c.precision,e.eq(We))return ue(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=f<0?-f:f)<=dx){for(i=new c(We),t=Math.ceil(n/de+4),he=!1;r%2&&(i=i.times(u),mm(i.d,t)),r=Xr(r/2),r!==0;)u=u.times(u),mm(u.d,t);return he=!0,e.s<0?new c(We).div(i):ue(i,n)}}else if(a<0)throw Error(Xe+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,he=!1,i=e.times(jn(u,n+s)),he=!0,i=px(i),i.s=a,i};z.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=ge(i),n=er(i,r<=a.toExpNeg||r>=a.toExpPos)):(ot(e,1,Vr),t===void 0?t=a.rounding:ot(t,0,8),i=ue(new a(i),e,t),r=ge(i),n=er(i,e<=r||r<=a.toExpNeg,e)),n};z.toSignificantDigits=z.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ot(e,1,Vr),t===void 0?t=n.rounding:ot(t,0,8)),ue(new n(r),e,t)};z.toString=z.valueOf=z.val=z.toJSON=z[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ge(e),r=e.constructor;return er(e,t<=r.toExpNeg||t>=r.toExpPos)};function hx(e,t){var r,n,i,a,o,u,c,s,f=e.constructor,l=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),he?ue(t,l):t;if(c=e.d,s=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=s.length):(n=s,i=o,u=c.length),o=Math.ceil(l/de),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=s.length,u-a<0&&(a=u,n=s,s=c,c=n),r=0;a;)r=(c[--a]=c[a]+s[a]+r)/Ae|0,c[a]%=Ae;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return t.d=c,t.e=i,he?ue(t,l):t}function ot(e,t,r){if(e!==~~e||er)throw Error(Zt+e)}function nt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=c=0;ui[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,c,s,f,l,d,p,y,v,h,b,x,w,O,m,g,_,A,T=n.constructor,M=n.s==i.s?1:-1,P=n.d,E=i.d;if(!n.s)return new T(n);if(!i.s)throw Error(Xe+"Division by zero");for(c=n.e-i.e,_=E.length,m=P.length,p=new T(M),y=p.d=[],s=0;E[s]==(P[s]||0);)++s;if(E[s]>(P[s]||0)&&--c,a==null?x=a=T.precision:o?x=a+(ge(n)-ge(i))+1:x=a,x<0)return new T(0);if(x=x/de+2|0,s=0,_==1)for(f=0,E=E[0],x++;(s1&&(E=e(E,f),P=e(P,f),_=E.length,m=P.length),O=_,v=P.slice(0,_),h=v.length;h<_;)v[h++]=0;A=E.slice(),A.unshift(0),g=E[0],E[1]>=Ae/2&&++g;do f=0,u=t(E,v,_,h),u<0?(b=v[0],_!=h&&(b=b*Ae+(v[1]||0)),f=b/g|0,f>1?(f>=Ae&&(f=Ae-1),l=e(E,f),d=l.length,h=v.length,u=t(l,v,d,h),u==1&&(f--,r(l,_16)throw Error(yd+ge(e));if(!e.s)return new f(We);for(t==null?(he=!1,u=l):u=t,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(Ut(2,s))/Math.LN10*2+5|0,u+=n,r=i=a=new f(We),f.precision=u;;){if(i=ue(i.times(e),u),r=r.times(++c),o=a.plus(mt(i,r,u)),nt(o.d).slice(0,u)===nt(a.d).slice(0,u)){for(;s--;)a=ue(a.times(a),u);return f.precision=l,t==null?(he=!0,ue(a,l)):a}a=o}}function ge(e){for(var t=e.e*de,r=e.d[0];r>=10;r/=10)t++;return t}function Ss(e,t,r){if(t>e.LN10.sd())throw he=!0,r&&(e.precision=r),Error(Xe+"LN10 precision limit exceeded");return ue(new e(e.LN10),t)}function Tt(e){for(var t="";e--;)t+="0";return t}function jn(e,t){var r,n,i,a,o,u,c,s,f,l=1,d=10,p=e,y=p.d,v=p.constructor,h=v.precision;if(p.s<1)throw Error(Xe+(p.s?"NaN":"-Infinity"));if(p.eq(We))return new v(0);if(t==null?(he=!1,s=h):s=t,p.eq(10))return t==null&&(he=!0),Ss(v,s);if(s+=d,v.precision=s,r=nt(y),n=r.charAt(0),a=ge(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=nt(p.d),n=r.charAt(0),l++;a=ge(p),n>1?(p=new v("0."+r),a++):p=new v(n+"."+r.slice(1))}else return c=Ss(v,s+2,h).times(a+""),p=jn(new v(n+"."+r.slice(1)),s-d).plus(c),v.precision=h,t==null?(he=!0,ue(p,h)):p;for(u=o=p=mt(p.minus(We),p.plus(We),s),f=ue(p.times(p),s),i=3;;){if(o=ue(o.times(f),s),c=u.plus(mt(o,new v(i),s)),nt(c.d).slice(0,s)===nt(u.d).slice(0,s))return u=u.times(2),a!==0&&(u=u.plus(Ss(v,s+2,h).times(a+""))),u=mt(u,new v(l),s),v.precision=h,t==null?(he=!0,ue(u,h)):u;u=c,i+=2}}function ym(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Xr(r/de),e.d=[],n=(r+1)%de,r<0&&(n+=de),nUi||e.e<-Ui))throw Error(yd+r)}else e.s=0,e.e=0,e.d=[0];return e}function ue(e,t,r){var n,i,a,o,u,c,s,f,l=e.d;for(o=1,a=l[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=de,i=t,s=l[f=0];else{if(f=Math.ceil((n+1)/de),a=l.length,f>=a)return e;for(s=a=l[f],o=1;a>=10;a/=10)o++;n%=de,i=n-de+o}if(r!==void 0&&(a=Ut(10,o-i-1),u=s/a%10|0,c=t<0||l[f+1]!==void 0||s%a,c=r<4?(u||c)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?s/Ut(10,o-i):0:l[f-1])%10&1||r==(e.s<0?8:7))),t<1||!l[0])return c?(a=ge(e),l.length=1,t=t-a-1,l[0]=Ut(10,(de-t%de)%de),e.e=Xr(-t/de)||0):(l.length=1,l[0]=e.e=e.s=0),e;if(n==0?(l.length=f,a=1,f--):(l.length=f+1,a=Ut(10,de-n),l[f]=i>0?(s/Ut(10,o-i)%Ut(10,i)|0)*a:0),c)for(;;)if(f==0){(l[0]+=a)==Ae&&(l[0]=1,++e.e);break}else{if(l[f]+=a,l[f]!=Ae)break;l[f--]=0,a=1}for(n=l.length;l[--n]===0;)l.pop();if(he&&(e.e>Ui||e.e<-Ui))throw Error(yd+ge(e));return e}function vx(e,t){var r,n,i,a,o,u,c,s,f,l,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),he?ue(t,p):t;if(c=e.d,l=t.d,n=t.e,s=e.e,c=c.slice(),o=s-n,o){for(f=o<0,f?(r=c,o=-o,u=l.length):(r=l,n=s,u=c.length),i=Math.max(Math.ceil(p/de),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=l.length,f=i0;--i)c[u++]=0;for(i=l.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Tt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Tt(-i-1)+a,r&&(n=r-o)>0&&(a+=Tt(n))):i>=o?(a+=Tt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Tt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Tt(n))),e.s<0?"-"+a:a}function mm(e,t){if(e.length>t)return e.length=t,!0}function yx(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Zt+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ym(o,a.toString())}else if(typeof a!="string")throw Error(Zt+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,qE.test(a))ym(o,a);else throw Error(Zt+a)}if(i.prototype=z,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=yx,i.config=i.set=LE,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Zt+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Zt+r+": "+n);return this}var md=yx(DE);We=new md(1);const ae=md;function BE(e){return UE(e)||zE(e)||WE(e)||FE()}function FE(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WE(e,t){if(e){if(typeof e=="string")return $l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $l(e,t)}}function zE(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function UE(e){if(Array.isArray(e))return $l(e)}function $l(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,gm(function(){for(var u=arguments.length,c=new Array(u),s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function aj(e){if(Array.isArray(e))return e}function wx(e){var t=Mn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function Ox(e,t,r){if(e.lte(0))return new ae(0);var n=Fa.getDigitCount(e.toNumber()),i=new ae(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new ae(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=u.mul(i);return t?c:new ae(Math.ceil(c))}function oj(e,t,r){var n=1,i=new ae(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new ae(10).pow(Fa.getDigitCount(e)-1),i=new ae(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new ae(Math.floor(e)))}else e===0?i=new ae(Math.floor((t-1)/2)):r||(i=new ae(Math.floor(e)));var o=Math.floor((t-1)/2),u=VE(KE(function(c){return i.add(new ae(c-o).mul(n)).toNumber()}),Cl);return u(0,t)}function _x(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ae(0),tickMin:new ae(0),tickMax:new ae(0)};var a=Ox(new ae(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new ae(0):(o=new ae(e).add(t).div(2),o=o.sub(new ae(o).mod(a)));var u=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new ae(t).sub(o).div(a).toNumber()),s=u+c+1;return s>r?_x(e,t,r,n,i+1):(s0?c+(r-s):c,u=t>0?u:u+(r-s)),{step:a,tickMin:o.sub(new ae(u).mul(a)),tickMax:o.add(new ae(c).mul(a))})}function uj(e){var t=Mn(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=wx([r,n]),c=Mn(u,2),s=c[0],f=c[1];if(s===-1/0||f===1/0){var l=f===1/0?[s].concat(kl(Cl(0,i-1).map(function(){return 1/0}))):[].concat(kl(Cl(0,i-1).map(function(){return-1/0})),[f]);return r>n?Il(l):l}if(s===f)return oj(s,i,a);var d=_x(s,f,o,a),p=d.step,y=d.tickMin,v=d.tickMax,h=Fa.rangeStep(y,v.add(new ae(.1).mul(p)),p);return r>n?Il(h):h}function cj(e,t){var r=Mn(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=wx([n,i]),u=Mn(o,2),c=u[0],s=u[1];if(c===-1/0||s===1/0)return[n,i];if(c===s)return[c];var f=Math.max(t,2),l=Ox(new ae(s).sub(c).div(f-1),a,0),d=[].concat(kl(Fa.rangeStep(new ae(c),new ae(s).sub(new ae(.99).mul(l)),l)),[s]);return n>i?Il(d):d}var sj=bx(uj),lj=bx(cj),fj="Invariant failed";function tr(e,t){throw new Error(fj)}var dj=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Er(e){"@babel/helpers - typeof";return Er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(e)}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bj(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wj(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,s=0;s0?i[s-1].coordinate:i[u-1].coordinate,l=i[s].coordinate,d=s>=u-1?i[0].coordinate:i[s+1].coordinate,p=void 0;if(Ce(l-f)!==Ce(d-l)){var y=[];if(Ce(d-l)===Ce(c[1]-c[0])){p=d;var v=l+c[1]-c[0];y[0]=Math.min(v,(v+f)/2),y[1]=Math.max(v,(v+f)/2)}else{p=f;var h=d+c[1]-c[0];y[0]=Math.min(l,(h+l)/2),y[1]=Math.max(l,(h+l)/2)}var b=[Math.min(l,(p+l)/2),Math.max(l,(p+l)/2)];if(t>b[0]&&t<=b[1]||t>=y[0]&&t<=y[1]){o=i[s].index;break}}else{var x=Math.min(f,d),w=Math.max(f,d);if(t>(x+l)/2&&t<=(w+l)/2){o=i[s].index;break}}}else for(var O=0;O0&&O(n[O].coordinate+n[O-1].coordinate)/2&&t<=(n[O].coordinate+n[O+1].coordinate)/2||O===u-1&&t>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},gd=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?ve(ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,u=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:u;break;default:c=u;break}return c},qj=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),c=0,s=u.length;c=0});if(b&&b.length){var x=b[0].type.defaultProps,w=x!==void 0?ve(ve({},x),b[0].props):b[0].props,O=w.barSize,m=w[h];o[m]||(o[m]=[]);var g=Q(O)?r:O;o[m].push({item:b[0],stackList:b.slice(1),barSize:Q(g)?void 0:Ie(g,n,0)})}}return o},Lj=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,u=t.maxBarSize,c=o.length;if(c<1)return null;var s=Ie(r,i,0,!0),f,l=[];if(o[0].barSize===+o[0].barSize){var d=!1,p=i/c,y=o.reduce(function(O,m){return O+m.barSize||0},0);y+=(c-1)*s,y>=i&&(y-=(c-1)*s,s=0),y>=i&&p>0&&(d=!0,p*=.9,y=c*p);var v=(i-y)/2>>0,h={offset:v-s,size:0};f=o.reduce(function(O,m){var g={item:m.item,position:{offset:h.offset+h.size+s,size:d?p:m.barSize}},_=[].concat(wm(O),[g]);return h=_[_.length-1].position,m.stackList&&m.stackList.length&&m.stackList.forEach(function(A){_.push({item:A,position:h})}),_},l)}else{var b=Ie(n,i,0,!0);i-2*b-(c-1)*s<=0&&(s=0);var x=(i-2*b-(c-1)*s)/c;x>1&&(x>>=0);var w=u===+u?Math.min(x,u):x;f=o.reduce(function(O,m,g){var _=[].concat(wm(O),[{item:m.item,position:{offset:b+(x+s)*g+(x-w)/2,size:w}}]);return m.stackList&&m.stackList.length&&m.stackList.forEach(function(A){_.push({item:A,position:_[_.length-1].position})}),_},l)}return f},Bj=function(t,r,n,i){var a=n.children,o=n.width,u=n.margin,c=o-(u.left||0)-(u.right||0),s=Tx({children:a,legendWidth:c});if(s){var f=i||{},l=f.width,d=f.height,p=s.align,y=s.verticalAlign,v=s.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&D(t[p]))return ve(ve({},t),{},br({},p,t[p]+(l||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&D(t[y]))return ve(ve({},t),{},br({},y,t[y]+(d||0)))}return t},Fj=function(t,r,n){return Q(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Ex=function(t,r,n,i,a){var o=r.props.children,u=Ve(o,Wa).filter(function(s){return Fj(i,a,s.props.direction)});if(u&&u.length){var c=u.map(function(s){return s.props.dataKey});return t.reduce(function(s,f){var l=Me(f,n);if(Q(l))return s;var d=Array.isArray(l)?[qa(l),Da(l)]:[l,l],p=c.reduce(function(y,v){var h=Me(f,v,0),b=d[0]-Math.abs(Array.isArray(h)?h[0]:h),x=d[1]+Math.abs(Array.isArray(h)?h[1]:h);return[Math.min(b,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],s[0]),Math.max(p[1],s[1])]},[1/0,-1/0])}return null},Wj=function(t,r,n,i,a){var o=r.map(function(u){return Ex(t,u,n,a,i)}).filter(function(u){return!Q(u)});return o&&o.length?o.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]):null},jx=function(t,r,n,i,a){var o=r.map(function(c){var s=c.props.dataKey;return n==="number"&&s&&Ex(t,c,s,i)||hn(t,s,n,a)});if(n==="number")return o.reduce(function(c,s){return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]);var u={};return o.reduce(function(c,s){for(var f=0,l=s.length;f=2?Ce(u[0]-u[1])*2*s:s,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(l){var d=a?a.indexOf(l):l;return{coordinate:i(d)+s,value:l,offset:s}});return f.filter(function(l){return!ei(l.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(l,d){return{coordinate:i(l)+s,value:l,index:d,offset:s}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(l){return{coordinate:i(l)+s,value:l,offset:s}}):i.domain().map(function(l,d){return{coordinate:i(l)+s,value:a?a[l]:l,index:d,offset:s}})},Ps=new WeakMap,yi=function(t,r){if(typeof r!="function")return t;Ps.has(t)||Ps.set(t,new WeakMap);var n=Ps.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},Cx=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,u=t.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:An(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:Bi(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:dn(),realScaleType:"point"}:a==="category"?{scale:An(),realScaleType:"band"}:{scale:Bi(),realScaleType:"linear"};if(Qn(i)){var c="scale".concat(_a(i));return{scale:(um[c]||dn)(),realScaleType:um[c]?c:"point"}}return X(i)?{scale:i}:{scale:dn(),realScaleType:"point"}},_m=1e-4,Ix=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-_m,o=Math.max(i[0],i[1])+_m,u=t(r[0]),c=t(r[n-1]);(uo||co)&&t.domain([r[0],r[n-1]])}},zj=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[u][n][0]=a,t[u][n][1]=a+c,a=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+c,o=t[u][n][1])}},Gj=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+u,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},Kj={sign:Hj,expand:k_,none:xr,silhouette:R_,wiggle:N_,positive:Gj},Vj=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),a=Kj[n],o=I_().keys(i).value(function(u,c){return+Me(u,c,0)}).order(hl).offset(a);return o(t)},Xj=function(t,r,n,i,a,o){if(!t)return null;var u=o?r.reverse():r,c={},s=u.reduce(function(l,d){var p,y=(p=d.type)!==null&&p!==void 0&&p.defaultProps?ve(ve({},d.type.defaultProps),d.props):d.props,v=y.stackId,h=y.hide;if(h)return l;var b=y[n],x=l[b]||{hasStack:!1,stackGroups:{}};if(Oe(v)){var w=x.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(d),x.hasStack=!0,x.stackGroups[v]=w}else x.stackGroups[ti("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[d]};return ve(ve({},l),{},br({},b,x))},c),f={};return Object.keys(s).reduce(function(l,d){var p=s[d];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,h){var b=p.stackGroups[h];return ve(ve({},v),{},br({},h,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:Vj(t,b.items,a)}))},y)}return ve(ve({},l),{},br({},d,p))},f)},kx=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var s=t.domain();if(!s.length)return null;var f=sj(s,a,u);return t.domain([qa(f),Da(f)]),{niceTicks:f}}if(a&&i==="number"){var l=t.domain(),d=lj(l,a,u);return{niceTicks:d}}return null},Am=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var c=Me(o,r.dataKey,r.domain[u]);return Q(c)?null:r.scale(c)-a/2+i},Yj=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},Zj=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ve(ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Oe(a)){var o=r[a];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},Jj=function(t){return t.reduce(function(r,n){return[qa(n.concat([r[0]]).filter(D)),Da(n.concat([r[1]]).filter(D))]},[1/0,-1/0])},Rx=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],u=o.stackedData,c=u.reduce(function(s,f){var l=Jj(f.slice(r,n+1));return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Sm=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Pm=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ql=function(t,r,n){if(X(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(D(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(Sm.test(t[0])){var a=+Sm.exec(t[0])[1];i[0]=r[0]-a}else X(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(D(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(Pm.test(t[1])){var o=+Pm.exec(t[1])[1];i[1]=r[1]+o}else X(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Ki=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=Hf(r,function(l){return l.coordinate}),o=1/0,u=1,c=a.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},uM=function(t,r,n,i,a){var o=t.width,u=t.height,c=t.startAngle,s=t.endAngle,f=Ie(t.cx,o,o/2),l=Ie(t.cy,u,u/2),d=qx(o,u,n),p=Ie(t.innerRadius,d,0),y=Ie(t.outerRadius,d,d*.8),v=Object.keys(r);return v.reduce(function(h,b){var x=r[b],w=x.domain,O=x.reversed,m;if(Q(x.range))i==="angleAxis"?m=[c,s]:i==="radiusAxis"&&(m=[p,y]),O&&(m=[m[1],m[0]]);else{m=x.range;var g=m,_=tM(g,2);c=_[0],s=_[1]}var A=Cx(x,a),T=A.realScaleType,M=A.scale;M.domain(w).range(m),Ix(M);var P=kx(M,ft(ft({},x),{},{realScaleType:T})),E=ft(ft(ft({},x),P),{},{range:m,radius:y,realScaleType:T,scale:M,cx:f,cy:l,innerRadius:p,outerRadius:y,startAngle:c,endAngle:s});return ft(ft({},h),{},Dx({},b,E))},{})},cM=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},sM=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,u=cM({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var c=(n-a)/u,s=Math.acos(c);return i>o&&(s=2*Math.PI-s),{radius:u,angle:oM(s),angleInRadian:s}},lM=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},fM=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return t+u*360},Mm=function(t,r){var n=t.x,i=t.y,a=sM({x:n,y:i},r),o=a.radius,u=a.angle,c=r.innerRadius,s=r.outerRadius;if(os)return!1;if(o===0)return!0;var f=lM(r),l=f.startAngle,d=f.endAngle,p=u,y;if(l<=d){for(;p>d;)p-=360;for(;p=l&&p<=d}else{for(;p>l;)p-=360;for(;p=d&&p<=l}return y?ft(ft({},r),{},{radius:o,angle:fM(p,r)}):null},Lx=function(t){return!q.isValidElement(t)&&!X(t)&&typeof t!="boolean"?t.className:""};function kn(e){"@babel/helpers - typeof";return kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kn(e)}var dM=["offset"];function hM(e){return mM(e)||yM(e)||vM(e)||pM()}function pM(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vM(e,t){if(e){if(typeof e=="string")return Ll(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ll(e,t)}}function yM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mM(e){if(Array.isArray(e))return Ll(e)}function Ll(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function we(e){for(var t=1;t=0?1:-1,w,O;i==="insideStart"?(w=p+x*o,O=v):i==="insideEnd"?(w=y-x*o,O=!v):i==="end"&&(w=y+x*o,O=v),O=b<=0?O:!O;var m=le(s,f,h,w),g=le(s,f,h,w+(O?1:-1)*359),_="M".concat(m.x,",").concat(m.y,` + A`).concat(h,",").concat(h,",0,1,").concat(O?0:1,`, + `).concat(g.x,",").concat(g.y),A=Q(t.id)?ti("recharts-radial-line-"):t.id;return S.createElement("text",Rn({},n,{dominantBaseline:"central",className:J("recharts-radial-bar-label",u)}),S.createElement("defs",null,S.createElement("path",{id:A,d:_})),S.createElement("textPath",{xlinkHref:"#".concat(A)},r))},PM=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,u=a.cy,c=a.innerRadius,s=a.outerRadius,f=a.startAngle,l=a.endAngle,d=(f+l)/2;if(i==="outside"){var p=le(o,u,s+n,d),y=p.x,v=p.y;return{x:y,y:v,textAnchor:y>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var h=(c+s)/2,b=le(o,u,h,d),x=b.x,w=b.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},TM=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,u=o.x,c=o.y,s=o.width,f=o.height,l=f>=0?1:-1,d=l*i,p=l>0?"end":"start",y=l>0?"start":"end",v=s>=0?1:-1,h=v*i,b=v>0?"end":"start",x=v>0?"start":"end";if(a==="top"){var w={x:u+s/2,y:c-l*i,textAnchor:"middle",verticalAnchor:p};return we(we({},w),n?{height:Math.max(c-n.y,0),width:s}:{})}if(a==="bottom"){var O={x:u+s/2,y:c+f+d,textAnchor:"middle",verticalAnchor:y};return we(we({},O),n?{height:Math.max(n.y+n.height-(c+f),0),width:s}:{})}if(a==="left"){var m={x:u-h,y:c+f/2,textAnchor:b,verticalAnchor:"middle"};return we(we({},m),n?{width:Math.max(m.x-n.x,0),height:f}:{})}if(a==="right"){var g={x:u+s+h,y:c+f/2,textAnchor:x,verticalAnchor:"middle"};return we(we({},g),n?{width:Math.max(n.x+n.width-g.x,0),height:f}:{})}var _=n?{width:s,height:f}:{};return a==="insideLeft"?we({x:u+h,y:c+f/2,textAnchor:x,verticalAnchor:"middle"},_):a==="insideRight"?we({x:u+s-h,y:c+f/2,textAnchor:b,verticalAnchor:"middle"},_):a==="insideTop"?we({x:u+s/2,y:c+d,textAnchor:"middle",verticalAnchor:y},_):a==="insideBottom"?we({x:u+s/2,y:c+f-d,textAnchor:"middle",verticalAnchor:p},_):a==="insideTopLeft"?we({x:u+h,y:c+d,textAnchor:x,verticalAnchor:y},_):a==="insideTopRight"?we({x:u+s-h,y:c+d,textAnchor:b,verticalAnchor:y},_):a==="insideBottomLeft"?we({x:u+h,y:c+f-d,textAnchor:x,verticalAnchor:p},_):a==="insideBottomRight"?we({x:u+s-h,y:c+f-d,textAnchor:b,verticalAnchor:p},_):Hr(a)&&(D(a.x)||Gt(a.x))&&(D(a.y)||Gt(a.y))?we({x:u+Ie(a.x,s),y:c+Ie(a.y,f),textAnchor:"end",verticalAnchor:"end"},_):we({x:u+s/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},EM=function(t){return"cx"in t&&D(t.cx)};function Se(e){var t=e.offset,r=t===void 0?5:t,n=gM(e,dM),i=we({offset:r},n),a=i.viewBox,o=i.position,u=i.value,c=i.children,s=i.content,f=i.className,l=f===void 0?"":f,d=i.textBreakAll;if(!a||Q(u)&&Q(c)&&!q.isValidElement(s)&&!X(s))return null;if(q.isValidElement(s))return q.cloneElement(s,i);var p;if(X(s)){if(p=q.createElement(s,i),q.isValidElement(p))return p}else p=_M(i);var y=EM(a),v=V(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return SM(i,p,v);var h=y?PM(i):TM(i);return S.createElement(Qt,Rn({className:J("recharts-label",l)},v,h,{breakAll:d}),p)}Se.displayName="Label";var Bx=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,u=t.r,c=t.radius,s=t.innerRadius,f=t.outerRadius,l=t.x,d=t.y,p=t.top,y=t.left,v=t.width,h=t.height,b=t.clockWise,x=t.labelViewBox;if(x)return x;if(D(v)&&D(h)){if(D(l)&&D(d))return{x:l,y:d,width:v,height:h};if(D(p)&&D(y))return{x:p,y,width:v,height:h}}return D(l)&&D(d)?{x:l,y:d,width:0,height:0}:D(r)&&D(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:s||0,outerRadius:f||c||u||0,clockWise:b}:t.viewBox?t.viewBox:{}},jM=function(t,r){return t?t===!0?S.createElement(Se,{key:"label-implicit",viewBox:r}):Oe(t)?S.createElement(Se,{key:"label-implicit",viewBox:r,value:t}):q.isValidElement(t)?t.type===Se?q.cloneElement(t,{key:"label-implicit",viewBox:r}):S.createElement(Se,{key:"label-implicit",content:t,viewBox:r}):X(t)?S.createElement(Se,{key:"label-implicit",content:t,viewBox:r}):Hr(t)?S.createElement(Se,Rn({viewBox:r},t,{key:"label-implicit"})):null:null},MM=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=Bx(t),o=Ve(i,Se).map(function(c,s){return q.cloneElement(c,{viewBox:r||a,key:"label-".concat(s)})});if(!n)return o;var u=jM(t.label,r||a);return[u].concat(hM(o))};Se.parseViewBox=Bx;Se.renderCallByParent=MM;var Ts,Cm;function $M(){if(Cm)return Ts;Cm=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ts=e,Ts}var CM=$M();const IM=oe(CM);function Nn(e){"@babel/helpers - typeof";return Nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(e)}var kM=["valueAccessor"],RM=["data","dataKey","clockWise","id","textBreakAll"];function NM(e){return BM(e)||LM(e)||qM(e)||DM()}function DM(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qM(e,t){if(e){if(typeof e=="string")return Bl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bl(e,t)}}function LM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BM(e){if(Array.isArray(e))return Bl(e)}function Bl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function UM(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var HM=function(t){return Array.isArray(t.value)?IM(t.value):t.value};function $t(e){var t=e.valueAccessor,r=t===void 0?HM:t,n=Rm(e,kM),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,c=n.textBreakAll,s=Rm(n,RM);return!i||!i.length?null:S.createElement(ie,{className:"recharts-label-list"},i.map(function(f,l){var d=Q(a)?r(f,l):Me(f&&f.payload,a),p=Q(u)?{}:{id:"".concat(u,"-").concat(l)};return S.createElement(Se,Xi({},V(f,!0),s,p,{parentViewBox:f.parentViewBox,value:d,textBreakAll:c,viewBox:Se.parseViewBox(Q(o)?f:km(km({},f),{},{clockWise:o})),key:"label-".concat(l),index:l}))}))}$t.displayName="LabelList";function GM(e,t){return e?e===!0?S.createElement($t,{key:"labelList-implicit",data:t}):S.isValidElement(e)||X(e)?S.createElement($t,{key:"labelList-implicit",data:t,content:e}):Hr(e)?S.createElement($t,Xi({data:t},e,{key:"labelList-implicit"})):null:null}function KM(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ve(n,$t).map(function(o,u){return q.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var a=GM(e.label,t);return[a].concat(NM(i))}$t.renderCallByParent=KM;function Dn(e){"@babel/helpers - typeof";return Dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(e)}function Fl(){return Fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>s),`, + `).concat(l.x,",").concat(l.y,` + `);if(i>0){var p=le(r,n,i,o),y=le(r,n,i,s);d+="L ".concat(y.x,",").concat(y.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(c)>180),",").concat(+(o<=s),`, + `).concat(p.x,",").concat(p.y," Z")}else d+="L ".concat(r,",").concat(n," Z");return d},JM=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,c=t.cornerIsExternal,s=t.startAngle,f=t.endAngle,l=Ce(f-s),d=mi({cx:r,cy:n,radius:a,angle:s,sign:l,cornerRadius:o,cornerIsExternal:c}),p=d.circleTangency,y=d.lineTangency,v=d.theta,h=mi({cx:r,cy:n,radius:a,angle:f,sign:-l,cornerRadius:o,cornerIsExternal:c}),b=h.circleTangency,x=h.lineTangency,w=h.theta,O=c?Math.abs(s-f):Math.abs(s-f)-v-w;if(O<0)return u?"M ".concat(y.x,",").concat(y.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):Fx({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:s,endAngle:f});var m="M ".concat(y.x,",").concat(y.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(p.x,",").concat(p.y,` + A`).concat(a,",").concat(a,",0,").concat(+(O>180),",").concat(+(l<0),",").concat(b.x,",").concat(b.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(x.x,",").concat(x.y,` + `);if(i>0){var g=mi({cx:r,cy:n,radius:i,angle:s,sign:l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=g.circleTangency,A=g.lineTangency,T=g.theta,M=mi({cx:r,cy:n,radius:i,angle:f,sign:-l,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=M.circleTangency,E=M.lineTangency,j=M.theta,I=c?Math.abs(s-f):Math.abs(s-f)-T-j;if(I<0&&o===0)return"".concat(m,"L").concat(r,",").concat(n,"Z");m+="L".concat(E.x,",").concat(E.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(P.x,",").concat(P.y,` + A`).concat(i,",").concat(i,",0,").concat(+(I>180),",").concat(+(l>0),",").concat(_.x,",").concat(_.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(l<0),",").concat(A.x,",").concat(A.y,"Z")}else m+="L".concat(r,",").concat(n,"Z");return m},QM={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Wx=function(t){var r=Dm(Dm({},QM),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,c=r.forceCornerRadius,s=r.cornerIsExternal,f=r.startAngle,l=r.endAngle,d=r.className;if(o0&&Math.abs(f-l)<360?h=JM({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,y/2),forceCornerRadius:c,cornerIsExternal:s,startAngle:f,endAngle:l}):h=Fx({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:l}),S.createElement("path",Fl({},V(r,!0),{className:p,d:h,role:"img"}))};function qn(e){"@babel/helpers - typeof";return qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qn(e)}function Wl(){return Wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function m$(e,t){return or(e.getTime(),t.getTime())}function g$(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function b$(e,t){return e===t}function Vm(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.entries(),o,u,c=0;(o=a.next())&&!o.done;){for(var s=t.entries(),f=!1,l=0;(u=s.next())&&!u.done;){if(i[l]){l++;continue}var d=o.value,p=u.value;if(r.equals(d[0],p[0],c,l,e,t,r)&&r.equals(d[1],p[1],d[0],p[0],e,t,r)){f=i[l]=!0;break}l++}if(!f)return!1;c++}return!0}var x$=or;function w$(e,t,r){var n=Km(e),i=n.length;if(Km(t).length!==i)return!1;for(;i-- >0;)if(!zx(e,t,r,n[i]))return!1;return!0}function on(e,t,r){var n=Hm(e),i=n.length;if(Hm(t).length!==i)return!1;for(var a,o,u;i-- >0;)if(a=n[i],!zx(e,t,r,a)||(o=Gm(e,a),u=Gm(t,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function O$(e,t){return or(e.valueOf(),t.valueOf())}function _$(e,t){return e.source===t.source&&e.flags===t.flags}function Xm(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),a=e.values(),o,u;(o=a.next())&&!o.done;){for(var c=t.values(),s=!1,f=0;(u=c.next())&&!u.done;){if(!i[f]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){s=i[f]=!0;break}f++}if(!s)return!1}return!0}function A$(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function S$(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function zx(e,t,r,n){return(n===v$||n===p$||n===h$)&&(e.$$typeof||t.$$typeof)?!0:d$(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var P$="[object Arguments]",T$="[object Boolean]",E$="[object Date]",j$="[object Error]",M$="[object Map]",$$="[object Number]",C$="[object Object]",I$="[object RegExp]",k$="[object Set]",R$="[object String]",N$="[object URL]",D$=Array.isArray,Ym=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Zm=Object.assign,q$=Object.prototype.toString.call.bind(Object.prototype.toString);function L$(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,u=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,s=e.areRegExpsEqual,f=e.areSetsEqual,l=e.areTypedArraysEqual,d=e.areUrlsEqual;return function(y,v,h){if(y===v)return!0;if(y==null||v==null)return!1;var b=typeof y;if(b!==typeof v)return!1;if(b!=="object")return b==="number"?o(y,v,h):b==="function"?i(y,v,h):!1;var x=y.constructor;if(x!==v.constructor)return!1;if(x===Object)return u(y,v,h);if(D$(y))return t(y,v,h);if(Ym!=null&&Ym(y))return l(y,v,h);if(x===Date)return r(y,v,h);if(x===RegExp)return s(y,v,h);if(x===Map)return a(y,v,h);if(x===Set)return f(y,v,h);var w=q$(y);return w===E$?r(y,v,h):w===I$?s(y,v,h):w===M$?a(y,v,h):w===k$?f(y,v,h):w===C$?typeof y.then!="function"&&typeof v.then!="function"&&u(y,v,h):w===N$?d(y,v,h):w===j$?n(y,v,h):w===P$?u(y,v,h):w===T$||w===$$||w===R$?c(y,v,h):!1}}function B$(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?on:y$,areDatesEqual:m$,areErrorsEqual:g$,areFunctionsEqual:b$,areMapsEqual:n?Um(Vm,on):Vm,areNumbersEqual:x$,areObjectsEqual:n?on:w$,arePrimitiveWrappersEqual:O$,areRegExpsEqual:_$,areSetsEqual:n?Um(Xm,on):Xm,areTypedArraysEqual:n?on:A$,areUrlsEqual:S$};if(r&&(i=Zm({},i,r(i))),t){var a=bi(i.areArraysEqual),o=bi(i.areMapsEqual),u=bi(i.areObjectsEqual),c=bi(i.areSetsEqual);i=Zm({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:u,areSetsEqual:c})}return i}function F$(e){return function(t,r,n,i,a,o,u){return e(t,r,u)}}function W$(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,a=e.strict;if(n)return function(c,s){var f=n(),l=f.cache,d=l===void 0?t?new WeakMap:void 0:l,p=f.meta;return r(c,s,{cache:d,equals:i,meta:p,strict:a})};if(t)return function(c,s){return r(c,s,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,s){return r(c,s,o)}}var z$=Rt();Rt({strict:!0});Rt({circular:!0});Rt({circular:!0,strict:!0});Rt({createInternalComparator:function(){return or}});Rt({strict:!0,createInternalComparator:function(){return or}});Rt({circular:!0,createInternalComparator:function(){return or}});Rt({circular:!0,createInternalComparator:function(){return or},strict:!0});function Rt(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,u=B$(e),c=L$(u),s=n?n(c):F$(c);return W$({circular:r,comparator:c,createState:i,equals:s,strict:o})}function U$(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Jm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):U$(i)};requestAnimationFrame(n)}function Ul(e){"@babel/helpers - typeof";return Ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ul(e)}function H$(e){return X$(e)||V$(e)||K$(e)||G$()}function G$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K$(e,t){if(e){if(typeof e=="string")return Qm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qm(e,t)}}function Qm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},v=function(b){for(var x=b>1?1:b,w=x,O=0;O<8;++O){var m=l(w)-x,g=p(w);if(Math.abs(m-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?17:o,c=function(f,l,d){var p=-(f-l)*n,y=d*a,v=d+(p-y)*u/1e3,h=d*u/1e3+f;return Math.abs(h-l)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PC(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function $s(e){return MC(e)||jC(e)||EC(e)||TC()}function TC(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EC(e,t){if(e){if(typeof e=="string")return Xl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xl(e,t)}}function jC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MC(e){if(Array.isArray(e))return Xl(e)}function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"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 Ji(e){return Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ji(e)}var wt=function(e){RC(r,e);var t=NC(r);function r(n,i){var a;$C(this,r),a=t.call(this,n,i);var o=a.props,u=o.isActive,c=o.attributeName,s=o.from,f=o.to,l=o.steps,d=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Jl(a)),a.changeStyle=a.changeStyle.bind(Jl(a)),!u||p<=0)return a.state={style:{}},typeof d=="function"&&(a.state={style:f}),Zl(a);if(l&&l.length)a.state={style:l[0].style};else if(s){if(typeof d=="function")return a.state={style:s},Zl(a);a.state={style:c?ln({},c,s):s}}else a.state={style:{}};return a}return IC(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,c=a.attributeName,s=a.shouldReAnimate,f=a.to,l=a.from,d=this.state.style;if(u){if(!o){var p={style:c?ln({},c,f):f};this.state&&d&&(c&&d[c]!==f||!c&&d!==f)&&this.setState(p);return}if(!(z$(i.to,f)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||s?l:i.to;if(this.state&&d){var h={style:c?ln({},c,v):v};(c&&d[c]!==v||!c&&d!==v)&&this.setState(h)}this.runAnimation(Je(Je({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,c=i.duration,s=i.easing,f=i.begin,l=i.onAnimationEnd,d=i.onAnimationStart,p=_C(o,u,dC(s),c,this.changeStyle),y=function(){a.stopJSAnimation=p()};this.manager.start([d,f,y,c,l])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,c=i.onAnimationStart,s=o[0],f=s.style,l=s.duration,d=l===void 0?0:l,p=function(v,h,b){if(b===0)return v;var x=h.duration,w=h.easing,O=w===void 0?"ease":w,m=h.style,g=h.properties,_=h.onAnimationEnd,A=b>0?o[b-1]:h,T=g||Object.keys(m);if(typeof O=="function"||O==="spring")return[].concat($s(v),[a.runJSAnimation.bind(a,{from:A.style,to:m,duration:x,easing:O}),x]);var M=rg(T,x,O),P=Je(Je(Je({},A.style),m),{},{transition:M});return[].concat($s(v),[P,x,_]).filter(eC)};return this.manager.start([c].concat($s(o.reduce(p,[f,Math.max(d,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Y$());var a=i.begin,o=i.duration,u=i.attributeName,c=i.to,s=i.easing,f=i.onAnimationStart,l=i.onAnimationEnd,d=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof s=="function"||typeof p=="function"||s==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var v=u?ln({},u,c):c,h=rg(Object.keys(v),o,s);y.start([f,a,Je(Je({},v),{},{transition:h}),o,l])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=SC(i,AC),s=q.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!u||s===0||o<=0)return a;var l=function(p){var y=p.props,v=y.style,h=v===void 0?{}:v,b=y.className,x=q.cloneElement(p,Je(Je({},c),{},{style:Je(Je({},h),f),className:b}));return x};return s===1?l(q.Children.only(a)):S.createElement("div",null,q.Children.map(a,function(d){return l(d)}))}}]),r}(q.PureComponent);wt.displayName="Animate";wt.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};wt.propTypes={from:ne.oneOfType([ne.object,ne.string]),to:ne.oneOfType([ne.object,ne.string]),attributeName:ne.string,duration:ne.number,begin:ne.number,easing:ne.oneOfType([ne.string,ne.func]),steps:ne.arrayOf(ne.shape({duration:ne.number.isRequired,style:ne.object.isRequired,easing:ne.oneOfType([ne.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ne.func]),properties:ne.arrayOf("string"),onAnimationEnd:ne.func})),children:ne.oneOfType([ne.node,ne.func]),isActive:ne.bool,canBegin:ne.bool,onAnimationEnd:ne.func,shouldReAnimate:ne.bool,onAnimationStart:ne.func,onAnimationReStart:ne.func};function Fn(e){"@babel/helpers - typeof";return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(e)}function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,s=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var l=[0,0,0,0],d=0,p=4;do?o:a[d];f="M".concat(t,",").concat(r+u*l[0]),l[0]>0&&(f+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(s,",").concat(t+c*l[0],",").concat(r)),f+="L ".concat(t+n-c*l[1],",").concat(r),l[1]>0&&(f+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(s,`, + `).concat(t+n,",").concat(r+u*l[1])),f+="L ".concat(t+n,",").concat(r+i-u*l[2]),l[2]>0&&(f+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(s,`, + `).concat(t+n-c*l[2],",").concat(r+i)),f+="L ".concat(t+c*l[3],",").concat(r+i),l[3]>0&&(f+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(s,`, + `).concat(t,",").concat(r+i-u*l[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var y=Math.min(o,a);f="M ".concat(t,",").concat(r+u*y,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+c*y,",").concat(r,` + L `).concat(t+n-c*y,",").concat(r,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n,",").concat(r+u*y,` + L `).concat(t+n,",").concat(r+i-u*y,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t+n-c*y,",").concat(r+i,` + L `).concat(t+c*y,",").concat(r+i,` + A `).concat(y,",").concat(y,",0,0,").concat(s,",").concat(t,",").concat(r+i-u*y," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},GC=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,u=r.width,c=r.height;if(Math.abs(u)>0&&Math.abs(c)>0){var s=Math.min(a,a+u),f=Math.max(a,a+u),l=Math.min(o,o+c),d=Math.max(o,o+c);return n>=s&&n<=f&&i>=l&&i<=d}return!1},KC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bd=function(t){var r=lg(lg({},KC),t),n=q.useRef(),i=q.useState(-1),a=qC(i,2),o=a[0],u=a[1];q.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&u(O)}catch{}},[]);var c=r.x,s=r.y,f=r.width,l=r.height,d=r.radius,p=r.className,y=r.animationEasing,v=r.animationDuration,h=r.animationBegin,b=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||s!==+s||f!==+f||l!==+l||f===0||l===0)return null;var w=J("recharts-rectangle",p);return x?S.createElement(wt,{canBegin:o>0,from:{width:f,height:l,x:c,y:s},to:{width:f,height:l,x:c,y:s},duration:v,animationEasing:y,isActive:x},function(O){var m=O.width,g=O.height,_=O.x,A=O.y;return S.createElement(wt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:h,duration:v,isActive:b,easing:y},S.createElement("path",Qi({},V(r,!0),{className:w,d:fg(_,A,m,g,d),ref:n})))}):S.createElement("path",Qi({},V(r,!0),{className:w,d:fg(c,s,f,l,d)}))},VC=["points","className","baseLinePoints","connectNulls"];function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YC(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dg(e){return eI(e)||QC(e)||JC(e)||ZC()}function ZC(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JC(e,t){if(e){if(typeof e=="string")return Ql(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ql(e,t)}}function QC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eI(e){if(Array.isArray(e))return Ql(e)}function Ql(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){hg(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),hg(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},vn=function(t,r){var n=tI(t);r&&(n=[n.reduce(function(a,o){return[].concat(dg(a),dg(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,u,c){return"".concat(o).concat(c===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},rI=function(t,r,n){var i=vn(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(vn(r.reverse(),n).slice(1))},nI=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=XC(t,VC);if(!r||!r.length)return null;var u=J("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",s=rI(r,i,a);return S.createElement("g",{className:u},S.createElement("path",dr({},V(o,!0),{fill:s.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:s})),c?S.createElement("path",dr({},V(o,!0),{fill:"none",d:vn(r,a)})):null,c?S.createElement("path",dr({},V(o,!0),{fill:"none",d:vn(i,a)})):null)}var f=vn(r,a);return S.createElement("path",dr({},V(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:u,d:f}))};function ef(){return ef=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fI=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},dI=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,u=o===void 0?0:o,c=t.left,s=c===void 0?0:c,f=t.width,l=f===void 0?0:f,d=t.height,p=d===void 0?0:d,y=t.className,v=sI(t,iI),h=aI({x:n,y:a,top:u,left:s,width:l,height:p},v);return!D(n)||!D(a)||!D(l)||!D(p)||!D(u)||!D(s)?null:S.createElement("path",tf({},V(h,!0),{className:J("recharts-cross",y),d:fI(n,a,l,p,u,s)}))},Cs,vg;function hI(){if(vg)return Cs;vg=1;var e=Na(),t=lx(),r=ct();function n(i,a){return i&&i.length?e(i,r(a,2),t):void 0}return Cs=n,Cs}var pI=hI();const vI=oe(pI);var Is,yg;function yI(){if(yg)return Is;yg=1;var e=Na(),t=ct(),r=fx();function n(i,a){return i&&i.length?e(i,t(a,2),r):void 0}return Is=n,Is}var mI=yI();const gI=oe(mI);var bI=["cx","cy","angle","ticks","axisLine"],xI=["ticks","tick","angle","tickFormatter","stroke"];function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}function yn(){return yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wI(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function OI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bg(e,t){for(var r=0;rDI?o=i==="outer"?"start":"end":a<-1e-5?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,u=n.axisLine,c=n.axisLineType,s=Wt(Wt({},V(this.props,!1)),{},{fill:"none"},V(u,!1));if(c==="circle")return S.createElement(xd,Ht({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:a,r:o}));var f=this.props.ticks,l=f.map(function(d){return le(i,a,o,d.coordinate)});return S.createElement(nI,Ht({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,u=i.tickLine,c=i.tickFormatter,s=i.stroke,f=V(this.props,!1),l=V(o,!1),d=Wt(Wt({},f),{},{fill:"none"},V(u,!1)),p=a.map(function(y,v){var h=n.getTickLineCoord(y),b=n.getTickTextAnchor(y),x=Wt(Wt(Wt({textAnchor:b},f),{},{stroke:"none",fill:s},l),{},{index:v,payload:y,x:h.x2,y:h.y2});return S.createElement(ie,Ht({className:J("recharts-polar-angle-axis-tick",Lx(o)),key:"tick-".concat(y.coordinate)},Jt(n.props,y,v)),u&&S.createElement("line",Ht({className:"recharts-polar-angle-axis-tick-line"},d,h)),o&&t.renderTickItem(o,x,c?c(y.value,v):y.value))});return S.createElement(ie,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:S.createElement(ie,{className:J("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return S.isValidElement(n)?o=S.cloneElement(n,i):X(n)?o=n(i):o=S.createElement(Qt,Ht({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(q.PureComponent);Ha(Ga,"displayName","PolarAngleAxis");Ha(Ga,"axisType","angleAxis");Ha(Ga,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var ks,Og;function qI(){if(Og)return ks;Og=1;var e=s0(),t=e(Object.getPrototypeOf,Object);return ks=t,ks}var Rs,_g;function LI(){if(_g)return Rs;_g=1;var e=Ot(),t=qI(),r=_t(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,u=a.hasOwnProperty,c=o.call(Object);function s(f){if(!r(f)||e(f)!=n)return!1;var l=t(f);if(l===null)return!0;var d=u.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&o.call(d)==c}return Rs=s,Rs}var BI=LI();const FI=oe(BI);var Ns,Ag;function WI(){if(Ag)return Ns;Ag=1;var e=Ot(),t=_t(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return Ns=n,Ns}var zI=WI();const UI=oe(zI);function zn(e){"@babel/helpers - typeof";return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zn(e)}function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:d,x:c,y:s},to:{upperWidth:f,lowerWidth:l,height:d,x:c,y:s},duration:v,animationEasing:y,isActive:b},function(w){var O=w.upperWidth,m=w.lowerWidth,g=w.height,_=w.x,A=w.y;return S.createElement(wt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:h,duration:v,easing:y},S.createElement("path",ra({},V(r,!0),{className:x,d:Eg(_,A,O,m,g),ref:n})))}):S.createElement("g",null,S.createElement("path",ra({},V(r,!0),{className:x,d:Eg(c,s,f,l,d)})))},tk=["option","shapeType","propTransformer","activeClassName","isActive"];function Un(e){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Un(e)}function rk(e,t){if(e==null)return{};var r=nk(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nk(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function jg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function na(e){for(var t=1;t0?ze(w,"paddingAngle",0):0;if(m){var _=Pt(m.endAngle-m.startAngle,w.endAngle-w.startAngle),A=ce(ce({},w),{},{startAngle:x+g,endAngle:x+_(v)+g});h.push(A),x=A.endAngle}else{var T=w.endAngle,M=w.startAngle,P=Pt(0,T-M),E=P(v),j=ce(ce({},w),{},{startAngle:x+g,endAngle:x+E+g});h.push(j),x=j.endAngle}}),S.createElement(ie,null,n.renderSectorsStatically(h))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!La(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,u=i.className,c=i.label,s=i.cx,f=i.cy,l=i.innerRadius,d=i.outerRadius,p=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!D(s)||!D(f)||!D(l)||!D(d))return null;var v=J("recharts-pie",u);return S.createElement(ie,{tabIndex:this.props.rootTabIndex,className:v,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),Se.renderCallByParent(this.props,null,!1),(!p||y)&&$t.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?x:x-1)*c,O=h-x*p-w,m=i.reduce(function(A,T){var M=Me(T,b,0);return A+(D(M)?M:0)},0),g;if(m>0){var _;g=i.map(function(A,T){var M=Me(A,b,0),P=Me(A,f,T),E=(D(M)?M:0)/m,j;T?j=_.endAngle+Ce(v)*c*(M!==0?1:0):j=o;var I=j+Ce(v)*((M!==0?p:0)+E*O),$=(j+I)/2,k=(y.innerRadius+y.outerRadius)/2,N=[{name:P,value:M,payload:A,dataKey:b,type:d}],L=le(y.cx,y.cy,k,$);return _=ce(ce(ce({percent:E,cornerRadius:a,name:P,tooltipPayload:N,midAngle:$,middleRadius:k,tooltipPosition:L},A),y),{},{value:Me(A,b),startAngle:j,endAngle:I,payload:A,paddingAngle:Ce(v)*c}),_})}return ce(ce({},y),{},{sectors:g,data:i})});var Ds,Ig;function Ak(){if(Ig)return Ds;Ig=1;var e=Math.ceil,t=Math.max;function r(n,i,a,o){for(var u=-1,c=t(e((i-n)/(a||1)),0),s=Array(c);c--;)s[o?c:++u]=n,n+=a;return s}return Ds=r,Ds}var qs,kg;function nw(){if(kg)return qs;kg=1;var e=S0(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-1/0){var a=i<0?-1:1;return a*r}return i===i?i:0}return qs=n,qs}var Ls,Rg;function Sk(){if(Rg)return Ls;Rg=1;var e=Ak(),t=ja(),r=nw();function n(i){return function(a,o,u){return u&&typeof u!="number"&&t(a,o,u)&&(o=u=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),u=u===void 0?a0&&n.handleDrag(i.changedTouches[0])}),Be(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o==null||o({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),Be(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Be(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Be(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Be(n,"handleSlideDragStart",function(i){var a=Fg(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Dk(t,e),Ik(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,c=u.gap,s=u.data,f=s.length-1,l=Math.min(i,a),d=Math.max(i,a),p=t.getIndexInRange(o,l),y=t.getIndexInRange(o,d);return{startIndex:p-p%c,endIndex:y===f?f:y-y%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,c=Me(a[n],u,n);return X(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,c=this.props,s=c.x,f=c.width,l=c.travellerWidth,d=c.startIndex,p=c.endIndex,y=c.onChange,v=n.pageX-a;v>0?v=Math.min(v,s+f-l-u,s+f-l-o):v<0&&(v=Math.max(v,s-o,s-u));var h=this.getIndex({startX:o+v,endX:u+v});(h.startIndex!==d||h.endIndex!==p)&&y&&y(h),this.setState({startX:o+v,endX:u+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=Fg(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,c=i.startX,s=this.state[o],f=this.props,l=f.x,d=f.width,p=f.travellerWidth,y=f.onChange,v=f.gap,h=f.data,b={startX:this.state.startX,endX:this.state.endX},x=n.pageX-a;x>0?x=Math.min(x,l+d-p-s):x<0&&(x=Math.max(x,l-s)),b[o]=s+x;var w=this.getIndex(b),O=w.startIndex,m=w.endIndex,g=function(){var A=h.length-1;return o==="startX"&&(u>c?O%v===0:m%v===0)||uc?m%v===0:O%v===0)||u>c&&m===A};this.setState(Be(Be({},o,s+x),"brushMoveStartX",n.pageX),function(){y&&g()&&y(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,c=o.startX,s=o.endX,f=this.state[i],l=u.indexOf(f);if(l!==-1){var d=l+n;if(!(d===-1||d>=u.length)){var p=u[d];i==="startX"&&p>=s||i==="endX"&&p<=c||this.setState(Be({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.fill,s=n.stroke;return S.createElement("rect",{stroke:s,fill:c,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.data,s=n.children,f=n.padding,l=q.Children.only(s);return l?S.cloneElement(l,{x:i,y:a,width:o,height:u,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,c=this.props,s=c.y,f=c.travellerWidth,l=c.height,d=c.traveller,p=c.ariaLabel,y=c.data,v=c.startIndex,h=c.endIndex,b=Math.max(n,this.props.x),x=Fs(Fs({},V(this.props,!1)),{},{x:b,y:s,width:f,height:l}),w=p||"Min value: ".concat((a=y[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[h])===null||o===void 0?void 0:o.name);return S.createElement(ie,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(m){["ArrowLeft","ArrowRight"].includes(m.key)&&(m.preventDefault(),m.stopPropagation(),u.handleTravellerMoveKeyboard(m.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(d,x))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,c=a.stroke,s=a.travellerWidth,f=Math.min(n,i)+s,l=Math.max(Math.abs(i-n)-s,0);return S.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:l,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,c=n.travellerWidth,s=n.stroke,f=this.state,l=f.startX,d=f.endX,p=5,y={pointerEvents:"none",fill:s};return S.createElement(ie,{className:"recharts-brush-texts"},S.createElement(Qt,oa({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,d)-p,y:o+u/2},y),this.getTextOfTick(i)),S.createElement(Qt,oa({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,d)+c+p,y:o+u/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,c=n.y,s=n.width,f=n.height,l=n.alwaysShowText,d=this.state,p=d.startX,y=d.endX,v=d.isTextActive,h=d.isSlideMoving,b=d.isTravellerMoving,x=d.isTravellerFocused;if(!i||!i.length||!D(u)||!D(c)||!D(s)||!D(f)||s<=0||f<=0)return null;var w=J("recharts-brush",a),O=S.Children.count(o)===1,m=$k("userSelect","none");return S.createElement(ie,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:m},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||h||b||x||l)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,c=n.stroke,s=Math.floor(a+u/2)-1;return S.createElement(S.Fragment,null,S.createElement("rect",{x:i,y:a,width:o,height:u,fill:c,stroke:"none"}),S.createElement("line",{x1:i+1,y1:s,x2:i+o-1,y2:s,fill:"none",stroke:"#fff"}),S.createElement("line",{x1:i+1,y1:s+2,x2:i+o-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return S.isValidElement(n)?a=S.cloneElement(n,i):X(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,c=n.travellerWidth,s=n.updateId,f=n.startIndex,l=n.endIndex;if(a!==i.prevData||s!==i.prevUpdateId)return Fs({prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o},a&&a.length?Lk({data:a,width:o,x:u,travellerWidth:c,startIndex:f,endIndex:l}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([u,u+o-c]);var d=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:s,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var c=Math.floor((o+u)/2);n[c]>i?u=c:o=c}return i>=n[u]?u:o}}])}(q.PureComponent);Be(kr,"displayName","Brush");Be(kr,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Ws,Wg;function Bk(){if(Wg)return Ws;Wg=1;var e=Uf();function t(r,n){var i;return e(r,function(a,o,u){return i=n(a,o,u),!i}),!!i}return Ws=t,Ws}var zs,zg;function Fk(){if(zg)return zs;zg=1;var e=r0(),t=ct(),r=Bk(),n=qe(),i=ja();function a(o,u,c){var s=n(o)?e:r;return c&&i(o,u,c)&&(u=void 0),s(o,t(u,3))}return zs=a,zs}var Wk=Fk();const zk=oe(Wk);var at=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},Us,Ug;function Uk(){if(Ug)return Us;Ug=1;var e=x0();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return Us=t,Us}var Hs,Hg;function Hk(){if(Hg)return Hs;Hg=1;var e=Uk(),t=g0(),r=ct();function n(i,a){var o={};return a=r(a,3),t(i,function(u,c,s){e(o,c,a(u,c,s))}),o}return Hs=n,Hs}var Gk=Hk();const Kk=oe(Gk);var Gs,Gg;function Vk(){if(Gg)return Gs;Gg=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iR(e,t){var r=e.x,n=e.y,i=rR(e,Jk),a="".concat(r),o=parseInt(a,10),u="".concat(n),c=parseInt(u,10),s="".concat(t.height||i.height),f=parseInt(s,10),l="".concat(t.width||i.width),d=parseInt(l,10);return un(un(un(un(un({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:d,name:t.name,radius:t.radius})}function Yg(e){return S.createElement(ew,uf({shapeType:"rectangle",propTransformer:iR,activeClassName:"recharts-active-bar"},e))}var aR=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=typeof n=="number";return a?t(n,i):(a||tr(),r)}},oR=["value","background"],cw;function Rr(e){"@babel/helpers - typeof";return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function uR(e,t){if(e==null)return{};var r=cR(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cR(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(I)0&&(j=Math.min((fe||0)-(I[ye-1]||0),j))}),Number.isFinite(j)){var $=j/E,k=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(_=$*k/2),v.padding==="no-gap"){var N=Ie(t.barCategoryGap,$*k),L=$*k/2;_=L-N-(L-N)/k*N}}}i==="xAxis"?A=[n.left+(w.left||0)+(_||0),n.left+n.width-(w.right||0)-(_||0)]:i==="yAxis"?A=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(_||0),n.top+n.height-(w.bottom||0)-(_||0)]:A=v.range,m&&(A=[A[1],A[0]]);var B=Cx(v,a,d),U=B.scale,G=B.realScaleType;U.domain(b).range(A),Ix(U);var W=kx(U,Qe(Qe({},v),{},{realScaleType:G}));i==="xAxis"?(P=h==="top"&&!O||h==="bottom"&&O,T=n.left,M=l[g]-P*v.height):i==="yAxis"&&(P=h==="left"&&!O||h==="right"&&O,T=l[g]-P*v.width,M=n.top);var K=Qe(Qe(Qe({},v),W),{},{realScaleType:G,x:T,y:M,scale:U,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return K.bandSize=Ki(K,W),!v.hide&&i==="xAxis"?l[g]+=(P?-1:1)*K.height:v.hide||(l[g]+=(P?-1:1)*K.width),Qe(Qe({},p),{},Xa({},y,K))},{})},dw=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},xR=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return dw({x:r,y:n},{x:i,y:a})},hw=function(){function e(t){yR(this,e),this.scale=t}return mR(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();Xa(hw,"EPS",1e-4);var wd=function(t){var r=Object.keys(t).reduce(function(n,i){return Qe(Qe({},n),{},Xa({},i,hw.create(t[i])))},{});return Qe(Qe({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return Kk(i,function(c,s){return r[s].apply(c,{bandAware:o,position:u})})},isInRange:function(i){return uw(i,function(a,o){return r[o].isInRange(a)})}})};function wR(e){return(e%180+180)%180}var OR=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=wR(i),o=a*Math.PI/180,u=Math.atan(n/r),c=o>u&&o-1?c[s?a[f]:f]:void 0}}return Xs=n,Xs}var Ys,rb;function AR(){if(rb)return Ys;rb=1;var e=nw();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return Ys=t,Ys}var Zs,nb;function SR(){if(nb)return Zs;nb=1;var e=h0(),t=ct(),r=AR(),n=Math.max;function i(a,o,u){var c=a==null?0:a.length;if(!c)return-1;var s=u==null?0:r(u);return s<0&&(s=n(c+s,0)),e(a,t(o,3),s)}return Zs=i,Zs}var Js,ib;function PR(){if(ib)return Js;ib=1;var e=_R(),t=SR(),r=e(t);return Js=r,Js}var TR=PR();const ER=oe(TR);var jR=jb();const MR=oe(jR);var $R=MR(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Od=q.createContext(void 0),_d=q.createContext(void 0),pw=q.createContext(void 0),vw=q.createContext({}),yw=q.createContext(void 0),mw=q.createContext(0),gw=q.createContext(0),ab=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,u=t.children,c=t.width,s=t.height,f=$R(a);return S.createElement(Od.Provider,{value:n},S.createElement(_d.Provider,{value:i},S.createElement(vw.Provider,{value:a},S.createElement(pw.Provider,{value:f},S.createElement(yw.Provider,{value:o},S.createElement(mw.Provider,{value:s},S.createElement(gw.Provider,{value:c},u)))))))},CR=function(){return q.useContext(yw)},bw=function(t){var r=q.useContext(Od);r==null&&tr();var n=r[t];return n==null&&tr(),n},IR=function(){var t=q.useContext(Od);return Et(t)},kR=function(){var t=q.useContext(_d),r=ER(t,function(n){return uw(n.domain,Number.isFinite)});return r||Et(t)},xw=function(t){var r=q.useContext(_d);r==null&&tr();var n=r[t];return n==null&&tr(),n},RR=function(){var t=q.useContext(pw);return t},NR=function(){return q.useContext(vw)},Ad=function(){return q.useContext(gw)},Sd=function(){return q.useContext(mw)};function Nr(e){"@babel/helpers - typeof";return Nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(e)}function DR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qR(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function bN(e,t){return Tw(e,t+1)}function xN(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,c=0,s=1,f=o,l=function(){var y=n==null?void 0:n[c];if(y===void 0)return{v:Tw(n,s)};var v=c,h,b=function(){return h===void 0&&(h=r(y,v)),h},x=y.coordinate,w=c===0||ha(e,x,b,f,u);w||(c=0,f=o,s+=1),w&&(f=x+e*(b()/2+i),c+=s)},d;s<=a.length;)if(d=l(),d)return d.v;return[]}function Xn(e){"@babel/helpers - typeof";return Xn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(e)}function hb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t0?p.coordinate-h*e:p.coordinate})}else a[d]=p=Ee(Ee({},p),{},{tickCoord:p.coordinate});var b=ha(e,p.tickCoord,v,u,c);b&&(c=p.tickCoord-e*(v()/2+i),a[d]=Ee(Ee({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)s(f);return a}function SN(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,c=t.start,s=t.end;if(a){var f=n[u-1],l=r(f,u-1),d=e*(f.coordinate+e*l/2-s);o[u-1]=f=Ee(Ee({},f),{},{tickCoord:d>0?f.coordinate-d*e:f.coordinate});var p=ha(e,f.tickCoord,function(){return l},c,s);p&&(s=f.tickCoord-e*(l/2+i),o[u-1]=Ee(Ee({},f),{},{isShow:!0}))}for(var y=a?u-1:u,v=function(x){var w=o[x],O,m=function(){return O===void 0&&(O=r(w,x)),O};if(x===0){var g=e*(w.coordinate-e*m()/2-c);o[x]=w=Ee(Ee({},w),{},{tickCoord:g<0?w.coordinate-g*e:w.coordinate})}else o[x]=w=Ee(Ee({},w),{},{tickCoord:w.coordinate});var _=ha(e,w.tickCoord,m,c,s);_&&(c=w.tickCoord+e*(m()/2+i),o[x]=Ee(Ee({},w),{},{isShow:!0}))},h=0;h=2?Ce(i[1].coordinate-i[0].coordinate):1,b=gN(a,h,p);return c==="equidistantPreserveStart"?xN(h,b,v,i,o):(c==="preserveStart"||c==="preserveStartEnd"?d=SN(h,b,v,i,o,c==="preserveStartEnd"):d=AN(h,b,v,i,o),d.filter(function(x){return x.isShow}))}var PN=["viewBox"],TN=["viewBox"],EN=["ticks"];function Lr(e){"@babel/helpers - typeof";return Lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function MN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vb(e,t){for(var r=0;r0?c(this.props):c(p)),o<=0||u<=0||!y||!y.length?null:S.createElement(ie,{className:J("recharts-cartesian-axis",s),ref:function(h){n.layerReference=h}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Se.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return S.isValidElement(n)?o=S.cloneElement(n,i):X(n)?o=n(i):o=S.createElement(Qt,pr({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(q.Component);jd(Zr,"displayName","CartesianAxis");jd(Zr,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var DN=["x1","y1","x2","y2","key"],qN=["offset"];function rr(e){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rr(e)}function yb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function je(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WN(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var zN=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,u=t.height,c=t.ry;return S.createElement("rect",{x:i,y:a,ry:c,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Mw(e,t){var r;if(S.isValidElement(e))r=S.cloneElement(e,t);else if(X(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,u=t.key,c=mb(t,DN),s=V(c,!1);s.offset;var f=mb(s,qN);r=S.createElement("line",Xt({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:u}))}return r}function UN(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=je(je({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(c),index:c});return Mw(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function HN(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var s=je(je({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(c),index:c});return Mw(i,s)});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function GN(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,u=e.horizontalPoints,c=e.horizontal,s=c===void 0?!0:c;if(!s||!t||!t.length)return null;var f=u.map(function(d){return Math.round(d+i-i)}).sort(function(d,p){return d-p});i!==f[0]&&f.unshift(0);var l=f.map(function(d,p){var y=!f[p+1],v=y?i+o-d:f[p+1]-d;if(v<=0)return null;var h=p%t.length;return S.createElement("rect",{key:"react-".concat(p),y:d,x:n,height:v,width:a,stroke:"none",fill:t[h],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function KN(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,u=e.width,c=e.height,s=e.verticalPoints;if(!r||!n||!n.length)return null;var f=s.map(function(d){return Math.round(d+a-a)}).sort(function(d,p){return d-p});a!==f[0]&&f.unshift(0);var l=f.map(function(d,p){var y=!f[p+1],v=y?a+u-d:f[p+1]-d;if(v<=0)return null;var h=p%n.length;return S.createElement("rect",{key:"react-".concat(p),x:d,y:o,width:v,height:c,stroke:"none",fill:n[h],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var VN=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return $x(Ed(je(je(je({},Zr.defaultProps),n),{},{ticks:pt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},XN=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return $x(Ed(je(je(je({},Zr.defaultProps),n),{},{ticks:pt(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},lr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function YN(e){var t,r,n,i,a,o,u=Ad(),c=Sd(),s=NR(),f=je(je({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:lr.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:lr.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:lr.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:lr.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:lr.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:lr.verticalFill,x:D(e.x)?e.x:s.left,y:D(e.y)?e.y:s.top,width:D(e.width)?e.width:s.width,height:D(e.height)?e.height:s.height}),l=f.x,d=f.y,p=f.width,y=f.height,v=f.syncWithTicks,h=f.horizontalValues,b=f.verticalValues,x=IR(),w=kR();if(!D(p)||p<=0||!D(y)||y<=0||!D(l)||l!==+l||!D(d)||d!==+d)return null;var O=f.verticalCoordinatesGenerator||VN,m=f.horizontalCoordinatesGenerator||XN,g=f.horizontalPoints,_=f.verticalPoints;if((!g||!g.length)&&X(m)){var A=h&&h.length,T=m({yAxis:w?je(je({},w),{},{ticks:A?h:w.ticks}):void 0,width:u,height:c,offset:s},A?!0:v);tt(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(rr(T),"]")),Array.isArray(T)&&(g=T)}if((!_||!_.length)&&X(O)){var M=b&&b.length,P=O({xAxis:x?je(je({},x),{},{ticks:M?b:x.ticks}):void 0,width:u,height:c,offset:s},M?!0:v);tt(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(rr(P),"]")),Array.isArray(P)&&(_=P)}return S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(zN,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),S.createElement(UN,Xt({},f,{offset:s,horizontalPoints:g,xAxis:x,yAxis:w})),S.createElement(HN,Xt({},f,{offset:s,verticalPoints:_,xAxis:x,yAxis:w})),S.createElement(GN,Xt({},f,{horizontalPoints:g})),S.createElement(KN,Xt({},f,{verticalPoints:_})))}YN.displayName="CartesianGrid";function Br(e){"@babel/helpers - typeof";return Br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(e)}function ZN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JN(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function BD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FD(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&D(i)&&D(a)?t.slice(i,a+1):[]};function zw(e){return e==="number"?[0,"auto"]:void 0}var Af=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=eo(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var p=l===void 0?u:l;d=il(p,o.dataKey,i)}else d=l&&l[n]||u[n];return d?[].concat(zr(c),[Nx(s,d)]):c},[])},Ab=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=QD(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=Dj(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,d=Af(t,r,f,l),p=e2(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:d,activeCoordinate:p}}return null},t2=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,d=t.stackOffset,p=Mx(f,a);return n.reduce(function(y,v){var h,b=v.type.defaultProps!==void 0?C(C({},v.type.defaultProps),v.props):v.props,x=b.type,w=b.dataKey,O=b.allowDataOverflow,m=b.allowDuplicatedCategory,g=b.scale,_=b.ticks,A=b.includeHidden,T=b[o];if(y[T])return y;var M=eo(t.data,{graphicalItems:i.filter(function(W){var K,fe=o in W.props?W.props[o]:(K=W.type.defaultProps)===null||K===void 0?void 0:K[o];return fe===T}),dataStartIndex:c,dataEndIndex:s}),P=M.length,E,j,I;TD(b.domain,O,x)&&(E=ql(b.domain,null,O),p&&(x==="number"||g!=="auto")&&(I=hn(M,w,"category")));var $=zw(x);if(!E||E.length===0){var k,N=(k=b.domain)!==null&&k!==void 0?k:$;if(w){if(E=hn(M,w,x),x==="category"&&p){var L=CO(E);m&&L?(j=E,E=aa(0,P)):m||(E=Tm(N,E,v).reduce(function(W,K){return W.indexOf(K)>=0?W:[].concat(zr(W),[K])},[]))}else if(x==="category")m?E=E.filter(function(W){return W!==""&&!Q(W)}):E=Tm(N,E,v).reduce(function(W,K){return W.indexOf(K)>=0||K===""||Q(K)?W:[].concat(zr(W),[K])},[]);else if(x==="number"){var B=Wj(M,i.filter(function(W){var K,fe,ye=o in W.props?W.props[o]:(K=W.type.defaultProps)===null||K===void 0?void 0:K[o],Le="hide"in W.props?W.props.hide:(fe=W.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return ye===T&&(A||!Le)}),w,a,f);B&&(E=B)}p&&(x==="number"||g!=="auto")&&(I=hn(M,w,"category"))}else p?E=aa(0,P):u&&u[T]&&u[T].hasStack&&x==="number"?E=d==="expand"?[0,1]:Rx(u[T].stackGroups,c,s):E=jx(M,i.filter(function(W){var K=o in W.props?W.props[o]:W.type.defaultProps[o],fe="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return K===T&&(A||!fe)}),x,f,!0);if(x==="number")E=wf(l,E,T,a,_),N&&(E=ql(N,E,O));else if(x==="category"&&N){var U=N,G=E.every(function(W){return U.indexOf(W)>=0});G&&(E=U)}}return C(C({},y),{},H({},T,C(C({},b),{},{axisType:a,domain:E,categoricalDomain:I,duplicateDomain:j,originalDomain:(h=b.domain)!==null&&h!==void 0?h:$,isCategorical:p,layout:f})))},{})},r2=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,d=eo(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),p=d.length,y=Mx(f,a),v=-1;return n.reduce(function(h,b){var x=b.type.defaultProps!==void 0?C(C({},b.type.defaultProps),b.props):b.props,w=x[o],O=zw("number");if(!h[w]){v++;var m;return y?m=aa(0,p):u&&u[w]&&u[w].hasStack?(m=Rx(u[w].stackGroups,c,s),m=wf(l,m,w,a)):(m=ql(O,jx(d,n.filter(function(g){var _,A,T=o in g.props?g.props[o]:(_=g.type.defaultProps)===null||_===void 0?void 0:_[o],M="hide"in g.props?g.props.hide:(A=g.type.defaultProps)===null||A===void 0?void 0:A.hide;return T===w&&!M}),"number",f),i.defaultProps.allowDataOverflow),m=wf(l,m,w,a)),C(C({},h),{},H({},w,C(C({axisType:a},i.defaultProps),{},{hide:!0,orientation:ze(ZD,"".concat(a,".").concat(v%2),null),domain:m,originalDomain:O,isCategorical:y,layout:f})))}return h},{})},n2=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),d=Ve(f,a),p={};return d.length?p=t2(t,{axes:d,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(p=r2(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),p},i2=function(t){var r=Et(t),n=pt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Hf(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Ki(r,n)}},Sb=function(t){var r=t.children,n=t.defaultShowTooltip,i=Fe(r,kr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},a2=function(t){return!t||!t.length?!1:t.some(function(r){var n=vt(r&&r.type);return n&&n.indexOf("Bar")>=0})},Pb=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},o2=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,d=n.margin||{},p=Fe(l,kr),y=Fe(l,mr),v=Object.keys(c).reduce(function(m,g){var _=c[g],A=_.orientation;return!_.mirror&&!_.hide?C(C({},m),{},H({},A,m[A]+_.width)):m},{left:d.left||0,right:d.right||0}),h=Object.keys(o).reduce(function(m,g){var _=o[g],A=_.orientation;return!_.mirror&&!_.hide?C(C({},m),{},H({},A,ze(m,"".concat(A))+_.height)):m},{top:d.top||0,bottom:d.bottom||0}),b=C(C({},h),v),x=b.bottom;p&&(b.bottom+=p.props.height||kr.defaultProps.height),y&&r&&(b=Bj(b,i,n,r));var w=s-b.left-b.right,O=f-b.top-b.bottom;return C(C({brushBottom:x},b),{},{width:Math.max(w,0),height:Math.max(O,0)})},u2=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Uw=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,d=function(b,x){var w=x.graphicalItems,O=x.stackGroups,m=x.offset,g=x.updateId,_=x.dataStartIndex,A=x.dataEndIndex,T=b.barSize,M=b.layout,P=b.barGap,E=b.barCategoryGap,j=b.maxBarSize,I=Pb(M),$=I.numericAxisName,k=I.cateAxisName,N=a2(w),L=[];return w.forEach(function(B,U){var G=eo(b.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:A}),W=B.type.defaultProps!==void 0?C(C({},B.type.defaultProps),B.props):B.props,K=W.dataKey,fe=W.maxBarSize,ye=W["".concat($,"Id")],Le=W["".concat(k,"Id")],Dt={},Re=c.reduce(function(qt,Lt){var to=x["".concat(Lt.axisType,"Map")],Cd=W["".concat(Lt.axisType,"Id")];to&&to[Cd]||Lt.axisType==="zAxis"||tr();var Id=to[Cd];return C(C({},qt),{},H(H({},Lt.axisType,Id),"".concat(Lt.axisType,"Ticks"),pt(Id)))},Dt),F=Re[k],Y=Re["".concat(k,"Ticks")],Z=O&&O[ye]&&O[ye].hasStack&&Zj(B,O[ye].stackGroups),R=vt(B.type).indexOf("Bar")>=0,pe=Ki(F,Y),ee=[],be=N&&qj({barSize:T,stackGroups:O,totalSize:u2(Re,k)});if(R){var xe,Ne,St=Q(fe)?j:fe,ur=(xe=(Ne=Ki(F,Y,!0))!==null&&Ne!==void 0?Ne:St)!==null&&xe!==void 0?xe:0;ee=Lj({barGap:P,barCategoryGap:E,bandSize:ur!==pe?ur:pe,sizeList:be[Le],maxBarSize:St}),ur!==pe&&(ee=ee.map(function(qt){return C(C({},qt),{},{position:C(C({},qt.position),{},{offset:qt.position.offset-ur/2})})}))}var ui=B&&B.type&&B.type.getComposedData;ui&&L.push({props:C(C({},ui(C(C({},Re),{},{displayedData:G,props:b,dataKey:K,item:B,bandSize:pe,barPosition:ee,offset:m,stackedData:Z,layout:M,dataStartIndex:_,dataEndIndex:A}))),{},H(H(H({key:B.key||"item-".concat(U)},$,Re[$]),k,Re[k]),"animationId",g)),childIndex:zO(B,b.children),item:B})}),L},p=function(b,x){var w=b.props,O=b.dataStartIndex,m=b.dataEndIndex,g=b.updateId;if(!Wh({props:w}))return null;var _=w.children,A=w.layout,T=w.stackOffset,M=w.data,P=w.reverseStackOrder,E=Pb(A),j=E.numericAxisName,I=E.cateAxisName,$=Ve(_,n),k=Xj(M,$,"".concat(j,"Id"),"".concat(I,"Id"),T,P),N=c.reduce(function(W,K){var fe="".concat(K.axisType,"Map");return C(C({},W),{},H({},fe,n2(w,C(C({},K),{},{graphicalItems:$,stackGroups:K.axisType===j&&k,dataStartIndex:O,dataEndIndex:m}))))},{}),L=o2(C(C({},N),{},{props:w,graphicalItems:$}),x==null?void 0:x.legendBBox);Object.keys(N).forEach(function(W){N[W]=f(w,N[W],L,W.replace("Map",""),r)});var B=N["".concat(I,"Map")],U=i2(B),G=d(w,C(C({},N),{},{dataStartIndex:O,dataEndIndex:m,updateId:g,graphicalItems:$,stackGroups:k,offset:L}));return C(C({formattedGraphicalItems:G,graphicalItems:$,offset:L,stackGroups:k},U),N)},y=function(h){function b(x){var w,O,m;return BD(this,b),m=zD(this,b,[x]),H(m,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),H(m,"accessibilityManager",new PD),H(m,"handleLegendBBoxUpdate",function(g){if(g){var _=m.state,A=_.dataStartIndex,T=_.dataEndIndex,M=_.updateId;m.setState(C({legendBBox:g},p({props:m.props,dataStartIndex:A,dataEndIndex:T,updateId:M},C(C({},m.state),{},{legendBBox:g}))))}}),H(m,"handleReceiveSyncEvent",function(g,_,A){if(m.props.syncId===g){if(A===m.eventEmitterSymbol&&typeof m.props.syncMethod!="function")return;m.applySyncEvent(_)}}),H(m,"handleBrushChange",function(g){var _=g.startIndex,A=g.endIndex;if(_!==m.state.dataStartIndex||A!==m.state.dataEndIndex){var T=m.state.updateId;m.setState(function(){return C({dataStartIndex:_,dataEndIndex:A},p({props:m.props,dataStartIndex:_,dataEndIndex:A,updateId:T},m.state))}),m.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),H(m,"handleMouseEnter",function(g){var _=m.getMouseInfo(g);if(_){var A=C(C({},_),{},{isTooltipActive:!0});m.setState(A),m.triggerSyncEvent(A);var T=m.props.onMouseEnter;X(T)&&T(A,g)}}),H(m,"triggeredAfterMouseMove",function(g){var _=m.getMouseInfo(g),A=_?C(C({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};m.setState(A),m.triggerSyncEvent(A);var T=m.props.onMouseMove;X(T)&&T(A,g)}),H(m,"handleItemMouseEnter",function(g){m.setState(function(){return{isTooltipActive:!0,activeItem:g,activePayload:g.tooltipPayload,activeCoordinate:g.tooltipPosition||{x:g.cx,y:g.cy}}})}),H(m,"handleItemMouseLeave",function(){m.setState(function(){return{isTooltipActive:!1}})}),H(m,"handleMouseMove",function(g){g.persist(),m.throttleTriggeredAfterMouseMove(g)}),H(m,"handleMouseLeave",function(g){m.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};m.setState(_),m.triggerSyncEvent(_);var A=m.props.onMouseLeave;X(A)&&A(_,g)}),H(m,"handleOuterEvent",function(g){var _=WO(g),A=ze(m.props,"".concat(_));if(_&&X(A)){var T,M;/.*touch.*/i.test(_)?M=m.getMouseInfo(g.changedTouches[0]):M=m.getMouseInfo(g),A((T=M)!==null&&T!==void 0?T:{},g)}}),H(m,"handleClick",function(g){var _=m.getMouseInfo(g);if(_){var A=C(C({},_),{},{isTooltipActive:!0});m.setState(A),m.triggerSyncEvent(A);var T=m.props.onClick;X(T)&&T(A,g)}}),H(m,"handleMouseDown",function(g){var _=m.props.onMouseDown;if(X(_)){var A=m.getMouseInfo(g);_(A,g)}}),H(m,"handleMouseUp",function(g){var _=m.props.onMouseUp;if(X(_)){var A=m.getMouseInfo(g);_(A,g)}}),H(m,"handleTouchMove",function(g){g.changedTouches!=null&&g.changedTouches.length>0&&m.throttleTriggeredAfterMouseMove(g.changedTouches[0])}),H(m,"handleTouchStart",function(g){g.changedTouches!=null&&g.changedTouches.length>0&&m.handleMouseDown(g.changedTouches[0])}),H(m,"handleTouchEnd",function(g){g.changedTouches!=null&&g.changedTouches.length>0&&m.handleMouseUp(g.changedTouches[0])}),H(m,"handleDoubleClick",function(g){var _=m.props.onDoubleClick;if(X(_)){var A=m.getMouseInfo(g);_(A,g)}}),H(m,"handleContextMenu",function(g){var _=m.props.onContextMenu;if(X(_)){var A=m.getMouseInfo(g);_(A,g)}}),H(m,"triggerSyncEvent",function(g){m.props.syncId!==void 0&&tl.emit(rl,m.props.syncId,g,m.eventEmitterSymbol)}),H(m,"applySyncEvent",function(g){var _=m.props,A=_.layout,T=_.syncMethod,M=m.state.updateId,P=g.dataStartIndex,E=g.dataEndIndex;if(g.dataStartIndex!==void 0||g.dataEndIndex!==void 0)m.setState(C({dataStartIndex:P,dataEndIndex:E},p({props:m.props,dataStartIndex:P,dataEndIndex:E,updateId:M},m.state)));else if(g.activeTooltipIndex!==void 0){var j=g.chartX,I=g.chartY,$=g.activeTooltipIndex,k=m.state,N=k.offset,L=k.tooltipTicks;if(!N)return;if(typeof T=="function")$=T(L,g);else if(T==="value"){$=-1;for(var B=0;B=0){var Z,R;if(j.dataKey&&!j.allowDuplicatedCategory){var pe=typeof j.dataKey=="function"?Y:"payload.".concat(j.dataKey.toString());Z=il(B,pe,$),R=U&&G&&il(G,pe,$)}else Z=B==null?void 0:B[I],R=U&&G&&G[I];if(Le||ye){var ee=g.props.activeIndex!==void 0?g.props.activeIndex:I;return[q.cloneElement(g,C(C(C({},T.props),Re),{},{activeIndex:ee})),null,null]}if(!Q(Z))return[F].concat(zr(m.renderActivePoints({item:T,activePoint:Z,basePoint:R,childIndex:I,isRange:U})))}else{var be,xe=(be=m.getItemByXY(m.state.activeCoordinate))!==null&&be!==void 0?be:{graphicalItem:F},Ne=xe.graphicalItem,St=Ne.item,ur=St===void 0?g:St,ui=Ne.childIndex,qt=C(C(C({},T.props),Re),{},{activeIndex:ui});return[q.cloneElement(ur,qt),null,null]}return U?[F,null,null]:[F,null]}),H(m,"renderCustomized",function(g,_,A){return q.cloneElement(g,C(C({key:"recharts-customized-".concat(A)},m.props),m.state))}),H(m,"renderMap",{CartesianGrid:{handler:wi,once:!0},ReferenceArea:{handler:m.renderReferenceElement},ReferenceLine:{handler:wi},ReferenceDot:{handler:m.renderReferenceElement},XAxis:{handler:wi},YAxis:{handler:wi},Brush:{handler:m.renderBrush,once:!0},Bar:{handler:m.renderGraphicChild},Line:{handler:m.renderGraphicChild},Area:{handler:m.renderGraphicChild},Radar:{handler:m.renderGraphicChild},RadialBar:{handler:m.renderGraphicChild},Scatter:{handler:m.renderGraphicChild},Pie:{handler:m.renderGraphicChild},Funnel:{handler:m.renderGraphicChild},Tooltip:{handler:m.renderCursor,once:!0},PolarGrid:{handler:m.renderPolarGrid,once:!0},PolarAngleAxis:{handler:m.renderPolarAxis},PolarRadiusAxis:{handler:m.renderPolarAxis},Customized:{handler:m.renderCustomized}}),m.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:ti("recharts"),"-clip"),m.throttleTriggeredAfterMouseMove=P0(m.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),m.state={},m}return GD(b,h),WD(b,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,m=w.data,g=w.height,_=w.layout,A=Fe(O,lt);if(A){var T=A.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var M=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,P=Af(this.state,m,T,M),E=this.state.tooltipTicks[T].coordinate,j=(this.state.offset.top+g)/2,I=_==="horizontal",$=I?{x:E,y:j}:{y:E,x:j},k=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});k&&($=C(C({},$),k.props.points[T].tooltipPosition),P=k.props.points[T].tooltipPayload);var N={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:M,activePayload:P,activeCoordinate:$};this.setState(N),this.renderCursor(A),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var m,g;this.accessibilityManager.setDetails({offset:{left:(m=this.props.margin.left)!==null&&m!==void 0?m:0,top:(g=this.props.margin.top)!==null&&g!==void 0?g:0}})}return null}},{key:"componentDidUpdate",value:function(w){ol([Fe(w.children,lt)],[Fe(this.props.children,lt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Fe(this.props.children,lt);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,m=O.getBoundingClientRect(),g=jS(m),_={chartX:Math.round(w.pageX-g.left),chartY:Math.round(w.pageY-g.top)},A=m.width/O.offsetWidth||1,T=this.inRange(_.chartX,_.chartY,A);if(!T)return null;var M=this.state,P=M.xAxisMap,E=M.yAxisMap,j=this.getTooltipEventType();if(j!=="axis"&&P&&E){var I=Et(P).scale,$=Et(E).scale,k=I&&I.invert?I.invert(_.chartX):null,N=$&&$.invert?$.invert(_.chartY):null;return C(C({},_),{},{xValue:k,yValue:N})}var L=Ab(this.state,this.props.data,this.props.layout,T);return L?C(C({},_),L):null}},{key:"inRange",value:function(w,O){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=this.props.layout,_=w/m,A=O/m;if(g==="horizontal"||g==="vertical"){var T=this.state.offset,M=_>=T.left&&_<=T.left+T.width&&A>=T.top&&A<=T.top+T.height;return M?{x:_,y:A}:null}var P=this.state,E=P.angleAxisMap,j=P.radiusAxisMap;if(E&&j){var I=Et(E);return Mm({x:_,y:A},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),m=Fe(w,lt),g={};m&&O==="axis"&&(m.props.trigger==="click"?g={onClick:this.handleClick}:g={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=_i(this.props,this.handleOuterEvent);return C(C({},_),g)}},{key:"addListener",value:function(){tl.on(rl,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){tl.removeListener(rl,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,m){for(var g=this.state.formattedGraphicalItems,_=0,A=g.length;_r in a?Ir(a,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[r]=t;var y=(a,r,t)=>Rr(a,typeof r!="symbol"?r+"":r,t);import{c as Z}from"./ui-utils-BNSC_Jv-.js";import{r as v,R as Fr,b as m,d as Lr}from"./react-core-D_V7s-9r.js";import{s as Wr,j as Ge,t as Ar,v as ft,w as Hr,x as $r,y as Qr,z as Br}from"./radix-core-mDeFS0Pz.js";function C(a){const r=Object.prototype.toString.call(a);return a instanceof Date||typeof a=="object"&&r==="[object Date]"?new a.constructor(+a):typeof a=="number"||r==="[object Number]"||typeof a=="string"||r==="[object String]"?new Date(a):new Date(NaN)}function oe(a,r){return a instanceof Date?new a.constructor(r):new Date(r)}function qr(a,r){const t=C(a);return isNaN(r)?oe(a,NaN):(r&&t.setDate(t.getDate()+r),t)}function Kr(a,r){const t=C(a);if(isNaN(r))return oe(a,NaN);if(!r)return t;const e=t.getDate(),n=oe(a,t.getTime());n.setMonth(t.getMonth()+r+1,0);const s=n.getDate();return e>=s?n:(t.setFullYear(n.getFullYear(),n.getMonth(),e),t)}function ze(a,r){const{years:t=0,months:e=0,weeks:n=0,days:s=0,hours:o=0,minutes:i=0,seconds:c=0}=r,u=C(a),l=e||t?Kr(u,e+t*12):u,d=s||n?qr(l,s+n*7):l,f=i+o*60,h=(c+f*60)*1e3;return oe(a,d.getTime()+h)}const Jn=6048e5,Vr=864e5,it=6e4,rn=36e5,mn=525600,Qe=43200,xt=1440;let Ur={};function Le(){return Ur}function ct(a,r){var i,c,u,l;const t=Le(),e=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,n=C(a),s=n.getDay(),o=(s=n.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function gn(a){const r=C(a);return r.setHours(0,0,0,0),r}function qe(a){const r=C(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function tr(a,r){const t=gn(a),e=gn(r),n=+t-qe(t),s=+e-qe(e);return Math.round((n-s)/Vr)}function jr(a){const r=er(a),t=oe(a,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),St(t)}function Ne(a,r){const t=C(a),e=C(r),n=t.getTime()-e.getTime();return n<0?-1:n>0?1:n}function nr(a){return oe(a,Date.now())}function Xr(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Gr(a){if(!Xr(a)&&typeof a!="number")return!1;const r=C(a);return!isNaN(Number(r))}function zr(a,r){const t=C(a),e=C(r),n=t.getFullYear()-e.getFullYear(),s=t.getMonth()-e.getMonth();return n*12+s}function Zr(a,r){const t=C(a),e=C(r);return t.getFullYear()-e.getFullYear()}function Jr(a,r){const t=C(a),e=C(r),n=wn(t,e),s=Math.abs(tr(t,e));t.setDate(t.getDate()-n*s);const o=+(wn(t,e)===-n),i=n*(s-o);return i===0?0:i}function wn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function Ft(a){return r=>{const e=(a?Math[a]:Math.trunc)(r);return e===0?0:e}}function an(a,r){return+C(a)-+C(r)}function ea(a,r,t){const e=an(a,r)/rn;return Ft(t==null?void 0:t.roundingMethod)(e)}function ta(a,r,t){const e=an(a,r)/it;return Ft(t==null?void 0:t.roundingMethod)(e)}function na(a){const r=C(a);return r.setHours(23,59,59,999),r}function ra(a){const r=C(a),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function aa(a){const r=C(a);return+na(r)==+ra(r)}function rr(a,r){const t=C(a),e=C(r),n=Ne(t,e),s=Math.abs(zr(t,e));let o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-n*s);let i=Ne(t,e)===-n;aa(C(a))&&s===1&&Ne(a,e)===1&&(i=!1),o=n*(s-Number(i))}return o===0?0:o}function ar(a,r,t){const e=an(a,r)/1e3;return Ft(t==null?void 0:t.roundingMethod)(e)}function sa(a,r){const t=C(a),e=C(r),n=Ne(t,e),s=Math.abs(Zr(t,e));t.setFullYear(1584),e.setFullYear(1584);const o=Ne(t,e)===-n,i=n*(s-+o);return i===0?0:i}function oa(a){const r=C(a),t=oe(a,0);return t.setFullYear(r.getFullYear(),0,1),t.setHours(0,0,0,0),t}const ia={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"}},ca=(a,r,t)=>{let e;const n=ia[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Bt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const ua={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},la={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},da={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fa={date:Bt({formats:ua,defaultWidth:"full"}),time:Bt({formats:la,defaultWidth:"full"}),dateTime:Bt({formats:da,defaultWidth:"full"})},pa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ha=(a,r,t,e)=>pa[a];function Ze(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const o=a.defaultFormattingWidth||a.defaultWidth,i=t!=null&&t.width?String(t.width):o;n=a.formattingValues[i]||a.formattingValues[o]}else{const o=a.defaultWidth,i=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[i]||a.values[o]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const ma={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ga={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wa={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"]},Da={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"]},ya={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"}},va={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"}},ba=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},ka={ordinalNumber:ba,era:Ze({values:ma,defaultWidth:"wide"}),quarter:Ze({values:ga,defaultWidth:"wide",argumentCallback:a=>a-1}),month:Ze({values:wa,defaultWidth:"wide"}),day:Ze({values:Da,defaultWidth:"wide"}),dayPeriod:Ze({values:ya,defaultWidth:"wide",formattingValues:va,defaultFormattingWidth:"wide"})};function Je(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const o=s[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(i)?Ma(i,d=>d.test(o)):_a(i,d=>d.test(o));let u;u=a.valueCallback?a.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const l=r.slice(o.length);return{value:u,rest:l}}}function _a(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function Ma(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let o=a.valueCallback?a.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(n.length);return{value:o,rest:i}}}const Sa=/^(\d+)(th|st|nd|rd)?/i,Ca=/\d+/i,Pa={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},Ta={any:[/^b/i,/^(a|c)/i]},Oa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ea={any:[/1/i,/2/i,/3/i,/4/i]},Na={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},Ya={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]},Ia={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},Ra={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]},Fa={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},La={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}},Wa={ordinalNumber:xa({matchPattern:Sa,parsePattern:Ca,valueCallback:a=>parseInt(a,10)}),era:Je({matchPatterns:Pa,defaultMatchWidth:"wide",parsePatterns:Ta,defaultParseWidth:"any"}),quarter:Je({matchPatterns:Oa,defaultMatchWidth:"wide",parsePatterns:Ea,defaultParseWidth:"any",valueCallback:a=>a+1}),month:Je({matchPatterns:Na,defaultMatchWidth:"wide",parsePatterns:Ya,defaultParseWidth:"any"}),day:Je({matchPatterns:Ia,defaultMatchWidth:"wide",parsePatterns:Ra,defaultParseWidth:"any"}),dayPeriod:Je({matchPatterns:Fa,defaultMatchWidth:"any",parsePatterns:La,defaultParseWidth:"any"})},Lt={code:"en-US",formatDistance:ca,formatLong:fa,formatRelative:ha,localize:ka,match:Wa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Aa(a){const r=C(a);return tr(r,oa(r))+1}function Ha(a){const r=C(a),t=+St(r)-+jr(r);return Math.round(t/Jn)+1}function sr(a,r){var l,d,f,p;const t=C(a),e=t.getFullYear(),n=Le(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(l=r==null?void 0:r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=oe(a,0);o.setFullYear(e+1,0,s),o.setHours(0,0,0,0);const i=ct(o,r),c=oe(a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const u=ct(c,r);return t.getTime()>=i.getTime()?e+1:t.getTime()>=u.getTime()?e:e-1}function $a(a,r){var i,c,u,l;const t=Le(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,n=sr(a,r),s=oe(a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),ct(s,r)}function Qa(a,r){const t=C(a),e=+ct(t,r)-+$a(t,r);return Math.round(e/Jn)+1}function T(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const _e={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return T(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):T(t+1,2)},d(a,r){return T(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return T(a.getHours()%12||12,r.length)},H(a,r){return T(a.getHours(),r.length)},m(a,r){return T(a.getMinutes(),r.length)},s(a,r){return T(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return T(n,r.length)}},Ae={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return _e.y(a,r)},Y:function(a,r,t,e){const n=sr(a,e),s=n>0?n:1-n;if(r==="YY"){const o=s%100;return T(o,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):T(s,r.length)},R:function(a,r){const t=er(a);return T(t,r.length)},u:function(a,r){const t=a.getFullYear();return T(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return T(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return T(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return _e.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return T(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=Qa(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):T(n,r.length)},I:function(a,r,t){const e=Ha(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):T(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):_e.d(a,r)},D:function(a,r,t){const e=Aa(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):T(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return T(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return T(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return T(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=Ae.noon:e===0?n=Ae.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=Ae.evening:e>=12?n=Ae.afternoon:e>=4?n=Ae.morning:n=Ae.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return _e.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):_e.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):T(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):T(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):_e.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):_e.s(a,r)},S:function(a,r){return _e.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return vn(e);case"XXXX":case"XX":return Te(e);case"XXXXX":case"XXX":default:return Te(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return vn(e);case"xxxx":case"xx":return Te(e);case"xxxxx":case"xxx":default:return Te(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+yn(e,":");case"OOOO":default:return"GMT"+Te(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+yn(e,":");case"zzzz":default:return"GMT"+Te(e,":")}},t:function(a,r,t){const e=Math.trunc(a.getTime()/1e3);return T(e,r.length)},T:function(a,r,t){const e=a.getTime();return T(e,r.length)}};function yn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+T(s,2)}function vn(a,r){return a%60===0?(a>0?"-":"+")+T(Math.abs(a)/60,2):Te(a,r)}function Te(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=T(Math.trunc(e/60),2),s=T(e%60,2);return t+n+r+s}const bn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},or=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Ba=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return bn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",bn(e,r)).replace("{{time}}",or(n,r))},qa={p:or,P:Ba},Ka=/^D+$/,Va=/^Y+$/,Ua=["D","DD","YY","YYYY"];function ja(a){return Ka.test(a)}function Xa(a){return Va.test(a)}function Ga(a,r,t){const e=za(a,r,t);if(console.warn(e),Ua.includes(a))throw new RangeError(e)}function za(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ja=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,es=/^'([^]*?)'?$/,ts=/''/g,ns=/[a-zA-Z]/;function ou(a,r,t){var l,d,f,p;const e=Le(),n=e.locale??Lt,s=e.firstWeekContainsDate??((d=(l=e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??1,o=e.weekStartsOn??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=C(a);if(!Gr(i))throw new RangeError("Invalid time value");let c=r.match(Ja).map(h=>{const g=h[0];if(g==="p"||g==="P"){const w=qa[g];return w(h,n.formatLong)}return h}).join("").match(Za).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rs(h)};if(Dn[g])return{isToken:!0,value:h};if(g.match(ns))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});n.localize.preprocessor&&(c=n.localize.preprocessor(i,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return c.map(h=>{if(!h.isToken)return h.value;const g=h.value;(Xa(g)||ja(g))&&Ga(g,r,String(a));const w=Dn[g[0]];return w(i,g,n.localize,u)}).join("")}function rs(a){const r=a.match(es);return r?r[1].replace(ts,"'"):a}function as(a,r,t){const e=Le(),n=(t==null?void 0:t.locale)??e.locale??Lt,s=2520,o=Ne(a,r);if(isNaN(o))throw new RangeError("Invalid time value");const i=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let c,u;o>0?(c=C(r),u=C(a)):(c=C(a),u=C(r));const l=ar(u,c),d=(qe(u)-qe(c))/1e3,f=Math.round((l-d)/60);let p;if(f<2)return t!=null&&t.includeSeconds?l<5?n.formatDistance("lessThanXSeconds",5,i):l<10?n.formatDistance("lessThanXSeconds",10,i):l<20?n.formatDistance("lessThanXSeconds",20,i):l<40?n.formatDistance("halfAMinute",0,i):l<60?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",1,i):f===0?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",f,i);if(f<45)return n.formatDistance("xMinutes",f,i);if(f<90)return n.formatDistance("aboutXHours",1,i);if(f0?(i=C(r),c=C(a)):(i=C(a),c=C(r));const u=Ft((t==null?void 0:t.roundingMethod)??"round"),l=c.getTime()-i.getTime(),d=l/it,f=qe(c)-qe(i),p=(l-f)/it,h=t==null?void 0:t.unit;let g;if(h?g=h:d<1?g="second":d<60?g="minute":d{const l=`x${u.replace(/(^.)/,f=>f.toUpperCase())}`,d=a[u];return d!==void 0&&(s||a[u])?c.concat(e.formatDistance(l,d)):c},[]).join(o):""}function lu(a,r){const t=C(a);if(isNaN(t.getTime()))throw new RangeError("Invalid time value");const e=(r==null?void 0:r.representation)??"complete";let n="",s="";const o="-",i=":";if(e!=="time"){const c=T(t.getDate(),2),u=T(t.getMonth()+1,2);n=`${T(t.getFullYear(),4)}${o}${u}${o}${c}`}if(e!=="date"){const c=t.getTimezoneOffset();if(c!==0){const h=Math.abs(c),g=T(Math.trunc(h/60),2),w=T(h%60,2);s=`${c<0?"+":"-"}${g}:${w}`}else s="Z";const u=T(t.getHours(),2),l=T(t.getMinutes(),2),d=T(t.getSeconds(),2),f=n===""?"":"T",p=[u,l,d].join(i);n=`${n}${f}${p}${s}`}return n}function du(a){return C(a*1e3)}function fu(a){const r=C(a.start),t=C(a.end),e={},n=sa(t,r);n&&(e.years=n);const s=ze(r,{years:e.years}),o=rr(t,s);o&&(e.months=o);const i=ze(s,{months:e.months}),c=Jr(t,i);c&&(e.days=c);const u=ze(i,{days:e.days}),l=ea(t,u);l&&(e.hours=l);const d=ze(u,{hours:e.hours}),f=ta(t,d);f&&(e.minutes=f);const p=ze(d,{minutes:e.minutes}),h=ar(t,p);return h&&(e.seconds=h),e}function pu(a,r){const e=ls(a);let n;if(e.date){const c=ds(e.date,2);n=fs(c.restDateString,c.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const s=n.getTime();let o=0,i;if(e.time&&(o=ps(e.time),isNaN(o)))return new Date(NaN);if(e.timezone){if(i=hs(e.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(s+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(s+o+i)}const pt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},is=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,cs=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,us=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ls(a){const r={},t=a.split(pt.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],pt.timeZoneDelimiter.test(r.date)&&(r.date=a.split(pt.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=pt.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function ds(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function fs(a,r){if(r===null)return new Date(NaN);const t=a.match(is);if(!t)return new Date(NaN);const e=!!t[4],n=et(t[1]),s=et(t[2])-1,o=et(t[3]),i=et(t[4]),c=et(t[5])-1;if(e)return ys(r,i,c)?ms(r,i,c):new Date(NaN);{const u=new Date(0);return!ws(r,s,o)||!Ds(r,n)?new Date(NaN):(u.setUTCFullYear(r,s,Math.max(n,o)),u)}}function et(a){return a?parseInt(a):1}function ps(a){const r=a.match(cs);if(!r)return NaN;const t=qt(r[1]),e=qt(r[2]),n=qt(r[3]);return vs(t,e,n)?t*rn+e*it+n*1e3:NaN}function qt(a){return a&&parseFloat(a.replace(",","."))||0}function hs(a){if(a==="Z")return 0;const r=a.match(us);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return bs(e,n)?t*(e*rn+n*it):NaN}function ms(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const gs=[31,null,31,30,31,30,31,31,30,31,30,31];function ir(a){return a%400===0||a%4===0&&a%100!==0}function ws(a,r,t){return r>=0&&r<=11&&t>=1&&t<=(gs[r]||(ir(a)?29:28))}function Ds(a,r){return r>=1&&r<=(ir(a)?366:365)}function ys(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function vs(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function bs(a,r){return r>=0&&r<=59}const cr=6048e5,ks=864e5,Wt=6e4,At=36e5,_s=1e3,kn=Symbol.for("constructDateFrom");function W(a,r){return typeof a=="function"?a(r):a&&typeof a=="object"&&kn in a?a[kn](r):a instanceof Date?new a.constructor(r):new Date(r)}function b(a,r){return W(r||a,a)}function ce(a,r,t){const e=b(a,t==null?void 0:t.in);return isNaN(r)?W((t==null?void 0:t.in)||a,NaN):(r&&e.setDate(e.getDate()+r),e)}function ue(a,r,t){const e=b(a,t==null?void 0:t.in);if(isNaN(r))return W(a,NaN);if(!r)return e;const n=e.getDate(),s=W(a,e.getTime());s.setMonth(e.getMonth()+r+1,0);const o=s.getDate();return n>=o?s:(e.setFullYear(s.getFullYear(),s.getMonth(),n),e)}function ur(a,r,t){return W(a,+b(a)+r)}function Ms(a,r,t){return ur(a,r*At)}let xs={};function We(){return xs}function be(a,r){var i,c,u,l;const t=We(),e=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.weekStartsOn)??0,n=b(a,r==null?void 0:r.in),s=n.getDay(),o=(s=s.getTime()?e+1:t.getTime()>=i.getTime()?e:e-1}function Ct(a){const r=b(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function ke(a,...r){const t=W.bind(null,r.find(e=>typeof e=="object"));return r.map(t)}function Re(a,r){const t=b(a,r==null?void 0:r.in);return t.setHours(0,0,0,0),t}function Ve(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=Re(e),o=Re(n),i=+s-Ct(s),c=+o-Ct(o);return Math.round((i-c)/ks)}function Ss(a,r){const t=lr(a,r),e=W(a,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Ke(e)}function Zt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setTime(e.getTime()+r*Wt),e}function sn(a,r,t){return ue(a,r*3,t)}function Cs(a,r,t){return ur(a,r*1e3)}function Pt(a,r,t){return ce(a,r*7,t)}function ge(a,r,t){return ue(a,r*12,t)}function _n(a,r){let t,e=r==null?void 0:r.in;return a.forEach(n=>{!e&&typeof n=="object"&&(e=W.bind(null,n));const s=b(n,e);(!t||t{!e&&typeof n=="object"&&(e=W.bind(null,n));const s=b(n,e);(!t||t>s||isNaN(+s))&&(t=s)}),W(e,t||NaN)}function Ps(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return+Re(e)==+Re(n)}function we(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Tt(a){return!(!we(a)&&typeof a!="number"||isNaN(+b(a)))}function Ot(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),o=e.getMonth()-n.getMonth();return s*12+o}function Ye(a,r){const t=b(a,r==null?void 0:r.in);return Math.trunc(t.getMonth()/3)+1}function Et(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),o=Ye(e)-Ye(n);return s*4+o}function Nt(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()-n.getFullYear()}function Ts(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r),s=xn(e,n),o=Math.abs(Ve(e,n));e.setDate(e.getDate()-s*o);const i=+(xn(e,n)===-s),c=s*(o-i);return c===0?0:c}function xn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function dr(a,r){const t=b(a,r==null?void 0:r.in);return t.setHours(23,59,59,999),t}function fr(a,r){const t=b(a,r==null?void 0:r.in),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Jt(a,r){const t=b(a,r==null?void 0:r.in),e=t.getMonth(),n=e-e%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function pr(a,r){const t=b(a,r==null?void 0:r.in);return t.setDate(1),t.setHours(0,0,0,0),t}function hr(a,r){const t=b(a,r==null?void 0:r.in),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Ht(a,r){const t=b(a,r==null?void 0:r.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Os(a,r){var i,c;const t=We(),e=t.weekStartsOn??((c=(i=t.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??0,n=b(a,r==null?void 0:r.in),s=n.getDay(),o=(s{let e;const n=Es[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Kt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const Ys={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Is={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rs={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fs={date:Kt({formats:Ys,defaultWidth:"full"}),time:Kt({formats:Is,defaultWidth:"full"}),dateTime:Kt({formats:Rs,defaultWidth:"full"})},Ls={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ws=(a,r,t,e)=>Ls[a];function tt(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const o=a.defaultFormattingWidth||a.defaultWidth,i=t!=null&&t.width?String(t.width):o;n=a.formattingValues[i]||a.formattingValues[o]}else{const o=a.defaultWidth,i=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[i]||a.values[o]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const As={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$s={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"]},Qs={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"]},Bs={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"}},qs={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"}},Ks=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Vs={ordinalNumber:Ks,era:tt({values:As,defaultWidth:"wide"}),quarter:tt({values:Hs,defaultWidth:"wide",argumentCallback:a=>a-1}),month:tt({values:$s,defaultWidth:"wide"}),day:tt({values:Qs,defaultWidth:"wide"}),dayPeriod:tt({values:Bs,defaultWidth:"wide",formattingValues:qs,defaultFormattingWidth:"wide"})};function nt(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const o=s[0],i=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(i)?js(i,d=>d.test(o)):Us(i,d=>d.test(o));let u;u=a.valueCallback?a.valueCallback(c):c,u=t.valueCallback?t.valueCallback(u):u;const l=r.slice(o.length);return{value:u,rest:l}}}function Us(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function js(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let o=a.valueCallback?a.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(n.length);return{value:o,rest:i}}}const Gs=/^(\d+)(th|st|nd|rd)?/i,zs=/\d+/i,Zs={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},Js={any:[/^b/i,/^(a|c)/i]},eo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},to={any:[/1/i,/2/i,/3/i,/4/i]},no={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},ro={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]},ao={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},so={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]},oo={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},io={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}},co={ordinalNumber:Xs({matchPattern:Gs,parsePattern:zs,valueCallback:a=>parseInt(a,10)}),era:nt({matchPatterns:Zs,defaultMatchWidth:"wide",parsePatterns:Js,defaultParseWidth:"any"}),quarter:nt({matchPatterns:eo,defaultMatchWidth:"wide",parsePatterns:to,defaultParseWidth:"any",valueCallback:a=>a+1}),month:nt({matchPatterns:no,defaultMatchWidth:"wide",parsePatterns:ro,defaultParseWidth:"any"}),day:nt({matchPatterns:ao,defaultMatchWidth:"wide",parsePatterns:so,defaultParseWidth:"any"}),dayPeriod:nt({matchPatterns:oo,defaultMatchWidth:"any",parsePatterns:io,defaultParseWidth:"any"})},mr={code:"en-US",formatDistance:Ns,formatLong:Fs,formatRelative:Ws,localize:Vs,match:co,options:{weekStartsOn:0,firstWeekContainsDate:1}};function uo(a,r){const t=b(a,r==null?void 0:r.in);return Ve(t,Ht(t))+1}function on(a,r){const t=b(a,r==null?void 0:r.in),e=+Ke(t)-+Ss(t);return Math.round(e/cr)+1}function cn(a,r){var l,d,f,p;const t=b(a,r==null?void 0:r.in),e=t.getFullYear(),n=We(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(l=r==null?void 0:r.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=W((r==null?void 0:r.in)||a,0);o.setFullYear(e+1,0,s),o.setHours(0,0,0,0);const i=be(o,r),c=W((r==null?void 0:r.in)||a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const u=be(c,r);return+t>=+i?e+1:+t>=+u?e:e-1}function lo(a,r){var i,c,u,l;const t=We(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((l=(u=t.locale)==null?void 0:u.options)==null?void 0:l.firstWeekContainsDate)??1,n=cn(a,r),s=W((r==null?void 0:r.in)||a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),be(s,r)}function gr(a,r){const t=b(a,r==null?void 0:r.in),e=+be(t,r)-+lo(t,r);return Math.round(e/cr)+1}function L(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const Me={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return L(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):L(t+1,2)},d(a,r){return L(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return L(a.getHours()%12||12,r.length)},H(a,r){return L(a.getHours(),r.length)},m(a,r){return L(a.getMinutes(),r.length)},s(a,r){return L(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return L(n,r.length)}},He={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return Me.y(a,r)},Y:function(a,r,t,e){const n=cn(a,e),s=n>0?n:1-n;if(r==="YY"){const o=s%100;return L(o,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):L(s,r.length)},R:function(a,r){const t=lr(a);return L(t,r.length)},u:function(a,r){const t=a.getFullYear();return L(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return L(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return L(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return Me.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return L(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=gr(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):L(n,r.length)},I:function(a,r,t){const e=on(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):L(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):Me.d(a,r)},D:function(a,r,t){const e=uo(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):L(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return L(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return L(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return L(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=He.noon:e===0?n=He.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=He.evening:e>=12?n=He.afternoon:e>=4?n=He.morning:n=He.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return Me.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):Me.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):L(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):L(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):Me.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):Me.s(a,r)},S:function(a,r){return Me.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return Pn(e);case"XXXX":case"XX":return Oe(e);case"XXXXX":case"XXX":default:return Oe(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return Pn(e);case"xxxx":case"xx":return Oe(e);case"xxxxx":case"xxx":default:return Oe(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Cn(e,":");case"OOOO":default:return"GMT"+Oe(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Cn(e,":");case"zzzz":default:return"GMT"+Oe(e,":")}},t:function(a,r,t){const e=Math.trunc(+a/1e3);return L(e,r.length)},T:function(a,r,t){return L(+a,r.length)}};function Cn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+L(s,2)}function Pn(a,r){return a%60===0?(a>0?"-":"+")+L(Math.abs(a)/60,2):Oe(a,r)}function Oe(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=L(Math.trunc(e/60),2),s=L(e%60,2);return t+n+r+s}const Tn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},wr=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},fo=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return Tn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",Tn(e,r)).replace("{{time}}",wr(n,r))},en={p:wr,P:fo},po=/^D+$/,ho=/^Y+$/,mo=["D","DD","YY","YYYY"];function go(a){return po.test(a)}function wo(a){return ho.test(a)}function Do(a,r,t){const e=yo(a,r,t);if(console.warn(e),mo.includes(a))throw new RangeError(e)}function yo(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ko=/^'([^]*?)'?$/,_o=/''/g,Mo=/[a-zA-Z]/;function On(a,r,t){var l,d,f,p,h,g,w,k;const e=We(),n=(t==null?void 0:t.locale)??e.locale??mr,s=(t==null?void 0:t.firstWeekContainsDate)??((d=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??e.firstWeekContainsDate??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(t==null?void 0:t.weekStartsOn)??((g=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??e.weekStartsOn??((k=(w=e.locale)==null?void 0:w.options)==null?void 0:k.weekStartsOn)??0,i=b(a,t==null?void 0:t.in);if(!Tt(i))throw new RangeError("Invalid time value");let c=r.match(bo).map(S=>{const x=S[0];if(x==="p"||x==="P"){const N=en[x];return N(S,n.formatLong)}return S}).join("").match(vo).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const x=S[0];if(x==="'")return{isToken:!1,value:xo(S)};if(Sn[x])return{isToken:!0,value:S};if(x.match(Mo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:S}});n.localize.preprocessor&&(c=n.localize.preprocessor(i,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return c.map(S=>{if(!S.isToken)return S.value;const x=S.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&wo(x)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&go(x))&&Do(x,r,String(a));const N=Sn[x[0]];return N(i,x,n.localize,u)}).join("")}function xo(a){const r=a.match(ko);return r?r[1].replace(_o,"'"):a}function En(a,r){return b(a,r==null?void 0:r.in).getDate()}function So(a,r){return b(a,r==null?void 0:r.in).getDay()}function Co(a,r){const t=b(a,r==null?void 0:r.in),e=t.getFullYear(),n=t.getMonth(),s=W(t,0);return s.setFullYear(e,n+1,0),s.setHours(0,0,0,0),s.getDate()}function Po(){return Object.assign({},We())}function De(a,r){return b(a,r==null?void 0:r.in).getHours()}function To(a,r){const t=b(a,r==null?void 0:r.in).getDay();return t===0?7:t}function ye(a,r){return b(a,r==null?void 0:r.in).getMinutes()}function te(a,r){return b(a,r==null?void 0:r.in).getMonth()}function Se(a){return b(a).getSeconds()}function tn(a){return+b(a)}function P(a,r){return b(a,r==null?void 0:r.in).getFullYear()}function Pe(a,r){return+b(a)>+b(r)}function Fe(a,r){return+b(a)<+b(r)}function Oo(a,r){return+b(a)==+b(r)}function Eo(a,r){const t=No(r)?new r(0):W(r,0);return t.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),t.setHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),t}function No(a){var r;return typeof a=="function"&&((r=a.prototype)==null?void 0:r.constructor)===a}const Yo=10;class Dr{constructor(){y(this,"subPriority",0)}validate(r,t){return!0}}class Io extends Dr{constructor(r,t,e,n,s){super(),this.value=r,this.validateValue=t,this.setValue=e,this.priority=n,s&&(this.subPriority=s)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,e){return this.setValue(r,t,this.value,e)}}class Ro extends Dr{constructor(t,e){super();y(this,"priority",Yo);y(this,"subPriority",-1);this.context=t||(n=>W(e,n))}set(t,e){return e.timestampIsSet?t:W(t,Eo(t,this.context))}}class Y{run(r,t,e,n){const s=this.parse(r,t,e,n);return s?{setter:new Io(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(r,t,e){return!0}}class Fo extends Y{constructor(){super(...arguments);y(this,"priority",140);y(this,"incompatibleTokens",["R","u","t","T"])}parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}const U={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}/},pe={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 j(a,r){return a&&{value:r(a.value),rest:a.rest}}function B(a,r){const t=r.match(a);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function he(a,r){const t=r.match(a);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const e=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:e*(n*At+s*Wt+o*_s),rest:r.slice(t[0].length)}}function yr(a){return B(U.anyDigitsSigned,a)}function V(a,r){switch(a){case 1:return B(U.singleDigit,r);case 2:return B(U.twoDigits,r);case 3:return B(U.threeDigits,r);case 4:return B(U.fourDigits,r);default:return B(new RegExp("^\\d{1,"+a+"}"),r)}}function Yt(a,r){switch(a){case 1:return B(U.singleDigitSigned,r);case 2:return B(U.twoDigitsSigned,r);case 3:return B(U.threeDigitsSigned,r);case 4:return B(U.fourDigitsSigned,r);default:return B(new RegExp("^-?\\d{1,"+a+"}"),r)}}function un(a){switch(a){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 vr(a,r){const t=r>0,e=t?r:1-r;let n;if(e<=50)n=a||100;else{const s=e+50,o=Math.trunc(s/100)*100,i=a>=s%100;n=a+o-(i?100:0)}return t?n:1-n}function br(a){return a%400===0||a%4===0&&a%100!==0}class Lo extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,e,n){const s=o=>({year:o,isTwoDigitYear:e==="yy"});switch(e){case"y":return j(V(4,t),s);case"yo":return j(n.ordinalNumber(t,{unit:"year"}),s);default:return j(V(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const s=t.getFullYear();if(n.isTwoDigitYear){const i=vr(n.year,s);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Wo extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,e,n){const s=o=>({year:o,isTwoDigitYear:e==="YY"});switch(e){case"Y":return j(V(4,t),s);case"Yo":return j(n.ordinalNumber(t,{unit:"year"}),s);default:return j(V(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,s){const o=cn(t,s);if(n.isTwoDigitYear){const c=vr(n.year,o);return t.setFullYear(c,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),be(t,s)}const i=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(i,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),be(t,s)}}class Ao extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,e){return Yt(e==="R"?4:e.length,t)}set(t,e,n){const s=W(t,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Ke(s)}}class Ho extends Y{constructor(){super(...arguments);y(this,"priority",130);y(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,e){return Yt(e==="u"?4:e.length,t)}set(t,e,n){return t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}class $o extends Y{constructor(){super(...arguments);y(this,"priority",120);y(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"Q":case"QQ":return V(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Qo extends Y{constructor(){super(...arguments);y(this,"priority",120);y(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"q":case"qq":return V(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Bo extends Y{constructor(){super(...arguments);y(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);y(this,"priority",110)}parse(t,e,n){const s=o=>o-1;switch(e){case"M":return j(B(U.month,t),s);case"MM":return j(V(2,t),s);case"Mo":return j(n.ordinalNumber(t,{unit:"month"}),s);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}class qo extends Y{constructor(){super(...arguments);y(this,"priority",110);y(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,e,n){const s=o=>o-1;switch(e){case"L":return j(B(U.month,t),s);case"LL":return j(V(2,t),s);case"Lo":return j(n.ordinalNumber(t,{unit:"month"}),s);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}function Ko(a,r,t){const e=b(a,t==null?void 0:t.in),n=gr(e,t)-r;return e.setDate(e.getDate()-n*7),b(e,t==null?void 0:t.in)}class Vo extends Y{constructor(){super(...arguments);y(this,"priority",100);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,e,n){switch(e){case"w":return B(U.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,s){return be(Ko(t,n,s),s)}}function Uo(a,r,t){const e=b(a,t==null?void 0:t.in),n=on(e,t)-r;return e.setDate(e.getDate()-n*7),e}class jo extends Y{constructor(){super(...arguments);y(this,"priority",100);y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,e,n){switch(e){case"I":return B(U.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return Ke(Uo(t,n))}}const Xo=[31,28,31,30,31,30,31,31,30,31,30,31],Go=[31,29,31,30,31,30,31,31,30,31,30,31];class zo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"subPriority",1);y(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"d":return B(U.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return V(e.length,t)}}validate(t,e){const n=t.getFullYear(),s=br(n),o=t.getMonth();return s?e>=1&&e<=Go[o]:e>=1&&e<=Xo[o]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}}class Zo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"subpriority",1);y(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,e,n){switch(e){case"D":case"DD":return B(U.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return V(e.length,t)}}validate(t,e){const n=t.getFullYear();return br(n)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),t.setHours(0,0,0,0),t}}function ln(a,r,t){var d,f,p,h;const e=We(),n=(t==null?void 0:t.weekStartsOn)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??e.weekStartsOn??((h=(p=e.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,s=b(a,t==null?void 0:t.in),o=s.getDay(),c=(r%7+7)%7,u=7-n,l=r<0||r>6?r-(o+u)%7:(c+u)%7-(o+u)%7;return ce(s,l,t)}class Jo extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}class ei extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,e,n,s){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+s.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return j(V(e.length,t),o);case"eo":return j(n.ordinalNumber(t,{unit:"day"}),o);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}class ti extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,e,n,s){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+s.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return j(V(e.length,t),o);case"co":return j(n.ordinalNumber(t,{unit:"day"}),o);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=ln(t,n,s),t.setHours(0,0,0,0),t}}function ni(a,r,t){const e=b(a,t==null?void 0:t.in),n=To(e,t),s=r-n;return ce(e,s,t)}class ri extends Y{constructor(){super(...arguments);y(this,"priority",90);y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,e,n){const s=o=>o===0?7:o;switch(e){case"i":case"ii":return V(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return j(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return j(n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return j(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiii":default:return j(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return t=ni(t,n),t.setHours(0,0,0,0),t}}class ai extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class si extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class oi extends Y{constructor(){super(...arguments);y(this,"priority",80);y(this,"incompatibleTokens",["a","b","t","T"])}parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(un(n),0,0,0),t}}class ii extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,e,n){switch(e){case"h":return B(U.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const s=t.getHours()>=12;return s&&n<12?t.setHours(n+12,0,0,0):!s&&n===12?t.setHours(0,0,0,0):t.setHours(n,0,0,0),t}}class ci extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,e,n){switch(e){case"H":return B(U.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}}class ui extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,e,n){switch(e){case"K":return B(U.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}}class li extends Y{constructor(){super(...arguments);y(this,"priority",70);y(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,e,n){switch(e){case"k":return B(U.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return V(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const s=n<=24?n%24:n;return t.setHours(s,0,0,0),t}}class di extends Y{constructor(){super(...arguments);y(this,"priority",60);y(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"m":return B(U.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}}class fi extends Y{constructor(){super(...arguments);y(this,"priority",50);y(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"s":return B(U.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return V(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}}class pi extends Y{constructor(){super(...arguments);y(this,"priority",30);y(this,"incompatibleTokens",["t","T"])}parse(t,e){const n=s=>Math.trunc(s*Math.pow(10,-e.length+3));return j(V(e.length,t),n)}set(t,e,n){return t.setMilliseconds(n),t}}class hi extends Y{constructor(){super(...arguments);y(this,"priority",10);y(this,"incompatibleTokens",["t","T","x"])}parse(t,e){switch(e){case"X":return he(pe.basicOptionalMinutes,t);case"XX":return he(pe.basic,t);case"XXXX":return he(pe.basicOptionalSeconds,t);case"XXXXX":return he(pe.extendedOptionalSeconds,t);case"XXX":default:return he(pe.extended,t)}}set(t,e,n){return e.timestampIsSet?t:W(t,t.getTime()-Ct(t)-n)}}class mi extends Y{constructor(){super(...arguments);y(this,"priority",10);y(this,"incompatibleTokens",["t","T","X"])}parse(t,e){switch(e){case"x":return he(pe.basicOptionalMinutes,t);case"xx":return he(pe.basic,t);case"xxxx":return he(pe.basicOptionalSeconds,t);case"xxxxx":return he(pe.extendedOptionalSeconds,t);case"xxx":default:return he(pe.extended,t)}}set(t,e,n){return e.timestampIsSet?t:W(t,t.getTime()-Ct(t)-n)}}class gi extends Y{constructor(){super(...arguments);y(this,"priority",40);y(this,"incompatibleTokens","*")}parse(t){return yr(t)}set(t,e,n){return[W(t,n*1e3),{timestampIsSet:!0}]}}class wi extends Y{constructor(){super(...arguments);y(this,"priority",20);y(this,"incompatibleTokens","*")}parse(t){return yr(t)}set(t,e,n){return[W(t,n),{timestampIsSet:!0}]}}const Di={G:new Fo,y:new Lo,Y:new Wo,R:new Ao,u:new Ho,Q:new $o,q:new Qo,M:new Bo,L:new qo,w:new Vo,I:new jo,d:new zo,D:new Zo,E:new Jo,e:new ei,c:new ti,i:new ri,a:new ai,b:new si,B:new oi,h:new ii,H:new ci,K:new ui,k:new li,m:new di,s:new fi,S:new pi,X:new hi,x:new mi,t:new gi,T:new wi},yi=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vi=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bi=/^'([^]*?)'?$/,ki=/''/g,_i=/\S/,Mi=/[a-zA-Z]/;function xi(a,r,t,e){var w,k,S,x,N,q,$,I;const n=()=>W((e==null?void 0:e.in)||t,NaN),s=Po(),o=(e==null?void 0:e.locale)??s.locale??mr,i=(e==null?void 0:e.firstWeekContainsDate)??((k=(w=e==null?void 0:e.locale)==null?void 0:w.options)==null?void 0:k.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(S=s.locale)==null?void 0:S.options)==null?void 0:x.firstWeekContainsDate)??1,c=(e==null?void 0:e.weekStartsOn)??((q=(N=e==null?void 0:e.locale)==null?void 0:N.options)==null?void 0:q.weekStartsOn)??s.weekStartsOn??((I=($=s.locale)==null?void 0:$.options)==null?void 0:I.weekStartsOn)??0;if(!r)return a?n():b(t,e==null?void 0:e.in);const u={firstWeekContainsDate:i,weekStartsOn:c,locale:o},l=[new Ro(e==null?void 0:e.in,t)],d=r.match(vi).map(_=>{const M=_[0];if(M in en){const F=en[M];return F(_,o.formatLong)}return _}).join("").match(yi),f=[];for(let _ of d){const M=_[0],F=Di[M];if(F){const{incompatibleTokens:X}=F;if(Array.isArray(X)){const J=f.find(le=>X.includes(le.token)||le.token===M);if(J)throw new RangeError(`The format string mustn't contain \`${J.fullToken}\` and \`${_}\` at the same time`)}else if(F.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);f.push({token:M,fullToken:_});const K=F.run(a,_,o.match,u);if(!K)return n();l.push(K.setter),a=K.rest}else{if(M.match(Mi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");if(_==="''"?_="'":M==="'"&&(_=Si(_)),a.indexOf(_)===0)a=a.slice(_.length);else return n()}}if(a.length>0&&_i.test(a))return n();const p=l.map(_=>_.priority).sort((_,M)=>M-_).filter((_,M,F)=>F.indexOf(_)===M).map(_=>l.filter(M=>M.priority===_).sort((M,F)=>F.subPriority-M.subPriority)).map(_=>_[0]);let h=b(t,e==null?void 0:e.in);if(isNaN(+h))return n();const g={};for(const _ of p){if(!_.validate(h,u))return n();const M=_.set(h,g,u);Array.isArray(M)?(h=M[0],Object.assign(g,M[1])):h=M}return h}function Si(a){return a.match(bi)[1].replace(ki,"'")}function Ci(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()}function Pi(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return+Jt(e)==+Jt(n)}function Ti(a,r,t){const[e,n]=ke(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()}function ut(a,r,t){const e=+b(a,t==null?void 0:t.in),[n,s]=[+b(r.start,t==null?void 0:t.in),+b(r.end,t==null?void 0:t.in)].sort((o,i)=>o-i);return e>=n&&e<=s}function Oi(a,r,t){return ce(a,-1,t)}function Ei(a,r){const t=()=>W(r==null?void 0:r.in,NaN),n=Ri(a);let s;if(n.date){const u=Fi(n.date,2);s=Li(u.restDateString,u.year)}if(!s||isNaN(+s))return t();const o=+s;let i=0,c;if(n.time&&(i=Wi(n.time),isNaN(i)))return t();if(n.timezone){if(c=Ai(n.timezone),isNaN(c))return t()}else{const u=new Date(o+i),l=b(0,r==null?void 0:r.in);return l.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),l.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),l}return b(o+i+c,r==null?void 0:r.in)}const ht={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ni=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Yi=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ii=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ri(a){const r={},t=a.split(ht.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],ht.timeZoneDelimiter.test(r.date)&&(r.date=a.split(ht.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=ht.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function Fi(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function Li(a,r){if(r===null)return new Date(NaN);const t=a.match(Ni);if(!t)return new Date(NaN);const e=!!t[4],n=rt(t[1]),s=rt(t[2])-1,o=rt(t[3]),i=rt(t[4]),c=rt(t[5])-1;if(e)return qi(r,i,c)?Hi(r,i,c):new Date(NaN);{const u=new Date(0);return!Qi(r,s,o)||!Bi(r,n)?new Date(NaN):(u.setUTCFullYear(r,s,Math.max(n,o)),u)}}function rt(a){return a?parseInt(a):1}function Wi(a){const r=a.match(Yi);if(!r)return NaN;const t=Vt(r[1]),e=Vt(r[2]),n=Vt(r[3]);return Ki(t,e,n)?t*At+e*Wt+n*1e3:NaN}function Vt(a){return a&&parseFloat(a.replace(",","."))||0}function Ai(a){if(a==="Z")return 0;const r=a.match(Ii);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return Vi(e,n)?t*(e*At+n*Wt):NaN}function Hi(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const $i=[31,null,31,30,31,30,31,31,30,31,30,31];function kr(a){return a%400===0||a%4===0&&a%100!==0}function Qi(a,r,t){return r>=0&&r<=11&&t>=1&&t<=($i[r]||(kr(a)?29:28))}function Bi(a,r){return r>=1&&r<=(kr(a)?366:365)}function qi(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Ki(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function Vi(a,r){return r>=0&&r<=59}function ae(a,r,t){const e=b(a,t==null?void 0:t.in),n=e.getFullYear(),s=e.getDate(),o=W(a,0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);const i=Co(o);return e.setMonth(r,Math.min(s,i)),e}function vt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setHours(r),e}function bt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setMinutes(r),e}function $e(a,r,t){const e=b(a,t==null?void 0:t.in),n=Math.trunc(e.getMonth()/3)+1,s=r-n;return ae(e,e.getMonth()+s*3)}function kt(a,r,t){const e=b(a,t==null?void 0:t.in);return e.setSeconds(r),e}function de(a,r,t){const e=b(a,t==null?void 0:t.in);return isNaN(+e)?W(a,NaN):(e.setFullYear(r),e)}function Ie(a,r,t){return ue(a,-r,t)}function _r(a,r,t){return sn(a,-1,t)}function Nn(a,r,t){return Pt(a,-1,t)}function Ue(a,r,t){return ge(a,-r,t)}const Mr={...Fr},Ui=Mr.useInsertionEffect,ji=Ui||(a=>a());function Xi(a){const r=v.useRef(()=>{});return ji(()=>{r.current=a}),v.useCallback(function(){for(var t=arguments.length,e=new Array(t),n=0;n"floating-ui-"+Math.random().toString(36).slice(2,6)+Gi++;function zi(){const[a,r]=v.useState(()=>Yn?In():void 0);return It(()=>{a==null&&r(In())},[]),v.useEffect(()=>{Yn=!0},[]),a}const Zi=Mr.useId,xr=Zi||zi,Ji=v.forwardRef(function(r,t){const{context:{placement:e,elements:{floating:n},middlewareData:{arrow:s,shift:o}},width:i=14,height:c=7,tipRadius:u=0,strokeWidth:l=0,staticOffset:d,stroke:f,d:p,style:{transform:h,...g}={},...w}=r,k=xr(),[S,x]=v.useState(!1);if(It(()=>{if(!n)return;Wr(n).direction==="rtl"&&x(!0)},[n]),!n)return null;const[N,q]=e.split("-"),$=N==="top"||N==="bottom";let I=d;($&&o!=null&&o.x||!$&&o!=null&&o.y)&&(I=null);const _=l*2,M=_/2,F=i/2*(u/-8+1),X=c/2*u/4,K=!!p,J=I&&q==="end"?"bottom":"top";let le=I&&q==="end"?"right":"left";I&&S&&(le=q==="end"?"left":"right");const G=(s==null?void 0:s.x)!=null?I||s.x:"",A=(s==null?void 0:s.y)!=null?I||s.y:"",Q=p||"M0,0"+(" H"+i)+(" L"+(i-F)+","+(c-X))+(" Q"+i/2+","+c+" "+F+","+(c-X))+" Z",ne={top:K?"rotate(180deg)":"",left:K?"rotate(90deg)":"rotate(-90deg)",bottom:K?"":"rotate(180deg)",right:K?"rotate(-90deg)":"rotate(90deg)"}[N];return Ge.jsxs("svg",{...w,"aria-hidden":!0,ref:t,width:K?i:i+_,height:i,viewBox:"0 0 "+i+" "+(c>i?c:i),style:{position:"absolute",pointerEvents:"none",[le]:G,[J]:A,[N]:$||K?"100%":"calc(100% - "+_/2+"px)",transform:[ne,h].filter(Xe=>!!Xe).join(" "),...g},children:[_>0&&Ge.jsx("path",{clipPath:"url(#"+k+")",fill:"none",stroke:f,strokeWidth:_+(p?0:1),d:Q}),Ge.jsx("path",{stroke:_&&!p?w.fill:"none",d:Q}),Ge.jsx("clipPath",{id:k,children:Ge.jsx("rect",{x:-M,y:M*(K?-1:1),width:i+_,height:i})})]})});function ec(){const a=new Map;return{emit(r,t){var e;(e=a.get(r))==null||e.forEach(n=>n(t))},on(r,t){a.set(r,[...a.get(r)||[],t])},off(r,t){var e;a.set(r,((e=a.get(r))==null?void 0:e.filter(n=>n!==t))||[])}}}const tc=v.createContext(null),nc=v.createContext(null),rc=()=>{var a;return((a=v.useContext(tc))==null?void 0:a.id)||null},ac=()=>v.useContext(nc);function sc(a){const{open:r=!1,onOpenChange:t,elements:e}=a,n=xr(),s=v.useRef({}),[o]=v.useState(()=>ec()),i=rc()!=null,[c,u]=v.useState(e.reference),l=Xi((p,h,g)=>{s.current.openEvent=p?h:void 0,o.emit("openchange",{open:p,event:h,reason:g,nested:i}),t==null||t(p,h,g)}),d=v.useMemo(()=>({setPositionReference:u}),[]),f=v.useMemo(()=>({reference:c||e.reference||null,floating:e.floating||null,domReference:e.reference}),[c,e.reference,e.floating]);return v.useMemo(()=>({dataRef:s,open:r,onOpenChange:l,elements:f,events:o,floatingId:n,refs:d}),[r,l,f,o,n,d])}function oc(a){a===void 0&&(a={});const{nodeId:r}=a,t=sc({...a,elements:{reference:null,floating:null,...a.elements}}),e=a.rootContext||t,n=e.elements,[s,o]=v.useState(null),[i,c]=v.useState(null),l=(n==null?void 0:n.domReference)||s,d=v.useRef(null),f=ac();It(()=>{l&&(d.current=l)},[l]);const p=Ar({...a,elements:{...n,...i&&{reference:i}}}),h=v.useCallback(x=>{const N=ft(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(N),p.refs.setReference(N)},[p.refs]),g=v.useCallback(x=>{(ft(x)||x===null)&&(d.current=x,o(x)),(ft(p.refs.reference.current)||p.refs.reference.current===null||x!==null&&!ft(x))&&p.refs.setReference(x)},[p.refs]),w=v.useMemo(()=>({...p.refs,setReference:g,setPositionReference:h,domReference:d}),[p.refs,g,h]),k=v.useMemo(()=>({...p.elements,domReference:l}),[p.elements,l]),S=v.useMemo(()=>({...p,...e,refs:w,elements:k,nodeId:r}),[p,w,k,r,e]);return It(()=>{e.dataRef.current.floatingContext=S;const x=f==null?void 0:f.nodesRef.current.find(N=>N.id===r);x&&(x.context=S)}),v.useMemo(()=>({...p,context:S,refs:w,elements:k}),[p,w,k,S])}/*! - react-datepicker v8.1.0 - https://github.com/Hacker0x01/react-datepicker - Released under the MIT License. -*/var nn=function(r,t){return nn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])},nn(r,t)};function z(a,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");nn(a,r);function t(){this.constructor=a}a.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var E=function(){return E=Object.assign||function(t){for(var e,n=1,s=arguments.length;n0?t[0]:t;return a&&H(a,n,e)||""}function uc(a,r,t){if(!a)return"";var e=re(a,t),n=r?re(r,t):"";return"".concat(e," - ").concat(n)}function lc(a,r){if(!(a!=null&&a.length))return"";var t=a[0]?re(a[0],r):"";if(a.length===1)return t;if(a.length===2&&a[1]){var e=re(a[1],r);return"".concat(t,", ").concat(e)}var n=a.length-1;return"".concat(t," (+").concat(n,")")}function jt(a,r){var t=r.hour,e=t===void 0?0:t,n=r.minute,s=n===void 0?0:n,o=r.second,i=o===void 0?0:o;return vt(bt(kt(a,i),s),e)}function dc(a){return on(a)}function fc(a,r){return H(a,"ddd",r)}function _t(a){return Re(a)}function Ce(a,r,t){var e=je(r||dn());return be(a,{locale:e,weekStartsOn:t})}function ve(a){return pr(a)}function st(a){return Ht(a)}function Rn(a){return Jt(a)}function Fn(){return Re(R())}function Ln(a){return dr(a)}function pc(a){return Os(a)}function hc(a){return fr(a)}function fe(a,r){return a&&r?Ti(a,r):!a&&!r}function ee(a,r){return a&&r?Ci(a,r):!a&&!r}function Rt(a,r){return a&&r?Pi(a,r):!a&&!r}function O(a,r){return a&&r?Ps(a,r):!a&&!r}function Ee(a,r){return a&&r?Oo(a,r):!a&&!r}function ot(a,r,t){var e,n=Re(r),s=dr(t);try{e=ut(a,{start:n,end:s})}catch{e=!1}return e}function dn(){var a=Sr();return a.__localeId__}function je(a){if(typeof a=="string"){var r=Sr();return r.__localeData__?r.__localeData__[a]:void 0}else return a}function mc(a,r,t){return r(H(a,"EEEE",t))}function gc(a,r){return H(a,"EEEEEE",r)}function wc(a,r){return H(a,"EEE",r)}function fn(a,r){return H(ae(R(),a),"LLLL",r)}function Cr(a,r){return H(ae(R(),a),"LLL",r)}function Dc(a,r){return H($e(R(),a),"QQQ",r)}function se(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.excludeDateIntervals,i=t.includeDates,c=t.includeDateIntervals,u=t.filterDate;return dt(a,{minDate:e,maxDate:n})||s&&s.some(function(l){return l instanceof Date?O(a,l):O(a,l.date)})||o&&o.some(function(l){var d=l.start,f=l.end;return ut(a,{start:d,end:f})})||i&&!i.some(function(l){return O(a,l)})||c&&!c.some(function(l){var d=l.start,f=l.end;return ut(a,{start:d,end:f})})||u&&!u(R(a))||!1}function pn(a,r){var t=r===void 0?{}:r,e=t.excludeDates,n=t.excludeDateIntervals;return n&&n.length>0?n.some(function(s){var o=s.start,i=s.end;return ut(a,{start:o,end:i})}):e&&e.some(function(s){var o;return s instanceof Date?O(a,s):O(a,(o=s.date)!==null&&o!==void 0?o:new Date)})||!1}function Pr(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate;return dt(a,{minDate:e?pr(e):void 0,maxDate:n?fr(n):void 0})||(s==null?void 0:s.some(function(c){return ee(a,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return ee(a,c)})||i&&!i(R(a))||!1}function mt(a,r,t,e){var n=P(a),s=te(a),o=P(r),i=te(r),c=P(e);return n===o&&n===c?s<=t&&t<=i:n=t||cn:!1}function yc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates;return dt(a,{minDate:e,maxDate:n})||s&&s.some(function(i){return ee(i instanceof Date?i:i.date,a)})||o&&!o.some(function(i){return ee(i,a)})||!1}function gt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate;return dt(a,{minDate:e,maxDate:n})||(s==null?void 0:s.some(function(c){return Rt(a,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return Rt(a,c)})||i&&!i(R(a))||!1}function wt(a,r,t){if(!r||!t||!Tt(r)||!Tt(t))return!1;var e=P(r),n=P(t);return e<=a&&n>=a}function Mt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,o=t.includeDates,i=t.filterDate,c=new Date(a,0,1);return dt(c,{minDate:e?Ht(e):void 0,maxDate:n?hr(n):void 0})||(s==null?void 0:s.some(function(u){return fe(c,u instanceof Date?u:u.date)}))||o&&!o.some(function(u){return fe(c,u)})||i&&!i(R(c))||!1}function Dt(a,r,t,e){var n=P(a),s=Ye(a),o=P(r),i=Ye(r),c=P(e);return n===o&&n===c?s<=t&&t<=i:n=t||cn:!1}function dt(a,r){var t,e=r===void 0?{}:r,n=e.minDate,s=e.maxDate;return(t=n&&Ve(a,n)<0||s&&Ve(a,s)>0)!==null&&t!==void 0?t:!1}function Wn(a,r){return r.some(function(t){return De(t)===De(a)&&ye(t)===ye(a)&&Se(t)===Se(a)})}function An(a,r){var t=r===void 0?{}:r,e=t.excludeTimes,n=t.includeTimes,s=t.filterTime;return e&&Wn(a,e)||n&&!Wn(a,n)||s&&!s(a)||!1}function Hn(a,r){var t=r.minTime,e=r.maxTime;if(!t||!e)throw new Error("Both minTime and maxTime props required");var n=R();n=vt(n,De(a)),n=bt(n,ye(a)),n=kt(n,Se(a));var s=R();s=vt(s,De(t)),s=bt(s,ye(t)),s=kt(s,Se(t));var o=R();o=vt(o,De(e)),o=bt(o,ye(e)),o=kt(o,Se(e));var i;try{i=!ut(n,{start:s,end:o})}catch{i=!1}return i}function $n(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ie(a,1);return e&&Ot(e,s)>0||n&&n.every(function(o){return Ot(o,s)>0})||!1}function Qn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ue(a,1);return e&&Ot(s,e)>0||n&&n.every(function(o){return Ot(s,o)>0})||!1}function vc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ht(a),o=_r(s);return e&&Et(e,o)>0||n&&n.every(function(i){return Et(i,o)>0})||!1}function bc(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=hr(a),o=sn(s,1);return e&&Et(o,e)>0||n&&n.every(function(i){return Et(o,i)>0})||!1}function Bn(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ue(a,1);return e&&Nt(e,s)>0||n&&n.every(function(o){return Nt(o,s)>0})||!1}function kc(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.yearItemNumber,s=n===void 0?lt:n,o=st(Ue(a,s)),i=xe(o,s).endPeriod,c=e&&P(e);return c&&c>i||!1}function qn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ge(a,1);return e&&Nt(s,e)>0||n&&n.every(function(o){return Nt(s,o)>0})||!1}function _c(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.yearItemNumber,s=n===void 0?lt:n,o=ge(a,s),i=xe(o,s).startPeriod,c=e&&P(e);return c&&c=0});return Mn(e)}else return t?Mn(t):r}function Or(a){var r=a.maxDate,t=a.includeDates;if(t&&r){var e=t.filter(function(n){return Ve(n,r)<=0});return _n(e)}else return t?_n(t):r}function Kn(a,r){var t;a===void 0&&(a=[]),r===void 0&&(r="react-datepicker__day--highlighted");for(var e=new Map,n=0,s=a.length;n=Yc,p=!n&&!t.isWeekInMonth(i);if(f||p)if(t.props.peekNextMonth)o=!0;else break}return e},t.onMonthClick=function(e,n){var s=t.isMonthDisabledForLabelDate(n),o=s.isDisabled,i=s.labelDate;o||t.handleDayClick(ve(i),e)},t.onMonthMouseEnter=function(e){var n=t.isMonthDisabledForLabelDate(e),s=n.isDisabled,o=n.labelDate;s||t.handleDayMouseEnter(ve(o))},t.handleMonthNavigation=function(e,n){var s,o,i,c;(o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,n),(c=(i=t.MONTH_REFS[e])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus()},t.handleKeyboardNavigation=function(e,n,s){var o,i=t.props,c=i.selected,u=i.preSelection,l=i.setPreSelection,d=i.minDate,f=i.maxDate,p=i.showFourColumnMonthYearPicker,h=i.showTwoColumnMonthYearPicker;if(u){var g=Gn(p,h),w=t.getVerticalOffset(g),k=(o=Xt[g])===null||o===void 0?void 0:o.grid,S=function(I,_,M){var F,X,K=_,J=M;switch(I){case D.ArrowRight:K=ue(_,yt),J=M===11?0:M+yt;break;case D.ArrowLeft:K=Ie(_,yt),J=M===0?11:M-yt;break;case D.ArrowUp:K=Ie(_,w),J=!((F=k==null?void 0:k[0])===null||F===void 0)&&F.includes(M)?M+12-w:M-w;break;case D.ArrowDown:K=ue(_,w),J=!((X=k==null?void 0:k[k.length-1])===null||X===void 0)&&X.includes(M)?M-12+w:M+w;break}return{newCalculatedDate:K,newCalculatedMonth:J}},x=function(I,_,M){for(var F=40,X=I,K=!1,J=0,le=S(X,_,M),G=le.newCalculatedDate,A=le.newCalculatedMonth;!K;){if(J>=F){G=_,A=M;break}if(d&&Gf){X=D.ArrowLeft;var Q=S(X,G,A);G=Q.newCalculatedDate,A=Q.newCalculatedMonth}if(yc(G,t.props)){var Q=S(X,G,A);G=Q.newCalculatedDate,A=Q.newCalculatedMonth}else K=!0;J++}return{newCalculatedDate:G,newCalculatedMonth:A}};if(n===D.Enter){t.isMonthDisabled(s)||(t.onMonthClick(e,s),l==null||l(c));return}var N=x(n,u,s),q=N.newCalculatedDate,$=N.newCalculatedMonth;switch(n){case D.ArrowRight:case D.ArrowLeft:case D.ArrowUp:case D.ArrowDown:t.handleMonthNavigation($,q);break}}},t.getVerticalOffset=function(e){var n,s;return(s=(n=Xt[e])===null||n===void 0?void 0:n.verticalNavigationOffset)!==null&&s!==void 0?s:0},t.onMonthKeyDown=function(e,n){var s=t.props,o=s.disabledKeyboardNavigation,i=s.handleOnMonthKeyDown,c=e.key;c!==D.Tab&&e.preventDefault(),o||t.handleKeyboardNavigation(e,c,n),i&&i(e)},t.onQuarterClick=function(e,n){var s=$e(t.props.day,n);gt(s,t.props)||t.handleDayClick(Rn(s),e)},t.onQuarterMouseEnter=function(e){var n=$e(t.props.day,e);gt(n,t.props)||t.handleDayMouseEnter(Rn(n))},t.handleQuarterNavigation=function(e,n){var s,o,i,c;t.isDisabled(n)||t.isExcluded(n)||((o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,n),(c=(i=t.QUARTER_REFS[e-1])===null||i===void 0?void 0:i.current)===null||c===void 0||c.focus())},t.onQuarterKeyDown=function(e,n){var s,o,i=e.key;if(!t.props.disabledKeyboardNavigation)switch(i){case D.Enter:t.onQuarterClick(e,n),(o=(s=t.props).setPreSelection)===null||o===void 0||o.call(s,t.props.selected);break;case D.ArrowRight:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===4?1:n+1,sn(t.props.preSelection,1));break;case D.ArrowLeft:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===1?4:n-1,_r(t.props.preSelection));break}},t.isMonthDisabledForLabelDate=function(e){var n,s=t.props,o=s.day,i=s.minDate,c=s.maxDate,u=s.excludeDates,l=s.includeDates,d=ae(o,e);return{isDisabled:(n=(i||c||u||l)&&Pr(d,t.props))!==null&&n!==void 0?n:!1,labelDate:d}},t.isMonthDisabled=function(e){var n=t.isMonthDisabledForLabelDate(e).isDisabled;return n},t.getMonthClassNames=function(e){var n=t.props,s=n.day,o=n.startDate,i=n.endDate,c=n.preSelection,u=n.monthClassName,l=u?u(ae(s,e)):void 0,d=t.getSelection();return Z("react-datepicker__month-text","react-datepicker__month-".concat(e),l,{"react-datepicker__month-text--disabled":t.isMonthDisabled(e),"react-datepicker__month-text--selected":d?t.isSelectMonthInList(s,e,d):void 0,"react-datepicker__month-text--keyboard-selected":!t.props.disabledKeyboardNavigation&&c&&t.isSelectedMonth(s,e,c)&&!t.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":t.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":o&&i?mt(o,i,e,s):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(s,e)})},t.getTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=te(t.props.preSelection),s=t.isMonthDisabledForLabelDate(n).isDisabled,o=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return o},t.getQuarterTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=Ye(t.props.preSelection),s=gt(t.props.day,t.props),o=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return o},t.getAriaLabel=function(e){var n=t.props,s=n.chooseDayAriaLabelPrefix,o=s===void 0?"Choose":s,i=n.disabledDayAriaLabelPrefix,c=i===void 0?"Not available":i,u=n.day,l=n.locale,d=ae(u,e),f=t.isDisabled(d)||t.isExcluded(d)?c:o;return"".concat(f," ").concat(H(d,"MMMM yyyy",l))},t.getQuarterClassNames=function(e){var n=t.props,s=n.day,o=n.startDate,i=n.endDate,c=n.selected,u=n.minDate,l=n.maxDate,d=n.excludeDates,f=n.includeDates,p=n.filterDate,h=n.preSelection,g=n.disabledKeyboardNavigation,w=(u||l||d||f||p)&>($e(s,e),t.props);return Z("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":w,"react-datepicker__quarter-text--selected":c?t.isSelectedQuarter(s,e,c):void 0,"react-datepicker__quarter-text--keyboard-selected":!g&&h&&t.isSelectedQuarter(s,e,h)&&!w,"react-datepicker__quarter-text--in-selecting-range":t.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":o&&i?Dt(o,i,e,s):void 0,"react-datepicker__quarter-text--range-start":t.isRangeStartQuarter(e),"react-datepicker__quarter-text--range-end":t.isRangeEndQuarter(e)})},t.getMonthContent=function(e){var n=t.props,s=n.showFullMonthYearPicker,o=n.renderMonthContent,i=n.locale,c=n.day,u=Cr(e,i),l=fn(e,i);return o?o(e,u,l,c):s?l:u},t.getQuarterContent=function(e){var n,s=t.props,o=s.renderQuarterContent,i=s.locale,c=Dc(e,i);return(n=o==null?void 0:o(e,c))!==null&&n!==void 0?n:c},t.renderMonths=function(){var e,n=t.props,s=n.showTwoColumnMonthYearPicker,o=n.showFourColumnMonthYearPicker,i=n.day,c=n.selected,u=(e=Xt[Gn(o,s)])===null||e===void 0?void 0:e.grid;return u==null?void 0:u.map(function(l,d){return m.createElement("div",{className:"react-datepicker__month-wrapper",key:d},l.map(function(f,p){return m.createElement("div",{ref:t.MONTH_REFS[f],key:p,onClick:function(h){t.onMonthClick(h,f)},onKeyDown:function(h){Er(h)&&(h.preventDefault(),h.key=D.Enter),t.onMonthKeyDown(h,f)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onMonthMouseEnter(f)},onPointerEnter:t.props.usePointerEvent?function(){return t.onMonthMouseEnter(f)}:void 0,tabIndex:Number(t.getTabIndex(f)),className:t.getMonthClassNames(f),"aria-disabled":t.isMonthDisabled(f),role:"option","aria-label":t.getAriaLabel(f),"aria-current":t.isCurrentMonth(i,f)?"date":void 0,"aria-selected":c?t.isSelectedMonth(i,f,c):void 0},t.getMonthContent(f))}))})},t.renderQuarters=function(){var e=t.props,n=e.day,s=e.selected,o=[1,2,3,4];return m.createElement("div",{className:"react-datepicker__quarter-wrapper"},o.map(function(i,c){return m.createElement("div",{key:c,ref:t.QUARTER_REFS[c],role:"option",onClick:function(u){t.onQuarterClick(u,i)},onKeyDown:function(u){t.onQuarterKeyDown(u,i)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onQuarterMouseEnter(i)},onPointerEnter:t.props.usePointerEvent?function(){return t.onQuarterMouseEnter(i)}:void 0,className:t.getQuarterClassNames(i),"aria-selected":s?t.isSelectedQuarter(n,i,s):void 0,tabIndex:Number(t.getQuarterTabIndex(i)),"aria-current":t.isCurrentQuarter(n,i)?"date":void 0},t.getQuarterContent(i))}))},t.getClassNames=function(){var e=t.props,n=e.selectingDate,s=e.selectsStart,o=e.selectsEnd,i=e.showMonthYearPicker,c=e.showQuarterYearPicker,u=e.showWeekPicker;return Z("react-datepicker__month",{"react-datepicker__month--selecting-range":n&&(s||o)},{"react-datepicker__monthPicker":i},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":u})},t}return r.prototype.getSelection=function(){var t=this.props,e=t.selected,n=t.selectedDates,s=t.selectsMultiple;if(s)return n;if(e)return[e]},r.prototype.render=function(){var t=this.props,e=t.showMonthYearPicker,n=t.showQuarterYearPicker,s=t.day,o=t.ariaLabelPrefix,i=o===void 0?"Month ":o,c=i?i.trim()+" ":"";return m.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(H(s,"MMMM, yyyy",this.props.locale)),role:"listbox"},e?this.renderMonths():n?this.renderQuarters():this.renderWeeks())},r}(v.Component),Rc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,n){return m.createElement("div",{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),"aria-selected":t.isSelectedMonth(n)?"true":void 0},t.isSelectedMonth(n)?m.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 r.prototype.render=function(){return m.createElement($t,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),Fc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(n,s){return m.createElement("option",{key:n,value:s},n)})},t.renderSelectMode=function(e){return m.createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(n){return t.onChange(parseInt(n.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,n){return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},m.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},n[t.props.month]))},t.renderDropdown=function(e){return m.createElement(Rc,E({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,s=[t.renderReadView(!n,e)];return n&&s.unshift(t.renderDropdown(e)),s},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 r.prototype.render=function(){var t=this,e=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(s){return Cr(s,t.props.locale)}:function(s){return fn(s,t.props.locale)}),n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode(e);break;case"select":n=this.renderSelectMode(e);break}return m.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},n)},r}(v.Component);function Lc(a,r){for(var t=[],e=ve(a),n=ve(r);!Pe(e,n);)t.push(R(e)),e=ue(e,1);return t}var Wc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.renderOptions=function(){return e.state.monthYearsList.map(function(n){var s=tn(n),o=fe(e.props.date,n)&&ee(e.props.date,n);return m.createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:s,onClick:e.onChange.bind(e,s),"aria-selected":o?"true":void 0},o?m.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",H(n,e.props.dateFormat,e.props.locale))})},e.onChange=function(n){return e.props.onChange(n)},e.handleClickOutside=function(){e.props.onCancel()},e.state={monthYearsList:Lc(e.props.minDate,e.props.maxDate)},e}return r.prototype.render=function(){var t=Z({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return m.createElement($t,{className:t,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),Ac=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=ve(t.props.minDate),n=ve(t.props.maxDate),s=[];!Pe(e,n);){var o=tn(e);s.push(m.createElement("option",{key:o,value:o},H(e,t.props.dateFormat,t.props.locale))),e=ue(e,1)}return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return m.createElement("select",{value:tn(ve(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var n=H(t.props.date,t.props.dateFormat,t.props.locale);return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},m.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},n))},t.renderDropdown=function(){return m.createElement(Wc,E({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=R(e);fe(t.props.date,n)&&ee(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return m.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(v.Component),Hc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={height:null},t.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,s;t.list&&(t.list.scrollTop=(s=t.centerLi&&r.calcCenterPosition(t.props.monthRef?t.props.monthRef.clientHeight-((n=(e=t.header)===null||e===void 0?void 0:e.clientHeight)!==null&&n!==void 0?n:0):t.list.clientHeight,t.centerLi))!==null&&s!==void 0?s:0)})},t.handleClick=function(e){var n,s;(t.props.minTime||t.props.maxTime)&&Hn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&An(e,t.props)||(s=(n=t.props).onChange)===null||s===void 0||s.call(n,e)},t.isSelectedTime=function(e){return t.props.selected&&Pc(t.props.selected,e)},t.isDisabledTime=function(e){return(t.props.minTime||t.props.maxTime)&&Hn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&An(e,t.props)},t.liClasses=function(e){var n,s=["react-datepicker__time-list-item",t.props.timeClassName?t.props.timeClassName(e):void 0];return t.isSelectedTime(e)&&s.push("react-datepicker__time-list-item--selected"),t.isDisabledTime(e)&&s.push("react-datepicker__time-list-item--disabled"),t.props.injectTimes&&(De(e)*3600+ye(e)*60+Se(e))%(((n=t.props.intervals)!==null&&n!==void 0?n:r.defaultProps.intervals)*60)!==0&&s.push("react-datepicker__time-list-item--injected"),s.join(" ")},t.handleOnKeyDown=function(e,n){var s,o;e.key===D.Space&&(e.preventDefault(),e.key=D.Enter),(e.key===D.ArrowUp||e.key===D.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===D.ArrowDown||e.key===D.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===D.Enter&&t.handleClick(n),(o=(s=t.props).handleOnKeyDown)===null||o===void 0||o.call(s,e)},t.renderTimes=function(){for(var e,n=[],s=typeof t.props.format=="string"?t.props.format:"p",o=(e=t.props.intervals)!==null&&e!==void 0?e:r.defaultProps.intervals,i=t.props.selected||t.props.openToDate||R(),c=_t(i),u=t.props.injectTimes&&t.props.injectTimes.sort(function(w,k){return w.getTime()-k.getTime()}),l=60*Cc(i),d=l/o,f=0;f=f?e.updateFocusOnPaginate(Math.abs(f-(n-p))):(u=(c=e.YEAR_REFS[n-p])===null||c===void 0?void 0:c.current)===null||u===void 0||u.focus())}},e.isSameDay=function(n,s){return O(n,s)},e.isCurrentYear=function(n){return n===P(R())},e.isRangeStart=function(n){return e.props.startDate&&e.props.endDate&&fe(de(R(),n),e.props.startDate)},e.isRangeEnd=function(n){return e.props.startDate&&e.props.endDate&&fe(de(R(),n),e.props.endDate)},e.isInRange=function(n){return wt(n,e.props.startDate,e.props.endDate)},e.isInSelectingRange=function(n){var s=e.props,o=s.selectsStart,i=s.selectsEnd,c=s.selectsRange,u=s.startDate,l=s.endDate;return!(o||i||c)||!e.selectingDate()?!1:o&&l?wt(n,e.selectingDate(),l):i&&u||c&&u&&!l?wt(n,u,e.selectingDate()):!1},e.isSelectingRangeStart=function(n){var s;if(!e.isInSelectingRange(n))return!1;var o=e.props,i=o.startDate,c=o.selectsStart,u=de(R(),n);return c?fe(u,(s=e.selectingDate())!==null&&s!==void 0?s:null):fe(u,i??null)},e.isSelectingRangeEnd=function(n){var s;if(!e.isInSelectingRange(n))return!1;var o=e.props,i=o.endDate,c=o.selectsEnd,u=o.selectsRange,l=de(R(),n);return c||u?fe(l,(s=e.selectingDate())!==null&&s!==void 0?s:null):fe(l,i??null)},e.isKeyboardSelected=function(n){if(!(e.props.date===void 0||e.props.selected==null||e.props.preSelection==null)){var s=e.props,o=s.minDate,i=s.maxDate,c=s.excludeDates,u=s.includeDates,l=s.filterDate,d=st(de(e.props.date,n)),f=(o||i||c||u||l)&&Mt(n,e.props);return!e.props.disabledKeyboardNavigation&&!e.props.inline&&!O(d,st(e.props.selected))&&O(d,st(e.props.preSelection))&&!f}},e.onYearClick=function(n,s){var o=e.props.date;o!==void 0&&e.handleYearClick(st(de(o,s)),n)},e.onYearKeyDown=function(n,s){var o,i,c=n.key,u=e.props,l=u.date,d=u.yearItemNumber,f=u.handleOnKeyDown;if(c!==D.Tab&&n.preventDefault(),!e.props.disabledKeyboardNavigation)switch(c){case D.Enter:if(e.props.selected==null)break;e.onYearClick(n,s),(i=(o=e.props).setPreSelection)===null||i===void 0||i.call(o,e.props.selected);break;case D.ArrowRight:if(e.props.preSelection==null)break;e.handleYearNavigation(s+1,ge(e.props.preSelection,1));break;case D.ArrowLeft:if(e.props.preSelection==null)break;e.handleYearNavigation(s-1,Ue(e.props.preSelection,1));break;case D.ArrowUp:{if(l===void 0||d===void 0||e.props.preSelection==null)break;var p=xe(l,d).startPeriod,h=zn,g=s-h;if(g=p&&sk){var w=d%h;s<=k&&s>k-w?h=w:h+=w,g=s+h}e.handleYearNavigation(g,ge(e.props.preSelection,h));break}}f&&f(n)},e.getYearClassNames=function(n){var s=e.props,o=s.date,i=s.minDate,c=s.maxDate,u=s.selected,l=s.excludeDates,d=s.includeDates,f=s.filterDate,p=s.yearClassName;return Z("react-datepicker__year-text","react-datepicker__year-".concat(n),o?p==null?void 0:p(de(o,n)):void 0,{"react-datepicker__year-text--selected":u?n===P(u):void 0,"react-datepicker__year-text--disabled":(i||c||l||d||f)&&Mt(n,e.props),"react-datepicker__year-text--keyboard-selected":e.isKeyboardSelected(n),"react-datepicker__year-text--range-start":e.isRangeStart(n),"react-datepicker__year-text--range-end":e.isRangeEnd(n),"react-datepicker__year-text--in-range":e.isInRange(n),"react-datepicker__year-text--in-selecting-range":e.isInSelectingRange(n),"react-datepicker__year-text--selecting-range-start":e.isSelectingRangeStart(n),"react-datepicker__year-text--selecting-range-end":e.isSelectingRangeEnd(n),"react-datepicker__year-text--today":e.isCurrentYear(n)})},e.getYearTabIndex=function(n){if(e.props.disabledKeyboardNavigation||e.props.preSelection==null)return"-1";var s=P(e.props.preSelection),o=Mt(n,e.props);return n===s&&!o?"0":"-1"},e.getYearContent=function(n){return e.props.renderYearContent?e.props.renderYearContent(n):n},e}return r.prototype.render=function(){var t=this,e=[],n=this.props,s=n.date,o=n.yearItemNumber,i=n.onYearMouseEnter,c=n.onYearMouseLeave;if(s===void 0)return null;for(var u=xe(s,o),l=u.startPeriod,d=u.endPeriod,f=function(g){e.push(m.createElement("div",{ref:p.YEAR_REFS[g-l],onClick:function(w){t.onYearClick(w,g)},onKeyDown:function(w){Er(w)&&(w.preventDefault(),w.key=D.Enter),t.onYearKeyDown(w,g)},tabIndex:Number(p.getYearTabIndex(g)),className:p.getYearClassNames(g),onMouseEnter:p.props.usePointerEvent?void 0:function(w){return i(w,g)},onPointerEnter:p.props.usePointerEvent?function(w){return i(w,g)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(w){return c(w,g)},onPointerLeave:p.props.usePointerEvent?function(w){return c(w,g)}:void 0,key:g,"aria-current":p.isCurrentYear(g)?"date":void 0},p.getYearContent(g)))},p=this,h=l;h<=d;h++)f(h);return m.createElement("div",{className:"react-datepicker__year"},m.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},e))},r}(v.Component);function Qc(a,r,t,e){for(var n=[],s=0;s<2*r+1;s++){var o=a+r-s,i=!0;t&&(i=P(t)<=o),e&&i&&(i=P(e)>=o),i&&n.push(o)}return n}var Bc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;e.renderOptions=function(){var i=e.props.year,c=e.state.yearsList.map(function(d){return m.createElement("div",{className:i===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:e.onChange.bind(e,d),"aria-selected":i===d?"true":void 0},i===d?m.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),u=e.props.minDate?P(e.props.minDate):null,l=e.props.maxDate?P(e.props.maxDate):null;return(!l||!e.state.yearsList.find(function(d){return d===l}))&&c.unshift(m.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:e.incrementYears},m.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!u||!e.state.yearsList.find(function(d){return d===u}))&&c.push(m.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:e.decrementYears},m.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},e.onChange=function(i){e.props.onChange(i)},e.handleClickOutside=function(){e.props.onCancel()},e.shiftYears=function(i){var c=e.state.yearsList.map(function(u){return u+i});e.setState({yearsList:c})},e.incrementYears=function(){return e.shiftYears(1)},e.decrementYears=function(){return e.shiftYears(-1)};var n=t.yearDropdownItemNumber,s=t.scrollableYearDropdown,o=n||(s?10:5);return e.state={yearsList:Qc(e.props.year,o,e.props.minDate,e.props.maxDate)},e.dropdownRef=v.createRef(),e}return r.prototype.componentDidMount=function(){var t=this.dropdownRef.current;if(t){var e=t.children?Array.from(t.children):null,n=e?e.find(function(s){return s.ariaSelected}):null;t.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-t.clientHeight)/2:(t.scrollHeight-t.clientHeight)/2}},r.prototype.render=function(){var t=Z({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return m.createElement($t,{className:t,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(v.Component),qc=function(a){z(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?P(t.props.minDate):1900,n=t.props.maxDate?P(t.props.maxDate):2100,s=[],o=e;o<=n;o++)s.push(m.createElement("option",{key:o,value:o},o));return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return m.createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return m.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(n){return t.toggleDropdown(n)}},m.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),m.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return m.createElement(Bc,E({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 s;(s=t.onSelect)===null||s===void 0||s.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var s,o;(o=(s=t.props).onSelect)===null||o===void 0||o.call(s,e,n)},t.setOpen=function(){var e,n;(n=(e=t.props).setOpen)===null||n===void 0||n.call(e,!0)},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return m.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(v.Component),Kc=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Vc=function(a){var r=(a.className||"").split(/\s+/);return Kc.some(function(t){return r.indexOf(t)>=0})},Uc=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.monthContainer=void 0,e.handleClickOutside=function(n){e.props.onClickOutside(n)},e.setClickOutsideRef=function(){return e.containerRef.current},e.handleDropdownFocus=function(n){var s,o;Vc(n.target)&&((o=(s=e.props).onDropdownFocus)===null||o===void 0||o.call(s,n))},e.getDateInView=function(){var n=e.props,s=n.preSelection,o=n.selected,i=n.openToDate,c=Tr(e.props),u=Or(e.props),l=R(),d=i||o||s;return d||(c&&Fe(l,c)?c:u&&Pe(l,u)?u:l)},e.increaseMonth=function(){e.setState(function(n){var s=n.date;return{date:ue(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.decreaseMonth=function(){e.setState(function(n){var s=n.date;return{date:Ie(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.handleDayClick=function(n,s,o){e.props.onSelect(n,s,o),e.props.setPreSelection&&e.props.setPreSelection(n)},e.handleDayMouseEnter=function(n){e.setState({selectingDate:n}),e.props.onDayMouseEnter&&e.props.onDayMouseEnter(n)},e.handleMonthMouseLeave=function(){e.setState({selectingDate:void 0}),e.props.onMonthMouseLeave&&e.props.onMonthMouseLeave()},e.handleYearMouseEnter=function(n,s){e.setState({selectingDate:de(R(),s)}),e.props.onYearMouseEnter&&e.props.onYearMouseEnter(n,s)},e.handleYearMouseLeave=function(n,s){e.props.onYearMouseLeave&&e.props.onYearMouseLeave(n,s)},e.handleYearChange=function(n){var s,o,i,c;(o=(s=e.props).onYearChange)===null||o===void 0||o.call(s,n),e.setState({isRenderAriaLiveMessage:!0}),e.props.adjustDateOnChange&&(e.props.onSelect(n),(c=(i=e.props).setOpen)===null||c===void 0||c.call(i,!0)),e.props.setPreSelection&&e.props.setPreSelection(n)},e.getEnabledPreSelectionDateForMonth=function(n){if(!se(n,e.props))return n;for(var s=ve(n),o=hc(n),i=Ts(o,s),c=null,u=0;u<=i;u++){var l=ce(s,u);if(!se(l,e.props)){c=l;break}}return c},e.handleMonthChange=function(n){var s,o,i,c=(s=e.getEnabledPreSelectionDateForMonth(n))!==null&&s!==void 0?s:n;e.handleCustomMonthChange(c),e.props.adjustDateOnChange&&(e.props.onSelect(c),(i=(o=e.props).setOpen)===null||i===void 0||i.call(o,!0)),e.props.setPreSelection&&e.props.setPreSelection(c)},e.handleCustomMonthChange=function(n){var s,o;(o=(s=e.props).onMonthChange)===null||o===void 0||o.call(s,n),e.setState({isRenderAriaLiveMessage:!0})},e.handleMonthYearChange=function(n){e.handleYearChange(n),e.handleMonthChange(n)},e.changeYear=function(n){e.setState(function(s){var o=s.date;return{date:de(o,Number(n))}},function(){return e.handleYearChange(e.state.date)})},e.changeMonth=function(n){e.setState(function(s){var o=s.date;return{date:ae(o,Number(n))}},function(){return e.handleMonthChange(e.state.date)})},e.changeMonthYear=function(n){e.setState(function(s){var o=s.date;return{date:de(ae(o,te(n)),P(n))}},function(){return e.handleMonthYearChange(e.state.date)})},e.header=function(n){n===void 0&&(n=e.state.date);var s=Ce(n,e.props.locale,e.props.calendarStartDay),o=[];return e.props.showWeekNumbers&&o.push(m.createElement("div",{key:"W",className:"react-datepicker__day-name"},e.props.weekLabel||"#")),o.concat([0,1,2,3,4,5,6].map(function(i){var c=ce(s,i),u=e.formatWeekday(c,e.props.locale),l=e.props.weekDayClassName?e.props.weekDayClassName(c):void 0;return m.createElement("div",{key:i,"aria-label":H(c,"EEEE",e.props.locale),className:Z("react-datepicker__day-name",l)},u)}))},e.formatWeekday=function(n,s){return e.props.formatWeekDay?mc(n,e.props.formatWeekDay,s):e.props.useWeekdaysShort?wc(n,s):gc(n,s)},e.decreaseYear=function(){e.setState(function(n){var s,o=n.date;return{date:Ue(o,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.clearSelectingDate=function(){e.setState({selectingDate:void 0})},e.renderPreviousButton=function(){var n,s,o;if(!e.props.renderCustomHeader){var i=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?i-1:0,u=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,l=Ie(e.state.date,u),d;switch(!0){case e.props.showMonthYearPicker:d=Bn(e.state.date,e.props);break;case e.props.showYearPicker:d=kc(e.state.date,e.props);break;case e.props.showQuarterYearPicker:d=vc(e.state.date,e.props);break;default:d=$n(l,e.props);break}if(!(!((o=e.props.forceShowMonthNavigation)!==null&&o!==void 0?o:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&d||e.props.showTimeSelectOnly)){var f=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],p=["react-datepicker__navigation","react-datepicker__navigation--previous"],h=e.decreaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(h=e.decreaseYear),d&&e.props.showDisabledMonthNavigation&&(p.push("react-datepicker__navigation--previous--disabled"),h=void 0);var g=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,w=e.props,k=w.previousMonthButtonLabel,S=k===void 0?r.defaultProps.previousMonthButtonLabel:k,x=w.previousYearButtonLabel,N=x===void 0?r.defaultProps.previousYearButtonLabel:x,q=e.props,$=q.previousMonthAriaLabel,I=$===void 0?typeof S=="string"?S:"Previous Month":$,_=q.previousYearAriaLabel,M=_===void 0?typeof N=="string"?N:"Previous Year":_;return m.createElement("button",{type:"button",className:p.join(" "),onClick:h,onKeyDown:e.props.handleOnKeyDown,"aria-label":g?M:I},m.createElement("span",{className:f.join(" ")},g?N:S))}}},e.increaseYear=function(){e.setState(function(n){var s,o=n.date;return{date:ge(o,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.renderNextButton=function(){var n;if(!e.props.renderCustomHeader){var s;switch(!0){case e.props.showMonthYearPicker:s=qn(e.state.date,e.props);break;case e.props.showYearPicker:s=_c(e.state.date,e.props);break;case e.props.showQuarterYearPicker:s=bc(e.state.date,e.props);break;default:s=Qn(e.state.date,e.props);break}if(!(!((n=e.props.forceShowMonthNavigation)!==null&&n!==void 0?n:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&s||e.props.showTimeSelectOnly)){var o=["react-datepicker__navigation","react-datepicker__navigation--next"],i=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];e.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),e.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var c=e.increaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(c=e.increaseYear),s&&e.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),c=void 0);var u=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,l=e.props,d=l.nextMonthButtonLabel,f=d===void 0?r.defaultProps.nextMonthButtonLabel:d,p=l.nextYearButtonLabel,h=p===void 0?r.defaultProps.nextYearButtonLabel:p,g=e.props,w=g.nextMonthAriaLabel,k=w===void 0?typeof f=="string"?f:"Next Month":w,S=g.nextYearAriaLabel,x=S===void 0?typeof h=="string"?h:"Next Year":S;return m.createElement("button",{type:"button",className:o.join(" "),onClick:c,onKeyDown:e.props.handleOnKeyDown,"aria-label":u?x:k},m.createElement("span",{className:i.join(" ")},u?h:f))}}},e.renderCurrentMonth=function(n){n===void 0&&(n=e.state.date);var s=["react-datepicker__current-month"];return e.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),e.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),e.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),m.createElement("h2",{className:s.join(" ")},H(n,e.props.dateFormat,e.props.locale))},e.renderYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showYearDropdown||n))return m.createElement(qc,E({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeYear,year:P(e.state.date)}))},e.renderMonthDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthDropdown||n))return m.createElement(Fc,E({},r.defaultProps,e.props,{month:te(e.state.date),onChange:e.changeMonth}))},e.renderMonthYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthYearDropdown||n))return m.createElement(Ac,E({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeMonthYear}))},e.handleTodayButtonClick=function(n){e.props.onSelect(Fn(),n),e.props.setPreSelection&&e.props.setPreSelection(Fn())},e.renderTodayButton=function(){if(!(!e.props.todayButton||e.props.showTimeSelectOnly))return m.createElement("div",{className:"react-datepicker__today-button",onClick:e.handleTodayButtonClick},e.props.todayButton)},e.renderDefaultHeader=function(n){var s=n.monthDate,o=n.i;return m.createElement("div",{className:"react-datepicker__header ".concat(e.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},e.renderCurrentMonth(s),m.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(e.props.dropdownMode),onFocus:e.handleDropdownFocus},e.renderMonthDropdown(o!==0),e.renderMonthYearDropdown(o!==0),e.renderYearDropdown(o!==0)),m.createElement("div",{className:"react-datepicker__day-names"},e.header(s)))},e.renderCustomHeader=function(n){var s,o,i=n.monthDate,c=n.i;if(e.props.showTimeSelect&&!e.state.monthContainer||e.props.showTimeSelectOnly)return null;var u=$n(e.state.date,e.props),l=Qn(e.state.date,e.props),d=Bn(e.state.date,e.props),f=qn(e.state.date,e.props),p=!e.props.showMonthYearPicker&&!e.props.showQuarterYearPicker&&!e.props.showYearPicker;return m.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:e.props.onDropdownFocus},(o=(s=e.props).renderCustomHeader)===null||o===void 0?void 0:o.call(s,E(E({},e.state),{customHeaderCount:c,monthDate:i,changeMonth:e.changeMonth,changeYear:e.changeYear,decreaseMonth:e.decreaseMonth,increaseMonth:e.increaseMonth,decreaseYear:e.decreaseYear,increaseYear:e.increaseYear,prevMonthButtonDisabled:u,nextMonthButtonDisabled:l,prevYearButtonDisabled:d,nextYearButtonDisabled:f})),p&&m.createElement("div",{className:"react-datepicker__day-names"},e.header(i)))},e.renderYearHeader=function(n){var s=n.monthDate,o=e.props,i=o.showYearPicker,c=o.yearItemNumber,u=c===void 0?r.defaultProps.yearItemNumber:c,l=xe(s,u),d=l.startPeriod,f=l.endPeriod;return m.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},i?"".concat(d," - ").concat(f):P(s))},e.renderHeader=function(n){var s=n.monthDate,o=n.i,i=o===void 0?0:o,c={monthDate:s,i};switch(!0){case e.props.renderCustomHeader!==void 0:return e.renderCustomHeader(c);case(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker):return e.renderYearHeader(c);default:return e.renderDefaultHeader(c)}},e.renderMonths=function(){var n,s;if(!(e.props.showTimeSelectOnly||e.props.showYearPicker)){for(var o=[],i=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?i-1:0,u=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?ge(e.state.date,c):Ie(e.state.date,c),l=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,d=0;d0;o.push(m.createElement("div",{key:h,ref:function(k){e.monthContainer=k??void 0},className:"react-datepicker__month-container"},e.renderHeader({monthDate:p,i:d}),m.createElement(Ic,E({},r.defaultProps,e.props,{ariaLabelPrefix:e.props.monthAriaLabelPrefix,day:p,onDayClick:e.handleDayClick,handleOnKeyDown:e.props.handleOnDayKeyDown,handleOnMonthKeyDown:e.props.handleOnKeyDown,onDayMouseEnter:e.handleDayMouseEnter,onMouseLeave:e.handleMonthMouseLeave,orderInDisplay:d,selectingDate:e.state.selectingDate,monthShowsDuplicateDaysEnd:g,monthShowsDuplicateDaysStart:w}))))}return o}},e.renderYears=function(){if(!e.props.showTimeSelectOnly&&e.props.showYearPicker)return m.createElement("div",{className:"react-datepicker__year--container"},e.renderHeader({monthDate:e.state.date}),m.createElement($c,E({},r.defaultProps,e.props,{selectingDate:e.state.selectingDate,date:e.state.date,onDayClick:e.handleDayClick,clearSelectingDate:e.clearSelectingDate,onYearMouseEnter:e.handleYearMouseEnter,onYearMouseLeave:e.handleYearMouseLeave})))},e.renderTimeSection=function(){if(e.props.showTimeSelect&&(e.state.monthContainer||e.props.showTimeSelectOnly))return m.createElement(Hc,E({},r.defaultProps,e.props,{onChange:e.props.onTimeChange,format:e.props.timeFormat,intervals:e.props.timeIntervals,monthRef:e.state.monthContainer}))},e.renderInputTimeSection=function(){var n=e.props.selected?new Date(e.props.selected):void 0,s=n&&Qt(n)&&!!e.props.selected,o=s?"".concat(Vn(n.getHours()),":").concat(Vn(n.getMinutes())):"";if(e.props.showTimeInput)return m.createElement(Tc,E({},r.defaultProps,e.props,{date:n,timeString:o,onChange:e.props.onTimeChange}))},e.renderAriaLiveRegion=function(){var n,s=xe(e.state.date,(n=e.props.yearItemNumber)!==null&&n!==void 0?n:r.defaultProps.yearItemNumber),o=s.startPeriod,i=s.endPeriod,c;return e.props.showYearPicker?c="".concat(o," - ").concat(i):e.props.showMonthYearPicker||e.props.showQuarterYearPicker?c=P(e.state.date):c="".concat(fn(te(e.state.date),e.props.locale)," ").concat(P(e.state.date)),m.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e.state.isRenderAriaLiveMessage&&c)},e.renderChildren=function(){if(e.props.children)return m.createElement("div",{className:"react-datepicker__children-container"},e.props.children)},e.containerRef=v.createRef(),e.state={date:e.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},e}return Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:lt}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){var t=this;this.props.showTimeSelect&&(this.assignMonthContainer=function(){t.setState({monthContainer:t.monthContainer})}())},r.prototype.componentDidUpdate=function(t){var e=this;if(this.props.preSelection&&(!O(this.props.preSelection,t.preSelection)||this.props.monthSelectedIn!==t.monthSelectedIn)){var n=!ee(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&e.handleCustomMonthChange(e.state.date)})}else this.props.openToDate&&!O(this.props.openToDate,t.openToDate)&&this.setState({date:this.props.openToDate})},r.prototype.render=function(){var t=this.props.container||ic;return m.createElement($t,{onClickOutside:this.handleClickOutside,style:{display:"contents"},containerRef:this.containerRef,ignoreClass:this.props.outsideClickIgnoreClass},m.createElement(t,{className:Z("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren()))},r}(v.Component),jc=function(a){var r=a.icon,t=a.className,e=t===void 0?"":t,n=a.onClick,s="react-datepicker__calendar-icon";if(typeof r=="string")return m.createElement("i",{className:"".concat(s," ").concat(r," ").concat(e),"aria-hidden":"true",onClick:n});if(m.isValidElement(r)){var o=r;return m.cloneElement(o,{className:"".concat(o.props.className||""," ").concat(s," ").concat(e),onClick:function(i){typeof o.props.onClick=="function"&&o.props.onClick(i),typeof n=="function"&&n(i)}})}return m.createElement("svg",{className:"".concat(s," ").concat(e),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:n},m.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"}))},Nr=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.portalRoot=null,e.el=document.createElement("div"),e}return r.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)},r.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},r.prototype.render=function(){return Lr.createPortal(this.props.children,this.el)},r}(v.Component),Xc="[tabindex], a, button, input, select, textarea",Gc=function(a){return(a instanceof HTMLAnchorElement||!a.disabled)&&a.tabIndex!==-1},Yr=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.getTabChildren=function(){var n;return Array.prototype.slice.call((n=e.tabLoopRef.current)===null||n===void 0?void 0:n.querySelectorAll(Xc),1,-1).filter(Gc)},e.handleFocusStart=function(){var n=e.getTabChildren();n&&n.length>1&&n[n.length-1].focus()},e.handleFocusEnd=function(){var n=e.getTabChildren();n&&n.length>1&&n[0].focus()},e.tabLoopRef=v.createRef(),e}return r.prototype.render=function(){var t;return((t=this.props.enableTabLoop)!==null&&t!==void 0?t:r.defaultProps.enableTabLoop)?m.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},m.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,m.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(v.Component);function zc(a){var r=function(t){var e,n=typeof t.hidePopper=="boolean"?t.hidePopper:!0,s=v.useRef(null),o=oc(E({open:!n,whileElementsMounted:Hr,placement:t.popperPlacement,middleware:me([$r({padding:15}),Qr(10),Br({element:s})],(e=t.popperModifiers)!==null&&e!==void 0?e:[],!0)},t.popperProps)),i=E(E({},t),{hidePopper:n,popperProps:E(E({},o),{arrowRef:s})});return m.createElement(a,E({},i))};return r}var Zc=function(a){z(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),r.prototype.render=function(){var t=this.props,e=t.className,n=t.wrapperClassName,s=t.hidePopper,o=s===void 0?r.defaultProps.hidePopper:s,i=t.popperComponent,c=t.targetComponent,u=t.enableTabLoop,l=t.popperOnKeyDown,d=t.portalId,f=t.portalHost,p=t.popperProps,h=t.showArrow,g=void 0;if(!o){var w=Z("react-datepicker-popper",e);g=m.createElement(Yr,{enableTabLoop:u},m.createElement("div",{ref:p.refs.setFloating,style:p.floatingStyles,className:w,"data-placement":p.placement,onKeyDown:l},i,h&&m.createElement(Ji,{ref:p.arrowRef,context:p.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(g=v.createElement(this.props.popperContainer,{},g)),d&&!o&&(g=m.createElement(Nr,{portalId:d,portalHost:f},g));var k=Z("react-datepicker-wrapper",n);return m.createElement(m.Fragment,null,m.createElement("div",{ref:p.refs.setReference,className:k},c),g)},r}(v.Component),Jc=zc(Zc),Zn="react-datepicker-ignore-onclickoutside";function eu(a,r){return a&&r?te(a)!==te(r)||P(a)!==P(r):a!==r}var Gt="Date input not valid.",hu=function(a){z(r,a);function r(t){var e=a.call(this,t)||this;return e.calendar=null,e.input=null,e.getPreSelection=function(){return e.props.openToDate?e.props.openToDate:e.props.selectsEnd&&e.props.startDate?e.props.startDate:e.props.selectsStart&&e.props.endDate?e.props.endDate:R()},e.modifyHolidays=function(){var n;return(n=e.props.holidays)===null||n===void 0?void 0:n.reduce(function(s,o){var i=new Date(o.date);return Qt(i)?me(me([],s,!0),[E(E({},o),{date:i})],!1):s},[])},e.calcInitialState=function(){var n,s=e.getPreSelection(),o=Tr(e.props),i=Or(e.props),c=o&&Fe(s,_t(o))?o:i&&Pe(s,Ln(i))?i:s;return{open:e.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(n=e.props.selectsRange?e.props.startDate:e.props.selected)!==null&&n!==void 0?n:c,highlightDates:Kn(e.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},e.resetHiddenStatus=function(){e.setState(E(E({},e.state),{wasHidden:!1}))},e.setHiddenStatus=function(){e.setState(E(E({},e.state),{wasHidden:!0}))},e.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&e.setHiddenStatus()},e.clearPreventFocusTimeout=function(){e.preventFocusTimeout&&clearTimeout(e.preventFocusTimeout)},e.safeFocus=function(){setTimeout(function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.focus)===null||s===void 0||s.call(n,{preventScroll:!0})},0)},e.safeBlur=function(){setTimeout(function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.blur)===null||s===void 0||s.call(n)},0)},e.setFocus=function(){e.safeFocus()},e.setBlur=function(){e.safeBlur(),e.cancelFocusInput()},e.setOpen=function(n,s){s===void 0&&(s=!1),e.setState({open:n,preSelection:n&&e.state.open?e.state.preSelection:e.calcInitialState().preSelection,lastPreSelectChange:zt},function(){n||e.setState(function(o){return{focused:s?o.focused:!1}},function(){!s&&e.setBlur(),e.setState({inputValue:null})})})},e.inputOk=function(){return we(e.state.preSelection)},e.isCalendarOpen=function(){return e.props.open===void 0?e.state.open&&!e.props.disabled&&!e.props.readOnly:e.props.open},e.handleFocus=function(n){var s,o,i=e.state.wasHidden,c=i?e.state.open:!0;i&&e.resetHiddenStatus(),e.state.preventFocus||((o=(s=e.props).onFocus)===null||o===void 0||o.call(s,n),c&&!e.props.preventOpenOnFocus&&!e.props.readOnly&&e.setOpen(!0)),e.setState({focused:!0})},e.sendFocusBackToInput=function(){e.preventFocusTimeout&&e.clearPreventFocusTimeout(),e.setState({preventFocus:!0},function(){e.preventFocusTimeout=setTimeout(function(){e.setFocus(),e.setState({preventFocus:!1})})})},e.cancelFocusInput=function(){clearTimeout(e.inputFocusTimeout),e.inputFocusTimeout=void 0},e.deferFocusInput=function(){e.cancelFocusInput(),e.inputFocusTimeout=setTimeout(function(){return e.setFocus()},1)},e.handleDropdownFocus=function(){e.cancelFocusInput()},e.handleBlur=function(n){var s,o;(!e.state.open||e.props.withPortal||e.props.showTimeInput)&&((o=(s=e.props).onBlur)===null||o===void 0||o.call(s,n)),e.state.open&&e.props.open===!1&&e.setOpen(!1),e.setState({focused:!1})},e.handleCalendarClickOutside=function(n){var s,o;e.props.inline||e.setOpen(!1),(o=(s=e.props).onClickOutside)===null||o===void 0||o.call(s,n),e.props.withPortal&&n.preventDefault()},e.handleChange=function(){for(var n,s,o,i,c,u=[],l=0;l=Q){ie=A;break}f&&iep&&(ne=D.ArrowLeft,ie=se(p,e.props)?_(ne,ie):p),se(ie,e.props)?((ne===D.PageUp||ne===D.Home)&&(ne=D.ArrowRight),(ne===D.PageDown||ne===D.End)&&(ne=D.ArrowLeft),ie=_(ne,ie)):Xe=!0,hn++}return ie};if(q===D.Enter){n.preventDefault(),e.handleSelect(I,n),!w&&e.setPreSelection(I);return}else if(q===D.Escape){n.preventDefault(),e.setOpen(!1),e.inputOk()||(c=(i=e.props).onInputError)===null||c===void 0||c.call(i,{code:1,msg:Gt});return}var F=null;switch(q){case D.ArrowLeft:case D.ArrowRight:case D.ArrowUp:case D.ArrowDown:case D.PageUp:case D.PageDown:case D.Home:case D.End:F=M(q,I);break}if(!F){(l=(u=e.props).onInputError)===null||l===void 0||l.call(u,{code:1,msg:Gt});return}if(n.preventDefault(),e.setState({lastPreSelectChange:zt}),x&&e.setSelected(F),e.setPreSelection(F),N){var X=te(I),K=te(F),J=P(I),le=P(F);X!==K||J!==le?e.setState({shouldFocusDayInline:!0}):e.setState({shouldFocusDayInline:!1})}}},e.onPopperKeyDown=function(n){var s=n.key;s===D.Escape&&(n.preventDefault(),e.sendFocusBackToInput())},e.onClearClick=function(n){n&&n.preventDefault&&n.preventDefault(),e.sendFocusBackToInput();var s=e.props,o=s.selectsRange,i=s.onChange;o?i==null||i([null,null],n):i==null||i(null,n),e.setState({inputValue:null})},e.clear=function(){e.onClearClick()},e.onScroll=function(n){typeof e.props.closeOnScroll=="boolean"&&e.props.closeOnScroll?(n.target===document||n.target===document.documentElement||n.target===document.body)&&e.setOpen(!1):typeof e.props.closeOnScroll=="function"&&e.props.closeOnScroll(n)&&e.setOpen(!1)},e.renderCalendar=function(){var n,s;return!e.props.inline&&!e.isCalendarOpen()?null:m.createElement(Uc,E({showMonthYearDropdown:void 0,ref:function(o){e.calendar=o}},e.props,e.state,{setOpen:e.setOpen,dateFormat:(n=e.props.dateFormatCalendar)!==null&&n!==void 0?n:r.defaultProps.dateFormatCalendar,onSelect:e.handleSelect,onClickOutside:e.handleCalendarClickOutside,holidays:xc(e.modifyHolidays()),outsideClickIgnoreClass:Zn,onDropdownFocus:e.handleDropdownFocus,onTimeChange:e.handleTimeChange,className:e.props.calendarClassName,container:e.props.calendarContainer,handleOnKeyDown:e.props.onKeyDown,handleOnDayKeyDown:e.onDayKeyDown,setPreSelection:e.setPreSelection,dropdownMode:(s=e.props.dropdownMode)!==null&&s!==void 0?s:r.defaultProps.dropdownMode}),e.props.children)},e.renderAriaLiveRegion=function(){var n=e.props,s=n.dateFormat,o=s===void 0?r.defaultProps.dateFormat:s,i=n.locale,c=e.props.showTimeInput||e.props.showTimeSelect,u=c?"PPPPp":"PPPP",l;return e.props.selectsRange?l="Selected start date: ".concat(re(e.props.startDate,{dateFormat:u,locale:i}),". ").concat(e.props.endDate?"End date: "+re(e.props.endDate,{dateFormat:u,locale:i}):""):e.props.showTimeSelectOnly?l="Selected time: ".concat(re(e.props.selected,{dateFormat:o,locale:i})):e.props.showYearPicker?l="Selected year: ".concat(re(e.props.selected,{dateFormat:"yyyy",locale:i})):e.props.showMonthYearPicker?l="Selected month: ".concat(re(e.props.selected,{dateFormat:"MMMM yyyy",locale:i})):e.props.showQuarterYearPicker?l="Selected quarter: ".concat(re(e.props.selected,{dateFormat:"yyyy, QQQ",locale:i})):l="Selected date: ".concat(re(e.props.selected,{dateFormat:u,locale:i})),m.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},l)},e.renderDateInput=function(){var n,s,o,i=Z(e.props.className,(n={},n[Zn]=e.state.open,n)),c=e.props.customInput||m.createElement("input",{type:"text"}),u=e.props.customInputRef||"ref",l=e.props,d=l.dateFormat,f=d===void 0?r.defaultProps.dateFormat:d,p=l.locale,h=typeof e.props.value=="string"?e.props.value:typeof e.state.inputValue=="string"?e.state.inputValue:e.props.selectsRange?uc(e.props.startDate,e.props.endDate,{dateFormat:f,locale:p}):e.props.selectsMultiple?lc((o=e.props.selectedDates)!==null&&o!==void 0?o:[],{dateFormat:f,locale:p}):re(e.props.selected,{dateFormat:f,locale:p});return v.cloneElement(c,(s={},s[u]=function(g){e.input=g},s.value=h,s.onBlur=e.handleBlur,s.onChange=e.handleChange,s.onClick=e.onInputClick,s.onFocus=e.handleFocus,s.onKeyDown=e.onInputKeyDown,s.id=e.props.id,s.name=e.props.name,s.form=e.props.form,s.autoFocus=e.props.autoFocus,s.placeholder=e.props.placeholderText,s.disabled=e.props.disabled,s.autoComplete=e.props.autoComplete,s.className=Z(c.props.className,i),s.title=e.props.title,s.readOnly=e.props.readOnly,s.required=e.props.required,s.tabIndex=e.props.tabIndex,s["aria-describedby"]=e.props.ariaDescribedBy,s["aria-invalid"]=e.props.ariaInvalid,s["aria-labelledby"]=e.props.ariaLabelledBy,s["aria-required"]=e.props.ariaRequired,s))},e.renderClearButton=function(){var n=e.props,s=n.isClearable,o=n.disabled,i=n.selected,c=n.startDate,u=n.endDate,l=n.clearButtonTitle,d=n.clearButtonClassName,f=d===void 0?"":d,p=n.ariaLabelClose,h=p===void 0?"Close":p,g=n.selectedDates;return s&&(i!=null||c!=null||u!=null||g!=null&&g.length)?m.createElement("button",{type:"button",className:Z("react-datepicker__close-icon",f,{"react-datepicker__close-icon--disabled":o}),disabled:o,"aria-label":h,onClick:e.onClearClick,title:l,tabIndex:-1}):null},e.state=e.calcInitialState(),e.preventFocusTimeout=void 0,e}return Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,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:lt,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(t,e){var n,s,o,i;t.inline&&eu(t.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&t.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),t.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:Kn(this.props.highlightDates)}),!e.focused&&!Ee(t.selected,this.props.selected)&&this.setState({inputValue:null}),e.open!==this.state.open&&(e.open===!1&&this.state.open===!0&&((s=(n=this.props).onCalendarOpen)===null||s===void 0||s.call(n)),e.open===!0&&this.state.open===!1&&((i=(o=this.props).onCalendarClose)===null||i===void 0||i.call(o)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var t=this.props,e=t.showIcon,n=t.icon,s=t.calendarIconClassname,o=t.calendarIconClassName,i=t.toggleCalendarOnIconClick,c=this.state.open;return s&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),m.createElement("div",{className:"react-datepicker__input-container".concat(e?" react-datepicker__view-calendar-icon":"")},e&&m.createElement(jc,E({icon:n,className:Z(o,!o&&s,c&&"react-datepicker-ignore-onclickoutside")},i?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var t=this.renderCalendar();if(this.props.inline)return t;if(this.props.withPortal){var e=this.state.open?m.createElement(Yr,{enableTabLoop:this.props.enableTabLoop},m.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},t)):null;return this.state.open&&this.props.portalId&&(e=m.createElement(Nr,E({portalId:this.props.portalId},this.props),e)),m.createElement("div",null,this.renderInputContainer(),e)}return m.createElement(Jc,E({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:t,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(v.Component),tu="input",zt="navigate";export{hu as D,lu as a,iu as b,ou as c,as as d,du as e,cu as f,uu as g,fu as h,Gr as i,pu as p}; diff --git a/pkg/ui/frontend/dist/assets/date-utils-D5i7Ep19.js b/pkg/ui/frontend/dist/assets/date-utils-D5i7Ep19.js new file mode 100644 index 0000000000..fd0cc7536e --- /dev/null +++ b/pkg/ui/frontend/dist/assets/date-utils-D5i7Ep19.js @@ -0,0 +1,5 @@ +var ar=Object.defineProperty;var sr=(a,r,t)=>r in a?ar(a,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[r]=t;var v=(a,r,t)=>sr(a,typeof r!="symbol"?r+"":r,t);import{c as G}from"./ui-utils-CrpwsBu-.js";import{r as b,b as ir,R as h,c as or}from"./react-router-BDU20MeH.js";import{s as cr,j as qe,t as ur,v as st,w as lr,x as dr,y as fr,z as pr}from"./radix-core-BQsrZC3d.js";const Tn=6048e5,hr=864e5,Ne=6e4,tt=36e5,mr=1e3,zt=525600,Fe=43200,Dt=1440,Zt=Symbol.for("constructDateFrom");function N(a,r){return typeof a=="function"?a(r):a&&typeof a=="object"&&Zt in a?a[Zt](r):a instanceof Date?new a.constructor(r):new Date(r)}function y(a,r){return N(r||a,a)}function se(a,r,t){const e=y(a,t==null?void 0:t.in);return isNaN(r)?N((t==null?void 0:t.in)||a,NaN):(r&&e.setDate(e.getDate()+r),e)}function ie(a,r,t){const e=y(a,t==null?void 0:t.in);if(isNaN(r))return N(a,NaN);if(!r)return e;const n=e.getDate(),s=N(a,e.getTime());s.setMonth(e.getMonth()+r+1,0);const i=s.getDate();return n>=i?s:(e.setFullYear(s.getFullYear(),s.getMonth(),n),e)}function Ve(a,r,t){const{years:e=0,months:n=0,weeks:s=0,days:i=0,hours:o=0,minutes:c=0,seconds:l=0}=r,u=y(a,t==null?void 0:t.in),d=n||e?ie(u,n+e*12):u,f=i||s?se(d,i+s*7):d,p=c+o*60,g=(l+p*60)*1e3;return N(a,+f+g)}function On(a,r,t){return N(a,+y(a)+r)}function gr(a,r,t){return On(a,r*tt)}let Dr={};function he(){return Dr}function ye(a,r){var o,c,l,u;const t=he(),e=(r==null?void 0:r.weekStartsOn)??((c=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((u=(l=t.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,n=y(a,r==null?void 0:r.in),s=n.getDay(),i=(s=s.getTime()?e+1:t.getTime()>=o.getTime()?e:e-1}function Ce(a){const r=y(a),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+a-+t}function ee(a,...r){const t=N.bind(null,a||r.find(e=>typeof e=="object"));return r.map(t)}function Ye(a,r){const t=y(a,r==null?void 0:r.in);return t.setHours(0,0,0,0),t}function He(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r),s=Ye(e),i=Ye(n),o=+s-Ce(s),c=+i-Ce(i);return Math.round((o-c)/hr)}function wr(a,r){const t=Nn(a,r),e=N(a,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Ae(e)}function Rt(a,r,t){const e=y(a,t==null?void 0:t.in);return e.setTime(e.getTime()+r*Ne),e}function Ht(a,r,t){return ie(a,r*3,t)}function vr(a,r,t){return On(a,r*1e3)}function wt(a,r,t){return se(a,r*7,t)}function me(a,r,t){return ie(a,r*12,t)}function Jt(a,r){let t,e=r==null?void 0:r.in;return a.forEach(n=>{!e&&typeof n=="object"&&(e=N.bind(null,n));const s=y(n,e);(!t||t{!e&&typeof n=="object"&&(e=N.bind(null,n));const s=y(n,e);(!t||t>s||isNaN(+s))&&(t=s)}),N(e,t||NaN)}function Ee(a,r){const t=+y(a)-+y(r);return t<0?-1:t>0?1:t}function Yn(a){return N(a,Date.now())}function yr(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r);return+Ye(e)==+Ye(n)}function ge(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function vt(a){return!(!ge(a)&&typeof a!="number"||isNaN(+y(a)))}function Ze(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),i=e.getMonth()-n.getMonth();return s*12+i}function Te(a,r){const t=y(a,r==null?void 0:r.in);return Math.trunc(t.getMonth()/3)+1}function yt(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r),s=e.getFullYear()-n.getFullYear(),i=Te(e)-Te(n);return s*4+i}function Je(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r);return e.getFullYear()-n.getFullYear()}function In(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r),s=tn(e,n),i=Math.abs(He(e,n));e.setDate(e.getDate()-s*i);const o=+(tn(e,n)===-s),c=s*(i-o);return c===0?0:c}function tn(a,r){const t=a.getFullYear()-r.getFullYear()||a.getMonth()-r.getMonth()||a.getDate()-r.getDate()||a.getHours()-r.getHours()||a.getMinutes()-r.getMinutes()||a.getSeconds()-r.getSeconds()||a.getMilliseconds()-r.getMilliseconds();return t<0?-1:t>0?1:t}function Mt(a){return r=>{const e=(a?Math[a]:Math.trunc)(r);return e===0?0:e}}function br(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r),s=(+e-+n)/tt;return Mt(t==null?void 0:t.roundingMethod)(s)}function Rn(a,r){return+y(a)-+y(r)}function kr(a,r,t){const e=Rn(a,r)/Ne;return Mt(t==null?void 0:t.roundingMethod)(e)}function Qt(a,r){const t=y(a,r==null?void 0:r.in);return t.setHours(23,59,59,999),t}function Bt(a,r){const t=y(a,r==null?void 0:r.in),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function _r(a,r){const t=y(a,r==null?void 0:r.in);return+Qt(t,r)==+Bt(t,r)}function Ln(a,r,t){const[e,n,s]=ee(t==null?void 0:t.in,a,a,r),i=Ee(n,s),o=Math.abs(Ze(n,s));if(o<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);let c=Ee(n,s)===-i;_r(e)&&o===1&&Ee(e,s)===1&&(c=!1);const l=i*(o-+c);return l===0?0:l}function Fn(a,r,t){const e=Rn(a,r)/1e3;return Mt(t==null?void 0:t.roundingMethod)(e)}function Mr(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r),s=Ee(e,n),i=Math.abs(Je(e,n));e.setFullYear(1584),n.setFullYear(1584);const o=Ee(e,n)===-s,c=s*(i-+o);return c===0?0:c}function Cr(a,r){const[t,e]=ee(a,r.start,r.end);return{start:t,end:e}}function Lt(a,r){const t=y(a,r==null?void 0:r.in),e=t.getMonth(),n=e-e%3;return t.setMonth(n,1),t.setHours(0,0,0,0),t}function Wn(a,r){const t=y(a,r==null?void 0:r.in);return t.setDate(1),t.setHours(0,0,0,0),t}function An(a,r){const t=y(a,r==null?void 0:r.in),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Ct(a,r){const t=y(a,r==null?void 0:r.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function xr(a,r){var o,c;const t=he(),e=t.weekStartsOn??((c=(o=t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??0,n=y(a,r==null?void 0:r.in),s=n.getDay(),i=(s{let e;const n=Sr[a];return typeof n=="string"?e=n:r===1?e=n.one:e=n.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Pt(a){return(r={})=>{const t=r.width?String(r.width):a.defaultWidth;return a.formats[t]||a.formats[a.defaultWidth]}}const Er={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Tr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Or={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nr={date:Pt({formats:Er,defaultWidth:"full"}),time:Pt({formats:Tr,defaultWidth:"full"}),dateTime:Pt({formats:Or,defaultWidth:"full"})},Yr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ir=(a,r,t,e)=>Yr[a];function Ue(a){return(r,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let n;if(e==="formatting"&&a.formattingValues){const i=a.defaultFormattingWidth||a.defaultWidth,o=t!=null&&t.width?String(t.width):i;n=a.formattingValues[o]||a.formattingValues[i]}else{const i=a.defaultWidth,o=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[o]||a.values[i]}const s=a.argumentCallback?a.argumentCallback(r):r;return n[s]}}const Rr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fr={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"]},Wr={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"]},Ar={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"}},Hr={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"}},Qr=(a,r)=>{const t=Number(a),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Br={ordinalNumber:Qr,era:Ue({values:Rr,defaultWidth:"wide"}),quarter:Ue({values:Lr,defaultWidth:"wide",argumentCallback:a=>a-1}),month:Ue({values:Fr,defaultWidth:"wide"}),day:Ue({values:Wr,defaultWidth:"wide"}),dayPeriod:Ue({values:Ar,defaultWidth:"wide",formattingValues:Hr,defaultFormattingWidth:"wide"})};function je(a){return(r,t={})=>{const e=t.width,n=e&&a.matchPatterns[e]||a.matchPatterns[a.defaultMatchWidth],s=r.match(n);if(!s)return null;const i=s[0],o=e&&a.parsePatterns[e]||a.parsePatterns[a.defaultParseWidth],c=Array.isArray(o)?qr(o,d=>d.test(i)):Kr(o,d=>d.test(i));let l;l=a.valueCallback?a.valueCallback(c):c,l=t.valueCallback?t.valueCallback(l):l;const u=r.slice(i.length);return{value:l,rest:u}}}function Kr(a,r){for(const t in a)if(Object.prototype.hasOwnProperty.call(a,t)&&r(a[t]))return t}function qr(a,r){for(let t=0;t{const e=r.match(a.matchPattern);if(!e)return null;const n=e[0],s=r.match(a.parsePattern);if(!s)return null;let i=a.valueCallback?a.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const o=r.slice(n.length);return{value:i,rest:o}}}const Ur=/^(\d+)(th|st|nd|rd)?/i,jr=/\d+/i,Xr={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},$r={any:[/^b/i,/^(a|c)/i]},Gr={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zr={any:[/1/i,/2/i,/3/i,/4/i]},Zr={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},Jr={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]},ea={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},ta={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]},na={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},ra={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}},aa={ordinalNumber:Vr({matchPattern:Ur,parsePattern:jr,valueCallback:a=>parseInt(a,10)}),era:je({matchPatterns:Xr,defaultMatchWidth:"wide",parsePatterns:$r,defaultParseWidth:"any"}),quarter:je({matchPatterns:Gr,defaultMatchWidth:"wide",parsePatterns:zr,defaultParseWidth:"any",valueCallback:a=>a+1}),month:je({matchPatterns:Zr,defaultMatchWidth:"wide",parsePatterns:Jr,defaultParseWidth:"any"}),day:je({matchPatterns:ea,defaultMatchWidth:"wide",parsePatterns:ta,defaultParseWidth:"any"}),dayPeriod:je({matchPatterns:na,defaultMatchWidth:"any",parsePatterns:ra,defaultParseWidth:"any"})},nt={code:"en-US",formatDistance:Pr,formatLong:Nr,formatRelative:Ir,localize:Br,match:aa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sa(a,r){const t=y(a,r==null?void 0:r.in);return He(t,Ct(t))+1}function Kt(a,r){const t=y(a,r==null?void 0:r.in),e=+Ae(t)-+wr(t);return Math.round(e/Tn)+1}function qt(a,r){var u,d,f,p;const t=y(a,r==null?void 0:r.in),e=t.getFullYear(),n=he(),s=(r==null?void 0:r.firstWeekContainsDate)??((d=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=N((r==null?void 0:r.in)||a,0);i.setFullYear(e+1,0,s),i.setHours(0,0,0,0);const o=ye(i,r),c=N((r==null?void 0:r.in)||a,0);c.setFullYear(e,0,s),c.setHours(0,0,0,0);const l=ye(c,r);return+t>=+o?e+1:+t>=+l?e:e-1}function ia(a,r){var o,c,l,u;const t=he(),e=(r==null?void 0:r.firstWeekContainsDate)??((c=(o=r==null?void 0:r.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(l=t.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,n=qt(a,r),s=N((r==null?void 0:r.in)||a,0);return s.setFullYear(n,0,e),s.setHours(0,0,0,0),ye(s,r)}function Hn(a,r){const t=y(a,r==null?void 0:r.in),e=+ye(t,r)-+ia(t,r);return Math.round(e/Tn)+1}function P(a,r){const t=a<0?"-":"",e=Math.abs(a).toString().padStart(r,"0");return t+e}const be={y(a,r){const t=a.getFullYear(),e=t>0?t:1-t;return P(r==="yy"?e%100:e,r.length)},M(a,r){const t=a.getMonth();return r==="M"?String(t+1):P(t+1,2)},d(a,r){return P(a.getDate(),r.length)},a(a,r){const t=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(a,r){return P(a.getHours()%12||12,r.length)},H(a,r){return P(a.getHours(),r.length)},m(a,r){return P(a.getMinutes(),r.length)},s(a,r){return P(a.getSeconds(),r.length)},S(a,r){const t=r.length,e=a.getMilliseconds(),n=Math.trunc(e*Math.pow(10,t-3));return P(n,r.length)}},Re={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nn={G:function(a,r,t){const e=a.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(a,r,t){if(r==="yo"){const e=a.getFullYear(),n=e>0?e:1-e;return t.ordinalNumber(n,{unit:"year"})}return be.y(a,r)},Y:function(a,r,t,e){const n=qt(a,e),s=n>0?n:1-n;if(r==="YY"){const i=s%100;return P(i,2)}return r==="Yo"?t.ordinalNumber(s,{unit:"year"}):P(s,r.length)},R:function(a,r){const t=Nn(a);return P(t,r.length)},u:function(a,r){const t=a.getFullYear();return P(t,r.length)},Q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"Q":return String(e);case"QQ":return P(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(a,r,t){const e=Math.ceil((a.getMonth()+1)/3);switch(r){case"q":return String(e);case"qq":return P(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(a,r,t){const e=a.getMonth();switch(r){case"M":case"MM":return be.M(a,r);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(a,r,t){const e=a.getMonth();switch(r){case"L":return String(e+1);case"LL":return P(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(a,r,t,e){const n=Hn(a,e);return r==="wo"?t.ordinalNumber(n,{unit:"week"}):P(n,r.length)},I:function(a,r,t){const e=Kt(a);return r==="Io"?t.ordinalNumber(e,{unit:"week"}):P(e,r.length)},d:function(a,r,t){return r==="do"?t.ordinalNumber(a.getDate(),{unit:"date"}):be.d(a,r)},D:function(a,r,t){const e=sa(a);return r==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):P(e,r.length)},E:function(a,r,t){const e=a.getDay();switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"e":return String(s);case"ee":return P(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(a,r,t,e){const n=a.getDay(),s=(n-e.weekStartsOn+8)%7||7;switch(r){case"c":return String(s);case"cc":return P(s,r.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(a,r,t){const e=a.getDay(),n=e===0?7:e;switch(r){case"i":return String(n);case"ii":return P(n,r.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(a,r,t){const n=a.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(a,r,t){const e=a.getHours();let n;switch(e===12?n=Re.noon:e===0?n=Re.midnight:n=e/12>=1?"pm":"am",r){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(a,r,t){const e=a.getHours();let n;switch(e>=17?n=Re.evening:e>=12?n=Re.afternoon:e>=4?n=Re.morning:n=Re.night,r){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(a,r,t){if(r==="ho"){let e=a.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return be.h(a,r)},H:function(a,r,t){return r==="Ho"?t.ordinalNumber(a.getHours(),{unit:"hour"}):be.H(a,r)},K:function(a,r,t){const e=a.getHours()%12;return r==="Ko"?t.ordinalNumber(e,{unit:"hour"}):P(e,r.length)},k:function(a,r,t){let e=a.getHours();return e===0&&(e=24),r==="ko"?t.ordinalNumber(e,{unit:"hour"}):P(e,r.length)},m:function(a,r,t){return r==="mo"?t.ordinalNumber(a.getMinutes(),{unit:"minute"}):be.m(a,r)},s:function(a,r,t){return r==="so"?t.ordinalNumber(a.getSeconds(),{unit:"second"}):be.s(a,r)},S:function(a,r){return be.S(a,r)},X:function(a,r,t){const e=a.getTimezoneOffset();if(e===0)return"Z";switch(r){case"X":return an(e);case"XXXX":case"XX":return Se(e);case"XXXXX":case"XXX":default:return Se(e,":")}},x:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"x":return an(e);case"xxxx":case"xx":return Se(e);case"xxxxx":case"xxx":default:return Se(e,":")}},O:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+rn(e,":");case"OOOO":default:return"GMT"+Se(e,":")}},z:function(a,r,t){const e=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+rn(e,":");case"zzzz":default:return"GMT"+Se(e,":")}},t:function(a,r,t){const e=Math.trunc(+a/1e3);return P(e,r.length)},T:function(a,r,t){return P(+a,r.length)}};function rn(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=Math.trunc(e/60),s=e%60;return s===0?t+String(n):t+String(n)+r+P(s,2)}function an(a,r){return a%60===0?(a>0?"-":"+")+P(Math.abs(a)/60,2):Se(a,r)}function Se(a,r=""){const t=a>0?"-":"+",e=Math.abs(a),n=P(Math.trunc(e/60),2),s=P(e%60,2);return t+n+r+s}const sn=(a,r)=>{switch(a){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Qn=(a,r)=>{switch(a){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},oa=(a,r)=>{const t=a.match(/(P+)(p+)?/)||[],e=t[1],n=t[2];if(!n)return sn(a,r);let s;switch(e){case"P":s=r.dateTime({width:"short"});break;case"PP":s=r.dateTime({width:"medium"});break;case"PPP":s=r.dateTime({width:"long"});break;case"PPPP":default:s=r.dateTime({width:"full"});break}return s.replace("{{date}}",sn(e,r)).replace("{{time}}",Qn(n,r))},Ft={p:Qn,P:oa},ca=/^D+$/,ua=/^Y+$/,la=["D","DD","YY","YYYY"];function da(a){return ca.test(a)}function fa(a){return ua.test(a)}function pa(a,r,t){const e=ha(a,r,t);if(console.warn(e),la.includes(a))throw new RangeError(e)}function ha(a,r,t){const e=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${r}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ma=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ga=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Da=/^'([^]*?)'?$/,wa=/''/g,va=/[a-zA-Z]/;function on(a,r,t){var u,d,f,p,m,g,D,k;const e=he(),n=(t==null?void 0:t.locale)??e.locale??nt,s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??e.firstWeekContainsDate??((p=(f=e.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,i=(t==null?void 0:t.weekStartsOn)??((g=(m=t==null?void 0:t.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??e.weekStartsOn??((k=(D=e.locale)==null?void 0:D.options)==null?void 0:k.weekStartsOn)??0,o=y(a,t==null?void 0:t.in);if(!vt(o))throw new RangeError("Invalid time value");let c=r.match(ga).map(x=>{const C=x[0];if(C==="p"||C==="P"){const O=Ft[C];return O(x,n.formatLong)}return x}).join("").match(ma).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const C=x[0];if(C==="'")return{isToken:!1,value:ya(x)};if(nn[C])return{isToken:!0,value:x};if(C.match(va))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:x}});n.localize.preprocessor&&(c=n.localize.preprocessor(o,c));const l={firstWeekContainsDate:s,weekStartsOn:i,locale:n};return c.map(x=>{if(!x.isToken)return x.value;const C=x.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&fa(C)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&da(C))&&pa(C,r,String(a));const O=nn[C[0]];return O(o,C,n.localize,l)}).join("")}function ya(a){const r=a.match(Da);return r?r[1].replace(wa,"'"):a}function ba(a,r,t){const e=he(),n=(t==null?void 0:t.locale)??e.locale??nt,s=2520,i=Ee(a,r);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:i}),[c,l]=ee(t==null?void 0:t.in,...i>0?[r,a]:[a,r]),u=Fn(l,c),d=(Ce(l)-Ce(c))/1e3,f=Math.round((u-d)/60);let p;if(f<2)return t!=null&&t.includeSeconds?u<5?n.formatDistance("lessThanXSeconds",5,o):u<10?n.formatDistance("lessThanXSeconds",10,o):u<20?n.formatDistance("lessThanXSeconds",20,o):u<40?n.formatDistance("halfAMinute",0,o):u<60?n.formatDistance("lessThanXMinutes",1,o):n.formatDistance("xMinutes",1,o):f===0?n.formatDistance("lessThanXMinutes",1,o):n.formatDistance("xMinutes",f,o);if(f<45)return n.formatDistance("xMinutes",f,o);if(f<90)return n.formatDistance("aboutXHours",1,o);if(f0?[r,a]:[a,r]),l=Mt((t==null?void 0:t.roundingMethod)??"round"),u=c.getTime()-o.getTime(),d=u/Ne,f=Ce(c)-Ce(o),p=(u-f)/Ne,m=t==null?void 0:t.unit;let g;if(m?g=m:d<1?g="second":d<60?g="minute":d{const u=`x${l.replace(/(^.)/,f=>f.toUpperCase())}`,d=a[l];return d!==void 0&&(s||a[l])?c.concat(e.formatDistance(u,d)):c},[]).join(i):""}function oo(a,r){const t=y(a,r==null?void 0:r.in);if(isNaN(+t))throw new RangeError("Invalid time value");const e=(r==null?void 0:r.representation)??"complete";let n="",s="";const i="-",o=":";if(e!=="time"){const c=P(t.getDate(),2),l=P(t.getMonth()+1,2);n=`${P(t.getFullYear(),4)}${i}${l}${i}${c}`}if(e!=="date"){const c=t.getTimezoneOffset();if(c!==0){const m=Math.abs(c),g=P(Math.trunc(m/60),2),D=P(m%60,2);s=`${c<0?"+":"-"}${g}:${D}`}else s="Z";const l=P(t.getHours(),2),u=P(t.getMinutes(),2),d=P(t.getSeconds(),2),f=n===""?"":"T",p=[l,u,d].join(o);n=`${n}${f}${p}${s}`}return n}function co(a,r){return y(a*1e3,r==null?void 0:r.in)}function cn(a,r){return y(a,r==null?void 0:r.in).getDate()}function Ma(a,r){return y(a,r==null?void 0:r.in).getDay()}function Ca(a,r){const t=y(a,r==null?void 0:r.in),e=t.getFullYear(),n=t.getMonth(),s=N(t,0);return s.setFullYear(e,n+1,0),s.setHours(0,0,0,0),s.getDate()}function xa(){return Object.assign({},he())}function De(a,r){return y(a,r==null?void 0:r.in).getHours()}function Sa(a,r){const t=y(a,r==null?void 0:r.in).getDay();return t===0?7:t}function we(a,r){return y(a,r==null?void 0:r.in).getMinutes()}function J(a,r){return y(a,r==null?void 0:r.in).getMonth()}function _e(a){return y(a).getSeconds()}function Wt(a){return+y(a)}function S(a,r){return y(a,r==null?void 0:r.in).getFullYear()}function uo(a,r){const{start:t,end:e}=Cr(r==null?void 0:r.in,a),n={},s=Mr(e,t);s&&(n.years=s);const i=Ve(t,{years:n.years}),o=Ln(e,i);o&&(n.months=o);const c=Ve(i,{months:n.months}),l=In(e,c);l&&(n.days=l);const u=Ve(c,{days:n.days}),d=br(e,u);d&&(n.hours=d);const f=Ve(u,{hours:n.hours}),p=kr(e,f);p&&(n.minutes=p);const m=Ve(f,{minutes:n.minutes}),g=Fn(e,m);return g&&(n.seconds=g),n}function xe(a,r){return+y(a)>+y(r)}function Ie(a,r){return+y(a)<+y(r)}function Pa(a,r){return+y(a)==+y(r)}function Ea(a,r){const t=Ta(r)?new r(0):N(r,0);return t.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),t.setHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),t}function Ta(a){var r;return typeof a=="function"&&((r=a.prototype)==null?void 0:r.constructor)===a}const Oa=10;class Bn{constructor(){v(this,"subPriority",0)}validate(r,t){return!0}}class Na extends Bn{constructor(r,t,e,n,s){super(),this.value=r,this.validateValue=t,this.setValue=e,this.priority=n,s&&(this.subPriority=s)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,e){return this.setValue(r,t,this.value,e)}}class Ya extends Bn{constructor(t,e){super();v(this,"priority",Oa);v(this,"subPriority",-1);this.context=t||(n=>N(e,n))}set(t,e){return e.timestampIsSet?t:N(t,Ea(t,this.context))}}class Y{run(r,t,e,n){const s=this.parse(r,t,e,n);return s?{setter:new Na(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(r,t,e){return!0}}class Ia extends Y{constructor(){super(...arguments);v(this,"priority",140);v(this,"incompatibleTokens",["R","u","t","T"])}parse(t,e,n){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,e,n){return e.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}const V={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}/},de={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 U(a,r){return a&&{value:r(a.value),rest:a.rest}}function Q(a,r){const t=r.match(a);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function fe(a,r){const t=r.match(a);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const e=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,i=t[5]?parseInt(t[5],10):0;return{value:e*(n*tt+s*Ne+i*mr),rest:r.slice(t[0].length)}}function Kn(a){return Q(V.anyDigitsSigned,a)}function q(a,r){switch(a){case 1:return Q(V.singleDigit,r);case 2:return Q(V.twoDigits,r);case 3:return Q(V.threeDigits,r);case 4:return Q(V.fourDigits,r);default:return Q(new RegExp("^\\d{1,"+a+"}"),r)}}function bt(a,r){switch(a){case 1:return Q(V.singleDigitSigned,r);case 2:return Q(V.twoDigitsSigned,r);case 3:return Q(V.threeDigitsSigned,r);case 4:return Q(V.fourDigitsSigned,r);default:return Q(new RegExp("^-?\\d{1,"+a+"}"),r)}}function Vt(a){switch(a){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 qn(a,r){const t=r>0,e=t?r:1-r;let n;if(e<=50)n=a||100;else{const s=e+50,i=Math.trunc(s/100)*100,o=a>=s%100;n=a+i-(o?100:0)}return t?n:1-n}function Vn(a){return a%400===0||a%4===0&&a%100!==0}class Ra extends Y{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,e,n){const s=i=>({year:i,isTwoDigitYear:e==="yy"});switch(e){case"y":return U(q(4,t),s);case"yo":return U(n.ordinalNumber(t,{unit:"year"}),s);default:return U(q(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n){const s=t.getFullYear();if(n.isTwoDigitYear){const o=qn(n.year,s);return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}const i=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class La extends Y{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,e,n){const s=i=>({year:i,isTwoDigitYear:e==="YY"});switch(e){case"Y":return U(q(4,t),s);case"Yo":return U(n.ordinalNumber(t,{unit:"year"}),s);default:return U(q(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,n,s){const i=qt(t,s);if(n.isTwoDigitYear){const c=qn(n.year,i);return t.setFullYear(c,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ye(t,s)}const o=!("era"in e)||e.era===1?n.year:1-n.year;return t.setFullYear(o,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ye(t,s)}}class Fa extends Y{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,e){return bt(e==="R"?4:e.length,t)}set(t,e,n){const s=N(t,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Ae(s)}}class Wa extends Y{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,e){return bt(e==="u"?4:e.length,t)}set(t,e,n){return t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}class Aa extends Y{constructor(){super(...arguments);v(this,"priority",120);v(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"Q":case"QQ":return q(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Ha extends Y{constructor(){super(...arguments);v(this,"priority",120);v(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"q":case"qq":return q(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class Qa extends Y{constructor(){super(...arguments);v(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);v(this,"priority",110)}parse(t,e,n){const s=i=>i-1;switch(e){case"M":return U(Q(V.month,t),s);case"MM":return U(q(2,t),s);case"Mo":return U(n.ordinalNumber(t,{unit:"month"}),s);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}class Ba extends Y{constructor(){super(...arguments);v(this,"priority",110);v(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,e,n){const s=i=>i-1;switch(e){case"L":return U(Q(V.month,t),s);case"LL":return U(q(2,t),s);case"Lo":return U(n.ordinalNumber(t,{unit:"month"}),s);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}function Ka(a,r,t){const e=y(a,t==null?void 0:t.in),n=Hn(e,t)-r;return e.setDate(e.getDate()-n*7),y(e,t==null?void 0:t.in)}class qa extends Y{constructor(){super(...arguments);v(this,"priority",100);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,e,n){switch(e){case"w":return Q(V.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return q(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n,s){return ye(Ka(t,n,s),s)}}function Va(a,r,t){const e=y(a,t==null?void 0:t.in),n=Kt(e,t)-r;return e.setDate(e.getDate()-n*7),e}class Ua extends Y{constructor(){super(...arguments);v(this,"priority",100);v(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,e,n){switch(e){case"I":return Q(V.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return q(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,n){return Ae(Va(t,n))}}const ja=[31,28,31,30,31,30,31,31,30,31,30,31],Xa=[31,29,31,30,31,30,31,31,30,31,30,31];class $a extends Y{constructor(){super(...arguments);v(this,"priority",90);v(this,"subPriority",1);v(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"d":return Q(V.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return q(e.length,t)}}validate(t,e){const n=t.getFullYear(),s=Vn(n),i=t.getMonth();return s?e>=1&&e<=Xa[i]:e>=1&&e<=ja[i]}set(t,e,n){return t.setDate(n),t.setHours(0,0,0,0),t}}class Ga extends Y{constructor(){super(...arguments);v(this,"priority",90);v(this,"subpriority",1);v(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,e,n){switch(e){case"D":case"DD":return Q(V.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return q(e.length,t)}}validate(t,e){const n=t.getFullYear();return Vn(n)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,n){return t.setMonth(0,n),t.setHours(0,0,0,0),t}}function Ut(a,r,t){var d,f,p,m;const e=he(),n=(t==null?void 0:t.weekStartsOn)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??e.weekStartsOn??((m=(p=e.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,s=y(a,t==null?void 0:t.in),i=s.getDay(),c=(r%7+7)%7,l=7-n,u=r<0||r>6?r-(i+l)%7:(c+l)%7-(i+l)%7;return se(s,u,t)}class za extends Y{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,e,n){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=Ut(t,n,s),t.setHours(0,0,0,0),t}}class Za extends Y{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,e,n,s){const i=o=>{const c=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return U(q(e.length,t),i);case"eo":return U(n.ordinalNumber(t,{unit:"day"}),i);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=Ut(t,n,s),t.setHours(0,0,0,0),t}}class Ja extends Y{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,e,n,s){const i=o=>{const c=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return U(q(e.length,t),i);case"co":return U(n.ordinalNumber(t,{unit:"day"}),i);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,n,s){return t=Ut(t,n,s),t.setHours(0,0,0,0),t}}function es(a,r,t){const e=y(a,t==null?void 0:t.in),n=Sa(e,t),s=r-n;return se(e,s,t)}class ts extends Y{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,e,n){const s=i=>i===0?7:i;switch(e){case"i":case"ii":return q(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return U(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return U(n.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return U(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s);case"iiii":default:return U(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,n){return t=es(t,n),t.setHours(0,0,0,0),t}}class ns extends Y{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,e,n){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(Vt(n),0,0,0),t}}class rs extends Y{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,e,n){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(Vt(n),0,0,0),t}}class as extends Y{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["a","b","t","T"])}parse(t,e,n){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,n){return t.setHours(Vt(n),0,0,0),t}}class ss extends Y{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,e,n){switch(e){case"h":return Q(V.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return q(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,n){const s=t.getHours()>=12;return s&&n<12?t.setHours(n+12,0,0,0):!s&&n===12?t.setHours(0,0,0,0):t.setHours(n,0,0,0),t}}class is extends Y{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,e,n){switch(e){case"H":return Q(V.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return q(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,n){return t.setHours(n,0,0,0),t}}class os extends Y{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,e,n){switch(e){case"K":return Q(V.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return q(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}}class cs extends Y{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,e,n){switch(e){case"k":return Q(V.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return q(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,n){const s=n<=24?n%24:n;return t.setHours(s,0,0,0),t}}class us extends Y{constructor(){super(...arguments);v(this,"priority",60);v(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"m":return Q(V.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return q(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setMinutes(n,0,0),t}}class ls extends Y{constructor(){super(...arguments);v(this,"priority",50);v(this,"incompatibleTokens",["t","T"])}parse(t,e,n){switch(e){case"s":return Q(V.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return q(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,n){return t.setSeconds(n,0),t}}class ds extends Y{constructor(){super(...arguments);v(this,"priority",30);v(this,"incompatibleTokens",["t","T"])}parse(t,e){const n=s=>Math.trunc(s*Math.pow(10,-e.length+3));return U(q(e.length,t),n)}set(t,e,n){return t.setMilliseconds(n),t}}class fs extends Y{constructor(){super(...arguments);v(this,"priority",10);v(this,"incompatibleTokens",["t","T","x"])}parse(t,e){switch(e){case"X":return fe(de.basicOptionalMinutes,t);case"XX":return fe(de.basic,t);case"XXXX":return fe(de.basicOptionalSeconds,t);case"XXXXX":return fe(de.extendedOptionalSeconds,t);case"XXX":default:return fe(de.extended,t)}}set(t,e,n){return e.timestampIsSet?t:N(t,t.getTime()-Ce(t)-n)}}class ps extends Y{constructor(){super(...arguments);v(this,"priority",10);v(this,"incompatibleTokens",["t","T","X"])}parse(t,e){switch(e){case"x":return fe(de.basicOptionalMinutes,t);case"xx":return fe(de.basic,t);case"xxxx":return fe(de.basicOptionalSeconds,t);case"xxxxx":return fe(de.extendedOptionalSeconds,t);case"xxx":default:return fe(de.extended,t)}}set(t,e,n){return e.timestampIsSet?t:N(t,t.getTime()-Ce(t)-n)}}class hs extends Y{constructor(){super(...arguments);v(this,"priority",40);v(this,"incompatibleTokens","*")}parse(t){return Kn(t)}set(t,e,n){return[N(t,n*1e3),{timestampIsSet:!0}]}}class ms extends Y{constructor(){super(...arguments);v(this,"priority",20);v(this,"incompatibleTokens","*")}parse(t){return Kn(t)}set(t,e,n){return[N(t,n),{timestampIsSet:!0}]}}const gs={G:new Ia,y:new Ra,Y:new La,R:new Fa,u:new Wa,Q:new Aa,q:new Ha,M:new Qa,L:new Ba,w:new qa,I:new Ua,d:new $a,D:new Ga,E:new za,e:new Za,c:new Ja,i:new ts,a:new ns,b:new rs,B:new as,h:new ss,H:new is,K:new os,k:new cs,m:new us,s:new ls,S:new ds,X:new fs,x:new ps,t:new hs,T:new ms},Ds=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ws=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vs=/^'([^]*?)'?$/,ys=/''/g,bs=/\S/,ks=/[a-zA-Z]/;function _s(a,r,t,e){var D,k,x,C,O,B,A,I;const n=()=>N((e==null?void 0:e.in)||t,NaN),s=xa(),i=(e==null?void 0:e.locale)??s.locale??nt,o=(e==null?void 0:e.firstWeekContainsDate)??((k=(D=e==null?void 0:e.locale)==null?void 0:D.options)==null?void 0:k.firstWeekContainsDate)??s.firstWeekContainsDate??((C=(x=s.locale)==null?void 0:x.options)==null?void 0:C.firstWeekContainsDate)??1,c=(e==null?void 0:e.weekStartsOn)??((B=(O=e==null?void 0:e.locale)==null?void 0:O.options)==null?void 0:B.weekStartsOn)??s.weekStartsOn??((I=(A=s.locale)==null?void 0:A.options)==null?void 0:I.weekStartsOn)??0;if(!r)return a?n():y(t,e==null?void 0:e.in);const l={firstWeekContainsDate:o,weekStartsOn:c,locale:i},u=[new Ya(e==null?void 0:e.in,t)],d=r.match(ws).map(_=>{const M=_[0];if(M in Ft){const L=Ft[M];return L(_,i.formatLong)}return _}).join("").match(Ds),f=[];for(let _ of d){const M=_[0],L=gs[M];if(L){const{incompatibleTokens:j}=L;if(Array.isArray(j)){const z=f.find(ce=>j.includes(ce.token)||ce.token===M);if(z)throw new RangeError(`The format string mustn't contain \`${z.fullToken}\` and \`${_}\` at the same time`)}else if(L.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);f.push({token:M,fullToken:_});const K=L.run(a,_,i.match,l);if(!K)return n();u.push(K.setter),a=K.rest}else{if(M.match(ks))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");if(_==="''"?_="'":M==="'"&&(_=Ms(_)),a.indexOf(_)===0)a=a.slice(_.length);else return n()}}if(a.length>0&&bs.test(a))return n();const p=u.map(_=>_.priority).sort((_,M)=>M-_).filter((_,M,L)=>L.indexOf(_)===M).map(_=>u.filter(M=>M.priority===_).sort((M,L)=>L.subPriority-M.subPriority)).map(_=>_[0]);let m=y(t,e==null?void 0:e.in);if(isNaN(+m))return n();const g={};for(const _ of p){if(!_.validate(m,l))return n();const M=_.set(m,g,l);Array.isArray(M)?(m=M[0],Object.assign(g,M[1])):m=M}return m}function Ms(a){return a.match(vs)[1].replace(ys,"'")}function Cs(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()}function xs(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r);return+Lt(e)==+Lt(n)}function Ss(a,r,t){const[e,n]=ee(t==null?void 0:t.in,a,r);return e.getFullYear()===n.getFullYear()}function et(a,r,t){const e=+y(a,t==null?void 0:t.in),[n,s]=[+y(r.start,t==null?void 0:t.in),+y(r.end,t==null?void 0:t.in)].sort((i,o)=>i-o);return e>=n&&e<=s}function Ps(a,r,t){return se(a,-1,t)}function Es(a,r){const t=()=>N(r==null?void 0:r.in,NaN),n=Ys(a);let s;if(n.date){const l=Is(n.date,2);s=Rs(l.restDateString,l.year)}if(!s||isNaN(+s))return t();const i=+s;let o=0,c;if(n.time&&(o=Ls(n.time),isNaN(o)))return t();if(n.timezone){if(c=Fs(n.timezone),isNaN(c))return t()}else{const l=new Date(i+o),u=y(0,r==null?void 0:r.in);return u.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),u.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),u}return y(i+o+c,r==null?void 0:r.in)}const it={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ts=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Os=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ns=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ys(a){const r={},t=a.split(it.dateTimeDelimiter);let e;if(t.length>2)return r;if(/:/.test(t[0])?e=t[0]:(r.date=t[0],e=t[1],it.timeZoneDelimiter.test(r.date)&&(r.date=a.split(it.timeZoneDelimiter)[0],e=a.substr(r.date.length,a.length))),e){const n=it.timezone.exec(e);n?(r.time=e.replace(n[1],""),r.timezone=n[1]):r.time=e}return r}function Is(a,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),e=a.match(t);if(!e)return{year:NaN,restDateString:""};const n=e[1]?parseInt(e[1]):null,s=e[2]?parseInt(e[2]):null;return{year:s===null?n:s*100,restDateString:a.slice((e[1]||e[2]).length)}}function Rs(a,r){if(r===null)return new Date(NaN);const t=a.match(Ts);if(!t)return new Date(NaN);const e=!!t[4],n=Xe(t[1]),s=Xe(t[2])-1,i=Xe(t[3]),o=Xe(t[4]),c=Xe(t[5])-1;if(e)return Bs(r,o,c)?Ws(r,o,c):new Date(NaN);{const l=new Date(0);return!Hs(r,s,i)||!Qs(r,n)?new Date(NaN):(l.setUTCFullYear(r,s,Math.max(n,i)),l)}}function Xe(a){return a?parseInt(a):1}function Ls(a){const r=a.match(Os);if(!r)return NaN;const t=Et(r[1]),e=Et(r[2]),n=Et(r[3]);return Ks(t,e,n)?t*tt+e*Ne+n*1e3:NaN}function Et(a){return a&&parseFloat(a.replace(",","."))||0}function Fs(a){if(a==="Z")return 0;const r=a.match(Ns);if(!r)return 0;const t=r[1]==="+"?-1:1,e=parseInt(r[2]),n=r[3]&&parseInt(r[3])||0;return qs(e,n)?t*(e*tt+n*Ne):NaN}function Ws(a,r,t){const e=new Date(0);e.setUTCFullYear(a,0,4);const n=e.getUTCDay()||7,s=(r-1)*7+t+1-n;return e.setUTCDate(e.getUTCDate()+s),e}const As=[31,null,31,30,31,30,31,31,30,31,30,31];function Un(a){return a%400===0||a%4===0&&a%100!==0}function Hs(a,r,t){return r>=0&&r<=11&&t>=1&&t<=(As[r]||(Un(a)?29:28))}function Qs(a,r){return r>=1&&r<=(Un(a)?366:365)}function Bs(a,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Ks(a,r,t){return a===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&a>=0&&a<25}function qs(a,r){return r>=0&&r<=59}function re(a,r,t){const e=y(a,t==null?void 0:t.in),n=e.getFullYear(),s=e.getDate(),i=N(a,0);i.setFullYear(n,r,15),i.setHours(0,0,0,0);const o=Ca(i);return e.setMonth(r,Math.min(s,o)),e}function ft(a,r,t){const e=y(a,t==null?void 0:t.in);return e.setHours(r),e}function pt(a,r,t){const e=y(a,t==null?void 0:t.in);return e.setMinutes(r),e}function Le(a,r,t){const e=y(a,t==null?void 0:t.in),n=Math.trunc(e.getMonth()/3)+1,s=r-n;return re(e,e.getMonth()+s*3)}function ht(a,r,t){const e=y(a,t==null?void 0:t.in);return e.setSeconds(r),e}function ue(a,r,t){const e=y(a,t==null?void 0:t.in);return isNaN(+e)?N(a,NaN):(e.setFullYear(r),e)}function Oe(a,r,t){return ie(a,-r,t)}function jn(a,r,t){return Ht(a,-1,t)}function un(a,r,t){return wt(a,-1,t)}function Qe(a,r,t){return me(a,-r,t)}const Xn={...ir},Vs=Xn.useInsertionEffect,Us=Vs||(a=>a());function js(a){const r=b.useRef(()=>{});return Us(()=>{r.current=a}),b.useCallback(function(){for(var t=arguments.length,e=new Array(t),n=0;n"floating-ui-"+Math.random().toString(36).slice(2,6)+Xs++;function $s(){const[a,r]=b.useState(()=>ln?dn():void 0);return kt(()=>{a==null&&r(dn())},[]),b.useEffect(()=>{ln=!0},[]),a}const Gs=Xn.useId,$n=Gs||$s,zs=b.forwardRef(function(r,t){const{context:{placement:e,elements:{floating:n},middlewareData:{arrow:s,shift:i}},width:o=14,height:c=7,tipRadius:l=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:p,style:{transform:m,...g}={},...D}=r,k=$n(),[x,C]=b.useState(!1);if(kt(()=>{if(!n)return;cr(n).direction==="rtl"&&C(!0)},[n]),!n)return null;const[O,B]=e.split("-"),A=O==="top"||O==="bottom";let I=d;(A&&i!=null&&i.x||!A&&i!=null&&i.y)&&(I=null);const _=u*2,M=_/2,L=o/2*(l/-8+1),j=c/2*l/4,K=!!p,z=I&&B==="end"?"bottom":"top";let ce=I&&B==="end"?"right":"left";I&&x&&(ce=B==="end"?"left":"right");const X=(s==null?void 0:s.x)!=null?I||s.x:"",F=(s==null?void 0:s.y)!=null?I||s.y:"",H=p||"M0,0"+(" H"+o)+(" L"+(o-L)+","+(c-j))+(" Q"+o/2+","+c+" "+L+","+(c-j))+" Z",te={top:K?"rotate(180deg)":"",left:K?"rotate(90deg)":"rotate(-90deg)",bottom:K?"":"rotate(180deg)",right:K?"rotate(-90deg)":"rotate(90deg)"}[O];return qe.jsxs("svg",{...D,"aria-hidden":!0,ref:t,width:K?o:o+_,height:o,viewBox:"0 0 "+o+" "+(c>o?c:o),style:{position:"absolute",pointerEvents:"none",[ce]:X,[z]:F,[O]:A||K?"100%":"calc(100% - "+_/2+"px)",transform:[te,m].filter(Ke=>!!Ke).join(" "),...g},children:[_>0&&qe.jsx("path",{clipPath:"url(#"+k+")",fill:"none",stroke:f,strokeWidth:_+(p?0:1),d:H}),qe.jsx("path",{stroke:_&&!p?D.fill:"none",d:H}),qe.jsx("clipPath",{id:k,children:qe.jsx("rect",{x:-M,y:M*(K?-1:1),width:o+_,height:o})})]})});function Zs(){const a=new Map;return{emit(r,t){var e;(e=a.get(r))==null||e.forEach(n=>n(t))},on(r,t){a.set(r,[...a.get(r)||[],t])},off(r,t){var e;a.set(r,((e=a.get(r))==null?void 0:e.filter(n=>n!==t))||[])}}}const Js=b.createContext(null),ei=b.createContext(null),ti=()=>{var a;return((a=b.useContext(Js))==null?void 0:a.id)||null},ni=()=>b.useContext(ei);function ri(a){const{open:r=!1,onOpenChange:t,elements:e}=a,n=$n(),s=b.useRef({}),[i]=b.useState(()=>Zs()),o=ti()!=null,[c,l]=b.useState(e.reference),u=js((p,m,g)=>{s.current.openEvent=p?m:void 0,i.emit("openchange",{open:p,event:m,reason:g,nested:o}),t==null||t(p,m,g)}),d=b.useMemo(()=>({setPositionReference:l}),[]),f=b.useMemo(()=>({reference:c||e.reference||null,floating:e.floating||null,domReference:e.reference}),[c,e.reference,e.floating]);return b.useMemo(()=>({dataRef:s,open:r,onOpenChange:u,elements:f,events:i,floatingId:n,refs:d}),[r,u,f,i,n,d])}function ai(a){a===void 0&&(a={});const{nodeId:r}=a,t=ri({...a,elements:{reference:null,floating:null,...a.elements}}),e=a.rootContext||t,n=e.elements,[s,i]=b.useState(null),[o,c]=b.useState(null),u=(n==null?void 0:n.domReference)||s,d=b.useRef(null),f=ni();kt(()=>{u&&(d.current=u)},[u]);const p=ur({...a,elements:{...n,...o&&{reference:o}}}),m=b.useCallback(C=>{const O=st(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),contextElement:C}:C;c(O),p.refs.setReference(O)},[p.refs]),g=b.useCallback(C=>{(st(C)||C===null)&&(d.current=C,i(C)),(st(p.refs.reference.current)||p.refs.reference.current===null||C!==null&&!st(C))&&p.refs.setReference(C)},[p.refs]),D=b.useMemo(()=>({...p.refs,setReference:g,setPositionReference:m,domReference:d}),[p.refs,g,m]),k=b.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),x=b.useMemo(()=>({...p,...e,refs:D,elements:k,nodeId:r}),[p,D,k,r,e]);return kt(()=>{e.dataRef.current.floatingContext=x;const C=f==null?void 0:f.nodesRef.current.find(O=>O.id===r);C&&(C.context=x)}),b.useMemo(()=>({...p,context:x,refs:D,elements:k}),[p,D,k,x])}/*! + react-datepicker v8.2.1 + https://github.com/Hacker0x01/react-datepicker + Released under the MIT License. +*/var At=function(r,t){return At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])},At(r,t)};function $(a,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");At(a,r);function t(){this.constructor=a}a.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var T=function(){return T=Object.assign||function(t){for(var e,n=1,s=arguments.length;n0?t[0]:t;return a&&W(a,n,e)||""}function oi(a,r,t){if(!a)return"";var e=ne(a,t),n=r?ne(r,t):"";return"".concat(e," - ").concat(n)}function ci(a,r){if(!(a!=null&&a.length))return"";var t=a[0]?ne(a[0],r):"";if(a.length===1)return t;if(a.length===2&&a[1]){var e=ne(a[1],r);return"".concat(t,", ").concat(e)}var n=a.length-1;return"".concat(t," (+").concat(n,")")}function Ot(a,r){var t=r.hour,e=t===void 0?0:t,n=r.minute,s=n===void 0?0:n,i=r.second,o=i===void 0?0:i;return ft(pt(ht(a,o),s),e)}function ui(a){return Kt(a)}function li(a,r){return W(a,"ddd",r)}function mt(a){return Ye(a)}function Me(a,r,t){var e=Be(r||jt());return ye(a,{locale:e,weekStartsOn:t})}function ve(a){return Wn(a)}function Ge(a){return Ct(a)}function fn(a){return Lt(a)}function pn(){return Ye(R())}function hn(a){return Qt(a)}function di(a){return xr(a)}function fi(a){return Bt(a)}function le(a,r){return a&&r?Ss(a,r):!a&&!r}function Z(a,r){return a&&r?Cs(a,r):!a&&!r}function _t(a,r){return a&&r?xs(a,r):!a&&!r}function E(a,r){return a&&r?yr(a,r):!a&&!r}function Pe(a,r){return a&&r?Pa(a,r):!a&&!r}function ze(a,r,t){var e,n=Ye(r),s=Qt(t);try{e=et(a,{start:n,end:s})}catch{e=!1}return e}function jt(){var a=Gn();return a.__localeId__}function Be(a){if(typeof a=="string"){var r=Gn();return r.__localeData__?r.__localeData__[a]:void 0}else return a}function pi(a,r,t){return r(W(a,"EEEE",t))}function hi(a,r){return W(a,"EEEEEE",r)}function mi(a,r){return W(a,"EEE",r)}function Xt(a,r){return W(re(R(),a),"LLLL",r)}function zn(a,r){return W(re(R(),a),"LLL",r)}function gi(a,r){return W(Le(R(),a),"QQQ",r)}function ae(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,i=t.excludeDateIntervals,o=t.includeDates,c=t.includeDateIntervals,l=t.filterDate;return at(a,{minDate:e,maxDate:n})||s&&s.some(function(u){return u instanceof Date?E(a,u):E(a,u.date)})||i&&i.some(function(u){var d=u.start,f=u.end;return et(a,{start:d,end:f})})||o&&!o.some(function(u){return E(a,u)})||c&&!c.some(function(u){var d=u.start,f=u.end;return et(a,{start:d,end:f})})||l&&!l(R(a))||!1}function $t(a,r){var t=r===void 0?{}:r,e=t.excludeDates,n=t.excludeDateIntervals;return n&&n.length>0?n.some(function(s){var i=s.start,o=s.end;return et(a,{start:i,end:o})}):e&&e.some(function(s){var i;return s instanceof Date?E(a,s):E(a,(i=s.date)!==null&&i!==void 0?i:new Date)})||!1}function Zn(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,i=t.includeDates,o=t.filterDate;return at(a,{minDate:e?Wn(e):void 0,maxDate:n?Bt(n):void 0})||(s==null?void 0:s.some(function(c){return Z(a,c instanceof Date?c:c.date)}))||i&&!i.some(function(c){return Z(a,c)})||o&&!o(R(a))||!1}function ot(a,r,t,e){var n=S(a),s=J(a),i=S(r),o=J(r),c=S(e);return n===i&&n===c?s<=t&&t<=o:n=t||cn:!1}function Di(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,i=t.includeDates;return at(a,{minDate:e,maxDate:n})||s&&s.some(function(o){return Z(o instanceof Date?o:o.date,a)})||i&&!i.some(function(o){return Z(o,a)})||!1}function ct(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,i=t.includeDates,o=t.filterDate;return at(a,{minDate:e,maxDate:n})||(s==null?void 0:s.some(function(c){return _t(a,c instanceof Date?c:c.date)}))||i&&!i.some(function(c){return _t(a,c)})||o&&!o(R(a))||!1}function ut(a,r,t){if(!r||!t||!vt(r)||!vt(t))return!1;var e=S(r),n=S(t);return e<=a&&n>=a}function gt(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.maxDate,s=t.excludeDates,i=t.includeDates,o=t.filterDate,c=new Date(a,0,1);return at(c,{minDate:e?Ct(e):void 0,maxDate:n?An(n):void 0})||(s==null?void 0:s.some(function(l){return le(c,l instanceof Date?l:l.date)}))||i&&!i.some(function(l){return le(c,l)})||o&&!o(R(c))||!1}function lt(a,r,t,e){var n=S(a),s=Te(a),i=S(r),o=Te(r),c=S(e);return n===i&&n===c?s<=t&&t<=o:n=t||cn:!1}function at(a,r){var t,e=r===void 0?{}:r,n=e.minDate,s=e.maxDate;return(t=n&&He(a,n)<0||s&&He(a,s)>0)!==null&&t!==void 0?t:!1}function mn(a,r){return r.some(function(t){return De(t)===De(a)&&we(t)===we(a)&&_e(t)===_e(a)})}function gn(a,r){var t=r===void 0?{}:r,e=t.excludeTimes,n=t.includeTimes,s=t.filterTime;return e&&mn(a,e)||n&&!mn(a,n)||s&&!s(a)||!1}function Dn(a,r){var t=r.minTime,e=r.maxTime;if(!t||!e)throw new Error("Both minTime and maxTime props required");var n=R();n=ft(n,De(a)),n=pt(n,we(a)),n=ht(n,_e(a));var s=R();s=ft(s,De(t)),s=pt(s,we(t)),s=ht(s,_e(t));var i=R();i=ft(i,De(e)),i=pt(i,we(e)),i=ht(i,_e(e));var o;try{o=!et(n,{start:s,end:i})}catch{o=!1}return o}function wn(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Oe(a,1);return e&&Ze(e,s)>0||n&&n.every(function(i){return Ze(i,s)>0})||!1}function vn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=ie(a,1);return e&&Ze(s,e)>0||n&&n.every(function(i){return Ze(s,i)>0})||!1}function wi(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Ct(a),i=jn(s);return e&&yt(e,i)>0||n&&n.every(function(o){return yt(o,i)>0})||!1}function vi(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=An(a),i=Ht(s,1);return e&&yt(i,e)>0||n&&n.every(function(o){return yt(i,o)>0})||!1}function yn(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.includeDates,s=Qe(a,1);return e&&Je(e,s)>0||n&&n.every(function(i){return Je(i,s)>0})||!1}function yi(a,r){var t=r===void 0?{}:r,e=t.minDate,n=t.yearItemNumber,s=n===void 0?rt:n,i=Ge(Qe(a,s)),o=ke(i,s).endPeriod,c=e&&S(e);return c&&c>o||!1}function bn(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.includeDates,s=me(a,1);return e&&Je(s,e)>0||n&&n.every(function(i){return Je(s,i)>0})||!1}function bi(a,r){var t=r===void 0?{}:r,e=t.maxDate,n=t.yearItemNumber,s=n===void 0?rt:n,i=me(a,s),o=ke(i,s).startPeriod,c=e&&S(e);return c&&c=0});return en(e)}else return t?en(t):r}function er(a){var r=a.maxDate,t=a.includeDates;if(t&&r){var e=t.filter(function(n){return He(n,r)<=0});return Jt(e)}else return t?Jt(t):r}function kn(a,r){var t;a===void 0&&(a=[]),r===void 0&&(r="react-datepicker__day--highlighted");for(var e=new Map,n=0,s=a.length;n=Oi,p=!n&&!t.isWeekInMonth(o);if(f||p)if(t.props.peekNextMonth)i=!0;else break}return e},t.onMonthClick=function(e,n){var s=t.isMonthDisabledForLabelDate(n),i=s.isDisabled,o=s.labelDate;i||t.handleDayClick(ve(o),e)},t.onMonthMouseEnter=function(e){var n=t.isMonthDisabledForLabelDate(e),s=n.isDisabled,i=n.labelDate;s||t.handleDayMouseEnter(ve(i))},t.handleMonthNavigation=function(e,n){var s,i,o,c;(i=(s=t.props).setPreSelection)===null||i===void 0||i.call(s,n),(c=(o=t.MONTH_REFS[e])===null||o===void 0?void 0:o.current)===null||c===void 0||c.focus()},t.handleKeyboardNavigation=function(e,n,s){var i,o=t.props,c=o.selected,l=o.preSelection,u=o.setPreSelection,d=o.minDate,f=o.maxDate,p=o.showFourColumnMonthYearPicker,m=o.showTwoColumnMonthYearPicker;if(l){var g=Sn(p,m),D=t.getVerticalOffset(g),k=(i=Nt[g])===null||i===void 0?void 0:i.grid,x=function(I,_,M){var L,j,K=_,z=M;switch(I){case w.ArrowRight:K=ie(_,dt),z=M===11?0:M+dt;break;case w.ArrowLeft:K=Oe(_,dt),z=M===0?11:M-dt;break;case w.ArrowUp:K=Oe(_,D),z=!((L=k==null?void 0:k[0])===null||L===void 0)&&L.includes(M)?M+12-D:M-D;break;case w.ArrowDown:K=ie(_,D),z=!((j=k==null?void 0:k[k.length-1])===null||j===void 0)&&j.includes(M)?M-12+D:M+D;break}return{newCalculatedDate:K,newCalculatedMonth:z}},C=function(I,_,M){for(var L=40,j=I,K=!1,z=0,ce=x(j,_,M),X=ce.newCalculatedDate,F=ce.newCalculatedMonth;!K;){if(z>=L){X=_,F=M;break}if(d&&Xf){j=w.ArrowLeft;var H=x(j,X,F);X=H.newCalculatedDate,F=H.newCalculatedMonth}if(Di(X,t.props)){var H=x(j,X,F);X=H.newCalculatedDate,F=H.newCalculatedMonth}else K=!0;z++}return{newCalculatedDate:X,newCalculatedMonth:F}};if(n===w.Enter){t.isMonthDisabled(s)||(t.onMonthClick(e,s),u==null||u(c));return}var O=C(n,l,s),B=O.newCalculatedDate,A=O.newCalculatedMonth;switch(n){case w.ArrowRight:case w.ArrowLeft:case w.ArrowUp:case w.ArrowDown:t.handleMonthNavigation(A,B);break}}},t.getVerticalOffset=function(e){var n,s;return(s=(n=Nt[e])===null||n===void 0?void 0:n.verticalNavigationOffset)!==null&&s!==void 0?s:0},t.onMonthKeyDown=function(e,n){var s=t.props,i=s.disabledKeyboardNavigation,o=s.handleOnMonthKeyDown,c=e.key;c!==w.Tab&&e.preventDefault(),i||t.handleKeyboardNavigation(e,c,n),o&&o(e)},t.onQuarterClick=function(e,n){var s=Le(t.props.day,n);ct(s,t.props)||t.handleDayClick(fn(s),e)},t.onQuarterMouseEnter=function(e){var n=Le(t.props.day,e);ct(n,t.props)||t.handleDayMouseEnter(fn(n))},t.handleQuarterNavigation=function(e,n){var s,i,o,c;t.isDisabled(n)||t.isExcluded(n)||((i=(s=t.props).setPreSelection)===null||i===void 0||i.call(s,n),(c=(o=t.QUARTER_REFS[e-1])===null||o===void 0?void 0:o.current)===null||c===void 0||c.focus())},t.onQuarterKeyDown=function(e,n){var s,i,o=e.key;if(!t.props.disabledKeyboardNavigation)switch(o){case w.Enter:t.onQuarterClick(e,n),(i=(s=t.props).setPreSelection)===null||i===void 0||i.call(s,t.props.selected);break;case w.ArrowRight:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===4?1:n+1,Ht(t.props.preSelection,1));break;case w.ArrowLeft:if(!t.props.preSelection)break;t.handleQuarterNavigation(n===1?4:n-1,jn(t.props.preSelection));break}},t.isMonthDisabledForLabelDate=function(e){var n,s=t.props,i=s.day,o=s.minDate,c=s.maxDate,l=s.excludeDates,u=s.includeDates,d=re(i,e);return{isDisabled:(n=(o||c||l||u)&&Zn(d,t.props))!==null&&n!==void 0?n:!1,labelDate:d}},t.isMonthDisabled=function(e){var n=t.isMonthDisabledForLabelDate(e).isDisabled;return n},t.getMonthClassNames=function(e){var n=t.props,s=n.day,i=n.startDate,o=n.endDate,c=n.preSelection,l=n.monthClassName,u=l?l(re(s,e)):void 0,d=t.getSelection();return G("react-datepicker__month-text","react-datepicker__month-".concat(e),u,{"react-datepicker__month-text--disabled":t.isMonthDisabled(e),"react-datepicker__month-text--selected":d?t.isSelectMonthInList(s,e,d):void 0,"react-datepicker__month-text--keyboard-selected":!t.props.disabledKeyboardNavigation&&c&&t.isSelectedMonth(s,e,c)&&!t.isMonthDisabled(e),"react-datepicker__month-text--in-selecting-range":t.isInSelectingRangeMonth(e),"react-datepicker__month-text--in-range":i&&o?ot(i,o,e,s):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(s,e)})},t.getTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=J(t.props.preSelection),s=t.isMonthDisabledForLabelDate(n).isDisabled,i=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return i},t.getQuarterTabIndex=function(e){if(t.props.preSelection==null)return"-1";var n=Te(t.props.preSelection),s=ct(t.props.day,t.props),i=e===n&&!(s||t.props.disabledKeyboardNavigation)?"0":"-1";return i},t.getAriaLabel=function(e){var n=t.props,s=n.chooseDayAriaLabelPrefix,i=s===void 0?"Choose":s,o=n.disabledDayAriaLabelPrefix,c=o===void 0?"Not available":o,l=n.day,u=n.locale,d=re(l,e),f=t.isDisabled(d)||t.isExcluded(d)?c:i;return"".concat(f," ").concat(W(d,"MMMM yyyy",u))},t.getQuarterClassNames=function(e){var n=t.props,s=n.day,i=n.startDate,o=n.endDate,c=n.selected,l=n.minDate,u=n.maxDate,d=n.excludeDates,f=n.includeDates,p=n.filterDate,m=n.preSelection,g=n.disabledKeyboardNavigation,D=(l||u||d||f||p)&&ct(Le(s,e),t.props);return G("react-datepicker__quarter-text","react-datepicker__quarter-".concat(e),{"react-datepicker__quarter-text--disabled":D,"react-datepicker__quarter-text--selected":c?t.isSelectedQuarter(s,e,c):void 0,"react-datepicker__quarter-text--keyboard-selected":!g&&m&&t.isSelectedQuarter(s,e,m)&&!D,"react-datepicker__quarter-text--in-selecting-range":t.isInSelectingRangeQuarter(e),"react-datepicker__quarter-text--in-range":i&&o?lt(i,o,e,s):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(s,e)})},t.getMonthContent=function(e){var n=t.props,s=n.showFullMonthYearPicker,i=n.renderMonthContent,o=n.locale,c=n.day,l=zn(e,o),u=Xt(e,o);return i?i(e,l,u,c):s?u:l},t.getQuarterContent=function(e){var n,s=t.props,i=s.renderQuarterContent,o=s.locale,c=gi(e,o);return(n=i==null?void 0:i(e,c))!==null&&n!==void 0?n:c},t.renderMonths=function(){var e,n=t.props,s=n.showTwoColumnMonthYearPicker,i=n.showFourColumnMonthYearPicker,o=n.day,c=n.selected,l=(e=Nt[Sn(i,s)])===null||e===void 0?void 0:e.grid;return l==null?void 0:l.map(function(u,d){return h.createElement("div",{className:"react-datepicker__month-wrapper",key:d},u.map(function(f,p){return h.createElement("div",{ref:t.MONTH_REFS[f],key:p,onClick:function(m){t.onMonthClick(m,f)},onKeyDown:function(m){tr(m)&&(m.preventDefault(),m.key=w.Enter),t.onMonthKeyDown(m,f)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onMonthMouseEnter(f)},onPointerEnter:t.props.usePointerEvent?function(){return t.onMonthMouseEnter(f)}:void 0,tabIndex:Number(t.getTabIndex(f)),className:t.getMonthClassNames(f),"aria-disabled":t.isMonthDisabled(f),role:"option","aria-label":t.getAriaLabel(f),"aria-current":t.isCurrentMonth(o,f)?"date":void 0,"aria-selected":c?t.isSelectedMonth(o,f,c):void 0},t.getMonthContent(f))}))})},t.renderQuarters=function(){var e=t.props,n=e.day,s=e.selected,i=[1,2,3,4];return h.createElement("div",{className:"react-datepicker__quarter-wrapper"},i.map(function(o,c){return h.createElement("div",{key:c,ref:t.QUARTER_REFS[c],role:"option",onClick:function(l){t.onQuarterClick(l,o)},onKeyDown:function(l){t.onQuarterKeyDown(l,o)},onMouseEnter:t.props.usePointerEvent?void 0:function(){return t.onQuarterMouseEnter(o)},onPointerEnter:t.props.usePointerEvent?function(){return t.onQuarterMouseEnter(o)}:void 0,className:t.getQuarterClassNames(o),"aria-selected":s?t.isSelectedQuarter(n,o,s):void 0,tabIndex:Number(t.getQuarterTabIndex(o)),"aria-current":t.isCurrentQuarter(n,o)?"date":void 0},t.getQuarterContent(o))}))},t.getClassNames=function(){var e=t.props,n=e.selectingDate,s=e.selectsStart,i=e.selectsEnd,o=e.showMonthYearPicker,c=e.showQuarterYearPicker,l=e.showWeekPicker;return G("react-datepicker__month",{"react-datepicker__month--selecting-range":n&&(s||i)},{"react-datepicker__monthPicker":o},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":l})},t}return r.prototype.getSelection=function(){var t=this.props,e=t.selected,n=t.selectedDates,s=t.selectsMultiple;if(s)return n;if(e)return[e]},r.prototype.render=function(){var t=this.props,e=t.showMonthYearPicker,n=t.showQuarterYearPicker,s=t.day,i=t.ariaLabelPrefix,o=i===void 0?"Month ":i,c=o?o.trim()+" ":"";return h.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":"".concat(c).concat(W(s,"MMMM, yyyy",this.props.locale)),role:"listbox"},e?this.renderMonths():n?this.renderQuarters():this.renderWeeks())},r}(b.Component),Yi=function(a){$(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.isSelectedMonth=function(e){return t.props.month===e},t.renderOptions=function(){return t.props.monthNames.map(function(e,n){return h.createElement("div",{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),"aria-selected":t.isSelectedMonth(n)?"true":void 0},t.isSelectedMonth(n)?h.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 r.prototype.render=function(){return h.createElement(xt,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},r}(b.Component),Ii=function(a){$(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(e){return e.map(function(n,s){return h.createElement("option",{key:n,value:s},n)})},t.renderSelectMode=function(e){return h.createElement("select",{value:t.props.month,className:"react-datepicker__month-select",onChange:function(n){return t.onChange(parseInt(n.target.value))}},t.renderSelectOptions(e))},t.renderReadView=function(e,n){return h.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:t.toggleDropdown},h.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),h.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},n[t.props.month]))},t.renderDropdown=function(e){return h.createElement(Yi,T({key:"dropdown"},t.props,{monthNames:e,onChange:t.onChange,onCancel:t.toggleDropdown}))},t.renderScrollMode=function(e){var n=t.state.dropdownVisible,s=[t.renderReadView(!n,e)];return n&&s.unshift(t.renderDropdown(e)),s},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 r.prototype.render=function(){var t=this,e=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(s){return zn(s,t.props.locale)}:function(s){return Xt(s,t.props.locale)}),n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode(e);break;case"select":n=this.renderSelectMode(e);break}return h.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},n)},r}(b.Component);function Ri(a,r){for(var t=[],e=ve(a),n=ve(r);!xe(e,n);)t.push(R(e)),e=ie(e,1);return t}var Li=function(a){$(r,a);function r(t){var e=a.call(this,t)||this;return e.renderOptions=function(){return e.state.monthYearsList.map(function(n){var s=Wt(n),i=le(e.props.date,n)&&Z(e.props.date,n);return h.createElement("div",{className:i?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:s,onClick:e.onChange.bind(e,s),"aria-selected":i?"true":void 0},i?h.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",W(n,e.props.dateFormat,e.props.locale))})},e.onChange=function(n){return e.props.onChange(n)},e.handleClickOutside=function(){e.props.onCancel()},e.state={monthYearsList:Ri(e.props.minDate,e.props.maxDate)},e}return r.prototype.render=function(){var t=G({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return h.createElement(xt,{className:t,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(b.Component),Fi=function(a){$(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=ve(t.props.minDate),n=ve(t.props.maxDate),s=[];!xe(e,n);){var i=Wt(e);s.push(h.createElement("option",{key:i,value:i},W(e,t.props.dateFormat,t.props.locale))),e=ie(e,1)}return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return h.createElement("select",{value:Wt(ve(t.props.date)),className:"react-datepicker__month-year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){var n=W(t.props.date,t.props.dateFormat,t.props.locale);return h.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:t.toggleDropdown},h.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),h.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},n))},t.renderDropdown=function(){return h.createElement(Li,T({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=R(e);le(t.props.date,n)&&Z(t.props.date,n)||t.props.onChange(n)},t.toggleDropdown=function(){return t.setState({dropdownVisible:!t.state.dropdownVisible})},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return h.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(b.Component),Wi=function(a){$(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={height:null},t.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var e,n,s;t.list&&(t.list.scrollTop=(s=t.centerLi&&r.calcCenterPosition(t.props.monthRef?t.props.monthRef.clientHeight-((n=(e=t.header)===null||e===void 0?void 0:e.clientHeight)!==null&&n!==void 0?n:0):t.list.clientHeight,t.centerLi))!==null&&s!==void 0?s:0)})},t.handleClick=function(e){var n,s;(t.props.minTime||t.props.maxTime)&&Dn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&gn(e,t.props)||(s=(n=t.props).onChange)===null||s===void 0||s.call(n,e)},t.isSelectedTime=function(e){return t.props.selected&&xi(t.props.selected,e)},t.isDisabledTime=function(e){return(t.props.minTime||t.props.maxTime)&&Dn(e,t.props)||(t.props.excludeTimes||t.props.includeTimes||t.props.filterTime)&&gn(e,t.props)},t.liClasses=function(e){var n,s=["react-datepicker__time-list-item",t.props.timeClassName?t.props.timeClassName(e):void 0];return t.isSelectedTime(e)&&s.push("react-datepicker__time-list-item--selected"),t.isDisabledTime(e)&&s.push("react-datepicker__time-list-item--disabled"),t.props.injectTimes&&(De(e)*3600+we(e)*60+_e(e))%(((n=t.props.intervals)!==null&&n!==void 0?n:r.defaultProps.intervals)*60)!==0&&s.push("react-datepicker__time-list-item--injected"),s.join(" ")},t.handleOnKeyDown=function(e,n){var s,i;e.key===w.Space&&(e.preventDefault(),e.key=w.Enter),(e.key===w.ArrowUp||e.key===w.ArrowLeft)&&e.target instanceof HTMLElement&&e.target.previousSibling&&(e.preventDefault(),e.target.previousSibling instanceof HTMLElement&&e.target.previousSibling.focus()),(e.key===w.ArrowDown||e.key===w.ArrowRight)&&e.target instanceof HTMLElement&&e.target.nextSibling&&(e.preventDefault(),e.target.nextSibling instanceof HTMLElement&&e.target.nextSibling.focus()),e.key===w.Enter&&t.handleClick(n),(i=(s=t.props).handleOnKeyDown)===null||i===void 0||i.call(s,e)},t.renderTimes=function(){for(var e,n=[],s=typeof t.props.format=="string"?t.props.format:"p",i=(e=t.props.intervals)!==null&&e!==void 0?e:r.defaultProps.intervals,o=t.props.selected||t.props.openToDate||R(),c=mt(o),l=t.props.injectTimes&&t.props.injectTimes.sort(function(D,k){return D.getTime()-k.getTime()}),u=60*Ci(o),d=u/i,f=0;f=f?e.updateFocusOnPaginate(Math.abs(f-(n-p))):(l=(c=e.YEAR_REFS[n-p])===null||c===void 0?void 0:c.current)===null||l===void 0||l.focus())}},e.isSameDay=function(n,s){return E(n,s)},e.isCurrentYear=function(n){return n===S(R())},e.isRangeStart=function(n){return e.props.startDate&&e.props.endDate&&le(ue(R(),n),e.props.startDate)},e.isRangeEnd=function(n){return e.props.startDate&&e.props.endDate&&le(ue(R(),n),e.props.endDate)},e.isInRange=function(n){return ut(n,e.props.startDate,e.props.endDate)},e.isInSelectingRange=function(n){var s=e.props,i=s.selectsStart,o=s.selectsEnd,c=s.selectsRange,l=s.startDate,u=s.endDate;return!(i||o||c)||!e.selectingDate()?!1:i&&u?ut(n,e.selectingDate(),u):o&&l||c&&l&&!u?ut(n,l,e.selectingDate()):!1},e.isSelectingRangeStart=function(n){var s;if(!e.isInSelectingRange(n))return!1;var i=e.props,o=i.startDate,c=i.selectsStart,l=ue(R(),n);return c?le(l,(s=e.selectingDate())!==null&&s!==void 0?s:null):le(l,o??null)},e.isSelectingRangeEnd=function(n){var s;if(!e.isInSelectingRange(n))return!1;var i=e.props,o=i.endDate,c=i.selectsEnd,l=i.selectsRange,u=ue(R(),n);return c||l?le(u,(s=e.selectingDate())!==null&&s!==void 0?s:null):le(u,o??null)},e.isKeyboardSelected=function(n){if(!(e.props.date===void 0||e.props.selected==null||e.props.preSelection==null)){var s=e.props,i=s.minDate,o=s.maxDate,c=s.excludeDates,l=s.includeDates,u=s.filterDate,d=Ge(ue(e.props.date,n)),f=(i||o||c||l||u)&>(n,e.props);return!e.props.disabledKeyboardNavigation&&!e.props.inline&&!E(d,Ge(e.props.selected))&&E(d,Ge(e.props.preSelection))&&!f}},e.onYearClick=function(n,s){var i=e.props.date;i!==void 0&&e.handleYearClick(Ge(ue(i,s)),n)},e.onYearKeyDown=function(n,s){var i,o,c=n.key,l=e.props,u=l.date,d=l.yearItemNumber,f=l.handleOnKeyDown;if(c!==w.Tab&&n.preventDefault(),!e.props.disabledKeyboardNavigation)switch(c){case w.Enter:if(e.props.selected==null)break;e.onYearClick(n,s),(o=(i=e.props).setPreSelection)===null||o===void 0||o.call(i,e.props.selected);break;case w.ArrowRight:if(e.props.preSelection==null)break;e.handleYearNavigation(s+1,me(e.props.preSelection,1));break;case w.ArrowLeft:if(e.props.preSelection==null)break;e.handleYearNavigation(s-1,Qe(e.props.preSelection,1));break;case w.ArrowUp:{if(u===void 0||d===void 0||e.props.preSelection==null)break;var p=ke(u,d).startPeriod,m=Pn,g=s-m;if(g=p&&sk){var D=d%m;s<=k&&s>k-D?m=D:m+=D,g=s+m}e.handleYearNavigation(g,me(e.props.preSelection,m));break}}f&&f(n)},e.getYearClassNames=function(n){var s=e.props,i=s.date,o=s.minDate,c=s.maxDate,l=s.selected,u=s.excludeDates,d=s.includeDates,f=s.filterDate,p=s.yearClassName;return G("react-datepicker__year-text","react-datepicker__year-".concat(n),i?p==null?void 0:p(ue(i,n)):void 0,{"react-datepicker__year-text--selected":l?n===S(l):void 0,"react-datepicker__year-text--disabled":(o||c||u||d||f)&>(n,e.props),"react-datepicker__year-text--keyboard-selected":e.isKeyboardSelected(n),"react-datepicker__year-text--range-start":e.isRangeStart(n),"react-datepicker__year-text--range-end":e.isRangeEnd(n),"react-datepicker__year-text--in-range":e.isInRange(n),"react-datepicker__year-text--in-selecting-range":e.isInSelectingRange(n),"react-datepicker__year-text--selecting-range-start":e.isSelectingRangeStart(n),"react-datepicker__year-text--selecting-range-end":e.isSelectingRangeEnd(n),"react-datepicker__year-text--today":e.isCurrentYear(n)})},e.getYearTabIndex=function(n){if(e.props.disabledKeyboardNavigation||e.props.preSelection==null)return"-1";var s=S(e.props.preSelection),i=gt(n,e.props);return n===s&&!i?"0":"-1"},e.getYearContent=function(n){return e.props.renderYearContent?e.props.renderYearContent(n):n},e}return r.prototype.render=function(){var t=this,e=[],n=this.props,s=n.date,i=n.yearItemNumber,o=n.onYearMouseEnter,c=n.onYearMouseLeave;if(s===void 0)return null;for(var l=ke(s,i),u=l.startPeriod,d=l.endPeriod,f=function(g){e.push(h.createElement("div",{ref:p.YEAR_REFS[g-u],onClick:function(D){t.onYearClick(D,g)},onKeyDown:function(D){tr(D)&&(D.preventDefault(),D.key=w.Enter),t.onYearKeyDown(D,g)},tabIndex:Number(p.getYearTabIndex(g)),className:p.getYearClassNames(g),onMouseEnter:p.props.usePointerEvent?void 0:function(D){return o(D,g)},onPointerEnter:p.props.usePointerEvent?function(D){return o(D,g)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(D){return c(D,g)},onPointerLeave:p.props.usePointerEvent?function(D){return c(D,g)}:void 0,key:g,"aria-current":p.isCurrentYear(g)?"date":void 0},p.getYearContent(g)))},p=this,m=u;m<=d;m++)f(m);return h.createElement("div",{className:"react-datepicker__year"},h.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},e))},r}(b.Component);function Hi(a,r,t,e){for(var n=[],s=0;s<2*r+1;s++){var i=a+r-s,o=!0;t&&(o=S(t)<=i),e&&o&&(o=S(e)>=i),o&&n.push(i)}return n}var Qi=function(a){$(r,a);function r(t){var e=a.call(this,t)||this;e.renderOptions=function(){var o=e.props.year,c=e.state.yearsList.map(function(d){return h.createElement("div",{className:o===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:e.onChange.bind(e,d),"aria-selected":o===d?"true":void 0},o===d?h.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),l=e.props.minDate?S(e.props.minDate):null,u=e.props.maxDate?S(e.props.maxDate):null;return(!u||!e.state.yearsList.find(function(d){return d===u}))&&c.unshift(h.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:e.incrementYears},h.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!l||!e.state.yearsList.find(function(d){return d===l}))&&c.push(h.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:e.decrementYears},h.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},e.onChange=function(o){e.props.onChange(o)},e.handleClickOutside=function(){e.props.onCancel()},e.shiftYears=function(o){var c=e.state.yearsList.map(function(l){return l+o});e.setState({yearsList:c})},e.incrementYears=function(){return e.shiftYears(1)},e.decrementYears=function(){return e.shiftYears(-1)};var n=t.yearDropdownItemNumber,s=t.scrollableYearDropdown,i=n||(s?10:5);return e.state={yearsList:Hi(e.props.year,i,e.props.minDate,e.props.maxDate)},e.dropdownRef=b.createRef(),e}return r.prototype.componentDidMount=function(){var t=this.dropdownRef.current;if(t){var e=t.children?Array.from(t.children):null,n=e?e.find(function(s){return s.ariaSelected}):null;t.scrollTop=n&&n instanceof HTMLElement?n.offsetTop+(n.clientHeight-t.clientHeight)/2:(t.scrollHeight-t.clientHeight)/2}},r.prototype.render=function(){var t=G({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return h.createElement(xt,{className:t,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},r}(b.Component),Bi=function(a){$(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.state={dropdownVisible:!1},t.renderSelectOptions=function(){for(var e=t.props.minDate?S(t.props.minDate):1900,n=t.props.maxDate?S(t.props.maxDate):2100,s=[],i=e;i<=n;i++)s.push(h.createElement("option",{key:i,value:i},i));return s},t.onSelectChange=function(e){t.onChange(parseInt(e.target.value))},t.renderSelectMode=function(){return h.createElement("select",{value:t.props.year,className:"react-datepicker__year-select",onChange:t.onSelectChange},t.renderSelectOptions())},t.renderReadView=function(e){return h.createElement("div",{key:"read",style:{visibility:e?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:function(n){return t.toggleDropdown(n)}},h.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),h.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},t.props.year))},t.renderDropdown=function(){return h.createElement(Qi,T({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 s;(s=t.onSelect)===null||s===void 0||s.call(t,e,n),t.setOpen()},t.onSelect=function(e,n){var s,i;(i=(s=t.props).onSelect)===null||i===void 0||i.call(s,e,n)},t.setOpen=function(){var e,n;(n=(e=t.props).setOpen)===null||n===void 0||n.call(e,!0)},t}return r.prototype.render=function(){var t;switch(this.props.dropdownMode){case"scroll":t=this.renderScrollMode();break;case"select":t=this.renderSelectMode();break}return h.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},t)},r}(b.Component),Ki=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],qi=function(a){var r=(a.className||"").split(/\s+/);return Ki.some(function(t){return r.indexOf(t)>=0})},Vi=function(a){$(r,a);function r(t){var e=a.call(this,t)||this;return e.monthContainer=void 0,e.handleClickOutside=function(n){e.props.onClickOutside(n)},e.setClickOutsideRef=function(){return e.containerRef.current},e.handleDropdownFocus=function(n){var s,i;qi(n.target)&&((i=(s=e.props).onDropdownFocus)===null||i===void 0||i.call(s,n))},e.getDateInView=function(){var n=e.props,s=n.preSelection,i=n.selected,o=n.openToDate,c=Jn(e.props),l=er(e.props),u=R(),d=o||i||s;return d||(c&&Ie(u,c)?c:l&&xe(u,l)?l:u)},e.increaseMonth=function(){e.setState(function(n){var s=n.date;return{date:ie(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.decreaseMonth=function(){e.setState(function(n){var s=n.date;return{date:Oe(s,1)}},function(){return e.handleMonthChange(e.state.date)})},e.handleDayClick=function(n,s,i){e.props.onSelect(n,s,i),e.props.setPreSelection&&e.props.setPreSelection(n)},e.handleDayMouseEnter=function(n){e.setState({selectingDate:n}),e.props.onDayMouseEnter&&e.props.onDayMouseEnter(n)},e.handleMonthMouseLeave=function(){e.setState({selectingDate:void 0}),e.props.onMonthMouseLeave&&e.props.onMonthMouseLeave()},e.handleYearMouseEnter=function(n,s){e.setState({selectingDate:ue(R(),s)}),e.props.onYearMouseEnter&&e.props.onYearMouseEnter(n,s)},e.handleYearMouseLeave=function(n,s){e.props.onYearMouseLeave&&e.props.onYearMouseLeave(n,s)},e.handleYearChange=function(n){var s,i,o,c;(i=(s=e.props).onYearChange)===null||i===void 0||i.call(s,n),e.setState({isRenderAriaLiveMessage:!0}),e.props.adjustDateOnChange&&(e.props.onSelect(n),(c=(o=e.props).setOpen)===null||c===void 0||c.call(o,!0)),e.props.setPreSelection&&e.props.setPreSelection(n)},e.getEnabledPreSelectionDateForMonth=function(n){if(!ae(n,e.props))return n;for(var s=ve(n),i=fi(n),o=In(i,s),c=null,l=0;l<=o;l++){var u=se(s,l);if(!ae(u,e.props)){c=u;break}}return c},e.handleMonthChange=function(n){var s,i,o,c=(s=e.getEnabledPreSelectionDateForMonth(n))!==null&&s!==void 0?s:n;e.handleCustomMonthChange(c),e.props.adjustDateOnChange&&(e.props.onSelect(c),(o=(i=e.props).setOpen)===null||o===void 0||o.call(i,!0)),e.props.setPreSelection&&e.props.setPreSelection(c)},e.handleCustomMonthChange=function(n){var s,i;(i=(s=e.props).onMonthChange)===null||i===void 0||i.call(s,n),e.setState({isRenderAriaLiveMessage:!0})},e.handleMonthYearChange=function(n){e.handleYearChange(n),e.handleMonthChange(n)},e.changeYear=function(n){e.setState(function(s){var i=s.date;return{date:ue(i,Number(n))}},function(){return e.handleYearChange(e.state.date)})},e.changeMonth=function(n){e.setState(function(s){var i=s.date;return{date:re(i,Number(n))}},function(){return e.handleMonthChange(e.state.date)})},e.changeMonthYear=function(n){e.setState(function(s){var i=s.date;return{date:ue(re(i,J(n)),S(n))}},function(){return e.handleMonthYearChange(e.state.date)})},e.header=function(n){n===void 0&&(n=e.state.date);var s=Me(n,e.props.locale,e.props.calendarStartDay),i=[];return e.props.showWeekNumbers&&i.push(h.createElement("div",{key:"W",className:"react-datepicker__day-name"},e.props.weekLabel||"#")),i.concat([0,1,2,3,4,5,6].map(function(o){var c=se(s,o),l=e.formatWeekday(c,e.props.locale),u=e.props.weekDayClassName?e.props.weekDayClassName(c):void 0;return h.createElement("div",{key:o,"aria-label":W(c,"EEEE",e.props.locale),className:G("react-datepicker__day-name",u)},l)}))},e.formatWeekday=function(n,s){return e.props.formatWeekDay?pi(n,e.props.formatWeekDay,s):e.props.useWeekdaysShort?mi(n,s):hi(n,s)},e.decreaseYear=function(){e.setState(function(n){var s,i=n.date;return{date:Qe(i,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.clearSelectingDate=function(){e.setState({selectingDate:void 0})},e.renderPreviousButton=function(){var n,s,i;if(!e.props.renderCustomHeader){var o=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?o-1:0,l=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,u=Oe(e.state.date,l),d;switch(!0){case e.props.showMonthYearPicker:d=yn(e.state.date,e.props);break;case e.props.showYearPicker:d=yi(e.state.date,e.props);break;case e.props.showQuarterYearPicker:d=wi(e.state.date,e.props);break;default:d=wn(u,e.props);break}if(!(!((i=e.props.forceShowMonthNavigation)!==null&&i!==void 0?i:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&d||e.props.showTimeSelectOnly)){var f=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],p=["react-datepicker__navigation","react-datepicker__navigation--previous"],m=e.decreaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(m=e.decreaseYear),d&&e.props.showDisabledMonthNavigation&&(p.push("react-datepicker__navigation--previous--disabled"),m=void 0);var g=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,D=e.props,k=D.previousMonthButtonLabel,x=k===void 0?r.defaultProps.previousMonthButtonLabel:k,C=D.previousYearButtonLabel,O=C===void 0?r.defaultProps.previousYearButtonLabel:C,B=e.props,A=B.previousMonthAriaLabel,I=A===void 0?typeof x=="string"?x:"Previous Month":A,_=B.previousYearAriaLabel,M=_===void 0?typeof O=="string"?O:"Previous Year":_;return h.createElement("button",{type:"button",className:p.join(" "),onClick:m,onKeyDown:e.props.handleOnKeyDown,"aria-label":g?M:I},h.createElement("span",{className:f.join(" ")},g?O:x))}}},e.increaseYear=function(){e.setState(function(n){var s,i=n.date;return{date:me(i,e.props.showYearPicker?(s=e.props.yearItemNumber)!==null&&s!==void 0?s:r.defaultProps.yearItemNumber:1)}},function(){return e.handleYearChange(e.state.date)})},e.renderNextButton=function(){var n;if(!e.props.renderCustomHeader){var s;switch(!0){case e.props.showMonthYearPicker:s=bn(e.state.date,e.props);break;case e.props.showYearPicker:s=bi(e.state.date,e.props);break;case e.props.showQuarterYearPicker:s=vi(e.state.date,e.props);break;default:s=vn(e.state.date,e.props);break}if(!(!((n=e.props.forceShowMonthNavigation)!==null&&n!==void 0?n:r.defaultProps.forceShowMonthNavigation)&&!e.props.showDisabledMonthNavigation&&s||e.props.showTimeSelectOnly)){var i=["react-datepicker__navigation","react-datepicker__navigation--next"],o=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];e.props.showTimeSelect&&i.push("react-datepicker__navigation--next--with-time"),e.props.todayButton&&i.push("react-datepicker__navigation--next--with-today-button");var c=e.increaseMonth;(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker)&&(c=e.increaseYear),s&&e.props.showDisabledMonthNavigation&&(i.push("react-datepicker__navigation--next--disabled"),c=void 0);var l=e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker,u=e.props,d=u.nextMonthButtonLabel,f=d===void 0?r.defaultProps.nextMonthButtonLabel:d,p=u.nextYearButtonLabel,m=p===void 0?r.defaultProps.nextYearButtonLabel:p,g=e.props,D=g.nextMonthAriaLabel,k=D===void 0?typeof f=="string"?f:"Next Month":D,x=g.nextYearAriaLabel,C=x===void 0?typeof m=="string"?m:"Next Year":x;return h.createElement("button",{type:"button",className:i.join(" "),onClick:c,onKeyDown:e.props.handleOnKeyDown,"aria-label":l?C:k},h.createElement("span",{className:o.join(" ")},l?m:f))}}},e.renderCurrentMonth=function(n){n===void 0&&(n=e.state.date);var s=["react-datepicker__current-month"];return e.props.showYearDropdown&&s.push("react-datepicker__current-month--hasYearDropdown"),e.props.showMonthDropdown&&s.push("react-datepicker__current-month--hasMonthDropdown"),e.props.showMonthYearDropdown&&s.push("react-datepicker__current-month--hasMonthYearDropdown"),h.createElement("h2",{className:s.join(" ")},W(n,e.props.dateFormat,e.props.locale))},e.renderYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showYearDropdown||n))return h.createElement(Bi,T({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeYear,year:S(e.state.date)}))},e.renderMonthDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthDropdown||n))return h.createElement(Ii,T({},r.defaultProps,e.props,{month:J(e.state.date),onChange:e.changeMonth}))},e.renderMonthYearDropdown=function(n){if(n===void 0&&(n=!1),!(!e.props.showMonthYearDropdown||n))return h.createElement(Fi,T({},r.defaultProps,e.props,{date:e.state.date,onChange:e.changeMonthYear}))},e.handleTodayButtonClick=function(n){e.props.onSelect(pn(),n),e.props.setPreSelection&&e.props.setPreSelection(pn())},e.renderTodayButton=function(){if(!(!e.props.todayButton||e.props.showTimeSelectOnly))return h.createElement("div",{className:"react-datepicker__today-button",onClick:e.handleTodayButtonClick},e.props.todayButton)},e.renderDefaultHeader=function(n){var s=n.monthDate,i=n.i;return h.createElement("div",{className:"react-datepicker__header ".concat(e.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},e.renderCurrentMonth(s),h.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(e.props.dropdownMode),onFocus:e.handleDropdownFocus},e.renderMonthDropdown(i!==0),e.renderMonthYearDropdown(i!==0),e.renderYearDropdown(i!==0)),h.createElement("div",{className:"react-datepicker__day-names"},e.header(s)))},e.renderCustomHeader=function(n){var s,i,o=n.monthDate,c=n.i;if(e.props.showTimeSelect&&!e.state.monthContainer||e.props.showTimeSelectOnly)return null;var l=wn(e.state.date,e.props),u=vn(e.state.date,e.props),d=yn(e.state.date,e.props),f=bn(e.state.date,e.props),p=!e.props.showMonthYearPicker&&!e.props.showQuarterYearPicker&&!e.props.showYearPicker;return h.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:e.props.onDropdownFocus},(i=(s=e.props).renderCustomHeader)===null||i===void 0?void 0:i.call(s,T(T({},e.state),{customHeaderCount:c,monthDate:o,changeMonth:e.changeMonth,changeYear:e.changeYear,decreaseMonth:e.decreaseMonth,increaseMonth:e.increaseMonth,decreaseYear:e.decreaseYear,increaseYear:e.increaseYear,prevMonthButtonDisabled:l,nextMonthButtonDisabled:u,prevYearButtonDisabled:d,nextYearButtonDisabled:f})),p&&h.createElement("div",{className:"react-datepicker__day-names"},e.header(o)))},e.renderYearHeader=function(n){var s=n.monthDate,i=e.props,o=i.showYearPicker,c=i.yearItemNumber,l=c===void 0?r.defaultProps.yearItemNumber:c,u=ke(s,l),d=u.startPeriod,f=u.endPeriod;return h.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},o?"".concat(d," - ").concat(f):S(s))},e.renderHeader=function(n){var s=n.monthDate,i=n.i,o=i===void 0?0:i,c={monthDate:s,i:o};switch(!0){case e.props.renderCustomHeader!==void 0:return e.renderCustomHeader(c);case(e.props.showMonthYearPicker||e.props.showQuarterYearPicker||e.props.showYearPicker):return e.renderYearHeader(c);default:return e.renderDefaultHeader(c)}},e.renderMonths=function(){var n,s;if(!(e.props.showTimeSelectOnly||e.props.showYearPicker)){for(var i=[],o=(n=e.props.monthsShown)!==null&&n!==void 0?n:r.defaultProps.monthsShown,c=e.props.showPreviousMonths?o-1:0,l=e.props.showMonthYearPicker||e.props.showQuarterYearPicker?me(e.state.date,c):Oe(e.state.date,c),u=(s=e.props.monthSelectedIn)!==null&&s!==void 0?s:c,d=0;d0;i.push(h.createElement("div",{key:m,ref:function(k){e.monthContainer=k??void 0},className:"react-datepicker__month-container"},e.renderHeader({monthDate:p,i:d}),h.createElement(Ni,T({},r.defaultProps,e.props,{containerRef:e.containerRef,ariaLabelPrefix:e.props.monthAriaLabelPrefix,day:p,onDayClick:e.handleDayClick,handleOnKeyDown:e.props.handleOnDayKeyDown,handleOnMonthKeyDown:e.props.handleOnKeyDown,onDayMouseEnter:e.handleDayMouseEnter,onMouseLeave:e.handleMonthMouseLeave,orderInDisplay:d,selectingDate:e.state.selectingDate,monthShowsDuplicateDaysEnd:g,monthShowsDuplicateDaysStart:D}))))}return i}},e.renderYears=function(){if(!e.props.showTimeSelectOnly&&e.props.showYearPicker)return h.createElement("div",{className:"react-datepicker__year--container"},e.renderHeader({monthDate:e.state.date}),h.createElement(Ai,T({},r.defaultProps,e.props,{selectingDate:e.state.selectingDate,date:e.state.date,onDayClick:e.handleDayClick,clearSelectingDate:e.clearSelectingDate,onYearMouseEnter:e.handleYearMouseEnter,onYearMouseLeave:e.handleYearMouseLeave})))},e.renderTimeSection=function(){if(e.props.showTimeSelect&&(e.state.monthContainer||e.props.showTimeSelectOnly))return h.createElement(Wi,T({},r.defaultProps,e.props,{onChange:e.props.onTimeChange,format:e.props.timeFormat,intervals:e.props.timeIntervals,monthRef:e.state.monthContainer}))},e.renderInputTimeSection=function(){var n=e.props.selected?new Date(e.props.selected):void 0,s=n&&St(n)&&!!e.props.selected,i=s?"".concat(_n(n.getHours()),":").concat(_n(n.getMinutes())):"";if(e.props.showTimeInput)return h.createElement(Si,T({},r.defaultProps,e.props,{date:n,timeString:i,onChange:e.props.onTimeChange}))},e.renderAriaLiveRegion=function(){var n,s=ke(e.state.date,(n=e.props.yearItemNumber)!==null&&n!==void 0?n:r.defaultProps.yearItemNumber),i=s.startPeriod,o=s.endPeriod,c;return e.props.showYearPicker?c="".concat(i," - ").concat(o):e.props.showMonthYearPicker||e.props.showQuarterYearPicker?c=S(e.state.date):c="".concat(Xt(J(e.state.date),e.props.locale)," ").concat(S(e.state.date)),h.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},e.state.isRenderAriaLiveMessage&&c)},e.renderChildren=function(){if(e.props.children)return h.createElement("div",{className:"react-datepicker__children-container"},e.props.children)},e.containerRef=b.createRef(),e.state={date:e.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},e}return Object.defineProperty(r,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:rt}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){var t=this;this.props.showTimeSelect&&(this.assignMonthContainer=function(){t.setState({monthContainer:t.monthContainer})}())},r.prototype.componentDidUpdate=function(t){var e=this;if(this.props.preSelection&&(!E(this.props.preSelection,t.preSelection)||this.props.monthSelectedIn!==t.monthSelectedIn)){var n=!Z(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return n&&e.handleCustomMonthChange(e.state.date)})}else this.props.openToDate&&!E(this.props.openToDate,t.openToDate)&&this.setState({date:this.props.openToDate})},r.prototype.render=function(){var t=this.props.container||si;return h.createElement(xt,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},h.createElement("div",{style:{display:"contents"},ref:this.containerRef},h.createElement(t,{className:G("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly},this.renderAriaLiveRegion(),this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},r}(b.Component),Ui=function(a){var r=a.icon,t=a.className,e=t===void 0?"":t,n=a.onClick,s="react-datepicker__calendar-icon";if(typeof r=="string")return h.createElement("i",{className:"".concat(s," ").concat(r," ").concat(e),"aria-hidden":"true",onClick:n});if(h.isValidElement(r)){var i=r;return h.cloneElement(i,{className:"".concat(i.props.className||""," ").concat(s," ").concat(e),onClick:function(o){typeof i.props.onClick=="function"&&i.props.onClick(o),typeof n=="function"&&n(o)}})}return h.createElement("svg",{className:"".concat(s," ").concat(e),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:n},h.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"}))},nr=function(a){$(r,a);function r(t){var e=a.call(this,t)||this;return e.portalRoot=null,e.el=document.createElement("div"),e}return r.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)},r.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},r.prototype.render=function(){return or.createPortal(this.props.children,this.el)},r}(b.Component),ji="[tabindex], a, button, input, select, textarea",Xi=function(a){return(a instanceof HTMLAnchorElement||!a.disabled)&&a.tabIndex!==-1},rr=function(a){$(r,a);function r(t){var e=a.call(this,t)||this;return e.getTabChildren=function(){var n;return Array.prototype.slice.call((n=e.tabLoopRef.current)===null||n===void 0?void 0:n.querySelectorAll(ji),1,-1).filter(Xi)},e.handleFocusStart=function(){var n=e.getTabChildren();n&&n.length>1&&n[n.length-1].focus()},e.handleFocusEnd=function(){var n=e.getTabChildren();n&&n.length>1&&n[0].focus()},e.tabLoopRef=b.createRef(),e}return r.prototype.render=function(){var t;return((t=this.props.enableTabLoop)!==null&&t!==void 0?t:r.defaultProps.enableTabLoop)?h.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},h.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,h.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},r.defaultProps={enableTabLoop:!0},r}(b.Component);function $i(a){var r=function(t){var e,n=typeof t.hidePopper=="boolean"?t.hidePopper:!0,s=b.useRef(null),i=ai(T({open:!n,whileElementsMounted:lr,placement:t.popperPlacement,middleware:pe([dr({padding:15}),fr(10),pr({element:s})],(e=t.popperModifiers)!==null&&e!==void 0?e:[],!0)},t.popperProps)),o=T(T({},t),{hidePopper:n,popperProps:T(T({},i),{arrowRef:s})});return h.createElement(a,T({},o))};return r}var Gi=function(a){$(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r,"defaultProps",{get:function(){return{hidePopper:!0}},enumerable:!1,configurable:!0}),r.prototype.render=function(){var t=this.props,e=t.className,n=t.wrapperClassName,s=t.hidePopper,i=s===void 0?r.defaultProps.hidePopper:s,o=t.popperComponent,c=t.targetComponent,l=t.enableTabLoop,u=t.popperOnKeyDown,d=t.portalId,f=t.portalHost,p=t.popperProps,m=t.showArrow,g=void 0;if(!i){var D=G("react-datepicker-popper",e);g=h.createElement(rr,{enableTabLoop:l},h.createElement("div",{ref:p.refs.setFloating,style:p.floatingStyles,className:D,"data-placement":p.placement,onKeyDown:u},o,m&&h.createElement(zs,{ref:p.arrowRef,context:p.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}this.props.popperContainer&&(g=b.createElement(this.props.popperContainer,{},g)),d&&!i&&(g=h.createElement(nr,{portalId:d,portalHost:f},g));var k=G("react-datepicker-wrapper",n);return h.createElement(h.Fragment,null,h.createElement("div",{ref:p.refs.setReference,className:k},c),g)},r}(b.Component),zi=$i(Gi),En="react-datepicker-ignore-onclickoutside";function Zi(a,r){return a&&r?J(a)!==J(r)||S(a)!==S(r):a!==r}var Yt="Date input not valid.",lo=function(a){$(r,a);function r(t){var e=a.call(this,t)||this;return e.calendar=null,e.input=null,e.getPreSelection=function(){return e.props.openToDate?e.props.openToDate:e.props.selectsEnd&&e.props.startDate?e.props.startDate:e.props.selectsStart&&e.props.endDate?e.props.endDate:R()},e.modifyHolidays=function(){var n;return(n=e.props.holidays)===null||n===void 0?void 0:n.reduce(function(s,i){var o=new Date(i.date);return St(o)?pe(pe([],s,!0),[T(T({},i),{date:o})],!1):s},[])},e.calcInitialState=function(){var n,s=e.getPreSelection(),i=Jn(e.props),o=er(e.props),c=i&&Ie(s,mt(i))?i:o&&xe(s,hn(o))?o:s;return{open:e.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:(n=e.props.selectsRange?e.props.startDate:e.props.selected)!==null&&n!==void 0?n:c,highlightDates:kn(e.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},e.resetHiddenStatus=function(){e.setState(T(T({},e.state),{wasHidden:!1}))},e.setHiddenStatus=function(){e.setState(T(T({},e.state),{wasHidden:!0}))},e.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&e.setHiddenStatus()},e.clearPreventFocusTimeout=function(){e.preventFocusTimeout&&clearTimeout(e.preventFocusTimeout)},e.setFocus=function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.focus)===null||s===void 0||s.call(n,{preventScroll:!0})},e.setBlur=function(){var n,s;(s=(n=e.input)===null||n===void 0?void 0:n.blur)===null||s===void 0||s.call(n),e.cancelFocusInput()},e.deferBlur=function(){requestAnimationFrame(function(){e.setBlur()})},e.setOpen=function(n,s){s===void 0&&(s=!1),e.setState({open:n,preSelection:n&&e.state.open?e.state.preSelection:e.calcInitialState().preSelection,lastPreSelectChange:It},function(){n||e.setState(function(i){return{focused:s?i.focused:!1}},function(){!s&&e.deferBlur(),e.setState({inputValue:null})})})},e.inputOk=function(){return ge(e.state.preSelection)},e.isCalendarOpen=function(){return e.props.open===void 0?e.state.open&&!e.props.disabled&&!e.props.readOnly:e.props.open},e.handleFocus=function(n){var s,i,o=e.state.wasHidden,c=o?e.state.open:!0;o&&e.resetHiddenStatus(),e.state.preventFocus||((i=(s=e.props).onFocus)===null||i===void 0||i.call(s,n),c&&!e.props.preventOpenOnFocus&&!e.props.readOnly&&e.setOpen(!0)),e.setState({focused:!0})},e.sendFocusBackToInput=function(){e.preventFocusTimeout&&e.clearPreventFocusTimeout(),e.setState({preventFocus:!0},function(){e.preventFocusTimeout=setTimeout(function(){e.setFocus(),e.setState({preventFocus:!1})})})},e.cancelFocusInput=function(){clearTimeout(e.inputFocusTimeout),e.inputFocusTimeout=void 0},e.deferFocusInput=function(){e.cancelFocusInput(),e.inputFocusTimeout=setTimeout(function(){return e.setFocus()},1)},e.handleDropdownFocus=function(){e.cancelFocusInput()},e.handleBlur=function(n){var s,i;(!e.state.open||e.props.withPortal||e.props.showTimeInput)&&((i=(s=e.props).onBlur)===null||i===void 0||i.call(s,n)),e.state.open&&e.props.open===!1&&e.setOpen(!1),e.setState({focused:!1})},e.handleCalendarClickOutside=function(n){var s,i;e.props.inline||e.setOpen(!1),(i=(s=e.props).onClickOutside)===null||i===void 0||i.call(s,n),e.props.withPortal&&n.preventDefault()},e.handleChange=function(){for(var n,s,i,o,c,l=[],u=0;u=H){oe=F;break}f&&oep&&(te=w.ArrowLeft,oe=ae(p,e.props)?_(te,oe):p),ae(oe,e.props)?((te===w.PageUp||te===w.Home)&&(te=w.ArrowRight),(te===w.PageDown||te===w.End)&&(te=w.ArrowLeft),oe=_(te,oe)):Ke=!0,Gt++}return oe};if(B===w.Enter){n.preventDefault(),e.handleSelect(I,n),!D&&e.setPreSelection(I);return}else if(B===w.Escape){n.preventDefault(),e.setOpen(!1),e.inputOk()||(c=(o=e.props).onInputError)===null||c===void 0||c.call(o,{code:1,msg:Yt});return}var L=null;switch(B){case w.ArrowLeft:case w.ArrowRight:case w.ArrowUp:case w.ArrowDown:case w.PageUp:case w.PageDown:case w.Home:case w.End:L=M(B,I);break}if(!L){(u=(l=e.props).onInputError)===null||u===void 0||u.call(l,{code:1,msg:Yt});return}if(n.preventDefault(),e.setState({lastPreSelectChange:It}),C&&e.setSelected(L),e.setPreSelection(L),O){var j=J(I),K=J(L),z=S(I),ce=S(L);j!==K||z!==ce?e.setState({shouldFocusDayInline:!0}):e.setState({shouldFocusDayInline:!1})}}},e.onPopperKeyDown=function(n){var s=n.key;s===w.Escape&&(n.preventDefault(),e.sendFocusBackToInput())},e.onClearClick=function(n){n&&n.preventDefault&&n.preventDefault(),e.sendFocusBackToInput();var s=e.props,i=s.selectsRange,o=s.onChange;i?o==null||o([null,null],n):o==null||o(null,n),e.setState({inputValue:null})},e.clear=function(){e.onClearClick()},e.onScroll=function(n){typeof e.props.closeOnScroll=="boolean"&&e.props.closeOnScroll?(n.target===document||n.target===document.documentElement||n.target===document.body)&&e.setOpen(!1):typeof e.props.closeOnScroll=="function"&&e.props.closeOnScroll(n)&&e.setOpen(!1)},e.renderCalendar=function(){var n,s;return!e.props.inline&&!e.isCalendarOpen()?null:h.createElement(Vi,T({showMonthYearDropdown:void 0,ref:function(i){e.calendar=i}},e.props,e.state,{setOpen:e.setOpen,dateFormat:(n=e.props.dateFormatCalendar)!==null&&n!==void 0?n:r.defaultProps.dateFormatCalendar,onSelect:e.handleSelect,onClickOutside:e.handleCalendarClickOutside,holidays:_i(e.modifyHolidays()),outsideClickIgnoreClass:En,onDropdownFocus:e.handleDropdownFocus,onTimeChange:e.handleTimeChange,className:e.props.calendarClassName,container:e.props.calendarContainer,handleOnKeyDown:e.props.onKeyDown,handleOnDayKeyDown:e.onDayKeyDown,setPreSelection:e.setPreSelection,dropdownMode:(s=e.props.dropdownMode)!==null&&s!==void 0?s:r.defaultProps.dropdownMode}),e.props.children)},e.renderAriaLiveRegion=function(){var n=e.props,s=n.dateFormat,i=s===void 0?r.defaultProps.dateFormat:s,o=n.locale,c=e.props.showTimeInput||e.props.showTimeSelect,l=c?"PPPPp":"PPPP",u;return e.props.selectsRange?u="Selected start date: ".concat(ne(e.props.startDate,{dateFormat:l,locale:o}),". ").concat(e.props.endDate?"End date: "+ne(e.props.endDate,{dateFormat:l,locale:o}):""):e.props.showTimeSelectOnly?u="Selected time: ".concat(ne(e.props.selected,{dateFormat:i,locale:o})):e.props.showYearPicker?u="Selected year: ".concat(ne(e.props.selected,{dateFormat:"yyyy",locale:o})):e.props.showMonthYearPicker?u="Selected month: ".concat(ne(e.props.selected,{dateFormat:"MMMM yyyy",locale:o})):e.props.showQuarterYearPicker?u="Selected quarter: ".concat(ne(e.props.selected,{dateFormat:"yyyy, QQQ",locale:o})):u="Selected date: ".concat(ne(e.props.selected,{dateFormat:l,locale:o})),h.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},u)},e.renderDateInput=function(){var n,s,i,o=G(e.props.className,(n={},n[En]=e.state.open,n)),c=e.props.customInput||h.createElement("input",{type:"text"}),l=e.props.customInputRef||"ref",u=e.props,d=u.dateFormat,f=d===void 0?r.defaultProps.dateFormat:d,p=u.locale,m=typeof e.props.value=="string"?e.props.value:typeof e.state.inputValue=="string"?e.state.inputValue:e.props.selectsRange?oi(e.props.startDate,e.props.endDate,{dateFormat:f,locale:p}):e.props.selectsMultiple?ci((i=e.props.selectedDates)!==null&&i!==void 0?i:[],{dateFormat:f,locale:p}):ne(e.props.selected,{dateFormat:f,locale:p});return b.cloneElement(c,(s={},s[l]=function(g){e.input=g},s.value=m,s.onBlur=e.handleBlur,s.onChange=e.handleChange,s.onClick=e.onInputClick,s.onFocus=e.handleFocus,s.onKeyDown=e.onInputKeyDown,s.id=e.props.id,s.name=e.props.name,s.form=e.props.form,s.autoFocus=e.props.autoFocus,s.placeholder=e.props.placeholderText,s.disabled=e.props.disabled,s.autoComplete=e.props.autoComplete,s.className=G(c.props.className,o),s.title=e.props.title,s.readOnly=e.props.readOnly,s.required=e.props.required,s.tabIndex=e.props.tabIndex,s["aria-describedby"]=e.props.ariaDescribedBy,s["aria-invalid"]=e.props.ariaInvalid,s["aria-labelledby"]=e.props.ariaLabelledBy,s["aria-required"]=e.props.ariaRequired,s))},e.renderClearButton=function(){var n=e.props,s=n.isClearable,i=n.disabled,o=n.selected,c=n.startDate,l=n.endDate,u=n.clearButtonTitle,d=n.clearButtonClassName,f=d===void 0?"":d,p=n.ariaLabelClose,m=p===void 0?"Close":p,g=n.selectedDates;return s&&(o!=null||c!=null||l!=null||g!=null&&g.length)?h.createElement("button",{type:"button",className:G("react-datepicker__close-icon",f,{"react-datepicker__close-icon--disabled":i}),disabled:i,"aria-label":m,onClick:e.onClearClick,title:u,tabIndex:-1}):null},e.state=e.calcInitialState(),e.preventFocusTimeout=void 0,e}return Object.defineProperty(r,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,readOnly:!1,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:rt,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),r.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.componentDidUpdate=function(t,e){var n,s,i,o;t.inline&&Zi(t.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&t.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),t.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:kn(this.props.highlightDates)}),!e.focused&&!Pe(t.selected,this.props.selected)&&this.setState({inputValue:null}),e.open!==this.state.open&&(e.open===!1&&this.state.open===!0&&((s=(n=this.props).onCalendarOpen)===null||s===void 0||s.call(n)),e.open===!0&&this.state.open===!1&&((o=(i=this.props).onCalendarClose)===null||o===void 0||o.call(i)))},r.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},r.prototype.renderInputContainer=function(){var t=this.props,e=t.showIcon,n=t.icon,s=t.calendarIconClassname,i=t.calendarIconClassName,o=t.toggleCalendarOnIconClick,c=this.state.open;return s&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),h.createElement("div",{className:"react-datepicker__input-container".concat(e?" react-datepicker__view-calendar-icon":"")},e&&h.createElement(Ui,T({icon:n,className:G(i,!i&&s,c&&"react-datepicker-ignore-onclickoutside")},o?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},r.prototype.render=function(){var t=this.renderCalendar();if(this.props.inline)return t;if(this.props.withPortal){var e=this.state.open?h.createElement(rr,{enableTabLoop:this.props.enableTabLoop},h.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},t)):null;return this.state.open&&this.props.portalId&&(e=h.createElement(nr,T({portalId:this.props.portalId},this.props),e)),h.createElement("div",null,this.renderInputContainer(),e)}return h.createElement(zi,T({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:t,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow}))},r}(b.Component),Ji="input",It="navigate";export{lo as D,oo as a,ao as b,on as c,ba as d,co as e,so as f,io as g,uo as h,vt as i,Es as p}; diff --git a/pkg/ui/frontend/dist/assets/form-libs-B6JBoFJD.js b/pkg/ui/frontend/dist/assets/form-libs-B6JBoFJD.js deleted file mode 100644 index 30d726f4e1..0000000000 --- a/pkg/ui/frontend/dist/assets/form-libs-B6JBoFJD.js +++ /dev/null @@ -1 +0,0 @@ -import{b as I}from"./react-core-D_V7s-9r.js";var Ge=r=>r.type==="checkbox",Ae=r=>r instanceof Date,H=r=>r==null;const mr=r=>typeof r=="object";var j=r=>!H(r)&&!Array.isArray(r)&&mr(r)&&!Ae(r),pr=r=>j(r)&&r.target?Ge(r.target)?r.target.checked:r.target.value:r,$r=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,yr=(r,e)=>r.has($r(e)),Ur=r=>{const e=r.constructor&&r.constructor.prototype;return j(e)&&e.hasOwnProperty("isPrototypeOf")},jt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function G(r){let e;const t=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)e=new Date(r);else if(r instanceof Set)e=new Set(r);else if(!(jt&&(r instanceof Blob||s))&&(t||j(r)))if(e=t?[]:{},!t&&!Ur(r))e=r;else for(const n in r)r.hasOwnProperty(n)&&(e[n]=G(r[n]));else return r;return e}var _t=r=>Array.isArray(r)?r.filter(Boolean):[],Z=r=>r===void 0,p=(r,e,t)=>{if(!e||!j(r))return t;const s=_t(e.split(/[,[\].]+?/)).reduce((n,a)=>H(n)?n:n[a],r);return Z(s)||s===r?Z(r[e])?t:r[e]:s},re=r=>typeof r=="boolean",Mt=r=>/^\w*$/.test(r),_r=r=>_t(r.replace(/["|']|\]/g,"").split(/\.|\[/)),F=(r,e,t)=>{let s=-1;const n=Mt(e)?[e]:_r(e),a=n.length,i=a-1;for(;++sI.useContext(gr),Fs=r=>{const{children:e,...t}=r;return I.createElement(gr.Provider,{value:t},e)};var vr=(r,e,t,s=!0)=>{const n={defaultValues:e._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const i=a;return e._proxyFormState[i]!==ae.all&&(e._proxyFormState[i]=!s||ae.all),t&&(t[i]=!0),r[i]}});return n},X=r=>j(r)&&!Object.keys(r).length,xr=(r,e,t,s)=>{t(r);const{name:n,...a}=r;return X(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(i=>e[i]===(!s||ae.all))},ze=r=>Array.isArray(r)?r:[r],br=(r,e,t)=>!r||!e||r===e||ze(r).some(s=>s&&(t?s===e:s.startsWith(e)||e.startsWith(s)));function Pt(r){const e=I.useRef(r);e.current=r,I.useEffect(()=>{const t=!r.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{t&&t.unsubscribe()}},[r.disabled])}function Br(r){const e=Lt(),{control:t=e.control,disabled:s,name:n,exact:a}=r,[i,d]=I.useState(t._formState),c=I.useRef(!0),h=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),y=I.useRef(n);return y.current=n,Pt({disabled:s,next:k=>c.current&&br(y.current,k.name,a)&&xr(k,h.current,t._updateFormState)&&d({...t._formState,...k}),subject:t._subjects.state}),I.useEffect(()=>(c.current=!0,h.current.isValid&&t._updateValid(!0),()=>{c.current=!1}),[t]),I.useMemo(()=>vr(i,t,h.current,!1),[i,t])}var ue=r=>typeof r=="string",kr=(r,e,t,s,n)=>ue(r)?(s&&e.watch.add(r),p(t,r,n)):Array.isArray(r)?r.map(a=>(s&&e.watch.add(a),p(t,a))):(s&&(e.watchAll=!0),t);function zr(r){const e=Lt(),{control:t=e.control,name:s,defaultValue:n,disabled:a,exact:i}=r,d=I.useRef(s);d.current=s,Pt({disabled:a,subject:t._subjects.values,next:y=>{br(d.current,y.name,i)&&h(G(kr(d.current,t._names,y.values||t._formValues,!1,n)))}});const[c,h]=I.useState(t._getWatch(s,n));return I.useEffect(()=>t._removeUnmounted()),c}function Wr(r){const e=Lt(),{name:t,disabled:s,control:n=e.control,shouldUnregister:a}=r,i=yr(n._names.array,t),d=zr({control:n,name:t,defaultValue:p(n._formValues,t,p(n._defaultValues,t,r.defaultValue)),exact:!0}),c=Br({control:n,name:t,exact:!0}),h=I.useRef(n.register(t,{...r.rules,value:d,...re(r.disabled)?{disabled:r.disabled}:{}})),y=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!p(c.errors,t)},isDirty:{enumerable:!0,get:()=>!!p(c.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!p(c.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!p(c.validatingFields,t)},error:{enumerable:!0,get:()=>p(c.errors,t)}}),[c,t]),k=I.useMemo(()=>({name:t,value:d,...re(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:M=>h.current.onChange({target:{value:pr(M),name:t},type:et.CHANGE}),onBlur:()=>h.current.onBlur({target:{value:p(n._formValues,t),name:t},type:et.BLUR}),ref:M=>{const Y=p(n._fields,t);Y&&M&&(Y._f.ref={focus:()=>M.focus(),select:()=>M.select(),setCustomValidity:z=>M.setCustomValidity(z),reportValidity:()=>M.reportValidity()})}}),[t,n._formValues,s,c.disabled,d,n._fields]);return I.useEffect(()=>{const M=n._options.shouldUnregister||a,Y=(z,q)=>{const K=p(n._fields,z);K&&K._f&&(K._f.mount=q)};if(Y(t,!0),M){const z=G(p(n._options.defaultValues,t));F(n._defaultValues,t,z),Z(p(n._formValues,t))&&F(n._formValues,t,z)}return!i&&n.register(t),()=>{(i?M&&!n._state.action:M)?n.unregister(t):Y(t,!1)}},[t,n,i,a]),I.useEffect(()=>{n._updateDisabledField({disabled:s,fields:n._fields,name:t})},[s,t,n]),I.useMemo(()=>({field:k,formState:c,fieldState:y}),[k,c,y])}const Is=r=>r.render(Wr(r));var qr=(r,e,t,s,n)=>e?{...t[r],types:{...t[r]&&t[r].types?t[r].types:{},[s]:n||!0}}:{},er=r=>({isOnSubmit:!r||r===ae.onSubmit,isOnBlur:r===ae.onBlur,isOnChange:r===ae.onChange,isOnAll:r===ae.all,isOnTouch:r===ae.onTouched}),tr=(r,e,t)=>!t&&(e.watchAll||e.watch.has(r)||[...e.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const We=(r,e,t,s)=>{for(const n of t||Object.keys(r)){const a=p(r,n);if(a){const{_f:i,...d}=a;if(i){if(i.refs&&i.refs[0]&&e(i.refs[0],n)&&!s)return!0;if(i.ref&&e(i.ref,i.name)&&!s)return!0;if(We(d,e))break}else if(j(d)&&We(d,e))break}}};var Hr=(r,e,t)=>{const s=ze(p(r,t));return F(s,"root",e[t]),F(r,t,s),r},$t=r=>r.type==="file",ie=r=>typeof r=="function",tt=r=>{if(!jt)return!1;const e=r?r.ownerDocument:0;return r instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},Ke=r=>ue(r),Ut=r=>r.type==="radio",rt=r=>r instanceof RegExp;const rr={value:!1,isValid:!1},sr={value:!0,isValid:!0};var wr=r=>{if(Array.isArray(r)){if(r.length>1){const e=r.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!Z(r[0].attributes.value)?Z(r[0].value)||r[0].value===""?sr:{value:r[0].value,isValid:!0}:sr:rr}return rr};const nr={isValid:!1,value:null};var Ar=r=>Array.isArray(r)?r.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,nr):nr;function ar(r,e,t="validate"){if(Ke(r)||Array.isArray(r)&&r.every(Ke)||re(r)&&!r)return{type:t,message:Ke(r)?r:"",ref:e}}var Ee=r=>j(r)&&!rt(r)?r:{value:r,message:""},ir=async(r,e,t,s,n,a)=>{const{ref:i,refs:d,required:c,maxLength:h,minLength:y,min:k,max:M,pattern:Y,validate:z,name:q,valueAsNumber:K,mount:ge}=r._f,R=p(t,q);if(!ge||e.has(q))return{};const le=d?d[0]:i,ce=E=>{n&&le.reportValidity&&(le.setCustomValidity(re(E)?"":E||""),le.reportValidity())},L={},Ce=Ut(i),Xe=Ge(i),we=Ce||Xe,Ve=(K||$t(i))&&Z(i.value)&&Z(R)||tt(i)&&i.value===""||R===""||Array.isArray(R)&&!R.length,ee=qr.bind(null,q,s,L),Qe=(E,N,P,W=fe.maxLength,ne=fe.minLength)=>{const te=E?N:P;L[q]={type:E?W:ne,message:te,ref:i,...ee(E?W:ne,te)}};if(a?!Array.isArray(R)||!R.length:c&&(!we&&(Ve||H(R))||re(R)&&!R||Xe&&!wr(d).isValid||Ce&&!Ar(d).isValid)){const{value:E,message:N}=Ke(c)?{value:!!c,message:c}:Ee(c);if(E&&(L[q]={type:fe.required,message:N,ref:le,...ee(fe.required,N)},!s))return ce(N),L}if(!Ve&&(!H(k)||!H(M))){let E,N;const P=Ee(M),W=Ee(k);if(!H(R)&&!isNaN(R)){const ne=i.valueAsNumber||R&&+R;H(P.value)||(E=ne>P.value),H(W.value)||(N=nenew Date(new Date().toDateString()+" "+Me),Ze=i.type=="time",je=i.type=="week";ue(P.value)&&R&&(E=Ze?te(R)>te(P.value):je?R>P.value:ne>new Date(P.value)),ue(W.value)&&R&&(N=Ze?te(R)+E.value,W=!H(N.value)&&R.length<+N.value;if((P||W)&&(Qe(P,E.message,N.message),!s))return ce(L[q].message),L}if(Y&&!Ve&&ue(R)){const{value:E,message:N}=Ee(Y);if(rt(E)&&!R.match(E)&&(L[q]={type:fe.pattern,message:N,ref:i,...ee(fe.pattern,N)},!s))return ce(N),L}if(z){if(ie(z)){const E=await z(R,t),N=ar(E,le);if(N&&(L[q]={...N,...ee(fe.validate,N.message)},!s))return ce(N.message),L}else if(j(z)){let E={};for(const N in z){if(!X(E)&&!s)break;const P=ar(await z[N](R,t),le,N);P&&(E={...P,...ee(N,P.message)},ce(P.message),s&&(L[q]=E))}if(!X(E)&&(L[q]={ref:le,...E},!s))return L}}return ce(!0),L};function Jr(r,e){const t=e.slice(0,-1).length;let s=0;for(;s{let r=[];return{get observers(){return r},next:n=>{for(const a of r)a.next&&a.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(a=>a!==n)}}),unsubscribe:()=>{r=[]}}},Ct=r=>H(r)||!mr(r);function be(r,e){if(Ct(r)||Ct(e))return r===e;if(Ae(r)&&Ae(e))return r.getTime()===e.getTime();const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const n of t){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const i=e[n];if(Ae(a)&&Ae(i)||j(a)&&j(i)||Array.isArray(a)&&Array.isArray(i)?!be(a,i):a!==i)return!1}}return!0}var Sr=r=>r.type==="select-multiple",Gr=r=>Ut(r)||Ge(r),At=r=>tt(r)&&r.isConnected,Tr=r=>{for(const e in r)if(ie(r[e]))return!0;return!1};function st(r,e={}){const t=Array.isArray(r);if(j(r)||t)for(const s in r)Array.isArray(r[s])||j(r[s])&&!Tr(r[s])?(e[s]=Array.isArray(r[s])?[]:{},st(r[s],e[s])):H(r[s])||(e[s]=!0);return e}function Cr(r,e,t){const s=Array.isArray(r);if(j(r)||s)for(const n in r)Array.isArray(r[n])||j(r[n])&&!Tr(r[n])?Z(e)||Ct(t[n])?t[n]=Array.isArray(r[n])?st(r[n],[]):{...st(r[n])}:Cr(r[n],H(e)?{}:e[n],t[n]):t[n]=!be(r[n],e[n]);return t}var Le=(r,e)=>Cr(r,e,st(e)),Vr=(r,{valueAsNumber:e,valueAsDate:t,setValueAs:s})=>Z(r)?r:e?r===""?NaN:r&&+r:t&&ue(r)?new Date(r):s?s(r):r;function St(r){const e=r.ref;return $t(e)?e.files:Ut(e)?Ar(r.refs).value:Sr(e)?[...e.selectedOptions].map(({value:t})=>t):Ge(e)?wr(r.refs).value:Vr(Z(e.value)?r.ref.value:e.value,r)}var Xr=(r,e,t,s)=>{const n={};for(const a of r){const i=p(e,a);i&&F(n,a,i._f)}return{criteriaMode:t,names:[...r],fields:n,shouldUseNativeValidation:s}},Pe=r=>Z(r)?r:rt(r)?r.source:j(r)?rt(r.value)?r.value.source:r.value:r;const ur="AsyncFunction";var Qr=r=>!!r&&!!r.validate&&!!(ie(r.validate)&&r.validate.constructor.name===ur||j(r.validate)&&Object.values(r.validate).find(e=>e.constructor.name===ur)),Kr=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate);function dr(r,e,t){const s=p(r,t);if(s||Mt(t))return{error:s,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),i=p(e,a),d=p(r,a);if(i&&!Array.isArray(i)&&t!==a)return{name:t};if(d&&d.type)return{name:a,error:d};n.pop()}return{name:t}}var es=(r,e,t,s,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(e||r):(t?s.isOnBlur:n.isOnBlur)?!r:(t?s.isOnChange:n.isOnChange)?r:!0,ts=(r,e)=>!_t(p(r,e)).length&&$(r,e);const rs={mode:ae.onSubmit,reValidateMode:ae.onChange,shouldFocusError:!0};function ss(r={}){let e={...rs,...r},t={submitCount:0,isDirty:!1,isLoading:ie(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},s={},n=j(e.defaultValues)||j(e.values)?G(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:G(n),i={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,h=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},k={values:wt(),array:wt(),state:wt()},M=er(e.mode),Y=er(e.reValidateMode),z=e.criteriaMode===ae.all,q=u=>o=>{clearTimeout(h),h=setTimeout(u,o)},K=async u=>{if(!e.disabled&&(y.isValid||u)){const o=e.resolver?X((await we()).errors):await ee(s,!0);o!==t.isValid&&k.state.next({isValid:o})}},ge=(u,o)=>{!e.disabled&&(y.isValidating||y.validatingFields)&&((u||Array.from(d.mount)).forEach(l=>{l&&(o?F(t.validatingFields,l,o):$(t.validatingFields,l))}),k.state.next({validatingFields:t.validatingFields,isValidating:!X(t.validatingFields)}))},R=(u,o=[],l,v,_=!0,m=!0)=>{if(v&&l&&!e.disabled){if(i.action=!0,m&&Array.isArray(p(s,u))){const w=l(p(s,u),v.argA,v.argB);_&&F(s,u,w)}if(m&&Array.isArray(p(t.errors,u))){const w=l(p(t.errors,u),v.argA,v.argB);_&&F(t.errors,u,w),ts(t.errors,u)}if(y.touchedFields&&m&&Array.isArray(p(t.touchedFields,u))){const w=l(p(t.touchedFields,u),v.argA,v.argB);_&&F(t.touchedFields,u,w)}y.dirtyFields&&(t.dirtyFields=Le(n,a)),k.state.next({name:u,isDirty:E(u,o),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else F(a,u,o)},le=(u,o)=>{F(t.errors,u,o),k.state.next({errors:t.errors})},ce=u=>{t.errors=u,k.state.next({errors:t.errors,isValid:!1})},L=(u,o,l,v)=>{const _=p(s,u);if(_){const m=p(a,u,Z(l)?p(n,u):l);Z(m)||v&&v.defaultChecked||o?F(a,u,o?m:St(_._f)):W(u,m),i.mount&&K()}},Ce=(u,o,l,v,_)=>{let m=!1,w=!1;const C={name:u};if(!e.disabled){const U=!!(p(s,u)&&p(s,u)._f&&p(s,u)._f.disabled);if(!l||v){y.isDirty&&(w=t.isDirty,t.isDirty=C.isDirty=E(),m=w!==C.isDirty);const B=U||be(p(n,u),o);w=!!(!U&&p(t.dirtyFields,u)),B||U?$(t.dirtyFields,u):F(t.dirtyFields,u,!0),C.dirtyFields=t.dirtyFields,m=m||y.dirtyFields&&w!==!B}if(l){const B=p(t.touchedFields,u);B||(F(t.touchedFields,u,l),C.touchedFields=t.touchedFields,m=m||y.touchedFields&&B!==l)}m&&_&&k.state.next(C)}return m?C:{}},Xe=(u,o,l,v)=>{const _=p(t.errors,u),m=y.isValid&&re(o)&&t.isValid!==o;if(e.delayError&&l?(c=q(()=>le(u,l)),c(e.delayError)):(clearTimeout(h),c=null,l?F(t.errors,u,l):$(t.errors,u)),(l?!be(_,l):_)||!X(v)||m){const w={...v,...m&&re(o)?{isValid:o}:{},errors:t.errors,name:u};t={...t,...w},k.state.next(w)}},we=async u=>{ge(u,!0);const o=await e.resolver(a,e.context,Xr(u||d.mount,s,e.criteriaMode,e.shouldUseNativeValidation));return ge(u),o},Ve=async u=>{const{errors:o}=await we(u);if(u)for(const l of u){const v=p(o,l);v?F(t.errors,l,v):$(t.errors,l)}else t.errors=o;return o},ee=async(u,o,l={valid:!0})=>{for(const v in u){const _=u[v];if(_){const{_f:m,...w}=_;if(m){const C=d.array.has(m.name),U=_._f&&Qr(_._f);U&&y.validatingFields&&ge([v],!0);const B=await ir(_,d.disabled,a,z,e.shouldUseNativeValidation&&!o,C);if(U&&y.validatingFields&&ge([v]),B[m.name]&&(l.valid=!1,o))break;!o&&(p(B,m.name)?C?Hr(t.errors,B,m.name):F(t.errors,m.name,B[m.name]):$(t.errors,m.name))}!X(w)&&await ee(w,o,l)}}return l.valid},Qe=()=>{for(const u of d.unMount){const o=p(s,u);o&&(o._f.refs?o._f.refs.every(l=>!At(l)):!At(o._f.ref))&&vt(u)}d.unMount=new Set},E=(u,o)=>!e.disabled&&(u&&o&&F(a,u,o),!be(zt(),n)),N=(u,o,l)=>kr(u,d,{...i.mount?a:Z(o)?n:ue(u)?{[u]:o}:o},l,o),P=u=>_t(p(i.mount?a:n,u,e.shouldUnregister?p(n,u,[]):[])),W=(u,o,l={})=>{const v=p(s,u);let _=o;if(v){const m=v._f;m&&(!m.disabled&&F(a,u,Vr(o,m)),_=tt(m.ref)&&H(o)?"":o,Sr(m.ref)?[...m.ref.options].forEach(w=>w.selected=_.includes(w.value)):m.refs?Ge(m.ref)?m.refs.length>1?m.refs.forEach(w=>(!w.defaultChecked||!w.disabled)&&(w.checked=Array.isArray(_)?!!_.find(C=>C===w.value):_===w.value)):m.refs[0]&&(m.refs[0].checked=!!_):m.refs.forEach(w=>w.checked=w.value===_):$t(m.ref)?m.ref.value="":(m.ref.value=_,m.ref.type||k.values.next({name:u,values:{...a}})))}(l.shouldDirty||l.shouldTouch)&&Ce(u,_,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&Me(u)},ne=(u,o,l)=>{for(const v in o){const _=o[v],m=`${u}.${v}`,w=p(s,m);(d.array.has(u)||j(_)||w&&!w._f)&&!Ae(_)?ne(m,_,l):W(m,_,l)}},te=(u,o,l={})=>{const v=p(s,u),_=d.array.has(u),m=G(o);F(a,u,m),_?(k.array.next({name:u,values:{...a}}),(y.isDirty||y.dirtyFields)&&l.shouldDirty&&k.state.next({name:u,dirtyFields:Le(n,a),isDirty:E(u,m)})):v&&!v._f&&!H(m)?ne(u,m,l):W(u,m,l),tr(u,d)&&k.state.next({...t}),k.values.next({name:i.mount?u:void 0,values:{...a}})},Ze=async u=>{i.mount=!0;const o=u.target;let l=o.name,v=!0;const _=p(s,l),m=()=>o.type?St(_._f):pr(u),w=C=>{v=Number.isNaN(C)||Ae(C)&&isNaN(C.getTime())||be(C,p(a,l,C))};if(_){let C,U;const B=m(),ve=u.type===et.BLUR||u.type===et.FOCUS_OUT,Mr=!Kr(_._f)&&!e.resolver&&!p(t.errors,l)&&!_._f.deps||es(ve,p(t.touchedFields,l),t.isSubmitted,Y,M),bt=tr(l,d,ve);F(a,l,B),ve?(_._f.onBlur&&_._f.onBlur(u),c&&c(0)):_._f.onChange&&_._f.onChange(u);const kt=Ce(l,B,ve,!1),Lr=!X(kt)||bt;if(!ve&&k.values.next({name:l,type:u.type,values:{...a}}),Mr)return y.isValid&&(e.mode==="onBlur"&&ve?K():ve||K()),Lr&&k.state.next({name:l,...bt?{}:kt});if(!ve&&bt&&k.state.next({...t}),e.resolver){const{errors:Qt}=await we([l]);if(w(B),v){const Pr=dr(t.errors,s,l),Kt=dr(Qt,s,Pr.name||l);C=Kt.error,l=Kt.name,U=X(Qt)}}else ge([l],!0),C=(await ir(_,d.disabled,a,z,e.shouldUseNativeValidation))[l],ge([l]),w(B),v&&(C?U=!1:y.isValid&&(U=await ee(s,!0)));v&&(_._f.deps&&Me(_._f.deps),Xe(l,U,C,kt))}},je=(u,o)=>{if(p(t.errors,o)&&u.focus)return u.focus(),1},Me=async(u,o={})=>{let l,v;const _=ze(u);if(e.resolver){const m=await Ve(Z(u)?u:_);l=X(m),v=u?!_.some(w=>p(m,w)):l}else u?(v=(await Promise.all(_.map(async m=>{const w=p(s,m);return await ee(w&&w._f?{[m]:w}:w)}))).every(Boolean),!(!v&&!t.isValid)&&K()):v=l=await ee(s);return k.state.next({...!ue(u)||y.isValid&&l!==t.isValid?{}:{name:u},...e.resolver||!u?{isValid:l}:{},errors:t.errors}),o.shouldFocus&&!v&&We(s,je,u?_:d.mount),v},zt=u=>{const o={...i.mount?a:n};return Z(u)?o:ue(u)?p(o,u):u.map(l=>p(o,l))},Wt=(u,o)=>({invalid:!!p((o||t).errors,u),isDirty:!!p((o||t).dirtyFields,u),error:p((o||t).errors,u),isValidating:!!p(t.validatingFields,u),isTouched:!!p((o||t).touchedFields,u)}),Ir=u=>{u&&ze(u).forEach(o=>$(t.errors,o)),k.state.next({errors:u?t.errors:{}})},qt=(u,o,l)=>{const v=(p(s,u,{_f:{}})._f||{}).ref,_=p(t.errors,u)||{},{ref:m,message:w,type:C,...U}=_;F(t.errors,u,{...U,...o,ref:v}),k.state.next({name:u,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&v&&v.focus&&v.focus()},Dr=(u,o)=>ie(u)?k.values.subscribe({next:l=>u(N(void 0,o),l)}):N(u,o,!0),vt=(u,o={})=>{for(const l of u?ze(u):d.mount)d.mount.delete(l),d.array.delete(l),o.keepValue||($(s,l),$(a,l)),!o.keepError&&$(t.errors,l),!o.keepDirty&&$(t.dirtyFields,l),!o.keepTouched&&$(t.touchedFields,l),!o.keepIsValidating&&$(t.validatingFields,l),!e.shouldUnregister&&!o.keepDefaultValue&&$(n,l);k.values.next({values:{...a}}),k.state.next({...t,...o.keepDirty?{isDirty:E()}:{}}),!o.keepIsValid&&K()},Ht=({disabled:u,name:o,field:l,fields:v})=>{(re(u)&&i.mount||u||d.disabled.has(o))&&(u?d.disabled.add(o):d.disabled.delete(o),Ce(o,St(l?l._f:p(v,o)._f),!1,!1,!0))},xt=(u,o={})=>{let l=p(s,u);const v=re(o.disabled)||re(e.disabled);return F(s,u,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:u}},name:u,mount:!0,...o}}),d.mount.add(u),l?Ht({field:l,disabled:re(o.disabled)?o.disabled:e.disabled,name:u}):L(u,!0,o.value),{...v?{disabled:o.disabled||e.disabled}:{},...e.progressive?{required:!!o.required,min:Pe(o.min),max:Pe(o.max),minLength:Pe(o.minLength),maxLength:Pe(o.maxLength),pattern:Pe(o.pattern)}:{},name:u,onChange:Ze,onBlur:Ze,ref:_=>{if(_){xt(u,o),l=p(s,u);const m=Z(_.value)&&_.querySelectorAll&&_.querySelectorAll("input,select,textarea")[0]||_,w=Gr(m),C=l._f.refs||[];if(w?C.find(U=>U===m):m===l._f.ref)return;F(s,u,{_f:{...l._f,...w?{refs:[...C.filter(At),m,...Array.isArray(p(n,u))?[{}]:[]],ref:{type:m.type,name:u}}:{ref:m}}}),L(u,!1,void 0,m)}else l=p(s,u,{}),l._f&&(l._f.mount=!1),(e.shouldUnregister||o.shouldUnregister)&&!(yr(d.array,u)&&i.action)&&d.unMount.add(u)}}},Jt=()=>e.shouldFocusError&&We(s,je,d.mount),Zr=u=>{re(u)&&(k.state.next({disabled:u}),We(s,(o,l)=>{const v=p(s,l);v&&(o.disabled=v._f.disabled||u,Array.isArray(v._f.refs)&&v._f.refs.forEach(_=>{_.disabled=v._f.disabled||u}))},0,!1))},Yt=(u,o)=>async l=>{let v;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let _=G(a);if(d.disabled.size)for(const m of d.disabled)F(_,m,void 0);if(k.state.next({isSubmitting:!0}),e.resolver){const{errors:m,values:w}=await we();t.errors=m,_=w}else await ee(s);if($(t.errors,"root"),X(t.errors)){k.state.next({errors:{}});try{await u(_,l)}catch(m){v=m}}else o&&await o({...t.errors},l),Jt(),setTimeout(Jt);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:X(t.errors)&&!v,submitCount:t.submitCount+1,errors:t.errors}),v)throw v},jr=(u,o={})=>{p(s,u)&&(Z(o.defaultValue)?te(u,G(p(n,u))):(te(u,o.defaultValue),F(n,u,G(o.defaultValue))),o.keepTouched||$(t.touchedFields,u),o.keepDirty||($(t.dirtyFields,u),t.isDirty=o.defaultValue?E(u,G(p(n,u))):E()),o.keepError||($(t.errors,u),y.isValid&&K()),k.state.next({...t}))},Gt=(u,o={})=>{const l=u?G(u):n,v=G(l),_=X(u),m=_?n:v;if(o.keepDefaultValues||(n=l),!o.keepValues){if(o.keepDirtyValues){const w=new Set([...d.mount,...Object.keys(Le(n,a))]);for(const C of Array.from(w))p(t.dirtyFields,C)?F(m,C,p(a,C)):te(C,p(m,C))}else{if(jt&&Z(u))for(const w of d.mount){const C=p(s,w);if(C&&C._f){const U=Array.isArray(C._f.refs)?C._f.refs[0]:C._f.ref;if(tt(U)){const B=U.closest("form");if(B){B.reset();break}}}}s={}}a=e.shouldUnregister?o.keepDefaultValues?G(n):{}:G(m),k.array.next({values:{...m}}),k.values.next({values:{...m}})}d={mount:o.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!y.isValid||!!o.keepIsValid||!!o.keepDirtyValues,i.watch=!!e.shouldUnregister,k.state.next({submitCount:o.keepSubmitCount?t.submitCount:0,isDirty:_?!1:o.keepDirty?t.isDirty:!!(o.keepDefaultValues&&!be(u,n)),isSubmitted:o.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:_?{}:o.keepDirtyValues?o.keepDefaultValues&&a?Le(n,a):t.dirtyFields:o.keepDefaultValues&&u?Le(n,u):o.keepDirty?t.dirtyFields:{},touchedFields:o.keepTouched?t.touchedFields:{},errors:o.keepErrors?t.errors:{},isSubmitSuccessful:o.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Xt=(u,o)=>Gt(ie(u)?u(a):u,o);return{control:{register:xt,unregister:vt,getFieldState:Wt,handleSubmit:Yt,setError:qt,_executeSchema:we,_getWatch:N,_getDirty:E,_updateValid:K,_removeUnmounted:Qe,_updateFieldArray:R,_updateDisabledField:Ht,_getFieldArray:P,_reset:Gt,_resetDefaultValues:()=>ie(e.defaultValues)&&e.defaultValues().then(u=>{Xt(u,e.resetOptions),k.state.next({isLoading:!1})}),_updateFormState:u=>{t={...t,...u}},_disableForm:Zr,_subjects:k,_proxyFormState:y,_setErrors:ce,get _fields(){return s},get _formValues(){return a},get _state(){return i},set _state(u){i=u},get _defaultValues(){return n},get _names(){return d},set _names(u){d=u},get _formState(){return t},set _formState(u){t=u},get _options(){return e},set _options(u){e={...e,...u}}},trigger:Me,register:xt,handleSubmit:Yt,watch:Dr,setValue:te,getValues:zt,reset:Xt,resetField:jr,clearErrors:Ir,unregister:vt,setError:qt,setFocus:(u,o={})=>{const l=p(s,u),v=l&&l._f;if(v){const _=v.refs?v.refs[0]:v.ref;_.focus&&(_.focus(),o.shouldSelect&&ie(_.select)&&_.select())}},getFieldState:Wt}}function Ds(r={}){const e=I.useRef(void 0),t=I.useRef(void 0),[s,n]=I.useState({isDirty:!1,isValidating:!1,isLoading:ie(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,defaultValues:ie(r.defaultValues)?void 0:r.defaultValues});e.current||(e.current={...ss(r),formState:s});const a=e.current.control;return a._options=r,Pt({subject:a._subjects.state,next:i=>{xr(i,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),I.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),I.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==s.isDirty&&a._subjects.state.next({isDirty:i})}},[a,s.isDirty]),I.useEffect(()=>{r.values&&!be(r.values,t.current)?(a._reset(r.values,a._options.resetOptions),t.current=r.values,n(i=>({...i}))):a._resetDefaultValues()},[r.values,a]),I.useEffect(()=>{r.errors&&a._setErrors(r.errors)},[r.errors,a]),I.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),I.useEffect(()=>{r.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[r.shouldUnregister,a]),e.current.formState=vr(s,a),e.current}const or=(r,e,t)=>{if(r&&"reportValidity"in r){const s=p(t,e);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},ns=(r,e)=>{for(const t in e.fields){const s=e.fields[t];s&&s.ref&&"reportValidity"in s.ref?or(s.ref,t,r):s.refs&&s.refs.forEach(n=>or(n,t,r))}},Zs=(r,e)=>{e.shouldUseNativeValidation&&ns(r,e);const t={};for(const s in r){const n=p(e.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(as(e.names||Object.keys(r),s)){const i=Object.assign({},p(t,s));F(i,"root",a),F(t,s,i)}else F(t,s,a)}return t},as=(r,e)=>r.some(t=>t.startsWith(e+"."));var O;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(d=>typeof n[n[d]]!="number"),i={};for(const d of a)i[d]=n[d];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(O||(O={}));var lr;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(lr||(lr={}));const x=O.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xe=r=>{switch(typeof r){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(r)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(r)?x.array:r===null?x.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?x.promise:typeof Map<"u"&&r instanceof Map?x.map:typeof Set<"u"&&r instanceof Set?x.set:typeof Date<"u"&&r instanceof Date?x.date:x.object;default:return x.unknown}},f=O.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class se extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let d=s,c=0;for(;ct.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}se.create=r=>new se(r);const He=(r,e)=>{let t;switch(r.code){case f.invalid_type:r.received===x.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,O.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${O.joinValues(r.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${O.joinValues(r.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${O.joinValues(r.options)}, received '${r.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:O.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case f.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case f.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,O.assertNever(r)}return{message:t}};let is=He;function Vt(){return is}const Et=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let d="";const c=s.filter(h=>!!h).slice().reverse();for(const h of c)d=h(i,{data:e,defaultError:d}).message;return{...n,path:a,message:d}};function g(r,e){const t=Vt(),s=Et({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===He?void 0:He].filter(n=>!!n)});r.common.issues.push(s)}class J{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return S;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return J.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return S;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const S=Object.freeze({status:"aborted"}),$e=r=>({status:"dirty",value:r}),Q=r=>({status:"valid",value:r}),cr=r=>r.status==="aborted",fr=r=>r.status==="dirty",Ne=r=>r.status==="valid",nt=r=>typeof Promise<"u"&&r instanceof Promise;function at(r,e,t,s){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Er(r,e,t,s,n){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var Ue,Be;class oe{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hr=(r,e)=>{if(Ne(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new se(r.common.issues);return this._error=t,this._error}}};function T(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,d)=>{var c,h;const{message:y}=r;return i.code==="invalid_enum_value"?{message:y??d.defaultError}:typeof d.data>"u"?{message:(c=y??s)!==null&&c!==void 0?c:d.defaultError}:i.code!=="invalid_type"?{message:d.defaultError}:{message:(h=y??t)!==null&&h!==void 0?h:d.defaultError}},description:n}}class V{get description(){return this._def.description}_getType(e){return xe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:xe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new J,ctx:{common:e.parent.common,data:e.data,parsedType:xe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(nt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xe(e)},a=this._parseSync({data:e,path:n.path,parent:n});return hr(n,a)}"~validate"(e){var t,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xe(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return Ne(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>Ne(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xe(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(nt(n)?n:Promise.resolve(n));return hr(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),d=()=>a.addIssue({code:f.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(d(),!1)):i?!0:(d(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new _e({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return pe.create(this,this._def)}nullable(){return Te.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ye.create(this,this._def)}or(e){return dt.create([this,e],this._def)}and(e){return ot.create(this,e,this._def)}transform(e){return new _e({...T(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new mt({...T(this._def),innerType:this,defaultValue:t,typeName:A.ZodDefault})}brand(){return new Fr({typeName:A.ZodBranded,type:this,...T(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new pt({...T(this._def),innerType:this,catchValue:t,typeName:A.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return gt.create(this,e)}readonly(){return yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const us=/^c[^\s-]{8,}$/i,ds=/^[0-9a-z]+$/,os=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ls=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cs=/^[a-z0-9_-]{21}$/i,fs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hs=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ms=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ps="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Tt;const ys=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_s=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Or="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ks=new RegExp(`^${Or}$`);function Rr(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ws(r){return new RegExp(`^${Rr(r)}$`)}function As(r){let e=`${Or}T${Rr(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ss(r,e){return!!((e==="v4"||!e)&&ys.test(r)||(e==="v6"||!e)&&gs.test(r))}function Ts(r,e){if(!fs.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function Cs(r,e){return!!((e==="v4"||!e)&&_s.test(r)||(e==="v6"||!e)&&vs.test(r))}class me extends V{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const a=this._getOrReturnCtx(e);return g(a,{code:f.invalid_type,expected:x.string,received:a.parsedType}),S}const s=new J;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,d=e.data.lengthe.test(n),{validation:t,code:f.invalid_string,...b.errToObj(s)})}_addCheck(e){return new me({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...b.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...b.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new me({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new me({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new me({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new me({checks:[],typeName:A.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...T(r)})};function Vs(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class Fe extends V{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const a=this._getOrReturnCtx(e);return g(a,{code:f.invalid_type,expected:x.number,received:a.parsedType}),S}let s;const n=new J;for(const a of this._def.checks)a.kind==="int"?O.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Vs(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:f.not_finite,message:a.message}),n.dirty()):O.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,s,n){return new Fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:b.toString(n)}]})}_addCheck(e){return new Fe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&O.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.valuenew Fe({checks:[],typeName:A.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...T(r)});class Ie extends V{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==x.bigint)return this._getInvalidInput(e);let s;const n=new J;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),g(s,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):O.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:x.bigint,received:t.parsedType}),S}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,s,n){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:b.toString(n)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Ie({checks:[],typeName:A.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...T(r)})};class Ot extends V{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==x.boolean){const s=this._getOrReturnCtx(e);return g(s,{code:f.invalid_type,expected:x.boolean,received:s.parsedType}),S}return Q(e.data)}}Ot.create=r=>new Ot({typeName:A.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...T(r)});class Je extends V{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const a=this._getOrReturnCtx(e);return g(a,{code:f.invalid_type,expected:x.date,received:a.parsedType}),S}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return g(a,{code:f.invalid_date}),S}const s=new J;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),g(n,{code:f.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):O.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Je({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Je({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:A.ZodDate,...T(r)});class Rt extends V{_parse(e){if(this._getType(e)!==x.symbol){const s=this._getOrReturnCtx(e);return g(s,{code:f.invalid_type,expected:x.symbol,received:s.parsedType}),S}return Q(e.data)}}Rt.create=r=>new Rt({typeName:A.ZodSymbol,...T(r)});class it extends V{_parse(e){if(this._getType(e)!==x.undefined){const s=this._getOrReturnCtx(e);return g(s,{code:f.invalid_type,expected:x.undefined,received:s.parsedType}),S}return Q(e.data)}}it.create=r=>new it({typeName:A.ZodUndefined,...T(r)});class ut extends V{_parse(e){if(this._getType(e)!==x.null){const s=this._getOrReturnCtx(e);return g(s,{code:f.invalid_type,expected:x.null,received:s.parsedType}),S}return Q(e.data)}}ut.create=r=>new ut({typeName:A.ZodNull,...T(r)});class Nt extends V{constructor(){super(...arguments),this._any=!0}_parse(e){return Q(e.data)}}Nt.create=r=>new Nt({typeName:A.ZodAny,...T(r)});class Re extends V{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Q(e.data)}}Re.create=r=>new Re({typeName:A.ZodUnknown,...T(r)});class ke extends V{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:x.never,received:t.parsedType}),S}}ke.create=r=>new ke({typeName:A.ZodNever,...T(r)});class Ft extends V{_parse(e){if(this._getType(e)!==x.undefined){const s=this._getOrReturnCtx(e);return g(s,{code:f.invalid_type,expected:x.void,received:s.parsedType}),S}return Q(e.data)}}Ft.create=r=>new Ft({typeName:A.ZodVoid,...T(r)});class de extends V{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==x.array)return g(t,{code:f.invalid_type,expected:x.array,received:t.parsedType}),S;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,d=t.data.lengthn.maxLength.value&&(g(t,{code:f.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,d)=>n.type._parseAsync(new oe(t,i,t.path,d)))).then(i=>J.mergeArray(s,i));const a=[...t.data].map((i,d)=>n.type._parseSync(new oe(t,i,t.path,d)));return J.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}de.create=(r,e)=>new de({type:r,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,...T(e)});function Oe(r){if(r instanceof D){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=pe.create(Oe(s))}return new D({...r._def,shape:()=>e})}else return r instanceof de?new de({...r._def,type:Oe(r.element)}):r instanceof pe?pe.create(Oe(r.unwrap())):r instanceof Te?Te.create(Oe(r.unwrap())):r instanceof ye?ye.create(r.items.map(e=>Oe(e))):r}class D extends V{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=O.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const h=this._getOrReturnCtx(e);return g(h,{code:f.invalid_type,expected:x.object,received:h.parsedType}),S}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),d=[];if(!(this._def.catchall instanceof ke&&this._def.unknownKeys==="strip"))for(const h in n.data)i.includes(h)||d.push(h);const c=[];for(const h of i){const y=a[h],k=n.data[h];c.push({key:{status:"valid",value:h},value:y._parse(new oe(n,k,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof ke){const h=this._def.unknownKeys;if(h==="passthrough")for(const y of d)c.push({key:{status:"valid",value:y},value:{status:"valid",value:n.data[y]}});else if(h==="strict")d.length>0&&(g(n,{code:f.unrecognized_keys,keys:d}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const y of d){const k=n.data[y];c.push({key:{status:"valid",value:y},value:h._parse(new oe(n,k,n.path,y)),alwaysSet:y in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const y of c){const k=await y.key,M=await y.value;h.push({key:k,value:M,alwaysSet:y.alwaysSet})}return h}).then(h=>J.mergeObjectSync(s,h)):J.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new D({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,d;const c=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(d=b.errToObj(e).message)!==null&&d!==void 0?d:c}:{message:c}}}:{}})}strip(){return new D({...this._def,unknownKeys:"strip"})}passthrough(){return new D({...this._def,unknownKeys:"passthrough"})}extend(e){return new D({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new D({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:A.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new D({...this._def,catchall:e})}pick(e){const t={};return O.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new D({...this._def,shape:()=>t})}omit(e){const t={};return O.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new D({...this._def,shape:()=>t})}deepPartial(){return Oe(this)}partial(e){const t={};return O.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new D({...this._def,shape:()=>t})}required(e){const t={};return O.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof pe;)a=a._def.innerType;t[s]=a}}),new D({...this._def,shape:()=>t})}keyof(){return Nr(O.objectKeys(this.shape))}}D.create=(r,e)=>new D({shape:()=>r,unknownKeys:"strip",catchall:ke.create(),typeName:A.ZodObject,...T(e)});D.strictCreate=(r,e)=>new D({shape:()=>r,unknownKeys:"strict",catchall:ke.create(),typeName:A.ZodObject,...T(e)});D.lazycreate=(r,e)=>new D({shape:r,unknownKeys:"strip",catchall:ke.create(),typeName:A.ZodObject,...T(e)});class dt extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const i=a.map(d=>new se(d.ctx.common.issues));return g(t,{code:f.invalid_union,unionErrors:i}),S}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const c of s){const h={...t,common:{...t.common,issues:[]},parent:null},y=c._parseSync({data:t.data,path:t.path,parent:h});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:h}),h.common.issues.length&&i.push(h.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const d=i.map(c=>new se(c));return g(t,{code:f.invalid_union,unionErrors:d}),S}}get options(){return this._def.options}}dt.create=(r,e)=>new dt({options:r,typeName:A.ZodUnion,...T(e)});const he=r=>r instanceof ct?he(r.schema):r instanceof _e?he(r.innerType()):r instanceof ft?[r.value]:r instanceof Se?r.options:r instanceof ht?O.objectValues(r.enum):r instanceof mt?he(r._def.innerType):r instanceof it?[void 0]:r instanceof ut?[null]:r instanceof pe?[void 0,...he(r.unwrap())]:r instanceof Te?[null,...he(r.unwrap())]:r instanceof Fr||r instanceof yt?he(r.unwrap()):r instanceof pt?he(r._def.innerType):[];class Bt extends V{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return g(t,{code:f.invalid_type,expected:x.object,received:t.parsedType}),S;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=he(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of i){if(n.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);n.set(d,a)}}return new Bt({typeName:A.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...T(s)})}}function It(r,e){const t=xe(r),s=xe(e);if(r===e)return{valid:!0,data:r};if(t===x.object&&s===x.object){const n=O.objectKeys(e),a=O.objectKeys(r).filter(d=>n.indexOf(d)!==-1),i={...r,...e};for(const d of a){const c=It(r[d],e[d]);if(!c.valid)return{valid:!1};i[d]=c.data}return{valid:!0,data:i}}else if(t===x.array&&s===x.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(cr(a)||cr(i))return S;const d=It(a.value,i.value);return d.valid?((fr(a)||fr(i))&&t.dirty(),{status:t.value,value:d.data}):(g(s,{code:f.invalid_intersection_types}),S)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ot.create=(r,e,t)=>new ot({left:r,right:e,typeName:A.ZodIntersection,...T(t)});class ye extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return g(s,{code:f.invalid_type,expected:x.array,received:s.parsedType}),S;if(s.data.lengththis._def.items.length&&(g(s,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,d)=>{const c=this._def.items[d]||this._def.rest;return c?c._parse(new oe(s,i,s.path,d)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>J.mergeArray(t,i)):J.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:r,typeName:A.ZodTuple,rest:null,...T(e)})};class lt extends V{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.object)return g(s,{code:f.invalid_type,expected:x.object,received:s.parsedType}),S;const n=[],a=this._def.keyType,i=this._def.valueType;for(const d in s.data)n.push({key:a._parse(new oe(s,d,s.path,d)),value:i._parse(new oe(s,s.data[d],s.path,d)),alwaysSet:d in s.data});return s.common.async?J.mergeObjectAsync(t,n):J.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof V?new lt({keyType:e,valueType:t,typeName:A.ZodRecord,...T(s)}):new lt({keyType:me.create(),valueType:e,typeName:A.ZodRecord,...T(t)})}}class Dt extends V{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return g(s,{code:f.invalid_type,expected:x.map,received:s.parsedType}),S;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([d,c],h)=>({key:n._parse(new oe(s,d,s.path,[h,"key"])),value:a._parse(new oe(s,c,s.path,[h,"value"]))}));if(s.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const c of i){const h=await c.key,y=await c.value;if(h.status==="aborted"||y.status==="aborted")return S;(h.status==="dirty"||y.status==="dirty")&&t.dirty(),d.set(h.value,y.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const c of i){const h=c.key,y=c.value;if(h.status==="aborted"||y.status==="aborted")return S;(h.status==="dirty"||y.status==="dirty")&&t.dirty(),d.set(h.value,y.value)}return{status:t.value,value:d}}}}Dt.create=(r,e,t)=>new Dt({valueType:e,keyType:r,typeName:A.ZodMap,...T(t)});class De extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return g(s,{code:f.invalid_type,expected:x.set,received:s.parsedType}),S;const n=this._def;n.minSize!==null&&s.data.sizen.maxSize.value&&(g(s,{code:f.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(c){const h=new Set;for(const y of c){if(y.status==="aborted")return S;y.status==="dirty"&&t.dirty(),h.add(y.value)}return{status:t.value,value:h}}const d=[...s.data.values()].map((c,h)=>a._parse(new oe(s,c,s.path,h)));return s.common.async?Promise.all(d).then(c=>i(c)):i(d)}min(e,t){return new De({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new De({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}De.create=(r,e)=>new De({valueType:r,minSize:null,maxSize:null,typeName:A.ZodSet,...T(e)});class qe extends V{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return g(t,{code:f.invalid_type,expected:x.function,received:t.parsedType}),S;function s(d,c){return Et({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Vt(),He].filter(h=>!!h),issueData:{code:f.invalid_arguments,argumentsError:c}})}function n(d,c){return Et({data:d,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Vt(),He].filter(h=>!!h),issueData:{code:f.invalid_return_type,returnTypeError:c}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Ye){const d=this;return Q(async function(...c){const h=new se([]),y=await d._def.args.parseAsync(c,a).catch(Y=>{throw h.addIssue(s(c,Y)),h}),k=await Reflect.apply(i,this,y);return await d._def.returns._def.type.parseAsync(k,a).catch(Y=>{throw h.addIssue(n(k,Y)),h})})}else{const d=this;return Q(function(...c){const h=d._def.args.safeParse(c,a);if(!h.success)throw new se([s(c,h.error)]);const y=Reflect.apply(i,this,h.data),k=d._def.returns.safeParse(y,a);if(!k.success)throw new se([n(y,k.error)]);return k.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qe({...this._def,args:ye.create(e).rest(Re.create())})}returns(e){return new qe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new qe({args:e||ye.create([]).rest(Re.create()),returns:t||Re.create(),typeName:A.ZodFunction,...T(s)})}}class ct extends V{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ct.create=(r,e)=>new ct({getter:r,typeName:A.ZodLazy,...T(e)});class ft extends V{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}ft.create=(r,e)=>new ft({value:r,typeName:A.ZodLiteral,...T(e)});function Nr(r,e){return new Se({values:r,typeName:A.ZodEnum,...T(e)})}class Se extends V{constructor(){super(...arguments),Ue.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return g(t,{expected:O.joinValues(s),received:t.parsedType,code:f.invalid_type}),S}if(at(this,Ue)||Er(this,Ue,new Set(this._def.values)),!at(this,Ue).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return g(t,{received:t.data,code:f.invalid_enum_value,options:s}),S}return Q(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Se.create(e,{...this._def,...t})}exclude(e,t=this._def){return Se.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}Ue=new WeakMap;Se.create=Nr;class ht extends V{constructor(){super(...arguments),Be.set(this,void 0)}_parse(e){const t=O.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const n=O.objectValues(t);return g(s,{expected:O.joinValues(n),received:s.parsedType,code:f.invalid_type}),S}if(at(this,Be)||Er(this,Be,new Set(O.getValidEnumValues(this._def.values))),!at(this,Be).has(e.data)){const n=O.objectValues(t);return g(s,{received:s.data,code:f.invalid_enum_value,options:n}),S}return Q(e.data)}get enum(){return this._def.values}}Be=new WeakMap;ht.create=(r,e)=>new ht({values:r,typeName:A.ZodNativeEnum,...T(e)});class Ye extends V{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&t.common.async===!1)return g(t,{code:f.invalid_type,expected:x.promise,received:t.parsedType}),S;const s=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return Q(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ye.create=(r,e)=>new Ye({type:r,typeName:A.ZodPromise,...T(e)});class _e extends V{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{g(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async d=>{if(t.value==="aborted")return S;const c=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return c.status==="aborted"?S:c.status==="dirty"||t.value==="dirty"?$e(c.value):c});{if(t.value==="aborted")return S;const d=this._def.schema._parseSync({data:i,path:s.path,parent:s});return d.status==="aborted"?S:d.status==="dirty"||t.value==="dirty"?$e(d.value):d}}if(n.type==="refinement"){const i=d=>{const c=n.refinement(d,a);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?S:(d.status==="dirty"&&t.dirty(),i(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?S:(d.status==="dirty"&&t.dirty(),i(d.value).then(()=>({status:t.value,value:d.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ne(i))return i;const d=n.transform(i.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>Ne(i)?Promise.resolve(n.transform(i.value,a)).then(d=>({status:t.value,value:d})):i);O.assertNever(n)}}_e.create=(r,e,t)=>new _e({schema:r,typeName:A.ZodEffects,effect:e,...T(t)});_e.createWithPreprocess=(r,e,t)=>new _e({schema:e,effect:{type:"preprocess",transform:r},typeName:A.ZodEffects,...T(t)});class pe extends V{_parse(e){return this._getType(e)===x.undefined?Q(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pe.create=(r,e)=>new pe({innerType:r,typeName:A.ZodOptional,...T(e)});class Te extends V{_parse(e){return this._getType(e)===x.null?Q(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Te.create=(r,e)=>new Te({innerType:r,typeName:A.ZodNullable,...T(e)});class mt extends V{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}mt.create=(r,e)=>new mt({innerType:r,typeName:A.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});class pt extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return nt(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new se(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new se(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}pt.create=(r,e)=>new pt({innerType:r,typeName:A.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});class Zt extends V{_parse(e){if(this._getType(e)!==x.nan){const s=this._getOrReturnCtx(e);return g(s,{code:f.invalid_type,expected:x.nan,received:s.parsedType}),S}return{status:"valid",value:e.data}}}Zt.create=r=>new Zt({typeName:A.ZodNaN,...T(r)});class Fr extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class gt extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?S:a.status==="dirty"?(t.dirty(),$e(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?S:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new gt({in:e,out:t,typeName:A.ZodPipeline})}}class yt extends V{_parse(e){const t=this._def.innerType._parse(e),s=n=>(Ne(n)&&(n.value=Object.freeze(n.value)),n);return nt(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}yt.create=(r,e)=>new yt({innerType:r,typeName:A.ZodReadonly,...T(e)});D.lazycreate;var A;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(A||(A={}));const js=me.create;Fe.create;Zt.create;Ie.create;Ot.create;const Ms=Je.create;Rt.create;it.create;ut.create;Nt.create;Re.create;ke.create;Ft.create;de.create;const Ls=D.create;D.strictCreate;dt.create;Bt.create;ot.create;ye.create;lt.create;Dt.create;De.create;qe.create;ct.create;ft.create;Se.create;ht.create;Ye.create;_e.create;pe.create;Te.create;_e.createWithPreprocess;gt.create;export{Is as C,Fs as F,qr as a,Ls as b,Ds as c,Ms as d,ns as o,Zs as r,js as s,Lt as u}; diff --git a/pkg/ui/frontend/dist/assets/form-libs-BC53Arqz.js b/pkg/ui/frontend/dist/assets/form-libs-BC53Arqz.js new file mode 100644 index 0000000000..284ed04816 --- /dev/null +++ b/pkg/ui/frontend/dist/assets/form-libs-BC53Arqz.js @@ -0,0 +1 @@ +import{R}from"./react-router-BDU20MeH.js";var Ye=r=>r.type==="checkbox",Se=r=>r instanceof Date,Y=r=>r==null;const pr=r=>typeof r=="object";var L=r=>!Y(r)&&!Array.isArray(r)&&pr(r)&&!Se(r),gr=r=>L(r)&&r.target?Ye(r.target)?r.target.checked:r.target.value:r,zr=r=>r.substring(0,r.search(/\.\d+(\.|$)/))||r,_r=(r,e)=>r.has(zr(e)),Wr=r=>{const e=r.constructor&&r.constructor.prototype;return L(e)&&e.hasOwnProperty("isPrototypeOf")},Dt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function z(r){let e;const t=Array.isArray(r),s=typeof FileList<"u"?r instanceof FileList:!1;if(r instanceof Date)e=new Date(r);else if(r instanceof Set)e=new Set(r);else if(!(Dt&&(r instanceof Blob||s))&&(t||L(r)))if(e=t?[]:{},!t&&!Wr(r))e=r;else for(const n in r)r.hasOwnProperty(n)&&(e[n]=z(r[n]));else return r;return e}var yt=r=>Array.isArray(r)?r.filter(Boolean):[],M=r=>r===void 0,g=(r,e,t)=>{if(!e||!L(r))return t;const s=yt(e.split(/[,[\].]+?/)).reduce((n,a)=>Y(n)?n:n[a],r);return M(s)||s===r?M(r[e])?t:r[e]:s},ee=r=>typeof r=="boolean",Zt=r=>/^\w*$/.test(r),vr=r=>yt(r.replace(/["|']|\]/g,"").split(/\.|\[/)),D=(r,e,t)=>{let s=-1;const n=Zt(e)?[e]:vr(e),a=n.length,d=a-1;for(;++sR.useContext(xr),Zs=r=>{const{children:e,...t}=r;return R.createElement(xr.Provider,{value:t},e)};var br=(r,e,t,s=!0)=>{const n={defaultValues:e._defaultValues};for(const a in r)Object.defineProperty(n,a,{get:()=>{const d=a;return e._proxyFormState[d]!==ie.all&&(e._proxyFormState[d]=!s||ie.all),t&&(t[d]=!0),r[d]}});return n};function qr(r){const e=jt(),{control:t=e.control,disabled:s,name:n,exact:a}=r,[d,o]=R.useState(t._formState),c=R.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=R.useRef(n);return h.current=n,R.useEffect(()=>t._subscribe({name:h.current,formState:c.current,exact:a,callback:y=>{!s&&o({...t._formState,...y})}}),[t,s,a]),R.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),R.useMemo(()=>br(d,t,c.current,!1),[d,t])}var le=r=>typeof r=="string",kr=(r,e,t,s,n)=>le(r)?(s&&e.watch.add(r),g(t,r,n)):Array.isArray(r)?r.map(a=>(s&&e.watch.add(a),g(t,a))):(s&&(e.watchAll=!0),t);function Hr(r){const e=jt(),{control:t=e.control,name:s,defaultValue:n,disabled:a,exact:d}=r,o=R.useRef(s),c=R.useRef(n);o.current=s,R.useEffect(()=>t._subscribe({name:o.current,formState:{values:!0},exact:d,callback:V=>!a&&y(kr(o.current,t._names,V.values||t._formValues,!1,c.current))}),[t,a,d]);const[h,y]=R.useState(t._getWatch(s,n));return R.useEffect(()=>t._removeUnmounted()),h}function Jr(r){const e=jt(),{name:t,disabled:s,control:n=e.control,shouldUnregister:a}=r,d=_r(n._names.array,t),o=Hr({control:n,name:t,defaultValue:g(n._formValues,t,g(n._defaultValues,t,r.defaultValue)),exact:!0}),c=qr({control:n,name:t,exact:!0}),h=R.useRef(r),y=R.useRef(n.register(t,{...r.rules,value:o,...ee(r.disabled)?{disabled:r.disabled}:{}})),V=R.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!g(c.errors,t)},isDirty:{enumerable:!0,get:()=>!!g(c.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!g(c.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!g(c.validatingFields,t)},error:{enumerable:!0,get:()=>g(c.errors,t)}}),[c,t]),C=R.useCallback(q=>y.current.onChange({target:{value:gr(q),name:t},type:Qe.CHANGE}),[t]),se=R.useCallback(()=>y.current.onBlur({target:{value:g(n._formValues,t),name:t},type:Qe.BLUR}),[t,n._formValues]),ne=R.useCallback(q=>{const H=g(n._fields,t);H&&q&&(H._f.ref={focus:()=>q.focus(),select:()=>q.select(),setCustomValidity:S=>q.setCustomValidity(S),reportValidity:()=>q.reportValidity()})},[n._fields,t]),B=R.useMemo(()=>({name:t,value:o,...ee(s)||c.disabled?{disabled:c.disabled||s}:{},onChange:C,onBlur:se,ref:ne}),[t,s,c.disabled,C,se,ne,o]);return R.useEffect(()=>{const q=n._options.shouldUnregister||a;n.register(t,{...h.current.rules,...ee(h.current.disabled)?{disabled:h.current.disabled}:{}});const H=(S,ae)=>{const K=g(n._fields,S);K&&K._f&&(K._f.mount=ae)};if(H(t,!0),q){const S=z(g(n._options.defaultValues,t));D(n._defaultValues,t,S),M(g(n._formValues,t))&&D(n._formValues,t,S)}return!d&&n.register(t),()=>{(d?q&&!n._state.action:q)?n.unregister(t):H(t,!1)}},[t,n,d,a]),R.useEffect(()=>{n._setDisabledField({disabled:s,name:t})},[s,t,n]),R.useMemo(()=>({field:B,formState:c,fieldState:V}),[B,c,V])}const js=r=>r.render(Jr(r));var Yr=(r,e,t,s,n)=>e?{...t[r],types:{...t[r]&&t[r].types?t[r].types:{},[s]:n||!0}}:{},Be=r=>Array.isArray(r)?r:[r],Kt=()=>{let r=[];return{get observers(){return r},next:n=>{for(const a of r)a.next&&a.next(n)},subscribe:n=>(r.push(n),{unsubscribe:()=>{r=r.filter(a=>a!==n)}}),unsubscribe:()=>{r=[]}}},St=r=>Y(r)||!pr(r);function ke(r,e){if(St(r)||St(e))return r===e;if(Se(r)&&Se(e))return r.getTime()===e.getTime();const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const n of t){const a=r[n];if(!s.includes(n))return!1;if(n!=="ref"){const d=e[n];if(Se(a)&&Se(d)||L(a)&&L(d)||Array.isArray(a)&&Array.isArray(d)?!ke(a,d):a!==d)return!1}}return!0}var J=r=>L(r)&&!Object.keys(r).length,Mt=r=>r.type==="file",de=r=>typeof r=="function",Ke=r=>{if(!Dt)return!1;const e=r?r.ownerDocument:0;return r instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},wr=r=>r.type==="select-multiple",Lt=r=>r.type==="radio",Gr=r=>Lt(r)||Ye(r),wt=r=>Ke(r)&&r.isConnected;function Xr(r,e){const t=e.slice(0,-1).length;let s=0;for(;s{for(const e in r)if(de(r[e]))return!0;return!1};function et(r,e={}){const t=Array.isArray(r);if(L(r)||t)for(const s in r)Array.isArray(r[s])||L(r[s])&&!Ar(r[s])?(e[s]=Array.isArray(r[s])?[]:{},et(r[s],e[s])):Y(r[s])||(e[s]=!0);return e}function Sr(r,e,t){const s=Array.isArray(r);if(L(r)||s)for(const n in r)Array.isArray(r[n])||L(r[n])&&!Ar(r[n])?M(e)||St(t[n])?t[n]=Array.isArray(r[n])?et(r[n],[]):{...et(r[n])}:Sr(r[n],Y(e)?{}:e[n],t[n]):t[n]=!ke(r[n],e[n]);return t}var Me=(r,e)=>Sr(r,e,et(e));const er={value:!1,isValid:!1},tr={value:!0,isValid:!0};var Tr=r=>{if(Array.isArray(r)){if(r.length>1){const e=r.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:e,isValid:!!e.length}}return r[0].checked&&!r[0].disabled?r[0].attributes&&!M(r[0].attributes.value)?M(r[0].value)||r[0].value===""?tr:{value:r[0].value,isValid:!0}:tr:er}return er},Cr=(r,{valueAsNumber:e,valueAsDate:t,setValueAs:s})=>M(r)?r:e?r===""?NaN:r&&+r:t&&le(r)?new Date(r):s?s(r):r;const rr={isValid:!1,value:null};var Vr=r=>Array.isArray(r)?r.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,rr):rr;function sr(r){const e=r.ref;return Mt(e)?e.files:Lt(e)?Vr(r.refs).value:wr(e)?[...e.selectedOptions].map(({value:t})=>t):Ye(e)?Tr(r.refs).value:Cr(M(e.value)?r.ref.value:e.value,r)}var Kr=(r,e,t,s)=>{const n={};for(const a of r){const d=g(e,a);d&&D(n,a,d._f)}return{criteriaMode:t,names:[...r],fields:n,shouldUseNativeValidation:s}},tt=r=>r instanceof RegExp,Le=r=>M(r)?r:tt(r)?r.source:L(r)?tt(r.value)?r.value.source:r.value:r,nr=r=>({isOnSubmit:!r||r===ie.onSubmit,isOnBlur:r===ie.onBlur,isOnChange:r===ie.onChange,isOnAll:r===ie.all,isOnTouch:r===ie.onTouched});const ar="AsyncFunction";var es=r=>!!r&&!!r.validate&&!!(de(r.validate)&&r.validate.constructor.name===ar||L(r.validate)&&Object.values(r.validate).find(e=>e.constructor.name===ar)),ts=r=>r.mount&&(r.required||r.min||r.max||r.maxLength||r.minLength||r.pattern||r.validate),ir=(r,e,t)=>!t&&(e.watchAll||e.watch.has(r)||[...e.watch].some(s=>r.startsWith(s)&&/^\.\w+/.test(r.slice(s.length))));const ze=(r,e,t,s)=>{for(const n of t||Object.keys(r)){const a=g(r,n);if(a){const{_f:d,...o}=a;if(d){if(d.refs&&d.refs[0]&&e(d.refs[0],n)&&!s)return!0;if(d.ref&&e(d.ref,d.name)&&!s)return!0;if(ze(o,e))break}else if(L(o)&&ze(o,e))break}}};function dr(r,e,t){const s=g(r,t);if(s||Zt(t))return{error:s,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),d=g(e,a),o=g(r,a);if(d&&!Array.isArray(d)&&t!==a)return{name:t};if(o&&o.type)return{name:a,error:o};n.pop()}return{name:t}}var rs=(r,e,t,s)=>{t(r);const{name:n,...a}=r;return J(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(d=>e[d]===(!s||ie.all))},ss=(r,e,t)=>!r||!e||r===e||Be(r).some(s=>s&&(t?s===e:s.startsWith(e)||e.startsWith(s))),ns=(r,e,t,s,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(e||r):(t?s.isOnBlur:n.isOnBlur)?!r:(t?s.isOnChange:n.isOnChange)?r:!0,as=(r,e)=>!yt(g(r,e)).length&&$(r,e),is=(r,e,t)=>{const s=Be(g(r,t));return D(s,"root",e[t]),D(r,t,s),r},Xe=r=>le(r);function or(r,e,t="validate"){if(Xe(r)||Array.isArray(r)&&r.every(Xe)||ee(r)&&!r)return{type:t,message:Xe(r)?r:"",ref:e}}var Ve=r=>L(r)&&!tt(r)?r:{value:r,message:""},ur=async(r,e,t,s,n,a)=>{const{ref:d,refs:o,required:c,maxLength:h,minLength:y,min:V,max:C,pattern:se,validate:ne,name:B,valueAsNumber:q,mount:H}=r._f,S=g(t,B);if(!H||e.has(B))return{};const ae=o?o[0]:d,K=I=>{n&&ae.reportValidity&&(ae.setCustomValidity(ee(I)?"":I||""),ae.reportValidity())},U={},De=Lt(d),Ze=Ye(d),gt=De||Ze,oe=(q||Mt(d))&&M(d.value)&&M(S)||Ke(d)&&d.value===""||S===""||Array.isArray(S)&&!S.length,Ae=Yr.bind(null,B,s,U),he=(I,O,j,X=me.maxLength,te=me.minLength)=>{const ue=I?O:j;U[B]={type:I?X:te,message:ue,ref:d,...Ae(I?X:te,ue)}};if(a?!Array.isArray(S)||!S.length:c&&(!gt&&(oe||Y(S))||ee(S)&&!S||Ze&&!Tr(o).isValid||De&&!Vr(o).isValid)){const{value:I,message:O}=Xe(c)?{value:!!c,message:c}:Ve(c);if(I&&(U[B]={type:me.required,message:O,ref:ae,...Ae(me.required,O)},!s))return K(O),U}if(!oe&&(!Y(V)||!Y(C))){let I,O;const j=Ve(C),X=Ve(V);if(!Y(S)&&!isNaN(S)){const te=d.valueAsNumber||S&&+S;Y(j.value)||(I=te>j.value),Y(X.value)||(O=tenew Date(new Date().toDateString()+" "+Ge),xe=d.type=="time",je=d.type=="week";le(j.value)&&S&&(I=xe?ue(S)>ue(j.value):je?S>j.value:te>new Date(j.value)),le(X.value)&&S&&(O=xe?ue(S)+I.value,X=!Y(O.value)&&S.length<+O.value;if((j||X)&&(he(j,I.message,O.message),!s))return K(U[B].message),U}if(se&&!oe&&le(S)){const{value:I,message:O}=Ve(se);if(tt(I)&&!S.match(I)&&(U[B]={type:me.pattern,message:O,ref:d,...Ae(me.pattern,O)},!s))return K(O),U}if(ne){if(de(ne)){const I=await ne(S,t),O=or(I,ae);if(O&&(U[B]={...O,...Ae(me.validate,O.message)},!s))return K(O.message),U}else if(L(ne)){let I={};for(const O in ne){if(!J(I)&&!s)break;const j=or(await ne[O](S,t),ae,O);j&&(I={...j,...Ae(O,j.message)},K(j.message),s&&(U[B]=I))}if(!J(I)&&(U[B]={ref:ae,...I},!s))return U}}return K(!0),U};const ds={mode:ie.onSubmit,reValidateMode:ie.onChange,shouldFocusError:!0};function os(r={}){let e={...ds,...r},t={submitCount:0,isDirty:!1,isLoading:de(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const s={};let n=L(e.defaultValues)||L(e.values)?z(e.values||e.defaultValues)||{}:{},a=e.shouldUnregister?{}:z(n),d={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,h=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let V={...y};const C={array:Kt(),state:Kt()},se=nr(e.mode),ne=nr(e.reValidateMode),B=e.criteriaMode===ie.all,q=i=>u=>{clearTimeout(h),h=setTimeout(i,u)},H=async i=>{if(!e.disabled&&(y.isValid||V.isValid||i)){const u=e.resolver?J((await oe()).errors):await he(s,!0);u!==t.isValid&&C.state.next({isValid:u})}},S=(i,u)=>{!e.disabled&&(y.isValidating||y.validatingFields||V.isValidating||V.validatingFields)&&((i||Array.from(o.mount)).forEach(l=>{l&&(u?D(t.validatingFields,l,u):$(t.validatingFields,l))}),C.state.next({validatingFields:t.validatingFields,isValidating:!J(t.validatingFields)}))},ae=(i,u=[],l,v,p=!0,m=!0)=>{if(v&&l&&!e.disabled){if(d.action=!0,m&&Array.isArray(g(s,i))){const b=l(g(s,i),v.argA,v.argB);p&&D(s,i,b)}if(m&&Array.isArray(g(t.errors,i))){const b=l(g(t.errors,i),v.argA,v.argB);p&&D(t.errors,i,b),as(t.errors,i)}if((y.touchedFields||V.touchedFields)&&m&&Array.isArray(g(t.touchedFields,i))){const b=l(g(t.touchedFields,i),v.argA,v.argB);p&&D(t.touchedFields,i,b)}(y.dirtyFields||V.dirtyFields)&&(t.dirtyFields=Me(n,a)),C.state.next({name:i,isDirty:O(i,u),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else D(a,i,u)},K=(i,u)=>{D(t.errors,i,u),C.state.next({errors:t.errors})},U=i=>{t.errors=i,C.state.next({errors:t.errors,isValid:!1})},De=(i,u,l,v)=>{const p=g(s,i);if(p){const m=g(a,i,M(l)?g(n,i):l);M(m)||v&&v.defaultChecked||u?D(a,i,u?m:sr(p._f)):te(i,m),d.mount&&H()}},Ze=(i,u,l,v,p)=>{let m=!1,b=!1;const F={name:i};if(!e.disabled){if(!l||v){(y.isDirty||V.isDirty)&&(b=t.isDirty,t.isDirty=F.isDirty=O(),m=b!==F.isDirty);const P=ke(g(n,i),u);b=!!g(t.dirtyFields,i),P?$(t.dirtyFields,i):D(t.dirtyFields,i,!0),F.dirtyFields=t.dirtyFields,m=m||(y.dirtyFields||V.dirtyFields)&&b!==!P}if(l){const P=g(t.touchedFields,i);P||(D(t.touchedFields,i,l),F.touchedFields=t.touchedFields,m=m||(y.touchedFields||V.touchedFields)&&P!==l)}m&&p&&C.state.next(F)}return m?F:{}},gt=(i,u,l,v)=>{const p=g(t.errors,i),m=(y.isValid||V.isValid)&&ee(u)&&t.isValid!==u;if(e.delayError&&l?(c=q(()=>K(i,l)),c(e.delayError)):(clearTimeout(h),c=null,l?D(t.errors,i,l):$(t.errors,i)),(l?!ke(p,l):p)||!J(v)||m){const b={...v,...m&&ee(u)?{isValid:u}:{},errors:t.errors,name:i};t={...t,...b},C.state.next(b)}},oe=async i=>{S(i,!0);const u=await e.resolver(a,e.context,Kr(i||o.mount,s,e.criteriaMode,e.shouldUseNativeValidation));return S(i),u},Ae=async i=>{const{errors:u}=await oe(i);if(i)for(const l of i){const v=g(u,l);v?D(t.errors,l,v):$(t.errors,l)}else t.errors=u;return u},he=async(i,u,l={valid:!0})=>{for(const v in i){const p=i[v];if(p){const{_f:m,...b}=p;if(m){const F=o.array.has(m.name),P=p._f&&es(p._f);P&&y.validatingFields&&S([v],!0);const W=await ur(p,o.disabled,a,B,e.shouldUseNativeValidation&&!u,F);if(P&&y.validatingFields&&S([v]),W[m.name]&&(l.valid=!1,u))break;!u&&(g(W,m.name)?F?is(t.errors,W,m.name):D(t.errors,m.name,W[m.name]):$(t.errors,m.name))}!J(b)&&await he(b,u,l)}}return l.valid},I=()=>{for(const i of o.unMount){const u=g(s,i);u&&(u._f.refs?u._f.refs.every(l=>!wt(l)):!wt(u._f.ref))&&vt(i)}o.unMount=new Set},O=(i,u)=>!e.disabled&&(i&&u&&D(a,i,u),!ke($t(),n)),j=(i,u,l)=>kr(i,o,{...d.mount?a:M(u)?n:le(i)?{[i]:u}:u},l,u),X=i=>yt(g(d.mount?a:n,i,e.shouldUnregister?g(n,i,[]):[])),te=(i,u,l={})=>{const v=g(s,i);let p=u;if(v){const m=v._f;m&&(!m.disabled&&D(a,i,Cr(u,m)),p=Ke(m.ref)&&Y(u)?"":u,wr(m.ref)?[...m.ref.options].forEach(b=>b.selected=p.includes(b.value)):m.refs?Ye(m.ref)?m.refs.length>1?m.refs.forEach(b=>(!b.defaultChecked||!b.disabled)&&(b.checked=Array.isArray(p)?!!p.find(F=>F===b.value):p===b.value)):m.refs[0]&&(m.refs[0].checked=!!p):m.refs.forEach(b=>b.checked=b.value===p):Mt(m.ref)?m.ref.value="":(m.ref.value=p,m.ref.type||C.state.next({name:i,values:z(a)})))}(l.shouldDirty||l.shouldTouch)&&Ze(i,p,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&_t(i)},ue=(i,u,l)=>{for(const v in u){const p=u[v],m=`${i}.${v}`,b=g(s,m);(o.array.has(i)||L(p)||b&&!b._f)&&!Se(p)?ue(m,p,l):te(m,p,l)}},xe=(i,u,l={})=>{const v=g(s,i),p=o.array.has(i),m=z(u);D(a,i,m),p?(C.array.next({name:i,values:z(a)}),(y.isDirty||y.dirtyFields||V.isDirty||V.dirtyFields)&&l.shouldDirty&&C.state.next({name:i,dirtyFields:Me(n,a),isDirty:O(i,m)})):v&&!v._f&&!Y(m)?ue(i,m,l):te(i,m,l),ir(i,o)&&C.state.next({...t}),C.state.next({name:d.mount?i:void 0,values:z(a)})},je=async i=>{d.mount=!0;const u=i.target;let l=u.name,v=!0;const p=g(s,l),m=b=>{v=Number.isNaN(b)||Se(b)&&isNaN(b.getTime())||ke(b,g(a,l,b))};if(p){let b,F;const P=u.type?sr(p._f):gr(i),W=i.type===Qe.BLUR||i.type===Qe.FOCUS_OUT,$r=!ts(p._f)&&!e.resolver&&!g(t.errors,l)&&!p._f.deps||ns(W,g(t.touchedFields,l),t.isSubmitted,ne,se),bt=ir(l,o,W);D(a,l,P),W?(p._f.onBlur&&p._f.onBlur(i),c&&c(0)):p._f.onChange&&p._f.onChange(i);const kt=Ze(l,P,W),Ur=!J(kt)||bt;if(!W&&C.state.next({name:l,type:i.type,values:z(a)}),$r)return(y.isValid||V.isValid)&&(e.mode==="onBlur"?W&&H():W||H()),Ur&&C.state.next({name:l,...bt?{}:kt});if(!W&&bt&&C.state.next({...t}),e.resolver){const{errors:Xt}=await oe([l]);if(m(P),v){const Br=dr(t.errors,s,l),Qt=dr(Xt,s,Br.name||l);b=Qt.error,l=Qt.name,F=J(Xt)}}else S([l],!0),b=(await ur(p,o.disabled,a,B,e.shouldUseNativeValidation))[l],S([l]),m(P),v&&(b?F=!1:(y.isValid||V.isValid)&&(F=await he(s,!0)));v&&(p._f.deps&&_t(p._f.deps),gt(l,F,b,kt))}},Ge=(i,u)=>{if(g(t.errors,u)&&i.focus)return i.focus(),1},_t=async(i,u={})=>{let l,v;const p=Be(i);if(e.resolver){const m=await Ae(M(i)?i:p);l=J(m),v=i?!p.some(b=>g(m,b)):l}else i?(v=(await Promise.all(p.map(async m=>{const b=g(s,m);return await he(b&&b._f?{[m]:b}:b)}))).every(Boolean),!(!v&&!t.isValid)&&H()):v=l=await he(s);return C.state.next({...!le(i)||(y.isValid||V.isValid)&&l!==t.isValid?{}:{name:i},...e.resolver||!i?{isValid:l}:{},errors:t.errors}),u.shouldFocus&&!v&&ze(s,Ge,i?p:o.mount),v},$t=i=>{const u={...d.mount?a:n};return M(i)?u:le(i)?g(u,i):i.map(l=>g(u,l))},Ut=(i,u)=>({invalid:!!g((u||t).errors,i),isDirty:!!g((u||t).dirtyFields,i),error:g((u||t).errors,i),isValidating:!!g(t.validatingFields,i),isTouched:!!g((u||t).touchedFields,i)}),Ir=i=>{i&&Be(i).forEach(u=>$(t.errors,u)),C.state.next({errors:i?t.errors:{}})},Bt=(i,u,l)=>{const v=(g(s,i,{_f:{}})._f||{}).ref,p=g(t.errors,i)||{},{ref:m,message:b,type:F,...P}=p;D(t.errors,i,{...P,...u,ref:v}),C.state.next({name:i,errors:t.errors,isValid:!1}),l&&l.shouldFocus&&v&&v.focus&&v.focus()},Dr=(i,u)=>de(i)?C.state.subscribe({next:l=>i(j(void 0,u),l)}):j(i,u,!0),zt=i=>C.state.subscribe({next:u=>{ss(i.name,u.name,i.exact)&&rs(u,i.formState||y,Pr,i.reRenderRoot)&&i.callback({values:{...a},...t,...u})}}).unsubscribe,Zr=i=>(d.mount=!0,V={...V,...i.formState},zt({...i,formState:V})),vt=(i,u={})=>{for(const l of i?Be(i):o.mount)o.mount.delete(l),o.array.delete(l),u.keepValue||($(s,l),$(a,l)),!u.keepError&&$(t.errors,l),!u.keepDirty&&$(t.dirtyFields,l),!u.keepTouched&&$(t.touchedFields,l),!u.keepIsValidating&&$(t.validatingFields,l),!e.shouldUnregister&&!u.keepDefaultValue&&$(n,l);C.state.next({values:z(a)}),C.state.next({...t,...u.keepDirty?{isDirty:O()}:{}}),!u.keepIsValid&&H()},Wt=({disabled:i,name:u})=>{(ee(i)&&d.mount||i||o.disabled.has(u))&&(i?o.disabled.add(u):o.disabled.delete(u))},xt=(i,u={})=>{let l=g(s,i);const v=ee(u.disabled)||ee(e.disabled);return D(s,i,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:i}},name:i,mount:!0,...u}}),o.mount.add(i),l?Wt({disabled:ee(u.disabled)?u.disabled:e.disabled,name:i}):De(i,!0,u.value),{...v?{disabled:u.disabled||e.disabled}:{},...e.progressive?{required:!!u.required,min:Le(u.min),max:Le(u.max),minLength:Le(u.minLength),maxLength:Le(u.maxLength),pattern:Le(u.pattern)}:{},name:i,onChange:je,onBlur:je,ref:p=>{if(p){xt(i,u),l=g(s,i);const m=M(p.value)&&p.querySelectorAll&&p.querySelectorAll("input,select,textarea")[0]||p,b=Gr(m),F=l._f.refs||[];if(b?F.find(P=>P===m):m===l._f.ref)return;D(s,i,{_f:{...l._f,...b?{refs:[...F.filter(wt),m,...Array.isArray(g(n,i))?[{}]:[]],ref:{type:m.type,name:i}}:{ref:m}}}),De(i,!1,void 0,m)}else l=g(s,i,{}),l._f&&(l._f.mount=!1),(e.shouldUnregister||u.shouldUnregister)&&!(_r(o.array,i)&&d.action)&&o.unMount.add(i)}}},qt=()=>e.shouldFocusError&&ze(s,Ge,o.mount),jr=i=>{ee(i)&&(C.state.next({disabled:i}),ze(s,(u,l)=>{const v=g(s,l);v&&(u.disabled=v._f.disabled||i,Array.isArray(v._f.refs)&&v._f.refs.forEach(p=>{p.disabled=v._f.disabled||i}))},0,!1))},Ht=(i,u)=>async l=>{let v;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let p=z(a);if(C.state.next({isSubmitting:!0}),e.resolver){const{errors:m,values:b}=await oe();t.errors=m,p=b}else await he(s);if(o.disabled.size)for(const m of o.disabled)D(p,m,void 0);if($(t.errors,"root"),J(t.errors)){C.state.next({errors:{}});try{await i(p,l)}catch(m){v=m}}else u&&await u({...t.errors},l),qt(),setTimeout(qt);if(C.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:J(t.errors)&&!v,submitCount:t.submitCount+1,errors:t.errors}),v)throw v},Mr=(i,u={})=>{g(s,i)&&(M(u.defaultValue)?xe(i,z(g(n,i))):(xe(i,u.defaultValue),D(n,i,z(u.defaultValue))),u.keepTouched||$(t.touchedFields,i),u.keepDirty||($(t.dirtyFields,i),t.isDirty=u.defaultValue?O(i,z(g(n,i))):O()),u.keepError||($(t.errors,i),y.isValid&&H()),C.state.next({...t}))},Jt=(i,u={})=>{const l=i?z(i):n,v=z(l),p=J(i),m=p?n:v;if(u.keepDefaultValues||(n=l),!u.keepValues){if(u.keepDirtyValues){const b=new Set([...o.mount,...Object.keys(Me(n,a))]);for(const F of Array.from(b))g(t.dirtyFields,F)?D(m,F,g(a,F)):xe(F,g(m,F))}else{if(Dt&&M(i))for(const b of o.mount){const F=g(s,b);if(F&&F._f){const P=Array.isArray(F._f.refs)?F._f.refs[0]:F._f.ref;if(Ke(P)){const W=P.closest("form");if(W){W.reset();break}}}}for(const b of o.mount)xe(b,g(m,b))}a=z(m),C.array.next({values:{...m}}),C.state.next({values:{...m}})}o={mount:u.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!y.isValid||!!u.keepIsValid||!!u.keepDirtyValues,d.watch=!!e.shouldUnregister,C.state.next({submitCount:u.keepSubmitCount?t.submitCount:0,isDirty:p?!1:u.keepDirty?t.isDirty:!!(u.keepDefaultValues&&!ke(i,n)),isSubmitted:u.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:p?{}:u.keepDirtyValues?u.keepDefaultValues&&a?Me(n,a):t.dirtyFields:u.keepDefaultValues&&i?Me(n,i):u.keepDirty?t.dirtyFields:{},touchedFields:u.keepTouched?t.touchedFields:{},errors:u.keepErrors?t.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1})},Yt=(i,u)=>Jt(de(i)?i(a):i,u),Lr=(i,u={})=>{const l=g(s,i),v=l&&l._f;if(v){const p=v.refs?v.refs[0]:v.ref;p.focus&&(p.focus(),u.shouldSelect&&de(p.select)&&p.select())}},Pr=i=>{t={...t,...i}},Gt={control:{register:xt,unregister:vt,getFieldState:Ut,handleSubmit:Ht,setError:Bt,_subscribe:zt,_runSchema:oe,_getWatch:j,_getDirty:O,_setValid:H,_setFieldArray:ae,_setDisabledField:Wt,_setErrors:U,_getFieldArray:X,_reset:Jt,_resetDefaultValues:()=>de(e.defaultValues)&&e.defaultValues().then(i=>{Yt(i,e.resetOptions),C.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:jr,_subjects:C,_proxyFormState:y,get _fields(){return s},get _formValues(){return a},get _state(){return d},set _state(i){d=i},get _defaultValues(){return n},get _names(){return o},set _names(i){o=i},get _formState(){return t},get _options(){return e},set _options(i){e={...e,...i}}},subscribe:Zr,trigger:_t,register:xt,handleSubmit:Ht,watch:Dr,setValue:xe,getValues:$t,reset:Yt,resetField:Mr,clearErrors:Ir,unregister:vt,setError:Bt,setFocus:Lr,getFieldState:Ut};return{...Gt,formControl:Gt}}function Ms(r={}){const e=R.useRef(void 0),t=R.useRef(void 0),[s,n]=R.useState({isDirty:!1,isValidating:!1,isLoading:de(r.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1,defaultValues:de(r.defaultValues)?void 0:r.defaultValues});e.current||(e.current={...r.formControl?r.formControl:os(r),formState:s},r.formControl&&r.defaultValues&&!de(r.defaultValues)&&r.formControl.reset(r.defaultValues,r.resetOptions));const a=e.current.control;return a._options=r,R.useLayoutEffect(()=>a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0}),[a]),R.useEffect(()=>a._disableForm(r.disabled),[a,r.disabled]),R.useEffect(()=>{if(a._proxyFormState.isDirty){const d=a._getDirty();d!==s.isDirty&&a._subjects.state.next({isDirty:d})}},[a,s.isDirty]),R.useEffect(()=>{r.values&&!ke(r.values,t.current)?(a._reset(r.values,a._options.resetOptions),t.current=r.values,n(d=>({...d}))):a._resetDefaultValues()},[r.values,a]),R.useEffect(()=>{r.errors&&!J(r.errors)&&a._setErrors(r.errors)},[r.errors,a]),R.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),R.useEffect(()=>{r.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[r.shouldUnregister,a]),e.current.formState=br(s,a),e.current}const lr=(r,e,t)=>{if(r&&"reportValidity"in r){const s=g(t,e);r.setCustomValidity(s&&s.message||""),r.reportValidity()}},us=(r,e)=>{for(const t in e.fields){const s=e.fields[t];s&&s.ref&&"reportValidity"in s.ref?lr(s.ref,t,r):s&&s.refs&&s.refs.forEach(n=>lr(n,t,r))}},Ls=(r,e)=>{e.shouldUseNativeValidation&&us(r,e);const t={};for(const s in r){const n=g(e.fields,s),a=Object.assign(r[s]||{},{ref:n&&n.ref});if(ls(e.names||Object.keys(r),s)){const d=Object.assign({},g(t,s));D(d,"root",a),D(t,s,d)}else D(t,s,a)}return t},ls=(r,e)=>{const t=cr(e);return r.some(s=>cr(s).match(`^${t}\\.\\d+`))};function cr(r){return r.replace(/\]|\[/g,"")}var N;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const d of n)a[d]=d;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),d={};for(const o of a)d[o]=n[o];return r.objectValues(d)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const d in n)Object.prototype.hasOwnProperty.call(n,d)&&a.push(d);return a},r.find=(n,a)=>{for(const d of n)if(a(d))return d},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(d=>typeof d=="string"?`'${d}'`:d).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(N||(N={}));var fr;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(fr||(fr={}));const x=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),be=r=>{switch(typeof r){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(r)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(r)?x.array:r===null?x.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?x.promise:typeof Map<"u"&&r instanceof Map?x.map:typeof Set<"u"&&r instanceof Set?x.set:typeof Date<"u"&&r instanceof Date?x.date:x.object;default:return x.unknown}},f=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class re extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const d of a.issues)if(d.code==="invalid_union")d.unionErrors.map(n);else if(d.code==="invalid_return_type")n(d.returnTypeError);else if(d.code==="invalid_arguments")n(d.argumentsError);else if(d.path.length===0)s._errors.push(t(d));else{let o=s,c=0;for(;ct.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}re.create=r=>new re(r);const qe=(r,e)=>{let t;switch(r.code){case f.invalid_type:r.received===x.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,N.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${N.joinValues(r.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${N.joinValues(r.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${N.joinValues(r.options)}, received '${r.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:N.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case f.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case f.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,N.assertNever(r)}return{message:t}};let cs=qe;function Tt(){return cs}const Ct=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],d={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const c=s.filter(h=>!!h).slice().reverse();for(const h of c)o=h(d,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function _(r,e){const t=Tt(),s=Ct({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===qe?void 0:qe].filter(n=>!!n)});r.common.issues.push(s)}class G{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return A;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,d=await n.value;s.push({key:a,value:d})}return G.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:d}=n;if(a.status==="aborted"||d.status==="aborted")return A;a.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof d.value<"u"||n.alwaysSet)&&(s[a.value]=d.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),Pe=r=>({status:"dirty",value:r}),Q=r=>({status:"valid",value:r}),hr=r=>r.status==="aborted",mr=r=>r.status==="dirty",Re=r=>r.status==="valid",rt=r=>typeof Promise<"u"&&r instanceof Promise;function st(r,e,t,s){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Er(r,e,t,s,n){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var k;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(k||(k={}));var $e,Ue;class fe{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const yr=(r,e)=>{if(Re(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new re(r.common.issues);return this._error=t,this._error}}};function T(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(d,o)=>{var c,h;const{message:y}=r;return d.code==="invalid_enum_value"?{message:y??o.defaultError}:typeof o.data>"u"?{message:(c=y??s)!==null&&c!==void 0?c:o.defaultError}:d.code!=="invalid_type"?{message:o.defaultError}:{message:(h=y??t)!==null&&h!==void 0?h:o.defaultError}},description:n}}class E{get description(){return this._def.description}_getType(e){return be(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new G,ctx:{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(rt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},a=this._parseSync({data:e,path:n.path,parent:n});return yr(n,a)}"~validate"(e){var t,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return Re(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>Re(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(rt(n)?n:Promise.resolve(n));return yr(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const d=e(n),o=()=>a.addIssue({code:f.custom,...s(n)});return typeof Promise<"u"&&d instanceof Promise?d.then(c=>c?!0:(o(),!1)):d?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new ve({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return ge.create(this,this._def)}nullable(){return Ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ce.create(this)}promise(){return Je.create(this,this._def)}or(e){return it.create([this,e],this._def)}and(e){return dt.create(this,e,this._def)}transform(e){return new ve({...T(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ft({...T(this._def),innerType:this,defaultValue:t,typeName:w.ZodDefault})}brand(){return new Fr({typeName:w.ZodBranded,type:this,...T(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ht({...T(this._def),innerType:this,catchValue:t,typeName:w.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return pt.create(this,e)}readonly(){return mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const fs=/^c[^\s-]{8,}$/i,hs=/^[0-9a-z]+$/,ms=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ys=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ps=/^[a-z0-9_-]{21}$/i,gs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_s=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,vs=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let At;const bs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ks=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ws=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,As=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ss=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ts=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Or="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Cs=new RegExp(`^${Or}$`);function Rr(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Vs(r){return new RegExp(`^${Rr(r)}$`)}function Es(r){let e=`${Or}T${Rr(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Os(r,e){return!!((e==="v4"||!e)&&bs.test(r)||(e==="v6"||!e)&&ws.test(r))}function Rs(r,e){if(!gs.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function Ns(r,e){return!!((e==="v4"||!e)&&ks.test(r)||(e==="v6"||!e)&&As.test(r))}class pe extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const a=this._getOrReturnCtx(e);return _(a,{code:f.invalid_type,expected:x.string,received:a.parsedType}),A}const s=new G;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:f.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const d=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:f.invalid_string,...k.errToObj(s)})}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...k.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...k.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...k.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new pe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new pe({checks:[],typeName:w.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...T(r)})};function Fs(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),d=parseInt(e.toFixed(n).replace(".",""));return a%d/Math.pow(10,n)}class Ne extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const a=this._getOrReturnCtx(e);return _(a,{code:f.invalid_type,expected:x.number,received:a.parsedType}),A}let s;const n=new G;for(const a of this._def.checks)a.kind==="int"?N.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),_(s,{code:f.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),_(s,{code:f.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Fs(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),_(s,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),_(s,{code:f.not_finite,message:a.message}),n.dirty()):N.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,s,n){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:k.toString(n)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.valuenew Ne({checks:[],typeName:w.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...T(r)});class Fe extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==x.bigint)return this._getInvalidInput(e);let s;const n=new G;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),_(s,{code:f.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),_(s,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):N.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return _(t,{code:f.invalid_type,expected:x.bigint,received:t.parsedType}),A}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,s,n){return new Fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:k.toString(n)}]})}_addCheck(e){return new Fe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Fe({checks:[],typeName:w.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...T(r)})};class Vt extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==x.boolean){const s=this._getOrReturnCtx(e);return _(s,{code:f.invalid_type,expected:x.boolean,received:s.parsedType}),A}return Q(e.data)}}Vt.create=r=>new Vt({typeName:w.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...T(r)});class He extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const a=this._getOrReturnCtx(e);return _(a,{code:f.invalid_type,expected:x.date,received:a.parsedType}),A}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return _(a,{code:f.invalid_date}),A}const s=new G;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),_(n,{code:f.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):N.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new He({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew He({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:w.ZodDate,...T(r)});class Et extends E{_parse(e){if(this._getType(e)!==x.symbol){const s=this._getOrReturnCtx(e);return _(s,{code:f.invalid_type,expected:x.symbol,received:s.parsedType}),A}return Q(e.data)}}Et.create=r=>new Et({typeName:w.ZodSymbol,...T(r)});class nt extends E{_parse(e){if(this._getType(e)!==x.undefined){const s=this._getOrReturnCtx(e);return _(s,{code:f.invalid_type,expected:x.undefined,received:s.parsedType}),A}return Q(e.data)}}nt.create=r=>new nt({typeName:w.ZodUndefined,...T(r)});class at extends E{_parse(e){if(this._getType(e)!==x.null){const s=this._getOrReturnCtx(e);return _(s,{code:f.invalid_type,expected:x.null,received:s.parsedType}),A}return Q(e.data)}}at.create=r=>new at({typeName:w.ZodNull,...T(r)});class Ot extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return Q(e.data)}}Ot.create=r=>new Ot({typeName:w.ZodAny,...T(r)});class Oe extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Q(e.data)}}Oe.create=r=>new Oe({typeName:w.ZodUnknown,...T(r)});class we extends E{_parse(e){const t=this._getOrReturnCtx(e);return _(t,{code:f.invalid_type,expected:x.never,received:t.parsedType}),A}}we.create=r=>new we({typeName:w.ZodNever,...T(r)});class Rt extends E{_parse(e){if(this._getType(e)!==x.undefined){const s=this._getOrReturnCtx(e);return _(s,{code:f.invalid_type,expected:x.void,received:s.parsedType}),A}return Q(e.data)}}Rt.create=r=>new Rt({typeName:w.ZodVoid,...T(r)});class ce extends E{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==x.array)return _(t,{code:f.invalid_type,expected:x.array,received:t.parsedType}),A;if(n.exactLength!==null){const d=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(_(t,{code:f.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((d,o)=>n.type._parseAsync(new fe(t,d,t.path,o)))).then(d=>G.mergeArray(s,d));const a=[...t.data].map((d,o)=>n.type._parseSync(new fe(t,d,t.path,o)));return G.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new ce({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new ce({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new ce({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}ce.create=(r,e)=>new ce({type:r,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...T(e)});function Ee(r){if(r instanceof Z){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=ge.create(Ee(s))}return new Z({...r._def,shape:()=>e})}else return r instanceof ce?new ce({...r._def,type:Ee(r.element)}):r instanceof ge?ge.create(Ee(r.unwrap())):r instanceof Ce?Ce.create(Ee(r.unwrap())):r instanceof _e?_e.create(r.items.map(e=>Ee(e))):r}class Z extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=N.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const h=this._getOrReturnCtx(e);return _(h,{code:f.invalid_type,expected:x.object,received:h.parsedType}),A}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:d}=this._getCached(),o=[];if(!(this._def.catchall instanceof we&&this._def.unknownKeys==="strip"))for(const h in n.data)d.includes(h)||o.push(h);const c=[];for(const h of d){const y=a[h],V=n.data[h];c.push({key:{status:"valid",value:h},value:y._parse(new fe(n,V,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof we){const h=this._def.unknownKeys;if(h==="passthrough")for(const y of o)c.push({key:{status:"valid",value:y},value:{status:"valid",value:n.data[y]}});else if(h==="strict")o.length>0&&(_(n,{code:f.unrecognized_keys,keys:o}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const y of o){const V=n.data[y];c.push({key:{status:"valid",value:y},value:h._parse(new fe(n,V,n.path,y)),alwaysSet:y in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const y of c){const V=await y.key,C=await y.value;h.push({key:V,value:C,alwaysSet:y.alwaysSet})}return h}).then(h=>G.mergeObjectSync(s,h)):G.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new Z({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,d,o;const c=(d=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&d!==void 0?d:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=k.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new Z({...this._def,unknownKeys:"strip"})}passthrough(){return new Z({...this._def,unknownKeys:"passthrough"})}extend(e){return new Z({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Z({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Z({...this._def,catchall:e})}pick(e){const t={};return N.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new Z({...this._def,shape:()=>t})}omit(e){const t={};return N.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new Z({...this._def,shape:()=>t})}deepPartial(){return Ee(this)}partial(e){const t={};return N.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new Z({...this._def,shape:()=>t})}required(e){const t={};return N.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof ge;)a=a._def.innerType;t[s]=a}}),new Z({...this._def,shape:()=>t})}keyof(){return Nr(N.objectKeys(this.shape))}}Z.create=(r,e)=>new Z({shape:()=>r,unknownKeys:"strip",catchall:we.create(),typeName:w.ZodObject,...T(e)});Z.strictCreate=(r,e)=>new Z({shape:()=>r,unknownKeys:"strict",catchall:we.create(),typeName:w.ZodObject,...T(e)});Z.lazycreate=(r,e)=>new Z({shape:r,unknownKeys:"strip",catchall:we.create(),typeName:w.ZodObject,...T(e)});class it extends E{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const d=a.map(o=>new re(o.ctx.common.issues));return _(t,{code:f.invalid_union,unionErrors:d}),A}if(t.common.async)return Promise.all(s.map(async a=>{const d={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:d}),ctx:d}})).then(n);{let a;const d=[];for(const c of s){const h={...t,common:{...t.common,issues:[]},parent:null},y=c._parseSync({data:t.data,path:t.path,parent:h});if(y.status==="valid")return y;y.status==="dirty"&&!a&&(a={result:y,ctx:h}),h.common.issues.length&&d.push(h.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=d.map(c=>new re(c));return _(t,{code:f.invalid_union,unionErrors:o}),A}}get options(){return this._def.options}}it.create=(r,e)=>new it({options:r,typeName:w.ZodUnion,...T(e)});const ye=r=>r instanceof ut?ye(r.schema):r instanceof ve?ye(r.innerType()):r instanceof lt?[r.value]:r instanceof Te?r.options:r instanceof ct?N.objectValues(r.enum):r instanceof ft?ye(r._def.innerType):r instanceof nt?[void 0]:r instanceof at?[null]:r instanceof ge?[void 0,...ye(r.unwrap())]:r instanceof Ce?[null,...ye(r.unwrap())]:r instanceof Fr||r instanceof mt?ye(r.unwrap()):r instanceof ht?ye(r._def.innerType):[];class Pt extends E{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return _(t,{code:f.invalid_type,expected:x.object,received:t.parsedType}),A;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(_(t,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const d=ye(a.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of d){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new Pt({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...T(s)})}}function Nt(r,e){const t=be(r),s=be(e);if(r===e)return{valid:!0,data:r};if(t===x.object&&s===x.object){const n=N.objectKeys(e),a=N.objectKeys(r).filter(o=>n.indexOf(o)!==-1),d={...r,...e};for(const o of a){const c=Nt(r[o],e[o]);if(!c.valid)return{valid:!1};d[o]=c.data}return{valid:!0,data:d}}else if(t===x.array&&s===x.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(hr(a)||hr(d))return A;const o=Nt(a.value,d.value);return o.valid?((mr(a)||mr(d))&&t.dirty(),{status:t.value,value:o.data}):(_(s,{code:f.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,d])=>n(a,d)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}dt.create=(r,e,t)=>new dt({left:r,right:e,typeName:w.ZodIntersection,...T(t)});class _e extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return _(s,{code:f.invalid_type,expected:x.array,received:s.parsedType}),A;if(s.data.lengththis._def.items.length&&(_(s,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((d,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new fe(s,d,s.path,o)):null}).filter(d=>!!d);return s.common.async?Promise.all(a).then(d=>G.mergeArray(t,d)):G.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new _e({...this._def,rest:e})}}_e.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _e({items:r,typeName:w.ZodTuple,rest:null,...T(e)})};class ot extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.object)return _(s,{code:f.invalid_type,expected:x.object,received:s.parsedType}),A;const n=[],a=this._def.keyType,d=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new fe(s,o,s.path,o)),value:d._parse(new fe(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?G.mergeObjectAsync(t,n):G.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof E?new ot({keyType:e,valueType:t,typeName:w.ZodRecord,...T(s)}):new ot({keyType:pe.create(),valueType:e,typeName:w.ZodRecord,...T(t)})}}class Ft extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return _(s,{code:f.invalid_type,expected:x.map,received:s.parsedType}),A;const n=this._def.keyType,a=this._def.valueType,d=[...s.data.entries()].map(([o,c],h)=>({key:n._parse(new fe(s,o,s.path,[h,"key"])),value:a._parse(new fe(s,c,s.path,[h,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of d){const h=await c.key,y=await c.value;if(h.status==="aborted"||y.status==="aborted")return A;(h.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(h.value,y.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const c of d){const h=c.key,y=c.value;if(h.status==="aborted"||y.status==="aborted")return A;(h.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(h.value,y.value)}return{status:t.value,value:o}}}}Ft.create=(r,e,t)=>new Ft({valueType:e,keyType:r,typeName:w.ZodMap,...T(t)});class Ie extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return _(s,{code:f.invalid_type,expected:x.set,received:s.parsedType}),A;const n=this._def;n.minSize!==null&&s.data.sizen.maxSize.value&&(_(s,{code:f.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function d(c){const h=new Set;for(const y of c){if(y.status==="aborted")return A;y.status==="dirty"&&t.dirty(),h.add(y.value)}return{status:t.value,value:h}}const o=[...s.data.values()].map((c,h)=>a._parse(new fe(s,c,s.path,h)));return s.common.async?Promise.all(o).then(c=>d(c)):d(o)}min(e,t){return new Ie({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new Ie({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ie.create=(r,e)=>new Ie({valueType:r,minSize:null,maxSize:null,typeName:w.ZodSet,...T(e)});class We extends E{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return _(t,{code:f.invalid_type,expected:x.function,received:t.parsedType}),A;function s(o,c){return Ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Tt(),qe].filter(h=>!!h),issueData:{code:f.invalid_arguments,argumentsError:c}})}function n(o,c){return Ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Tt(),qe].filter(h=>!!h),issueData:{code:f.invalid_return_type,returnTypeError:c}})}const a={errorMap:t.common.contextualErrorMap},d=t.data;if(this._def.returns instanceof Je){const o=this;return Q(async function(...c){const h=new re([]),y=await o._def.args.parseAsync(c,a).catch(se=>{throw h.addIssue(s(c,se)),h}),V=await Reflect.apply(d,this,y);return await o._def.returns._def.type.parseAsync(V,a).catch(se=>{throw h.addIssue(n(V,se)),h})})}else{const o=this;return Q(function(...c){const h=o._def.args.safeParse(c,a);if(!h.success)throw new re([s(c,h.error)]);const y=Reflect.apply(d,this,h.data),V=o._def.returns.safeParse(y,a);if(!V.success)throw new re([n(y,V.error)]);return V.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new We({...this._def,args:_e.create(e).rest(Oe.create())})}returns(e){return new We({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new We({args:e||_e.create([]).rest(Oe.create()),returns:t||Oe.create(),typeName:w.ZodFunction,...T(s)})}}class ut extends E{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ut.create=(r,e)=>new ut({getter:r,typeName:w.ZodLazy,...T(e)});class lt extends E{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return _(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}lt.create=(r,e)=>new lt({value:r,typeName:w.ZodLiteral,...T(e)});function Nr(r,e){return new Te({values:r,typeName:w.ZodEnum,...T(e)})}class Te extends E{constructor(){super(...arguments),$e.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return _(t,{expected:N.joinValues(s),received:t.parsedType,code:f.invalid_type}),A}if(st(this,$e)||Er(this,$e,new Set(this._def.values)),!st(this,$e).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return _(t,{received:t.data,code:f.invalid_enum_value,options:s}),A}return Q(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Te.create(e,{...this._def,...t})}exclude(e,t=this._def){return Te.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}$e=new WeakMap;Te.create=Nr;class ct extends E{constructor(){super(...arguments),Ue.set(this,void 0)}_parse(e){const t=N.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const n=N.objectValues(t);return _(s,{expected:N.joinValues(n),received:s.parsedType,code:f.invalid_type}),A}if(st(this,Ue)||Er(this,Ue,new Set(N.getValidEnumValues(this._def.values))),!st(this,Ue).has(e.data)){const n=N.objectValues(t);return _(s,{received:s.data,code:f.invalid_enum_value,options:n}),A}return Q(e.data)}get enum(){return this._def.values}}Ue=new WeakMap;ct.create=(r,e)=>new ct({values:r,typeName:w.ZodNativeEnum,...T(e)});class Je extends E{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&t.common.async===!1)return _(t,{code:f.invalid_type,expected:x.promise,received:t.parsedType}),A;const s=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return Q(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Je.create=(r,e)=>new Je({type:r,typeName:w.ZodPromise,...T(e)});class ve extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:d=>{_(s,d),d.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const d=n.transform(s.data,a);if(s.common.async)return Promise.resolve(d).then(async o=>{if(t.value==="aborted")return A;const c=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return c.status==="aborted"?A:c.status==="dirty"||t.value==="dirty"?Pe(c.value):c});{if(t.value==="aborted")return A;const o=this._def.schema._parseSync({data:d,path:s.path,parent:s});return o.status==="aborted"?A:o.status==="dirty"||t.value==="dirty"?Pe(o.value):o}}if(n.type==="refinement"){const d=o=>{const c=n.refinement(o,a);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?A:(o.status==="dirty"&&t.dirty(),d(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?A:(o.status==="dirty"&&t.dirty(),d(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Re(d))return d;const o=n.transform(d.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>Re(d)?Promise.resolve(n.transform(d.value,a)).then(o=>({status:t.value,value:o})):d);N.assertNever(n)}}ve.create=(r,e,t)=>new ve({schema:r,typeName:w.ZodEffects,effect:e,...T(t)});ve.createWithPreprocess=(r,e,t)=>new ve({schema:e,effect:{type:"preprocess",transform:r},typeName:w.ZodEffects,...T(t)});class ge extends E{_parse(e){return this._getType(e)===x.undefined?Q(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ge.create=(r,e)=>new ge({innerType:r,typeName:w.ZodOptional,...T(e)});class Ce extends E{_parse(e){return this._getType(e)===x.null?Q(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ce.create=(r,e)=>new Ce({innerType:r,typeName:w.ZodNullable,...T(e)});class ft extends E{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ft.create=(r,e)=>new ft({innerType:r,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});class ht extends E{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return rt(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new re(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new re(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ht.create=(r,e)=>new ht({innerType:r,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});class It extends E{_parse(e){if(this._getType(e)!==x.nan){const s=this._getOrReturnCtx(e);return _(s,{code:f.invalid_type,expected:x.nan,received:s.parsedType}),A}return{status:"valid",value:e.data}}}It.create=r=>new It({typeName:w.ZodNaN,...T(r)});class Fr extends E{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class pt extends E{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?A:a.status==="dirty"?(t.dirty(),Pe(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?A:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new pt({in:e,out:t,typeName:w.ZodPipeline})}}class mt extends E{_parse(e){const t=this._def.innerType._parse(e),s=n=>(Re(n)&&(n.value=Object.freeze(n.value)),n);return rt(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}mt.create=(r,e)=>new mt({innerType:r,typeName:w.ZodReadonly,...T(e)});Z.lazycreate;var w;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(w||(w={}));const Ps=pe.create;Ne.create;It.create;Fe.create;Vt.create;const $s=He.create;Et.create;nt.create;at.create;Ot.create;Oe.create;we.create;Rt.create;ce.create;const Us=Z.create;Z.strictCreate;it.create;Pt.create;dt.create;_e.create;ot.create;Ft.create;Ie.create;We.create;ut.create;lt.create;Te.create;ct.create;Je.create;ve.create;ge.create;Ce.create;ve.createWithPreprocess;pt.create;export{js as C,Zs as F,Yr as a,Us as b,Ps as c,$s as d,Ms as e,us as o,Ls as s,jt as u}; diff --git a/pkg/ui/frontend/dist/assets/index-BbvoJYjW.js b/pkg/ui/frontend/dist/assets/index-BbvoJYjW.js deleted file mode 100644 index b9ca1eb2e5..0000000000 --- a/pkg/ui/frontend/dist/assets/index-BbvoJYjW.js +++ /dev/null @@ -1,63 +0,0 @@ -import{j as e,S as Ee,c as br,P as ae,e as Be,B as po,E as yr,G as mo,T as fo,H as go,I as vr,J as ho,K as xo,L as bo,M as jr,u as wr,N as yo,V as Nr,a as vo,g as jo,b as wt,d as me,O as wo,n as No,p as ko,m as So}from"./radix-core-mDeFS0Pz.js";import{c as kr,r as i,b as ze}from"./react-core-D_V7s-9r.js";import{u as Ft,a as nt,L as de,b as Sr,c as Eo,d as Co,R as To,e as Ro,f as Ao,g as _o}from"./react-router-CHYnaA34.js";import{t as Io,c as vs,a as Ce}from"./ui-utils-BNSC_Jv-.js";import{S as Fo,M as Lo,C as Er,R as Po,H as Do,a as Ge,b as Oo,A as Ys,c as cs,d as Cr,e as Lt,X as js,f as Tr,P as $o,L as xe,g as ot,h as Rr,i as Mo,j as Bo,k as it,l as Ar,F as zo,m as Vo,D as _r,n as Ir,o as Uo,G as ws,p as qo,q as Go,r as Ho,s as Ko,t as Wo,U as Zo,u as Yo,B as Xo}from"./ui-icons-CjYyohUG.js";import{f as Qo,a as Jo,b as Fr,c as Nt,p as ds,i as Ye,d as ei,e as Xs,g as ti,h as si,D as Qs}from"./date-utils-B7GSU5zA.js";import{R as Lr,I as ri,T as Pr,a as ai,S as Dr,b as Or,P as ni,C as $r,V as oi,L as Mr,c as Br,d as ii,e as li,f as zr,g as ci,h as di,i as Vr,j as ui,k as Ur,l as qr,m as Gr}from"./radix-inputs-CUuf_8as.js";import{S as Hr,d as Kr,P as pi,C as Wr,e as Zr,f as Yr,g as Xr,h as Qr,L as Jr,i as ea,j as mi,T as fi,k as ta,V as gi,l as hi,m as sa,n as xi,o as ra,p as aa,q as na,r as bi,c as yi}from"./radix-navigation-WDVJ59Wc.js";import{R as Ns,P as ks,O as lt,C as ct,a as oa,T as Pt,D as Dt,b as ia,c as vi,d as ji,e as wi,f as Ni,g as ki,h as la}from"./radix-layout-CuQMCqor.js";import{R as dt,P as Ot,a as $t,C as Mt,T as ut,d as Si,B as Ei,b as Ci,Y as Ti,X as Ri,c as Ai}from"./data-viz-BuFFX-vG.js";import{u as Bt,a as _i,Q as Ii,b as Fi}from"./query-management-D8IQJSUy.js";import{z as Li}from"./theme-utils-CNom64Sw.js";import{u as Pi,F as Di,C as Oi,o as $i,r as Mi,a as Bi,b as ca,s as Xe,d as Js,c as da}from"./form-libs-B6JBoFJD.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();var ua,er=kr;ua=er.createRoot,er.hydrateRoot;function v(...t){return Io(vs(t))}function fe(t){if(t===0)return"0 B";const s=1024,r=["B","KB","MB","GB","TB","PB"],a=Math.floor(Math.log(t)/Math.log(s));return`${parseFloat((t/Math.pow(s,a)).toFixed(2))} ${r[a]}`}function $e(t,s){return t?Object.keys(t).find(r=>pa(t[r],s)):null}function pa(t,s){var r;return((r=t.services)==null?void 0:r.some(a=>a.service===s))??!1}const zi=Ce("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),q=i.forwardRef(({className:t,variant:s,size:r,asChild:a=!1,...n},o)=>{const l=a?Ee:"button";return e.jsx(l,{className:v(zi({variant:s,size:r,className:t})),ref:o,...n})});q.displayName="Button";function Vi(){return e.jsx(q,{variant:"ghost",size:"icon",className:"bg-muted hover:bg-muted-hover rounded-lg",asChild:!0,children:e.jsxs("a",{href:"https://github.com/grafana/loki",target:"_blank",rel:"noopener noreferrer",children:[e.jsx("svg",{viewBox:"0 0 438.549 438.549",className:"h-[1.2rem] w-[1.2rem]",children:e.jsx("path",{fill:"currentColor",d:"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"})}),e.jsx("span",{className:"sr-only",children:"View on GitHub"})]})})}const Ui={theme:"light",setTheme:()=>null},ma=i.createContext(Ui);function qi(){const t=i.useContext(ma);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}function Gi({children:t,defaultTheme:s="light",storageKey:r="loki-ui-theme",...a}){const[n,o]=i.useState(()=>{try{const c=localStorage.getItem(r);return c==="dark"||c==="light"?c:s}catch{return s}}),l=c=>{try{localStorage.setItem(r,c),o(c)}catch(d){console.error("Failed to save theme:",d)}};return i.useEffect(()=>{const c=window.document.documentElement;c.classList.remove("light","dark"),c.classList.add(n)},[n]),e.jsx(ma.Provider,{value:{theme:n,setTheme:l},...a,children:t})}function Hi(){const{theme:t,setTheme:s}=qi(),r=()=>{s(t==="light"?"dark":"light")};return e.jsxs(q,{variant:"ghost",size:"icon",className:"bg-muted hover:bg-muted-hover rounded-lg",onClick:r,children:[t==="light"?e.jsx(Fo,{className:"h-[1.2rem] w-[1.2rem]"}):e.jsx(Lo,{className:"h-[1.2rem] w-[1.2rem]"}),e.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function Ki(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Vi,{}),e.jsx(Hi,{})]})}const Ss=i.forwardRef(({...t},s)=>e.jsx("nav",{ref:s,"aria-label":"breadcrumb",...t}));Ss.displayName="Breadcrumb";const Es=i.forwardRef(({className:t,...s},r)=>e.jsx("ol",{ref:r,className:v("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...s}));Es.displayName="BreadcrumbList";const kt=i.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:v("inline-flex items-center gap-1.5",t),...s}));kt.displayName="BreadcrumbItem";const St=i.forwardRef(({asChild:t,className:s,...r},a)=>{const n=t?Ee:"a";return e.jsx(n,{ref:a,className:v("transition-colors hover:text-foreground",s),...r})});St.displayName="BreadcrumbLink";const fa=i.forwardRef(({className:t,...s},r)=>e.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:v("font-normal text-foreground",t),...s}));fa.displayName="BreadcrumbPage";const Et=({children:t,className:s,...r})=>e.jsx("li",{role:"presentation","aria-hidden":"true",className:v("[&>svg]:w-3.5 [&>svg]:h-3.5",s),...r,children:t??e.jsx(Er,{})});Et.displayName="BreadcrumbSeparator";const Wi=({match:t})=>{const s=t.params.nodeName;return e.jsx("span",{children:s})},Zi=({match:t})=>{const s=t.params.ringName;return e.jsx("span",{children:s})},ee=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("rounded-xl border bg-card text-card-foreground shadow",t),...s}));ee.displayName="Card";const se=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",t),...s}));se.displayName="CardHeader";const ne=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("font-semibold leading-none tracking-tight",t),...s}));ne.displayName="CardTitle";const Je=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("text-sm text-muted-foreground",t),...s}));Je.displayName="CardDescription";const te=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("p-6 pt-0",t),...s}));te.displayName="CardContent";const ga=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",t),...s}));ga.displayName="CardFooter";function Yi(){const t=Ft(),[s]=nt(),r=s.get("path")||window.location.pathname;return e.jsxs("div",{className:"flex min-h-[calc(100vh-12rem)] items-center justify-center bg-dot-pattern px-4",children:[e.jsxs(ee,{className:"w-full max-w-[450px] overflow-hidden",children:[e.jsxs(se,{className:"text-center pb-0",children:[e.jsxs("div",{className:"relative mb-8",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center"}),e.jsx("div",{className:"relative flex justify-center py-4",children:e.jsx("div",{className:"bg-white dark:bg-transparent p-2 rounded-full",children:e.jsx("img",{src:"https://grafana.com/media/docs/loki/logo-grafana-loki.png",alt:"Loki Logo",className:v("h-16 w-16 sm:h-24 sm:w-24","rotate-180 animate-swing hover:animate-shake cursor-pointer transition-all duration-300")})})})]}),e.jsx(ne,{className:"text-5xl sm:text-7xl font-bold bg-gradient-to-r from-primary to-primary/50 bg-clip-text text-transparent",children:"404"})]}),e.jsxs(te,{className:"text-center space-y-3 pb-8",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-semibold tracking-tight",children:"Oops! Page Not Found"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Even with our powerful log aggregation, we couldn't find this page in any of our streams!"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground italic",children:["Error: LogQL query returned 0 results for label"," ",`{path="${r}"}`]})]}),e.jsxs(ga,{className:"flex justify-center gap-4 pb-8",children:[e.jsxs(q,{variant:"outline",onClick:()=>t(-1),className:"gap-2 group",size:"sm",children:[e.jsx(Po,{className:"h-4 w-4 group-hover:animate-spin"}),"Go Back"]}),e.jsxs(q,{onClick:()=>t("/"),className:"gap-2 group",size:"sm",children:[e.jsx(Do,{className:"h-4 w-4 group-hover:animate-bounce"}),"Go Home"]})]})]}),e.jsx("style",{children:` - .bg-dot-pattern { - background-image: radial-gradient(circle at 1px 1px, hsl(var(--muted-foreground) / 0.1) 1px, transparent 0); - background-size: 32px 32px; - } - @keyframes shake { - 0%, 100% { transform: rotate(180deg); } - 25% { transform: rotate(170deg); } - 75% { transform: rotate(190deg); } - } - @keyframes swing { - 0%, 100% { transform: rotate(180deg); } - 50% { transform: rotate(190deg); } - } - .animate-swing { - animation: swing 1s ease-in-out infinite; - } - .animate-shake { - animation: shake 0.3s ease-in-out; - } - `})]})}const J={INGESTER:"ingester",PARTITION_INGESTER:"partition-ingester",DISTRIBUTOR:"distributor",PATTERN_INGESTER:"pattern-ingester",QUERY_SCHEDULER:"query-scheduler",COMPACTOR:"compactor",RULER:"ruler",INDEX_GATEWAY:"index-gateway"},ha={0:"Unknown",1:"Pending",2:"Active",3:"Inactive",4:"Deleted"},Xi={cluster:null,error:null,isLoading:!0,refresh:()=>Promise.resolve()},xa=i.createContext(Xi);function pe(){const t=i.useContext(xa);if(!t)throw new Error("useCluster must be used within a ClusterProvider");return t}function Cs(){const s=window.location.pathname.match(/(.*\/ui\/)/);return(s==null?void 0:s[1])||"/ui/"}function re(t){return`${Cs()}${t.startsWith("/")?t.slice(1):t}`}function ba(t){const s=new Date(t);return`${Qo(s)} ago`}function ya(t){const s=new Date(t);return Jo(s,{format:"extended"})}function Ct(t){switch(typeof t=="string"?parseInt(t,10):t){case 2:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case 1:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case 3:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case 4:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}}function va(t){const s=t.split("").reduce((n,o)=>o.charCodeAt(0)+((n<<5)-n),0),r=["bg-rose-100 text-rose-800 dark:bg-rose-900 dark:text-rose-200","bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200","bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200","bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-200","bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200","bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200","bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200","bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900 dark:text-fuchsia-200"],a=Math.abs(s)%r.length;return r[a]}function Ts(t){const s=t.split("-");return s.length>=3?s[s.length-2]:""}function Qi(t){const s=["B","KiB","MiB","GiB","TiB"];let r=t,a=0;for(;r>=1024&&aObject.values(t).some(r=>pa(r,s)),ja={ingester:"ingester","partition-ring":"partition-ring",distributor:"distributor","pattern-ingester":"pattern-ingester","query-scheduler":"query-scheduler",compactor:"compactor",ruler:"ruler","index-gateway":"index-gateway"},ke={ingester:{title:"Ingester",ringName:J.INGESTER,ringPath:"/ring",needsTokens:!0},"partition-ring":{title:"Partition Ingester",ringName:J.PARTITION_INGESTER,ringPath:"/partition-ring",needsTokens:!0},distributor:{title:"Distributor",ringName:J.DISTRIBUTOR,ringPath:"/distributor/ring",needsTokens:!1},"pattern-ingester":{title:"Pattern Ingester",ringName:J.PATTERN_INGESTER,ringPath:"/pattern/ring",needsTokens:!0},"query-scheduler":{title:"Scheduler",ringName:J.QUERY_SCHEDULER,ringPath:"/scheduler/ring",needsTokens:!1},compactor:{title:"Compactor",ringName:J.COMPACTOR,ringPath:"/compactor/ring",needsTokens:!1},ruler:{title:"Ruler",ringName:J.RULER,ringPath:"/ruler/ring",needsTokens:!0},"index-gateway":{title:"Index Gateway",ringName:J.INDEX_GATEWAY,ringPath:"/indexgateway/ring",needsTokens:!0}};function wa(t){return Object.keys(ke).find(s=>ke[s].ringName===t)}function el(t){if(!t)return!1;const s=wa(t);return s?ke[s].needsTokens:!1}const tl=t=>{const s=[];if(!t)return s;for(const r in ke)Ji(t,r)&&s.push({title:ke[r].title,url:`/rings/${ke[r].ringName}`});return s};function Na(t,s){if(!t||!s)return"";const r=wa(s);if(!r)return"";const a=$e(t,r);if(!a)return"";const n=re(`/api/v1/proxy/${a}`),o=ke[r].ringPath,l=ke[r].needsTokens?"?tokens=true":"";return`${n}${o}${l}`}const ka=[{id:J.INGESTER,title:"Ingester"},{id:J.PARTITION_INGESTER,title:"Partition Ingester"},{id:J.DISTRIBUTOR,title:"Distributor"},{id:J.PATTERN_INGESTER,title:"Pattern Ingester"},{id:J.QUERY_SCHEDULER,title:"Scheduler"},{id:J.COMPACTOR,title:"Compactor"},{id:J.RULER,title:"Ruler"},{id:J.INDEX_GATEWAY,title:"Index Gateway"}];function sl(t){const s={};try{const r=/]*>([\s\S]*?)<\/tbody>/,a=t.match(r);if(!a)return s;const n=/]*>([\s\S]*?)<\/tr>/g,o=Array.from(a[1].matchAll(n));for(const l of o){const c=/]*>([\s\S]*?)<\/td>/g,d=Array.from(l[1].matchAll(c)).map(u=>u[1].trim().replace(/ /g,""));if(d.length>=10){const u=d[0],m=d[9].endsWith("%")?d[9]:`${d[9]}%`;s[u]=m}}}catch(r){console.error("Error parsing ring HTML:",r)}return s}function rl({ringName:t,isPaused:s=!1}){const{cluster:r}=pe(),[a,n]=i.useState(null),[o,l]=i.useState(""),[c,d]=i.useState(!1),u=i.useRef(),m=i.useMemo(()=>el(t),[t]),g=i.useCallback(()=>Na(r==null?void 0:r.members,t??""),[r,t]),y=i.useCallback(async()=>{if(!t){l("Ring name is required");return}const f=g();if(!f){l("No cluster members available");return}u.current&&u.current.abort(),u.current=new AbortController,d(!0);try{const x=await fetch(f,{headers:{Accept:"application/json"},signal:u.current.signal});if(!x.ok)throw new Error(`Failed to fetch ring: ${x.statusText}`);const b=await x.json();if(!b||!b.shards){n(null);return}const j=await fetch(f,{headers:{Accept:"text/plain"},signal:u.current.signal});if(!j.ok)throw new Error(`Failed to fetch ring ownership: ${j.statusText}`);const w=await j.text(),E=sl(w),C={...b,shards:b.shards.map(A=>({...A,ownership:E[A.id]||"0%"}))};n(C),l("")}catch(x){if(x instanceof Error&&x.name==="AbortError")return;console.error("Error fetching ring:",x),l(x instanceof Error?x.message:"Unknown error"),n(null)}finally{d(!1)}},[t,g]),N=i.useCallback(async f=>{const x=g();if(!x)throw new Error("Ring name and node name are required");let b=0;const j=f.length;for(const w of f)try{const E=new FormData;E.append("forget",w),(await fetch(x,{method:"POST",body:E})).ok&&b++}catch(E){console.error(`Error forgetting instance ${w}:`,E)}return{success:b,total:j}},[g]),{uniqueStates:h,uniqueZones:p}=i.useMemo(()=>{if(!(a!=null&&a.shards))return{uniqueStates:[],uniqueZones:[]};const f=new Set,x=new Set;return a.shards.forEach(b=>{const j=b.state||"unknown";j.trim()&&f.add(j),b.zone&&b.zone.trim()&&x.add(b.zone)}),{uniqueStates:Array.from(f).sort(),uniqueZones:Array.from(x).sort()}},[a==null?void 0:a.shards]);return i.useEffect(()=>()=>{u.current&&u.current.abort()},[]),i.useEffect(()=>{if(y(),!s){const f=setInterval(()=>{y()},5e3);return()=>{clearInterval(f)}}},[y,s]),{ring:a,error:o,isLoading:c,fetchRing:y,forgetInstances:N,uniqueStates:h,uniqueZones:p,isTokenBased:m}}const Pe=i.forwardRef(({className:t,...s},r)=>e.jsx(Lr,{ref:r,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:e.jsx(ri,{className:v("flex items-center justify-center text-current"),children:e.jsx(Ge,{className:"h-4 w-4"})})}));Pe.displayName=Lr.displayName;const Te=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:v("w-full caption-bottom text-sm",t),...s})}));Te.displayName="Table";const Re=i.forwardRef(({className:t,...s},r)=>e.jsx("thead",{ref:r,className:v("[&_tr]:border-b",t),...s}));Re.displayName="TableHeader";const Ae=i.forwardRef(({className:t,...s},r)=>e.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",t),...s}));Ae.displayName="TableBody";const al=i.forwardRef(({className:t,...s},r)=>e.jsx("tfoot",{ref:r,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...s}));al.displayName="TableFooter";const X=i.forwardRef(({className:t,...s},r)=>e.jsx("tr",{ref:r,className:v("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...s}));X.displayName="TableRow";const D=i.forwardRef(({className:t,...s},r)=>e.jsx("th",{ref:r,className:v("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s}));D.displayName="TableHead";const F=i.forwardRef(({className:t,...s},r)=>e.jsx("td",{ref:r,className:v("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s}));F.displayName="TableCell";const nl=i.forwardRef(({className:t,...s},r)=>e.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",t),...s}));nl.displayName="TableCaption";const ol=mi,il=fi,ll=i.forwardRef(({className:t,inset:s,children:r,...a},n)=>e.jsxs(Hr,{ref:n,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",s&&"pl-8",t),...a,children:[r,e.jsx(Er,{className:"ml-auto h-4 w-4"})]}));ll.displayName=Hr.displayName;const cl=i.forwardRef(({className:t,...s},r)=>e.jsx(Kr,{ref:r,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));cl.displayName=Kr.displayName;const Sa=i.forwardRef(({className:t,sideOffset:s=4,...r},a)=>e.jsx(pi,{children:e.jsx(Wr,{ref:a,sideOffset:s,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Sa.displayName=Wr.displayName;const us=i.forwardRef(({className:t,inset:s,...r},a)=>e.jsx(Zr,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s&&"pl-8",t),...r}));us.displayName=Zr.displayName;const dl=i.forwardRef(({className:t,children:s,checked:r,...a},n)=>e.jsxs(Yr,{ref:n,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Xr,{children:e.jsx(Ge,{className:"h-4 w-4"})})}),s]}));dl.displayName=Yr.displayName;const ul=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Qr,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Xr,{children:e.jsx(Oo,{className:"h-2 w-2 fill-current"})})}),s]}));ul.displayName=Qr.displayName;const pl=i.forwardRef(({className:t,inset:s,...r},a)=>e.jsx(Jr,{ref:a,className:v("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",t),...r}));pl.displayName=Jr.displayName;const ml=i.forwardRef(({className:t,...s},r)=>e.jsx(ea,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",t),...s}));ml.displayName=ea.displayName;function Z({title:t,field:s,sortField:r,sortDirection:a,onSort:n}){const o=r===s,l=c=>{r===s&&a===c||n(s)};return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(ol,{children:[e.jsx(il,{asChild:!0,children:e.jsx(q,{variant:"ghost",size:"sm",className:"-ml-3 h-8 hover:bg-muted/50 data-[state=open]:bg-muted/50",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:t}),o?a==="desc"?e.jsx(Ys,{className:"ml-2 h-4 w-4"}):e.jsx(cs,{className:"ml-2 h-4 w-4"}):e.jsx(Cr,{className:"ml-2 h-4 w-4"})]})})}),e.jsxs(Sa,{align:"start",children:[e.jsxs(us,{onClick:()=>l("asc"),className:v("cursor-pointer",o&&a==="asc"&&"bg-accent"),children:[e.jsx(cs,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),e.jsxs(us,{onClick:()=>l("desc"),className:v("cursor-pointer",o&&a==="desc"&&"bg-accent"),children:[e.jsx(Ys,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]})]})]})})}var Rs="Progress",As=100,[fl,Fm]=br(Rs),[gl,hl]=fl(Rs),Ea=i.forwardRef((t,s)=>{const{__scopeProgress:r,value:a=null,max:n,getValueLabel:o=xl,...l}=t;(n||n===0)&&!tr(n)&&console.error(bl(`${n}`,"Progress"));const c=tr(n)?n:As;a!==null&&!sr(a,c)&&console.error(yl(`${a}`,"Progress"));const d=sr(a,c)?a:null,u=Tt(d)?o(d,c):void 0;return e.jsx(gl,{scope:r,value:d,max:c,children:e.jsx(ae.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Tt(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":Ra(d,c),"data-value":d??void 0,"data-max":c,...l,ref:s})})});Ea.displayName=Rs;var Ca="ProgressIndicator",Ta=i.forwardRef((t,s)=>{const{__scopeProgress:r,...a}=t,n=hl(Ca,r);return e.jsx(ae.div,{"data-state":Ra(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...a,ref:s})});Ta.displayName=Ca;function xl(t,s){return`${Math.round(t/s*100)}%`}function Ra(t,s){return t==null?"indeterminate":t===s?"complete":"loading"}function Tt(t){return typeof t=="number"}function tr(t){return Tt(t)&&!isNaN(t)&&t>0}function sr(t,s){return Tt(t)&&!isNaN(t)&&t<=s&&t>=0}function bl(t,s){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${s}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${As}\`.`}function yl(t,s){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${s}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${As} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var Aa=Ea,vl=Ta;const _a=i.forwardRef(({className:t,value:s,...r},a)=>e.jsx(Aa,{ref:a,className:v("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...r,children:e.jsx(vl,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})}));_a.displayName=Aa.displayName;function jl({visibleIds:t,selectedIds:s,onChange:r}){const a=t.every(o=>s.has(o)),n=()=>{const o=new Set(t);r(a?new Set([...s].filter(l=>!o.has(l))):new Set([...s,...t]))};return e.jsx(Pe,{checked:t.length>0&&a,onCheckedChange:n,"aria-label":"Select all visible instances"})}function wl({instances:t,selectedInstances:s,onSelectInstance:r,sortField:a,sortDirection:n,onSort:o,showTokens:l=!1}){return e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[50px]",children:e.jsx(jl,{visibleIds:t.map(c=>c.id),selectedIds:s,onChange:c=>{t.forEach(d=>{c.has(d.id)!==s.has(d.id)&&r(d.id)})}})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"ID",field:"id",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"State",field:"state",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{children:e.jsx(Z,{title:"Address",field:"address",sortField:a,sortDirection:n,onSort:o})}),l&&e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Ownership",field:"ownership",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Zone",field:"zone",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Last Heartbeat",field:"timestamp",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[50px]"})]})}),e.jsxs(Ae,{children:[t.map(c=>{const d=l?c.ownership:0;return e.jsxs(X,{children:[e.jsx(F,{children:e.jsx(Pe,{checked:s.has(c.id),onCheckedChange:()=>r(c.id),"aria-label":`Select instance ${c.id}`})}),e.jsx(F,{className:"font-medium",children:e.jsx(de,{to:`/nodes/${c.id}`,className:"hover:underline",children:c.id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Ct(c.state)),children:c.state})}),e.jsx(F,{children:c.address}),l&&e.jsx(F,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:d}),e.jsxs("span",{className:"text-muted-foreground",children:[c.tokens.length," tokens"]})]}),e.jsx(_a,{value:typeof d=="number"?d:Number(d.slice(0,-1)),className:"h-2"})]})}),e.jsx(F,{children:c.zone?e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",va(c.zone)),children:c.zone}):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(F,{children:e.jsx("span",{title:ya(c.timestamp),className:"text-muted-foreground",children:ba(c.timestamp)})}),e.jsx(F,{children:e.jsx(q,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",title:"View instance details",children:e.jsx(de,{to:`/nodes/${c.id}`,children:e.jsx(Lt,{className:"h-4 w-4"})})})})]},c.id)}),t.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No instances found"})})})]})]})}const be=i.forwardRef(({className:t,type:s,...r},a)=>e.jsx("input",{type:s,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:a,...r}));be.displayName="Input";var rr=1,Nl=.9,kl=.8,Sl=.17,Jt=.1,es=.999,El=.9999,Cl=.99,Tl=/[\\\/_+.#"@\[\(\{&]/,Rl=/[\\\/_+.#"@\[\(\{&]/g,Al=/[\s-]/,Ia=/[\s-]/g;function ps(t,s,r,a,n,o,l){if(o===s.length)return n===t.length?rr:Cl;var c=`${n},${o}`;if(l[c]!==void 0)return l[c];for(var d=a.charAt(o),u=r.indexOf(d,n),m=0,g,y,N,h;u>=0;)g=ps(t,s,r,a,u+1,o+1,l),g>m&&(u===n?g*=rr:Tl.test(t.charAt(u-1))?(g*=kl,N=t.slice(n,u-1).match(Rl),N&&n>0&&(g*=Math.pow(es,N.length))):Al.test(t.charAt(u-1))?(g*=Nl,h=t.slice(n,u-1).match(Ia),h&&n>0&&(g*=Math.pow(es,h.length))):(g*=Sl,n>0&&(g*=Math.pow(es,u-n))),t.charAt(u)!==s.charAt(o)&&(g*=El)),(gg&&(g=y*Jt)),g>m&&(m=g),u=r.indexOf(d,u+1);return l[c]=m,m}function ar(t){return t.toLowerCase().replace(Ia," ")}function _l(t,s,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ps(t,s,ar(t),ar(s),0,0,{})}var Fa={exports:{}},La={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ue=i;function Il(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Fl=typeof Object.is=="function"?Object.is:Il,Ll=Ue.useState,Pl=Ue.useEffect,Dl=Ue.useLayoutEffect,Ol=Ue.useDebugValue;function $l(t,s){var r=s(),a=Ll({inst:{value:r,getSnapshot:s}}),n=a[0].inst,o=a[1];return Dl(function(){n.value=r,n.getSnapshot=s,ts(n)&&o({inst:n})},[t,r,s]),Pl(function(){return ts(n)&&o({inst:n}),t(function(){ts(n)&&o({inst:n})})},[t]),Ol(r),r}function ts(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!Fl(t,r)}catch{return!0}}function Ml(t,s){return s()}var Bl=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ml:$l;La.useSyncExternalStore=Ue.useSyncExternalStore!==void 0?Ue.useSyncExternalStore:Bl;Fa.exports=La;var zl=Fa.exports,Ze='[cmdk-group=""]',ss='[cmdk-group-items=""]',Vl='[cmdk-group-heading=""]',_s='[cmdk-item=""]',nr=`${_s}:not([aria-disabled="true"])`,ms="cmdk-item-select",Ie="data-value",Ul=(t,s,r)=>_l(t,s,r),Pa=i.createContext(void 0),pt=()=>i.useContext(Pa),Da=i.createContext(void 0),Is=()=>i.useContext(Da),Oa=i.createContext(void 0),$a=i.forwardRef((t,s)=>{let r=Me(()=>{var S,R;return{search:"",value:(R=(S=t.value)!=null?S:t.defaultValue)!=null?R:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Me(()=>new Set),n=Me(()=>new Map),o=Me(()=>new Map),l=Me(()=>new Set),c=Ma(t),{label:d,children:u,value:m,onValueChange:g,filter:y,shouldFilter:N,loop:h,disablePointerSelection:p=!1,vimBindings:f=!0,...x}=t,b=Be(),j=Be(),w=Be(),E=i.useRef(null),C=ec();De(()=>{if(m!==void 0){let S=m.trim();r.current.value=S,A.emit()}},[m]),De(()=>{C(6,W)},[]);let A=i.useMemo(()=>({subscribe:S=>(l.current.add(S),()=>l.current.delete(S)),snapshot:()=>r.current,setState:(S,R,$)=>{var L,G,H;if(!Object.is(r.current[S],R)){if(r.current[S]=R,S==="search")M(),Y(),C(1,K);else if(S==="value"&&($||C(5,W),((L=c.current)==null?void 0:L.value)!==void 0)){let oe=R??"";(H=(G=c.current).onValueChange)==null||H.call(G,oe);return}A.emit()}},emit:()=>{l.current.forEach(S=>S())}}),[]),B=i.useMemo(()=>({value:(S,R,$)=>{var L;R!==((L=o.current.get(S))==null?void 0:L.value)&&(o.current.set(S,{value:R,keywords:$}),r.current.filtered.items.set(S,z(R,$)),C(2,()=>{Y(),A.emit()}))},item:(S,R)=>(a.current.add(S),R&&(n.current.has(R)?n.current.get(R).add(S):n.current.set(R,new Set([S]))),C(3,()=>{M(),Y(),r.current.value||K(),A.emit()}),()=>{o.current.delete(S),a.current.delete(S),r.current.filtered.items.delete(S);let $=T();C(4,()=>{M(),($==null?void 0:$.getAttribute("id"))===S&&K(),A.emit()})}),group:S=>(n.current.has(S)||n.current.set(S,new Set),()=>{o.current.delete(S),n.current.delete(S)}),filter:()=>c.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:b,inputId:w,labelId:j,listInnerRef:E}),[]);function z(S,R){var $,L;let G=(L=($=c.current)==null?void 0:$.filter)!=null?L:Ul;return S?G(S,r.current.search,R):0}function Y(){if(!r.current.search||c.current.shouldFilter===!1)return;let S=r.current.filtered.items,R=[];r.current.filtered.groups.forEach(L=>{let G=n.current.get(L),H=0;G.forEach(oe=>{let ue=S.get(oe);H=Math.max(ue,H)}),R.push([L,H])});let $=E.current;O().sort((L,G)=>{var H,oe;let ue=L.getAttribute("id"),gt=G.getAttribute("id");return((H=S.get(gt))!=null?H:0)-((oe=S.get(ue))!=null?oe:0)}).forEach(L=>{let G=L.closest(ss);G?G.appendChild(L.parentElement===G?L:L.closest(`${ss} > *`)):$.appendChild(L.parentElement===$?L:L.closest(`${ss} > *`))}),R.sort((L,G)=>G[1]-L[1]).forEach(L=>{var G;let H=(G=E.current)==null?void 0:G.querySelector(`${Ze}[${Ie}="${encodeURIComponent(L[0])}"]`);H==null||H.parentElement.appendChild(H)})}function K(){let S=O().find($=>$.getAttribute("aria-disabled")!=="true"),R=S==null?void 0:S.getAttribute(Ie);A.setState("value",R||void 0)}function M(){var S,R,$,L;if(!r.current.search||c.current.shouldFilter===!1){r.current.filtered.count=a.current.size;return}r.current.filtered.groups=new Set;let G=0;for(let H of a.current){let oe=(R=(S=o.current.get(H))==null?void 0:S.value)!=null?R:"",ue=(L=($=o.current.get(H))==null?void 0:$.keywords)!=null?L:[],gt=z(oe,ue);r.current.filtered.items.set(H,gt),gt>0&&G++}for(let[H,oe]of n.current)for(let ue of oe)if(r.current.filtered.items.get(ue)>0){r.current.filtered.groups.add(H);break}r.current.filtered.count=G}function W(){var S,R,$;let L=T();L&&(((S=L.parentElement)==null?void 0:S.firstChild)===L&&(($=(R=L.closest(Ze))==null?void 0:R.querySelector(Vl))==null||$.scrollIntoView({block:"nearest"})),L.scrollIntoView({block:"nearest"}))}function T(){var S;return(S=E.current)==null?void 0:S.querySelector(`${_s}[aria-selected="true"]`)}function O(){var S;return Array.from(((S=E.current)==null?void 0:S.querySelectorAll(nr))||[])}function V(S){let R=O()[S];R&&A.setState("value",R.getAttribute(Ie))}function Q(S){var R;let $=T(),L=O(),G=L.findIndex(oe=>oe===$),H=L[G+S];(R=c.current)!=null&&R.loop&&(H=G+S<0?L[L.length-1]:G+S===L.length?L[0]:L[G+S]),H&&A.setState("value",H.getAttribute(Ie))}function _(S){let R=T(),$=R==null?void 0:R.closest(Ze),L;for(;$&&!L;)$=S>0?Ql($,Ze):Jl($,Ze),L=$==null?void 0:$.querySelector(nr);L?A.setState("value",L.getAttribute(Ie)):Q(S)}let I=()=>V(O().length-1),P=S=>{S.preventDefault(),S.metaKey?I():S.altKey?_(1):Q(1)},U=S=>{S.preventDefault(),S.metaKey?V(0):S.altKey?_(-1):Q(-1)};return i.createElement(ae.div,{ref:s,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:S=>{var R;if((R=x.onKeyDown)==null||R.call(x,S),!S.defaultPrevented)switch(S.key){case"n":case"j":{f&&S.ctrlKey&&P(S);break}case"ArrowDown":{P(S);break}case"p":case"k":{f&&S.ctrlKey&&U(S);break}case"ArrowUp":{U(S);break}case"Home":{S.preventDefault(),V(0);break}case"End":{S.preventDefault(),I();break}case"Enter":if(!S.nativeEvent.isComposing&&S.keyCode!==229){S.preventDefault();let $=T();if($){let L=new Event(ms);$.dispatchEvent(L)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:sc},d),zt(t,S=>i.createElement(Da.Provider,{value:A},i.createElement(Pa.Provider,{value:B},S))))}),ql=i.forwardRef((t,s)=>{var r,a;let n=Be(),o=i.useRef(null),l=i.useContext(Oa),c=pt(),d=Ma(t),u=(a=(r=d.current)==null?void 0:r.forceMount)!=null?a:l==null?void 0:l.forceMount;De(()=>{if(!u)return c.item(n,l==null?void 0:l.id)},[u]);let m=Ba(n,o,[t.value,t.children,o],t.keywords),g=Is(),y=Oe(C=>C.value&&C.value===m.current),N=Oe(C=>u||c.filter()===!1?!0:C.search?C.filtered.items.get(n)>0:!0);i.useEffect(()=>{let C=o.current;if(!(!C||t.disabled))return C.addEventListener(ms,h),()=>C.removeEventListener(ms,h)},[N,t.onSelect,t.disabled]);function h(){var C,A;p(),(A=(C=d.current).onSelect)==null||A.call(C,m.current)}function p(){g.setState("value",m.current,!0)}if(!N)return null;let{disabled:f,value:x,onSelect:b,forceMount:j,keywords:w,...E}=t;return i.createElement(ae.div,{ref:et([o,s]),...E,id:n,"cmdk-item":"",role:"option","aria-disabled":!!f,"aria-selected":!!y,"data-disabled":!!f,"data-selected":!!y,onPointerMove:f||c.getDisablePointerSelection()?void 0:p,onClick:f?void 0:h},t.children)}),Gl=i.forwardRef((t,s)=>{let{heading:r,children:a,forceMount:n,...o}=t,l=Be(),c=i.useRef(null),d=i.useRef(null),u=Be(),m=pt(),g=Oe(N=>n||m.filter()===!1?!0:N.search?N.filtered.groups.has(l):!0);De(()=>m.group(l),[]),Ba(l,c,[t.value,t.heading,d]);let y=i.useMemo(()=>({id:l,forceMount:n}),[n]);return i.createElement(ae.div,{ref:et([c,s]),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&i.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),zt(t,N=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},i.createElement(Oa.Provider,{value:y},N))))}),Hl=i.forwardRef((t,s)=>{let{alwaysRender:r,...a}=t,n=i.useRef(null),o=Oe(l=>!l.search);return!r&&!o?null:i.createElement(ae.div,{ref:et([n,s]),...a,"cmdk-separator":"",role:"separator"})}),Kl=i.forwardRef((t,s)=>{let{onValueChange:r,...a}=t,n=t.value!=null,o=Is(),l=Oe(m=>m.search),c=Oe(m=>m.value),d=pt(),u=i.useMemo(()=>{var m;let g=(m=d.listInnerRef.current)==null?void 0:m.querySelector(`${_s}[${Ie}="${encodeURIComponent(c)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return i.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),i.createElement(ae.input,{ref:s,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:n?t.value:l,onChange:m=>{n||o.setState("search",m.target.value),r==null||r(m.target.value)}})}),Wl=i.forwardRef((t,s)=>{let{children:r,label:a="Suggestions",...n}=t,o=i.useRef(null),l=i.useRef(null),c=pt();return i.useEffect(()=>{if(l.current&&o.current){let d=l.current,u=o.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=d.offsetHeight;u.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),i.createElement(ae.div,{ref:et([o,s]),...n,"cmdk-list":"",role:"listbox","aria-label":a,id:c.listId},zt(t,d=>i.createElement("div",{ref:et([l,c.listInnerRef]),"cmdk-list-sizer":""},d)))}),Zl=i.forwardRef((t,s)=>{let{open:r,onOpenChange:a,overlayClassName:n,contentClassName:o,container:l,...c}=t;return i.createElement(Ns,{open:r,onOpenChange:a},i.createElement(ks,{container:l},i.createElement(lt,{"cmdk-overlay":"",className:n}),i.createElement(ct,{"aria-label":t.label,"cmdk-dialog":"",className:o},i.createElement($a,{ref:s,...c}))))}),Yl=i.forwardRef((t,s)=>Oe(r=>r.filtered.count===0)?i.createElement(ae.div,{ref:s,...t,"cmdk-empty":"",role:"presentation"}):null),Xl=i.forwardRef((t,s)=>{let{progress:r,children:a,label:n="Loading...",...o}=t;return i.createElement(ae.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":n},zt(t,l=>i.createElement("div",{"aria-hidden":!0},l)))}),ie=Object.assign($a,{List:Wl,Item:ql,Input:Kl,Group:Gl,Separator:Hl,Dialog:Zl,Empty:Yl,Loading:Xl});function Ql(t,s){let r=t.nextElementSibling;for(;r;){if(r.matches(s))return r;r=r.nextElementSibling}}function Jl(t,s){let r=t.previousElementSibling;for(;r;){if(r.matches(s))return r;r=r.previousElementSibling}}function Ma(t){let s=i.useRef(t);return De(()=>{s.current=t}),s}var De=typeof window>"u"?i.useEffect:i.useLayoutEffect;function Me(t){let s=i.useRef();return s.current===void 0&&(s.current=t()),s}function et(t){return s=>{t.forEach(r=>{typeof r=="function"?r(s):r!=null&&(r.current=s)})}}function Oe(t){let s=Is(),r=()=>t(s.snapshot());return zl.useSyncExternalStore(s.subscribe,r,r)}function Ba(t,s,r,a=[]){let n=i.useRef(),o=pt();return De(()=>{var l;let c=(()=>{var u;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(u=m.current.textContent)==null?void 0:u.trim():n.current}})(),d=a.map(u=>u.trim());o.value(t,c,d),(l=s.current)==null||l.setAttribute(Ie,c),n.current=c}),n}var ec=()=>{let[t,s]=i.useState(),r=Me(()=>new Map);return De(()=>{r.current.forEach(a=>a()),r.current=new Map},[t]),(a,n)=>{r.current.set(a,n),s({})}};function tc(t){let s=t.type;return typeof s=="function"?s(t.props):"render"in s?s.render(t.props):t}function zt({asChild:t,children:s},r){return t&&i.isValidElement(s)?i.cloneElement(tc(s),{ref:s.ref},r(s.props.children)):r(s)}var sc={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const za=Ns,rc=ks,Va=i.forwardRef(({className:t,...s},r)=>e.jsx(lt,{ref:r,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s}));Va.displayName=lt.displayName;const Fs=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(rc,{children:[e.jsx(Va,{}),e.jsxs(ct,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[s,e.jsxs(oa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(js,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Fs.displayName=ct.displayName;const Ls=({className:t,...s})=>e.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});Ls.displayName="DialogHeader";const Ps=({className:t,...s})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});Ps.displayName="DialogFooter";const Ds=i.forwardRef(({className:t,...s},r)=>e.jsx(Pt,{ref:r,className:v("text-lg font-semibold leading-none tracking-tight",t),...s}));Ds.displayName=Pt.displayName;const Os=i.forwardRef(({className:t,...s},r)=>e.jsx(Dt,{ref:r,className:v("text-sm text-muted-foreground",t),...s}));Os.displayName=Dt.displayName;const Ua=i.forwardRef(({className:t,...s},r)=>e.jsx(ie,{ref:r,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s}));Ua.displayName=ie.displayName;const qa=i.forwardRef(({className:t,...s},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Tr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(ie.Input,{ref:r,className:v("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]}));qa.displayName=ie.Input.displayName;const ac=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.List,{ref:r,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...s}));ac.displayName=ie.List.displayName;const Ga=i.forwardRef((t,s)=>e.jsx(ie.Empty,{ref:s,className:"py-6 text-center text-sm",...t}));Ga.displayName=ie.Empty.displayName;const Ha=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.Group,{ref:r,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s}));Ha.displayName=ie.Group.displayName;const nc=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.Separator,{ref:r,className:v("-mx-1 h-px bg-border",t),...s}));nc.displayName=ie.Separator.displayName;const fs=i.forwardRef(({className:t,...s},r)=>e.jsx(ie.Item,{ref:r,className:v("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...s}));fs.displayName=ie.Item.displayName;const oc=mo,ic=fo,Ka=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...a},n)=>e.jsx(po,{children:e.jsx(yr,{ref:n,align:s,sideOffset:r,className:v("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})}));Ka.displayName=yr.displayName;function Le({options:t=[],selected:s=[],onChange:r,placeholder:a="Select options...",emptyMessage:n="No options found.",className:o}){const[l,c]=i.useState(!1),d=y=>{const N=s.includes(y)?s.filter(h=>h!==y):[...s,y];r(N)},u=()=>{s.length===t.length?r([]):r(t.map(y=>y.value))},m=s.length,g=t.length;return e.jsxs(oc,{open:l,onOpenChange:c,children:[e.jsx(ic,{asChild:!0,children:e.jsxs(q,{variant:"outline",role:"combobox","aria-expanded":l,className:v("justify-between",o),children:[m===0?a:`${m} selected`,e.jsx(Cr,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ka,{className:"w-[200px] p-0",children:e.jsxs(Ua,{children:[e.jsx(qa,{placeholder:a}),e.jsx(Ga,{children:n}),e.jsxs(Ha,{children:[g>0&&e.jsx(fs,{onSelect:u,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Pe,{checked:m>0&&m===g,"aria-label":"Select all"}),e.jsx("span",{children:"Select all"})]})}),t.map(y=>e.jsx(fs,{onSelect:()=>d(y.value),children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Pe,{checked:s.includes(y.value)}),e.jsx("span",{children:y.label})]})},y.value))]})]})})]})}function lc({idFilter:t,onIdFilterChange:s,stateFilter:r,onStateFilterChange:a,zoneFilter:n,onZoneFilterChange:o,uniqueStates:l,uniqueZones:c}){return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Tr,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(be,{placeholder:"Filter by ID...",value:t,onChange:d=>s(d.target.value),className:"pl-8"})]}),l.length>0&&e.jsx(Le,{options:l.map(d=>({value:d,label:d})),selected:r,onChange:a,placeholder:"Filter by State",className:"w-[180px]"}),c.length>0&&e.jsx(Le,{options:c.map(d=>({value:d,label:d})),selected:n,onChange:o,placeholder:"Filter by Zone",className:"w-[180px]"})]})}const cc=t=>{switch(t){case"ACTIVE":return"#22c55e";case"LEAVING":return"#eab308";case"PENDING":return"#3b82f6";case"JOINING":return"#a855f7";case"LEFT":return"#ef4444";default:return"#6b7280"}};function dc({instances:t}){const s=i.useMemo(()=>{const a=new Map;return t.forEach(n=>{const o=n.state||"unknown";a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:n,value:o,color:cc(n)}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Instances"})]}),e.jsx(dt,{width:"100%",height:"100%",children:e.jsxs(Ot,{children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map(a=>e.jsx(Mt,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}function Wa({onRefresh:t,isPaused:s=!1,isLoading:r,className:a}){const[n,o]=i.useState(r);return i.useEffect(()=>{let l;return r?o(!0):l=setTimeout(()=>{o(!1)},1e3),()=>{l&&clearTimeout(l)}},[r]),e.jsxs("div",{className:`flex items-center gap-2 text-sm text-muted-foreground ${a}`,children:[e.jsx(q,{variant:"secondary",size:"sm",className:"h-6 px-2 text-xs hover:bg-muted",onClick:t,children:"Refresh now"}),s?e.jsx($o,{className:"h-3 w-3 text-orange-500"}):e.jsx(xe,{className:`h-3 w-3 ${n?"animate-spin text-emerald-500 ":"opacity-0 transition-opacity duration-1000"} `}),e.jsx("span",{className:"transition-opacity duration-1000",children:s?"Auto-refresh paused":n?"Refreshing...":""})]})}const uc=Ce("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),He=i.forwardRef(({className:t,variant:s,...r},a)=>e.jsx("div",{ref:a,role:"alert",className:v(uc({variant:s}),t),...r}));He.displayName="Alert";const Ke=i.forwardRef(({className:t,...s},r)=>e.jsx("h5",{ref:r,className:v("mb-1 font-medium leading-none tracking-tight",t),...s}));Ke.displayName="AlertTitle";const We=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:v("text-sm [&_p]:leading-relaxed",t),...s}));We.displayName="AlertDescription";function Se({children:t,className:s,spacing:r=!0,...a}){return e.jsx("div",{className:"container p-6",children:e.jsx("div",{className:v(r&&"space-y-6",s),...a,children:t})})}function $s({error:t,ringName:s}){return t?e.jsx(Se,{children:e.jsxs(He,{variant:"destructive",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:t})]})}):s?null:e.jsx(Se,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Rr,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Rings"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ka.map(r=>e.jsx(de,{to:`/rings/${r.id}`,children:e.jsxs(ee,{className:"hover:bg-muted/50 transition-colors cursor-pointer",children:[e.jsx(se,{children:e.jsx(ne,{children:r.title})}),e.jsx(te,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["View and manage ",r.title.toLowerCase()," ring members"]})})]})},r.id))})]})})}const pc=5,mc=1e6;let rs=0;function fc(){return rs=(rs+1)%Number.MAX_SAFE_INTEGER,rs.toString()}const as=new Map,or=t=>{if(as.has(t))return;const s=setTimeout(()=>{as.delete(t),Qe({type:"REMOVE_TOAST",toastId:t})},mc);as.set(t,s)},gc=(t,s)=>{switch(s.type){case"ADD_TOAST":return{...t,toasts:[s.toast,...t.toasts].slice(0,pc)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===s.toast.id?{...r,...s.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=s;return r?or(r):t.toasts.forEach(a=>{or(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===r||r===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return s.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==s.toastId)}}},bt=[];let yt={toasts:[]};function Qe(t){yt=gc(yt,t),bt.forEach(s=>{s(yt)})}function hc({...t}){const s=fc(),r=n=>Qe({type:"UPDATE_TOAST",toast:{...n,id:s}}),a=()=>Qe({type:"DISMISS_TOAST",toastId:s});return Qe({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:n=>{n||a()}}}),{id:s,dismiss:a,update:r}}function Vt(){const[t,s]=i.useState(yt);return i.useEffect(()=>(bt.push(s),()=>{const r=bt.indexOf(s);r>-1&&bt.splice(r,1)}),[t]),{...t,toast:hc,dismiss:r=>Qe({type:"DISMISS_TOAST",toastId:r})}}function xc({ringName:t}){var Q;const[s,r]=i.useState(new Set),[a,n]=i.useState(!1),[o,l]=i.useState(0),[c,d]=i.useState("id"),[u,m]=i.useState("asc"),[g,y]=i.useState(""),[N,h]=i.useState([]),[p,f]=i.useState([]),[x,b]=i.useState(!1),{ring:j,error:w,isLoading:E,fetchRing:C,forgetInstances:A,uniqueStates:B,uniqueZones:z,isTokenBased:Y}=rl({ringName:t,isPaused:s.size>0}),K=i.useMemo(()=>j!=null&&j.shards?j.shards.filter(_=>s.has(_.id)):[],[j==null?void 0:j.shards,s]),M=i.useCallback(_=>{d(I=>I===_?(m(P=>P==="asc"?"desc":"asc"),_):(m("asc"),_))},[]),W=i.useCallback(_=>{r(I=>{const P=new Set(I);return P.has(_)?P.delete(_):P.add(_),P})},[]),{toast:T}=Vt(),O=i.useCallback(async()=>{if(s.size!==0)try{n(!0),l(0);const{success:_,total:I}=await A(Array.from(s));_>0&&(await C(),r(new Set)),_j!=null&&j.shards?j.shards.filter(_=>{const I=_.id.toLowerCase().includes(g.toLowerCase()),P=N.length===0||N.includes(_.state),U=p.length===0||p.includes(_.zone);return I&&P&&U}).sort((_,I)=>{let P=0;switch(c){case"id":P=_.id.localeCompare(I.id);break;case"state":P=_.state.localeCompare(I.state);break;case"address":P=_.address.localeCompare(I.address);break;case"zone":P=(_.zone||"").localeCompare(I.zone||"");break;case"timestamp":P=new Date(_.timestamp).getTime()-new Date(I.timestamp).getTime();break;case"tokens":P=_.tokens.length-I.tokens.length;break;case"ownership":P=parseFloat(_.ownership)-parseFloat(I.ownership);break}return u==="asc"?P:-P}):[],[j==null?void 0:j.shards,g,N,p,c,u]);return w?e.jsx($s,{error:w,ringName:t}):e.jsxs("div",{className:"container space-y-6 p-6",children:[e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs(ne,{className:"text-3xl font-semibold tracking-tight",children:[((Q=ka.find(_=>_.id===t))==null?void 0:Q.title)||""," ","Ring Members"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage ring instances with their current status and configuration"})]}),e.jsxs("div",{className:"flex items-center justify-between min-h-[32px]",children:[e.jsx(Wa,{onRefresh:C,isPaused:s.size>0,isLoading:E}),s.size>0&&e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.size," instance",s.size!==1?"s":""," selected"]}),e.jsxs(q,{onClick:()=>b(!0),disabled:a,size:"sm",variant:"outline",className:v("border-red-200 bg-red-50 text-red-900 hover:bg-red-100 hover:text-red-900","dark:border-red-800 dark:bg-red-950 dark:text-red-200 dark:hover:bg-red-900","disabled:hover:bg-red-50 dark:disabled:hover:bg-red-950"),children:[a&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"mr-2 h-4 w-4 animate-spin"}),o>0&&e.jsxs("span",{className:"mr-2",children:[o,"/",s.size]})]}),"Forget Selected"]})]})]})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:(j==null?void 0:j.shards)&&e.jsx(dc,{instances:j.shards})})})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsx(lc,{idFilter:g,onIdFilterChange:y,stateFilter:N,onStateFilterChange:h,zoneFilter:p,onZoneFilterChange:f,uniqueStates:B,uniqueZones:z}),e.jsx("div",{className:"rounded-md border bg-card",children:e.jsx(wl,{instances:V,selectedInstances:s,onSelectInstance:W,sortField:c,sortDirection:u,onSort:M,showTokens:Y})})]})]}),e.jsx(za,{open:x,onOpenChange:b,children:e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Ds,{children:"Confirm Forget Instances"}),e.jsx(Os,{children:"Are you sure you want to forget the following instances? This action cannot be undone."})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:K.map(_=>e.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:_.id}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Ct(_.state)),children:_.state})]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:_.address})]},_.id))})}),e.jsxs(Ps,{children:[e.jsx(q,{variant:"outline",onClick:()=>b(!1),disabled:a,children:"Cancel"}),e.jsx(q,{variant:"outline",onClick:O,disabled:a,className:v("border-red-200 bg-red-50 text-red-900 hover:bg-red-100 hover:text-red-900","dark:border-red-800 dark:bg-red-950 dark:text-red-200 dark:hover:bg-red-900","disabled:hover:bg-red-50 dark:disabled:hover:bg-red-950"),children:a?e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"mr-2 h-4 w-4 animate-spin"}),"Forgetting..."]}):"Forget Instances"})]})]})})]})}const bc=()=>{const t=i.useRef({});return{fetchMetrics:i.useCallback(async({nodeNames:r,metrics:a})=>{if(!r.length)return{};const n={...t.current},o={};return await Promise.all(r.map(async l=>{try{const c=await fetch(re(`/api/v1/proxy/${l}/metrics`));if(!c.ok)throw new Error(`Failed to fetch metrics: ${c.statusText}`);const d=await c.text(),u={timestamp:Date.now(),values:{}};a.forEach(g=>{const y=new RegExp(`${g}\\{[^}]*\\}\\s+([\\d.e+]+)`),N=d.match(y);N&&(u.values[g]=parseFloat(N[1]))});const m=t.current[l];if(n[l]=u,m){const g=(u.timestamp-m.timestamp)/1e3;if(g>0){const y=a.map(N=>{const h=u.values[N],p=m.values[N];if(h!==void 0&&p!==void 0){const f=(h-p)/g;return{name:N,rate:f,currentValue:h}}return{name:N,rate:0,currentValue:h??0}});o[l]=y}}}catch(c){console.error(`Error fetching metrics for node ${l}:`,c)}})),t.current=n,o},[])}},yc={0:"PartitionUnknown",1:"PartitionPending",2:"PartitionActive",3:"PartitionInactive",4:"PartitionDeleted"};function vc({isPaused:t=!1}={}){const{cluster:s,isLoading:r}=pe(),[a,n]=i.useState({partitions:[],error:"",isLoading:!1}),o=i.useRef(),l=i.useCallback(()=>Na(s==null?void 0:s.members,J.PARTITION_INGESTER),[s]),{fetchMetrics:c}=bc(),d=i.useCallback(async()=>{if(!l()){n(g=>({...g,partitions:[],error:"No cluster members available",isLoading:!1}));return}o.current&&o.current.abort(),o.current=new AbortController;try{n(f=>({...f,isLoading:!0,error:""}));const g=await fetch(l(),{signal:o.current.signal,headers:{Accept:"application/json"}});if(!g.ok)throw new Error(`Failed to fetch partitions: ${g.statusText}`);const N=(await g.json()).partitions.flatMap(f=>f.owner_ids.map(x=>({...f,owner_id:x,owner_ids:[x],zone:Ts(x)}))),h=Array.from(new Set(N.map(f=>f.owner_ids).flat().filter(f=>f!==void 0))),p=await c({nodeNames:h,metrics:["loki_ingest_storage_reader_fetch_bytes_total","loki_ingest_storage_reader_fetch_compressed_bytes_total"]});n(f=>({...f,isLoading:!1,partitions:N.map(x=>{var j,w;if(!x.owner_id)return x;const b=p[x.owner_id]||[];return{...x,uncompressedRate:((j=b.find(E=>E.name==="loki_ingest_storage_reader_fetch_bytes_total"))==null?void 0:j.rate)||0,compressedRate:((w=b.find(E=>E.name==="loki_ingest_storage_reader_fetch_compressed_bytes_total"))==null?void 0:w.rate)||0}})}))}catch(g){g instanceof Error&&g.name!=="AbortError"&&n(y=>({...y,error:g instanceof Error?g.message:"Unknown error occurred",isLoading:!1}))}},[l,c]),u=i.useCallback(async(g,y)=>{if(!l())throw new Error("No cluster members available");const N=Array.from(new Set(g)),h=N.length;let p=0;return await Promise.allSettled(N.map(async f=>{const x=new FormData;x.append("action","change_state"),x.append("partition_id",f.toString());const b=yc[y];if(b===void 0)throw new Error(`Invalid partition state: ${y}`);x.append("partition_state",b.toString());const j=await fetch(l(),{method:"POST",body:x});if(!j.ok){const w=await j.text();throw new Error(`Failed to change state for partition ${f}: ${w}`)}return p++,f})),{success:p,total:h}},[l]),m=i.useMemo(()=>{const g=new Set,y=new Set,N={};return a.partitions.forEach(h=>{const p=h.state.toString();N[p]=(N[p]||0)+1,g.add(p),h.owner_ids.forEach(f=>{const x=f.split("-")[2];x&&y.add(x)})}),{partitionsByState:N,uniqueStates:Array.from(g).sort(),uniqueZones:Array.from(y).sort()}},[a.partitions]);return i.useEffect(()=>()=>{o.current&&o.current.abort()},[]),i.useEffect(()=>{if(d(),!t){const g=setInterval(d,5e3);return()=>clearInterval(g)}},[d,t]),{partitions:a.partitions,error:a.error,isLoading:a.isLoading||r,fetchPartitions:d,changePartitionState:u,...m}}function jc(t,s){return t===void 0||s===void 0||Math.abs((t-s)/s)<.1?null:t>s?"up":"down"}function wc({trend:t}){return t?t==="up"?e.jsx(Mo,{className:"inline h-4 w-4 text-green-500 ml-1"}):e.jsx(Bo,{className:"inline h-4 w-4 text-red-500 ml-1"}):null}function ir({currentRate:t,label:s,className:r}){const a=i.useRef(t),n=i.useMemo(()=>jc(t,a.current),[t]);return i.useEffect(()=>{const o=setTimeout(()=>{a.current=t},2e3);return()=>clearTimeout(o)},[t]),e.jsxs("span",{className:r,children:[Qi(t),"/s",s&&` ${s}`,e.jsx(wc,{trend:n})]})}function Nc({allPartitions:t,selectedIds:s,onChange:r}){const a=i.useMemo(()=>Array.from(new Set(t.map(l=>l.id))),[t]),n=a.every(l=>s.has(l)),o=()=>{r(n?new Set:new Set(a))};return e.jsx(Pe,{checked:a.length>0&&n,onCheckedChange:o,"aria-label":"Select all partitions"})}function kc(t){switch(t){case 2:return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case 1:return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case 3:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case 4:return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}}const Sc=[{value:1,label:"Pending"},{value:2,label:"Active"},{value:3,label:"Inactive"},{value:4,label:"Deleted"}];function Ec({partitions:t,selectedPartitions:s,onSelectPartition:r,sortField:a,sortDirection:n,onSort:o}){const l=i.useMemo(()=>[...t].sort((c,d)=>{var m;let u=0;switch(a){case"uncompressed_rate":{u=(c.uncompressedRate||0)-(d.uncompressedRate||0);break}case"compressed_rate":{u=(c.compressedRate||0)-(d.compressedRate||0);break}case"id":u=c.id-d.id;break;case"state":u=c.state-d.state;break;case"owner":u=((m=c.owner_id)==null?void 0:m.localeCompare(d.owner_id||""))||0;break;case"zone":u=(c.zone||"").localeCompare(d.zone||"");break;case"timestamp":u=new Date(c.state_timestamp).getTime()-new Date(d.state_timestamp).getTime();break}return n==="asc"?u:-u}),[t,a,n]);return e.jsx(e.Fragment,{children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[50px]",children:e.jsx(Nc,{allPartitions:t,selectedIds:s,onChange:c=>{new Set(t.map(u=>u.id)).forEach(u=>{c.has(u)!==s.has(u)&&r(u)})}})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Owner",field:"owner",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Zone",field:"zone",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[100px]",children:e.jsx(Z,{title:"Partition ID",field:"id",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"State",field:"state",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Last Update",field:"timestamp",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Uncompressed Rate",field:"uncompressed_rate",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Compressed Rate",field:"compressed_rate",sortField:a,sortDirection:n,onSort:o})}),e.jsx(D,{className:"w-[100px]"})]})}),e.jsxs(Ae,{children:[l.map(c=>{var d;return e.jsxs(X,{children:[e.jsx(F,{children:e.jsx(Pe,{checked:s.has(c.id),onCheckedChange:()=>r(c.id),"aria-label":`Select partition ${c.id}`})}),e.jsx(F,{className:"font-medium",children:e.jsx(de,{to:`/nodes/${c.owner_id}`,className:"hover:underline",children:c.owner_id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",va(c.zone||"")),children:c.zone||"-"})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",c.corrupted?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-muted"),title:c.corrupted?"Corrupted":void 0,children:c.id})}),e.jsx(F,{children:e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",kc(c.state)),children:((d=Sc.find(u=>u.value===c.state))==null?void 0:d.label)||"Unknown"})}),e.jsx(F,{children:e.jsx("span",{title:ya(c.state_timestamp),className:"text-muted-foreground",children:ba(c.state_timestamp)})}),e.jsx(F,{children:e.jsx(ir,{currentRate:c.uncompressedRate||0,className:"text-muted-foreground inline-flex items-center"})}),e.jsx(F,{children:e.jsx(ir,{currentRate:c.compressedRate||0,className:"text-muted-foreground inline-flex items-center"})}),e.jsx(F,{children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(de,{to:`/nodes/${c.owner_id}`,className:"hover:underline",children:e.jsx(q,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"View instance details",children:e.jsx(Lt,{className:"h-4 w-4"})})})})})]},`${c.owner_id}-${c.id}`)}),l.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No partitions found"})})})]})]})})}const Rt=ci,At=di,tt=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Pr,{ref:a,className:v("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[s,e.jsx(ai,{asChild:!0,children:e.jsx(it,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=Pr.displayName;const Za=i.forwardRef(({className:t,...s},r)=>e.jsx(Dr,{ref:r,className:v("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Ar,{className:"h-4 w-4"})}));Za.displayName=Dr.displayName;const Ya=i.forwardRef(({className:t,...s},r)=>e.jsx(Or,{ref:r,className:v("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(it,{className:"h-4 w-4"})}));Ya.displayName=Or.displayName;const st=i.forwardRef(({className:t,children:s,position:r="popper",...a},n)=>e.jsx(ni,{children:e.jsxs($r,{ref:n,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...a,children:[e.jsx(Za,{}),e.jsx(oi,{className:v("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(Ya,{})]})}));st.displayName=$r.displayName;const Cc=i.forwardRef(({className:t,...s},r)=>e.jsx(Mr,{ref:r,className:v("px-2 py-1.5 text-sm font-semibold",t),...s}));Cc.displayName=Mr.displayName;const Ve=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(Br,{ref:a,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ii,{children:e.jsx(Ge,{className:"h-4 w-4"})})}),e.jsx(li,{children:s})]}));Ve.displayName=Br.displayName;const Tc=i.forwardRef(({className:t,...s},r)=>e.jsx(zr,{ref:r,className:v("-mx-1 my-1 h-px bg-muted",t),...s}));Tc.displayName=zr.displayName;const Rc=t=>{switch(t){case 2:return"#22c55e";case 1:return"#3b82f6";case 3:return"#eab308";case 4:return"#ef4444";default:return"#6b7280"}};function Ac({partitions:t}){const s=i.useMemo(()=>{const a=new Map;return t.forEach(n=>{const o=n.state;a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:ha[n],value:o,color:Rc(n)}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Partitions"})]}),e.jsx(dt,{width:"100%",height:"100%",children:e.jsxs(Ot,{children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map(a=>e.jsx(Mt,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}function _c({idFilter:t,onIdFilterChange:s,stateFilter:r,onStateFilterChange:a,zoneFilter:n,onZoneFilterChange:o,ownerFilter:l,onOwnerFilterChange:c,uniqueStates:d,partitions:u}){const m=d.map(p=>({value:p,label:ha[parseInt(p)]})),g=new Set;u.forEach(p=>{p.owner_ids.forEach(f=>{const x=Ts(f);x&&g.add(x)})});const y=Array.from(g).sort().map(p=>({value:p,label:p})),h=Array.from(new Set(u.map(p=>p.id.toString()))).sort((p,f)=>parseInt(p)-parseInt(f)).map(p=>({value:p,label:`Partition ${p}`}));return e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx("div",{className:"flex-1 min-w-[200px]",children:e.jsx(be,{placeholder:"Filter by owner name...",value:l,onChange:p=>c(p.target.value),className:"max-w-sm"})}),e.jsx(Le,{options:m,selected:r,onChange:a,placeholder:"Filter by state",className:"w-[200px]"}),e.jsx(Le,{options:y,selected:n,onChange:o,placeholder:"Filter by zone",className:"w-[200px]"}),e.jsx(Le,{options:h,selected:t,onChange:s,placeholder:"Filter by partition ID",className:"w-[200px]"})]})}const ht=[{value:1,label:"Pending"},{value:2,label:"Active"},{value:3,label:"Inactive"},{value:4,label:"Deleted"}];function Ic(){const[t,s]=i.useState(new Set),[r,a]=i.useState("id"),[n,o]=i.useState("asc"),[l,c]=i.useState([]),[d,u]=i.useState([]),[m,g]=i.useState([]),[y,N]=i.useState(""),[h,p]=i.useState(!1),[f,x]=i.useState(),[b,j]=i.useState(!1),{toast:w}=Vt(),{partitions:E,error:C,isLoading:A,fetchPartitions:B,changePartitionState:z,uniqueStates:Y,uniqueZones:K}=vc({isPaused:t.size>0}),M=i.useMemo(()=>E.flatMap(I=>I.owner_ids.map(P=>({...I,owner_id:P,owner_ids:[P],zone:Ts(P)}))),[E]),W=i.useCallback(I=>{a(P=>P===I?(o(U=>U==="asc"?"desc":"asc"),I):(o("asc"),I))},[]),T=i.useCallback(I=>{s(P=>{const U=new Set(P);return U.has(I)?U.delete(I):U.add(I),U})},[]),O=i.useMemo(()=>M.filter(I=>{const P=l.length===0||l.includes(I.id.toString()),U=d.length===0||d.includes(I.state.toString()),S=m.length===0||m.includes(I.zone),R=y?I.owner_id.toLowerCase().includes(y.toLowerCase()):!0;return P&&U&&S&&R}),[M,l,d,m,y]),V=i.useMemo(()=>M.filter(I=>t.has(I.id)),[M,t]),Q=i.useCallback(async()=>{var I;if(!(t.size===0||!f))try{p(!0);const P=parseInt(f,10),{success:U,total:S}=await z(V.map(R=>R.id),f);U>0&&S===U?(w({title:"State Change Success",description:`Successfully changed state for ${U} partition${U!==1?"s":""} to ${(I=ht.find(R=>R.value===P))==null?void 0:I.label}`}),await B()):U0,isLoading:A}),t.size>0&&e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.size," partition",t.size!==1?"s":""," selected"]}),e.jsxs(Rt,{value:f,onValueChange:x,children:[e.jsx(tt,{className:"w-[160px]",children:e.jsx(At,{placeholder:"Select new state"})}),e.jsx(st,{children:ht.map(I=>e.jsx(Ve,{value:I.value.toString(),children:I.label},I.value))})]}),e.jsxs(q,{onClick:()=>j(!0),disabled:h||!f,size:"sm",variant:"outline",children:[h&&e.jsx(xe,{className:"mr-2 h-4 w-4 animate-spin"}),"Change State"]})]})]})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:e.jsx(Ac,{partitions:E})})})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsx(_c,{idFilter:l,onIdFilterChange:c,stateFilter:d,onStateFilterChange:u,zoneFilter:m,onZoneFilterChange:g,ownerFilter:y,onOwnerFilterChange:N,uniqueStates:Y,uniqueZones:K,partitions:E}),e.jsx("div",{className:"rounded-md border bg-card",children:e.jsx(Ec,{..._})})]})]}),e.jsx(za,{open:b,onOpenChange:j,children:e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsx(Ds,{children:"Confirm State Change"}),e.jsx(Os,{children:"Are you sure you want to change the state of these partitions?"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx("div",{className:"space-y-2",children:Array.from(new Set(V.map(I=>I.id))).map(I=>{var U,S;const P=E.find(R=>R.id===I);return P?e.jsx("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-medium",children:["Partition ",I]}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Ct(P.state)),children:(U=ht.find(R=>R.value===P.state))==null?void 0:U.label}),e.jsx(Lt,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:v("inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium",Ct(parseInt(f||"0",10))),children:(S=ht.find(R=>R.value===parseInt(f,10)))==null?void 0:S.label})]})},I):null})})}),e.jsxs(Ps,{children:[e.jsx(q,{variant:"outline",onClick:()=>j(!1),disabled:h,children:"Cancel"}),e.jsx(q,{onClick:Q,disabled:h,children:h?"Changing States...":"Confirm Changes"})]})]})})]})}function lr(){const{ringName:t}=Sr(),s=Object.values(J).includes(t);return!t||!s?e.jsx($s,{}):t===J.PARTITION_INGESTER?e.jsx(Ic,{}):e.jsx(xc,{ringName:t})}const mt=i.forwardRef(({className:t,children:s,...r},a)=>e.jsxs(ta,{ref:a,className:v("relative overflow-hidden",t),...r,children:[e.jsx(gi,{className:"h-full w-full rounded-[inherit]",children:s}),e.jsx(Xa,{}),e.jsx(hi,{})]}));mt.displayName=ta.displayName;const Xa=i.forwardRef(({className:t,orientation:s="vertical",...r},a)=>e.jsx(sa,{ref:a,orientation:s,className:v("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:e.jsx(xi,{className:"relative flex-1 rounded-full bg-border"})}));Xa.displayName=sa.displayName;const Ut=vi,qt=ji,ft=i.forwardRef(({className:t,align:s="center",sideOffset:r=4,...a},n)=>e.jsx(ia,{ref:n,align:s,sideOffset:r,className:v("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));ft.displayName=ia.displayName;const Ms=({date:t,className:s=""})=>{const r=Fr(t,{addSuffix:!0}),a=Nt(t,"yyyy-MM-dd HH:mm:ss"),n=Nt(new Date(t.getTime()+t.getTimezoneOffset()*6e4),"yyyy-MM-dd HH:mm:ss");return e.jsxs(Ut,{children:[e.jsx(qt,{children:e.jsx("div",{className:`inline-block ${s}`,children:r})}),e.jsx(ft,{className:"w-[280px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"UTC"}),e.jsx("span",{className:"font-mono",children:n})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"Local"}),e.jsx("span",{className:"font-mono",children:a})]})]})})]})};function Fc({current:t,parent:s,files:r,folders:a}){const n=Ft(),[,o]=nt(),l=d=>{o({path:d})},c=d=>{n(`/storage/dataobj/metadata?path=${encodeURIComponent(t+"/"+d.name)}`)};return e.jsx("div",{className:"space-y-4",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"h-12",children:[e.jsx(D,{children:"Name"}),e.jsx(D,{children:"Modified"}),e.jsx(D,{children:"Size"}),e.jsx(D,{})]})}),e.jsxs(Ae,{children:[s!==t&&e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:()=>l(s||""),children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 19l-7-7 7-7"})}),".."]})}),e.jsx(F,{children:"-"}),e.jsx(F,{children:"-"}),e.jsx(F,{})]},"parent"),a.map(d=>e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:()=>l(t?`${t}/${d}`:d),children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(zo,{className:"mr-2 h-4 w-4"}),d]})}),e.jsx(F,{children:"-"}),e.jsx(F,{children:"-"}),e.jsx(F,{})]},d)),r.map(d=>e.jsxs(X,{className:"h-12 cursor-pointer hover:bg-muted/50",onClick:u=>{u.target.closest("a[download]")||c(d)},children:[e.jsx(F,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Vo,{className:"mr-2 h-4 w-4"}),d.name]})}),e.jsx(F,{children:e.jsx(Ms,{date:new Date(d.lastModified)})}),e.jsx(F,{children:fe(d.size)}),e.jsx(F,{children:e.jsx(q,{variant:"outline",size:"icon",asChild:!0,className:"h-8 w-8",children:e.jsx(de,{to:d.downloadUrl,target:"_blank",download:!0,onClick:u=>u.stopPropagation(),children:e.jsx(_r,{className:"h-4 w-4"})})})})]},d.name))]})]})})}function Lc(t){const{cluster:s}=pe(),r=i.useMemo(()=>$e(s==null?void 0:s.members,"dataobj-explorer"),[s==null?void 0:s.members]);return Bt({queryKey:["explorer",t,r],queryFn:async()=>{if(!r)throw new Error("Node name not found");const a=await fetch(re(`/api/v1/proxy/${r}/dataobj/api/v1/list?path=${encodeURIComponent(t)}`));if(!a.ok)throw new Error("Failed to fetch explorer data");const n=await a.json();return{...n,files:Pc(n.files).map(o=>({...o,downloadUrl:re(`/api/v1/proxy/${r}/dataobj/api/v1/download?file=${encodeURIComponent(t?`${t}/${o.name}`:o.name)}`)}))}}})}const Pc=t=>[...t].sort((s,r)=>new Date(r.lastModified).getTime()-new Date(s.lastModified).getTime()),Dc=t=>{switch(t){case"S3":return{bg:"bg-orange-100",text:"text-orange-800",darkBg:"dark:bg-orange-900",darkText:"dark:text-orange-300"};case"GCS":return{bg:"bg-blue-100",text:"text-blue-800",darkBg:"dark:bg-blue-900",darkText:"dark:text-blue-300"};case"AZURE":return{bg:"bg-sky-100",text:"text-sky-800",darkBg:"dark:bg-sky-900",darkText:"dark:text-sky-300"};case"SWIFT":return{bg:"bg-red-100",text:"text-red-800",darkBg:"dark:bg-red-900",darkText:"dark:text-red-300"};case"COS":return{bg:"bg-purple-100",text:"text-purple-800",darkBg:"dark:bg-purple-900",darkText:"dark:text-purple-300"};case"ALIYUNOSS":return{bg:"bg-rose-100",text:"text-rose-800",darkBg:"dark:bg-rose-900",darkText:"dark:text-rose-300"};case"OCI":return{bg:"bg-red-100",text:"text-red-800",darkBg:"dark:bg-red-900",darkText:"dark:text-red-300"};case"OBS":return{bg:"bg-cyan-100",text:"text-cyan-800",darkBg:"dark:bg-cyan-900",darkText:"dark:text-cyan-300"};case"FILESYSTEM":return{bg:"bg-green-100",text:"text-green-800",darkBg:"dark:bg-green-900",darkText:"dark:text-green-300"};case"MEMORY":return{bg:"bg-yellow-100",text:"text-yellow-800",darkBg:"dark:bg-yellow-900",darkText:"dark:text-yellow-300"};default:return{bg:"bg-gray-100",text:"text-gray-800",darkBg:"dark:bg-gray-700",darkText:"dark:text-gray-300"}}};function Qa(){const[t,s]=ze.useState(""),{cluster:r}=pe(),a=i.useMemo(()=>$e(r==null?void 0:r.members,"dataobj-explorer"),[r==null?void 0:r.members]);ze.useEffect(()=>{a&&fetch(re(`/api/v1/proxy/${a}/dataobj/api/v1/provider`)).then(d=>d.json()).then(d=>s(d.provider)).catch(console.error)},[a]);const[n]=nt(),l=(n.get("path")||"").split("/").filter(Boolean),c=Dc(t);return e.jsx(Ss,{children:e.jsxs(Es,{children:[e.jsx(kt,{children:e.jsx(St,{asChild:!0,children:e.jsxs(de,{to:"/storage/dataobj",className:`inline-flex items-center h-7 gap-2 px-3 py-1 text-xs font-medium ${c.bg} ${c.text} ${c.darkBg} ${c.darkText} rounded-full hover:ring-1 hover:ring-gray-300 dark:hover:ring-gray-600 transition-all duration-200`,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",className:"w-4 h-4",fill:"currentColor",children:e.jsx("path",{d:"M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"})}),t||""]})})}),l.length>0&&e.jsx(Et,{}),l.map((d,u)=>{const m=l.slice(0,u+1).join("/"),g=u===l.length-1;return e.jsxs(ze.Fragment,{children:[e.jsx(kt,{children:e.jsx(St,{asChild:!0,children:g?e.jsx("span",{className:"text-gray-500",children:d}):e.jsx(de,{to:`/storage/dataobj?path=${encodeURIComponent(m)}`,children:d})})}),u{navigator.clipboard.writeText(t).then(()=>{n(!0),r==null||r(),setTimeout(()=>n(!1),2e3)})};return e.jsx(q,{variant:"ghost",size:"sm",onClick:o,className:v("h-8 px-2",s),children:a?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"h-4 w-4 mr-1"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ir,{className:"h-4 w-4 mr-1"}),"Copy"]})})}const Gt=({compressed:t,uncompressed:s,showVisualization:r=!1})=>{if(t===0||s===0)return e.jsx("span",{className:"dark:text-gray-200",children:"-"});const a=s/t,n=a>1;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"font-medium whitespace-nowrap dark:text-gray-200",children:[a.toFixed(1),"x"]}),r&&n&&e.jsx("div",{className:"flex-1 h-2.5 bg-gray-100 dark:bg-gray-600 border border-gray-200 dark:border-gray-500 rounded relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 bg-blue-600 dark:bg-blue-500 rounded",style:{width:`${t/s*100}%`}})})]})},Mc=t=>{switch(t){case"INT64":return"bg-blue-500/20 text-blue-700 dark:bg-blue-500/30 dark:text-blue-300 hover:bg-blue-500/30";case"BYTES":return"bg-red-500/20 text-red-700 dark:bg-red-500/30 dark:text-red-300 hover:bg-red-500/30";case"FLOAT64":return"bg-purple-500/20 text-purple-700 dark:bg-purple-500/30 dark:text-purple-300 hover:bg-purple-500/30";case"BOOL":return"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/30 dark:text-yellow-300 hover:bg-yellow-500/30";case"STRING":return"bg-green-500/20 text-green-700 dark:bg-green-500/30 dark:text-green-300 hover:bg-green-500/30";case"TIMESTAMP":return"bg-orange-500/20 text-orange-700 dark:bg-orange-500/30 dark:text-orange-300 hover:bg-orange-500/30";default:return"bg-gray-500/20 text-gray-700 dark:bg-gray-500/30 dark:text-gray-300 hover:bg-gray-500/30"}};function Bc({metadata:t,filename:s,downloadUrl:r}){const[a,n]=i.useState(null),[o,l]=i.useState({}),c=p=>{n(a===p?null:p)},d=(p,f)=>{const x=`${p}-${f}`;l(b=>({...b,[x]:!b[x]}))},u=t.sections.reduce((p,f)=>p+f.totalCompressedSize,0),m=t.sections.reduce((p,f)=>p+f.totalUncompressedSize,0),g=t.sections.filter(p=>p.type==="SECTION_TYPE_STREAMS"),y=t.sections.filter(p=>p.type==="SECTION_TYPE_LOGS"),N=g==null?void 0:g.reduce((p,f)=>p+(f.columns[0].rows_count||0),0),h=y==null?void 0:y.reduce((p,f)=>p+(f.columns[0].rows_count||0),0);return e.jsxs(ee,{className:"w-full",children:[e.jsx(zc,{filename:s,downloadUrl:r,lastModified:t.lastModified}),e.jsxs(te,{className:"space-y-8",children:[e.jsx(Vc,{totalCompressed:u,totalUncompressed:m,sections:t.sections,streamCount:N,logCount:h}),e.jsx(Uc,{sections:t.sections,expandedSectionIndex:a,expandedColumns:o,onToggleSection:c,onToggleColumn:d})]})]})}function zc({filename:t,downloadUrl:s,lastModified:r}){return e.jsxs(se,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ne,{className:"text-2xl font-semibold tracking-tight",children:"Thor Dataobj File"}),e.jsx(q,{asChild:!0,variant:"outline",children:e.jsxs(de,{to:s,target:"_blank",download:!0,children:[e.jsx(_r,{className:"h-4 w-4 mr-2"}),"Download"]})})]}),e.jsx(Je,{className:"space-y-2",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-sm text-foreground",children:t}),e.jsx(Bs,{text:t})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:"Last Modified:"}),e.jsx(Ms,{date:new Date(r)})]})]})})})]})}function Vc({totalCompressed:t,totalUncompressed:s,sections:r,streamCount:a,logCount:n}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Compression"}),e.jsx(Gt,{compressed:t,uncompressed:s,showVisualization:!0}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[fe(t)," → ",fe(s)]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Sections"}),e.jsx("div",{className:"font-medium text-lg",children:r.length}),e.jsx("div",{className:"text-xs text-muted-foreground mt-2",children:r.map(o=>o.type).join(", ")})]}),a&&e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Stream Count"}),e.jsx("div",{className:"font-medium text-lg",children:a.toLocaleString()})]}),n&&e.jsxs("div",{className:"rounded-lg bg-muted/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Log Count"}),e.jsx("div",{className:"font-medium text-lg",children:n.toLocaleString()})]})]})}function Uc({sections:t,expandedSectionIndex:s,expandedColumns:r,onToggleSection:a,onToggleColumn:n}){return e.jsx("div",{className:"divide-y divide-border",children:t.map((o,l)=>e.jsx(qc,{section:o,sectionIndex:l,isExpanded:s===l,expandedColumns:r,onToggle:()=>a(l),onToggleColumn:c=>n(l,c)},l))})}function qc({section:t,sectionIndex:s,isExpanded:r,expandedColumns:a,onToggle:n,onToggleColumn:o}){return e.jsxs("div",{className:"py-4",children:[e.jsxs("button",{className:"w-full flex justify-between items-center py-4 px-6 rounded-lg hover:bg-accent/50 transition-colors",onClick:n,children:[e.jsxs("h3",{className:"text-lg font-semibold",children:["Section #",s+1,": ",t.type]}),e.jsx("svg",{className:`w-5 h-5 transform transition-transform duration-300 ${r?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),r&&e.jsxs("div",{className:"mt-6 px-6",children:[e.jsx(Gc,{section:t}),e.jsx(Hc,{columns:t.columns,sectionIndex:s,expandedColumns:a,onToggleColumn:o})]})]})}function Gc({section:t}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Compression"}),e.jsx(Gt,{compressed:t.totalCompressedSize,uncompressed:t.totalUncompressedSize,showVisualization:!0}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[fe(t.totalCompressedSize)," →"," ",fe(t.totalUncompressedSize)]})]}),e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Column Count"}),e.jsx("div",{className:"font-medium text-lg",children:t.columnCount})]}),e.jsxs("div",{className:"rounded-lg bg-secondary/50 p-6 shadow-sm",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Type"}),e.jsx("div",{className:"font-medium text-lg flex items-center gap-2",children:e.jsx(ye,{variant:"outline",className:"font-mono",children:t.type})})]})]})}function Hc({columns:t,sectionIndex:s,expandedColumns:r,onToggleColumn:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("h4",{className:"text-lg font-medium",children:["Columns (",t.length,")"]}),e.jsx("div",{className:"space-y-4",children:t.map((n,o)=>e.jsx(Kc,{column:n,isExpanded:r[`${s}-${o}`],onToggle:()=>a(o)},o))})]})}function Kc({column:t,isExpanded:s,onToggle:r}){return e.jsxs(ee,{className:"bg-card/50",children:[e.jsxs("button",{className:"w-full flex justify-between items-center p-6 hover:bg-accent/50 transition-colors rounded-t-lg",onClick:r,children:[e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-lg",children:t.name?`${t.name} (${t.type})`:t.type}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-2",children:e.jsx(ye,{variant:"secondary",className:v("font-mono text-xs",Mc(t.value_type)),children:t.value_type})})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:["Compression:",e.jsx(ye,{variant:"outline",className:"font-mono",children:t.compression||"NONE"})]}),e.jsx("svg",{className:`w-4 h-4 transform transition-transform ${s?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]})]}),s&&e.jsxs(te,{className:"pt-6",children:[e.jsx(Wc,{column:t}),t.pages.length>0&&e.jsx(Zc,{pages:t.pages})]})]})}function Wc({column:t}){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2 flex items-center gap-2",children:e.jsx(ye,{variant:"outline",className:"font-mono",children:t.compression||"NONE"})}),e.jsx("div",{className:"font-medium",children:e.jsx(Gt,{compressed:t.compressed_size,uncompressed:t.uncompressed_size})}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:[fe(t.compressed_size)," →"," ",fe(t.uncompressed_size)]})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Rows"}),e.jsx("div",{className:"font-medium text-lg",children:t.rows_count.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Values Count"}),e.jsx("div",{className:"font-medium text-lg",children:t.values_count.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg bg-muted p-6",children:[e.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Offset"}),e.jsx("div",{className:"font-medium text-lg",children:fe(t.metadata_offset)})]})]})}function Zc({pages:t}){return e.jsxs("div",{className:"mt-8",children:[e.jsxs("h6",{className:"text-base font-medium mb-4",children:["Pages (",t.length,")"]}),e.jsx("div",{className:"rounded-lg border border-border overflow-hidden bg-background",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-secondary/50 border-b border-border",children:[e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"#"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Rows"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Values"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Encoding"}),e.jsx("th",{className:"text-left p-4 font-medium text-muted-foreground",children:"Compression"})]})}),e.jsx("tbody",{children:t.map((s,r)=>e.jsxs("tr",{className:"border-t border-border hover:bg-accent/50 transition-colors",children:[e.jsx("td",{className:"p-4",children:r+1}),e.jsx("td",{className:"p-4",children:s.rows_count.toLocaleString()}),e.jsx("td",{className:"p-4",children:s.values_count.toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsx(ye,{variant:"outline",className:"font-mono",children:s.encoding})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Gt,{compressed:s.compressed_size,uncompressed:s.uncompressed_size}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",fe(s.compressed_size)," →"," ",fe(s.uncompressed_size),")"]})]})})]},r))})]})})]})}function Yc(t){const{cluster:s}=pe(),r=i.useMemo(()=>$e(s==null?void 0:s.members,"dataobj-explorer"),[s==null?void 0:s.members]),a=i.useMemo(()=>`/api/v1/proxy/${r}/dataobj/api/v1/download?file=${encodeURIComponent(t||"")}`,[t,r]);return{...Bt({queryKey:["file-metadata",t,r],queryFn:async()=>{if(!t)throw new Error("No file path provided");if(!r)throw new Error("Node name not found");const o=await fetch(re(`/api/v1/proxy/${r}/dataobj/api/v1/inspect?file=${encodeURIComponent(t)}`));if(!o.ok)throw new Error("Failed to fetch file metadata");return o.json()},enabled:!!t&&!!r}),downloadUrl:a}}function Xc(){const[t]=nt(),s=t.get("path")||"",{data:r,downloadUrl:a,isLoading:n,error:o}=Yc(s);return e.jsx(Se,{children:e.jsxs("div",{className:"flex h-full flex-col space-y-6",children:[e.jsx(Qa,{}),e.jsx(mt,{className:"h-full",children:n?e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(xe,{className:"h-16 w-16 animate-spin"})}):o?e.jsxs(He,{variant:"destructive",children:[e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:o.message})]}):r&&s?e.jsx(Bc,{metadata:r,filename:s,downloadUrl:a}):null})]})})}const Qc=["New","Starting","Running","Stopping","Terminated","Failed"],Jc=({nameFilter:t,targetFilter:s,selectedStates:r,onNameFilterChange:a,onTargetFilterChange:n,onStatesChange:o,onRefresh:l,availableTargets:c})=>{const d=Qc.map(m=>({label:m,value:m})),u=m=>{o(m)};return e.jsxs("div",{className:"grid grid-cols-[auto_1fr_auto] gap-x-4 gap-y-2",children:[e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Node filters"}),e.jsx(be,{value:t,onChange:m=>a(m.target.value),placeholder:"Filter by node name...",className:"w-[300px]"}),e.jsx(Le,{options:c.map(m=>({value:m,label:m})),selected:s,onChange:n,placeholder:"All Targets",className:"w-[300px]"})]})}),e.jsxs("div",{className:"space-y-1.5 self-end",children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Service states"}),e.jsx(Le,{options:d,selected:r,onChange:u,placeholder:"Filter nodes by service states...",className:"w-full min-w-[300px]"})]}),e.jsx("div",{className:"self-end",children:e.jsx(q,{onClick:l,size:"sm",variant:"outline",className:"h-9 w-9",children:e.jsx(Uo,{className:"h-4 w-4"})})})]})},ed=({services:t,error:s})=>{const r=()=>{if(s)return{className:"bg-red-500 dark:bg-red-500/80 hover:bg-red-600 dark:hover:bg-red-500 text-white border-transparent",tooltip:`Error: ${s}`,status:"error"};const o=t.every(c=>c.status==="Running"),l=t.every(c=>c.status==="Starting"||c.status==="Running");return o?{className:"bg-green-500 dark:bg-green-500/80 hover:bg-green-600 dark:hover:bg-green-500 text-white border-transparent",status:"healthy"}:l?{className:"bg-yellow-500 dark:bg-yellow-500/80 hover:bg-yellow-600 dark:hover:bg-yellow-500 text-white border-transparent",status:"pending"}:{className:"bg-red-500 dark:bg-red-500/80 hover:bg-red-600 dark:hover:bg-red-500 text-white border-transparent",status:"unhealthy"}},a=o=>{switch(o){case"Running":return"text-green-600 dark:text-green-400";case"Starting":return"text-yellow-600 dark:text-yellow-400";case"Failed":return"text-red-600 dark:text-red-400";case"Terminated":return"text-gray-600 dark:text-gray-400";case"Stopping":return"text-orange-600 dark:text-orange-400";case"New":return"text-blue-600 dark:text-blue-400";default:return"text-gray-600 dark:text-gray-400"}},{className:n}=r();return e.jsxs(Ut,{children:[e.jsx(qt,{children:e.jsx("button",{type:"button",children:e.jsxs(ye,{className:n,children:[t.length," services"]})})}),e.jsx(ft,{className:"w-80 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",sideOffset:5,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"font-medium border-b border-gray-200 dark:border-gray-700 pb-1",children:"Service Status"}),e.jsx("div",{className:"space-y-1",children:t.map((o,l)=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"mr-4 font-medium",children:o.service}),e.jsx("span",{className:`${a(o.status)}`,children:o.status})]},l))}),s&&e.jsx("div",{className:"mt-2 pt-2 border-t border-gray-200 dark:border-gray-700 text-red-600 dark:text-red-400",children:s})]})})]})},zs=ho,rt=xo,at=bo,qe=i.forwardRef(({className:t,sideOffset:s=4,...r},a)=>e.jsx(go,{children:e.jsx(vr,{ref:a,sideOffset:s,className:v("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));qe.displayName=vr.displayName;function td({isReady:t,message:s,className:r}){return e.jsx(zs,{children:e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsx("div",{className:v("flex items-center gap-2",r),children:e.jsx("div",{className:v("h-2.5 w-2.5 rounded-full",t?"bg-green-500":"bg-red-500")})})}),e.jsx(qe,{children:e.jsx("p",{className:"text-sm",children:s||(t?"Ready":"Not Ready")})})]})})}const sd=t=>{try{const s=ds(t);return Ye(s)?Fr(s,{addSuffix:!0}):"Invalid date"}catch(s){return console.warn("Error parsing date:",t,s),"Invalid date"}},rd=({name:t,node:s,onNavigate:r})=>{var a,n;return e.jsxs(X,{className:"hover:bg-muted/50 cursor-pointer",onClick:()=>r(t),children:[e.jsx(F,{className:"font-medium",children:t}),e.jsx(F,{children:s.target}),e.jsx(F,{className:"font-mono text-sm",children:s.build.version}),e.jsx(F,{children:sd(s.build.buildDate)}),e.jsx(F,{children:e.jsx(ed,{services:s.services,error:s.error})}),e.jsx(F,{children:e.jsx(td,{isReady:(a=s.ready)==null?void 0:a.isReady,message:(n=s.ready)==null?void 0:n.message})}),e.jsx(F,{children:e.jsxs(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>{o.stopPropagation(),r(t)},children:[e.jsx(Lt,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"View details"})]})})]},t)},ad=({nodes:t,sortField:s,sortDirection:r,onSort:a})=>{const n=Ft(),o=(d,u)=>{const m=ds(d),g=ds(u);return!Ye(m)&&!Ye(g)?0:Ye(m)?Ye(g)?m.getTime()-g.getTime():-1:1},l=Object.entries(t).sort(([d,u],[m,g])=>{let y=0;switch(s){case"name":y=d.localeCompare(m);break;case"target":y=u.target.localeCompare(g.target);break;case"version":y=u.build.version.localeCompare(g.build.version);break;case"buildDate":y=o(u.build.buildDate,g.build.buildDate);break}return r==="asc"?y:-y}),c=d=>{n(`/nodes/${d}`)};return e.jsx("div",{className:"rounded-md border bg-card",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[300px]",children:e.jsx(Z,{title:"Node Name",field:"name",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Target",field:"target",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Version",field:"version",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Build Date",field:"buildDate",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[150px]",children:"Status"}),e.jsx(D,{className:"w-[50px]",children:"Ready"}),e.jsx(D,{className:"w-[100px]",children:"Actions"})]})}),e.jsxs(Ae,{children:[l.map(([d,u])=>e.jsx(rd,{name:d,node:u,onNavigate:c},d)),l.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No nodes found"})})})]})]})})},cr=t=>`hsl(var(--chart-${t%6+1}))`;function nd({nodes:t}){const s=i.useMemo(()=>{const a=new Map;return Object.values(t).forEach(n=>{const o=n.target||"unknown";a.set(o,(a.get(o)||0)+1)}),Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o],l)=>({name:n,value:o,color:cr(l)}))},[t]),r=i.useMemo(()=>Object.keys(t).length,[t]);return s.length===0?null:e.jsxs("div",{className:"w-full h-[120px] relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"text-xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Nodes"})]}),e.jsx(dt,{width:"100%",height:"100%",children:e.jsxs(Ot,{children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:60,innerRadius:42,fill:"hsl(var(--chart-1))",dataKey:"value",paddingAngle:1,strokeWidth:1,children:s.map((a,n)=>e.jsx(Mt,{fill:cr(n),stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]})}class Ja extends ze.Component{constructor(s){super(s),this.state={hasError:!1}}static getDerivedStateFromError(s){return{hasError:!0,error:s}}render(){var s;return this.state.hasError?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-destructive/10 p-6 rounded-lg max-w-2xl w-full",children:[e.jsx("h2",{className:"text-xl font-semibold text-destructive mb-4",children:"Something went wrong"}),e.jsx("div",{className:"bg-background/50 p-4 rounded-md",children:e.jsx("pre",{className:"text-sm overflow-auto",children:(s=this.state.error)==null?void 0:s.message})}),e.jsx("button",{className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",onClick:()=>window.location.reload(),children:"Reload Page"})]})}):this.props.children}}const od=()=>{const{cluster:t,error:s,refresh:r,isLoading:a}=pe(),[n,o]=i.useState(""),[l,c]=i.useState([]),[d,u]=i.useState(["New","Starting","Running","Stopping","Terminated","Failed"]),[m,g]=i.useState("name"),[y,N]=i.useState("asc"),h=x=>{x===m?N(y==="asc"?"desc":"asc"):(g(x),N("asc"))},p=()=>t?Object.entries(t.members).reduce((x,[b,j])=>{const w=b.toLowerCase().includes(n.toLowerCase()),E=!l||l.length===0||l.includes(j.target),C=d.length===0||j.services&&Array.isArray(j.services)&&j.services.some(A=>(A==null?void 0:A.status)&&d.includes(A.status));return w&&E&&C&&(x[b]=j),x},{}):{},f=()=>{if(!t)return[];const x=new Set;return Object.values(t.members).forEach(b=>{b.target&&x.add(b.target)}),Array.from(x).sort()};return e.jsx(Se,{children:e.jsxs(ee,{className:"shadow-sm",children:[e.jsx(se,{children:e.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:"Nodes"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage Loki nodes in your cluster with their current status and configuration"})]}),e.jsx(Jc,{nameFilter:n,targetFilter:l,selectedStates:d,onNameFilterChange:o,onTargetFilterChange:c,onStatesChange:u,onRefresh:r,availableTargets:f(),isLoading:a})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("div",{className:"w-[250px]",children:e.jsx(nd,{nodes:p()})})})]})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs(He,{variant:"destructive",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:s})]}),a&&e.jsxs("div",{className:"flex items-center justify-center py-4",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading..."})]}),!a&&!s&&e.jsx(ad,{nodes:p(),sortField:m,sortDirection:y,onSort:h})]})})]})})};function dr(){return e.jsx(Ja,{children:e.jsx(od,{})})}const id=bi,en=i.forwardRef(({className:t,...s},r)=>e.jsx(ra,{ref:r,className:v("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...s}));en.displayName=ra.displayName;const vt=i.forwardRef(({className:t,...s},r)=>e.jsx(aa,{ref:r,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...s}));vt.displayName=aa.displayName;const jt=i.forwardRef(({className:t,...s},r)=>e.jsx(na,{ref:r,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));jt.displayName=na.displayName;var ld=Object.create,Ht=Object.defineProperty,cd=Object.defineProperties,dd=Object.getOwnPropertyDescriptor,ud=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertyNames,_t=Object.getOwnPropertySymbols,pd=Object.getPrototypeOf,Vs=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,ur=(t,s,r)=>s in t?Ht(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,ge=(t,s)=>{for(var r in s||(s={}))Vs.call(s,r)&&ur(t,r,s[r]);if(_t)for(var r of _t(s))sn.call(s,r)&&ur(t,r,s[r]);return t},Kt=(t,s)=>cd(t,ud(s)),rn=(t,s)=>{var r={};for(var a in t)Vs.call(t,a)&&s.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&_t)for(var a of _t(t))s.indexOf(a)<0&&sn.call(t,a)&&(r[a]=t[a]);return r},md=(t,s)=>function(){return s||(0,t[tn(t)[0]])((s={exports:{}}).exports,s),s.exports},fd=(t,s)=>{for(var r in s)Ht(t,r,{get:s[r],enumerable:!0})},gd=(t,s,r,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of tn(s))!Vs.call(t,n)&&n!==r&&Ht(t,n,{get:()=>s[n],enumerable:!(a=dd(s,n))||a.enumerable});return t},hd=(t,s,r)=>(r=t!=null?ld(pd(t)):{},gd(!t||!t.__esModule?Ht(r,"default",{value:t,enumerable:!0}):r,t)),xd=md({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,s){var r=function(){var a=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},l={util:{encode:function h(p){return p instanceof c?new c(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"+b.content+""};function d(h,p,f,x){h.lastIndex=p;var b=h.exec(f);if(b&&x&&b[1]){var j=b[1].length;b.index+=j,b[0]=b[0].slice(j)}return b}function u(h,p,f,x,b,j){for(var w in f)if(!(!f.hasOwnProperty(w)||!f[w])){var E=f[w];E=Array.isArray(E)?E:[E];for(var C=0;C=j.reach);O+=T.value.length,T=T.next){var V=T.value;if(p.length>h.length)return;if(!(V instanceof c)){var Q=1,_;if(Y){if(_=d(W,O,h,z),!_||_.index>=h.length)break;var S=_.index,I=_.index+_[0].length,P=O;for(P+=T.value.length;S>=P;)T=T.next,P+=T.value.length;if(P-=T.value.length,O=P,T.value instanceof c)continue;for(var U=T;U!==p.tail&&(Pj.reach&&(j.reach=G);var H=T.prev;$&&(H=g(p,H,$),O+=$.length),y(p,H,Q);var oe=new c(w,B?l.tokenize(R,B):R,K,R);if(T=g(p,H,oe),L&&g(p,T,L),Q>1){var ue={cause:w+","+C,reach:G};u(h,p,f,T.prev,O,ue),j&&ue.reach>j.reach&&(j.reach=ue.reach)}}}}}}function m(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function g(h,p,f){var x=p.next,b={value:f,prev:p,next:x};return p.next=b,x.prev=b,h.length++,b}function y(h,p,f){for(var x=p.next,b=0;b/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},k.languages.markup.tag.inside["attr-value"].inside.entity=k.languages.markup.entity,k.languages.markup.doctype.inside["internal-subset"].inside=k.languages.markup,k.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(k.languages.markup.tag,"addInlined",{value:function(t,a){var r={},r=(r["language-"+a]={pattern:/(^$)/i,lookbehind:!0,inside:k.languages[a]},r.cdata=/^$/i,{"included-cdata":{pattern://i,inside:r}}),a=(r["language-"+a]={pattern:/[\s\S]+/,inside:k.languages[a]},{});a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},k.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(k.languages.markup.tag,"addAttribute",{value:function(t,s){k.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:k.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),k.languages.html=k.languages.markup,k.languages.mathml=k.languages.markup,k.languages.svg=k.languages.markup,k.languages.xml=k.languages.extend("markup",{}),k.languages.ssml=k.languages.xml,k.languages.atom=k.languages.xml,k.languages.rss=k.languages.xml,function(t){var s={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a="(?:[^\\\\-]|"+r.source+")",a=RegExp(a+"-"+a),n={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:a,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":s,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:r}},"special-escape":s,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":n}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},k.languages.javascript=k.languages.extend("clike",{"class-name":[k.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),k.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,k.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:k.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:k.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:k.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:k.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:k.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),k.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:k.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),k.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),k.languages.markup&&(k.languages.markup.tag.addInlined("script","javascript"),k.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),k.languages.js=k.languages.javascript,k.languages.actionscript=k.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),k.languages.actionscript["class-name"].alias="function",delete k.languages.actionscript.parameter,delete k.languages.actionscript["literal-property"],k.languages.markup&&k.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:k.languages.markup}}),function(t){var s=/#(?!\{).+/,r={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:s,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:r}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:s,interpolation:r}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:r}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript}(k),function(t){var s=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(s,"addSupport",{value:function(r,a){(r=typeof r=="string"?[r]:r).forEach(function(n){var o=function(g){g.inside||(g.inside={}),g.inside.rest=a},l="doc-comment";if(c=t.languages[n]){var c,d=c[l];if((d=d||(c=t.languages.insertBefore(n,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[l])instanceof RegExp&&(d=c[l]={pattern:d}),Array.isArray(d))for(var u=0,m=d.length;u|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=s,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:s,number:r,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:s,number:r})}(k),function(t){var s=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+s.source+")?|"+s.source+"(?:[ ]+"+r.source+")?)",n=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,d){d=(d||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return c});return RegExp(u,d)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return"(?:"+n+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:s,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml}(k),function(t){var s=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(u){return u=u.replace(//g,function(){return s}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,n=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,l=(t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+n+o+"(?:"+n+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+n+o+")(?:"+n+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+n+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+n+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(m){u!==m&&(t.languages.markdown[u].inside.content.inside[m]=t.languages.markdown[m])})}),t.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function m(g){if(g&&typeof g!="string")for(var y=0,N=g.length;y",quot:'"'},d=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown}(k),k.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:k.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},k.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var s=t.tokens.filter(function(h){return typeof h!="string"&&h.type!=="comment"&&h.type!=="scalar"}),r=0;r?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(t){var s=t.languages.javascript["template-string"],r=s.pattern.source,a=s.inside.interpolation,n=a.inside["interpolation-punctuation"],o=a.pattern.source;function l(g,y){if(t.languages[g])return{pattern:RegExp("((?:"+y+")\\s*)"+r),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:g}}}}function c(g,y,N){return g={code:g,grammar:y,language:N},t.hooks.run("before-tokenize",g),g.tokens=t.tokenize(g.code,g.grammar),t.hooks.run("after-tokenize",g),g.tokens}function d(g,y,N){var f=t.tokenize(g,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),h=0,p={},f=c(f.map(function(b){if(typeof b=="string")return b;for(var j,w,b=b.content;g.indexOf((w=h++,j="___"+N.toUpperCase()+"_"+w+"___"))!==-1;);return p[j]=b,j}).join(""),y,N),x=Object.keys(p);return h=0,function b(j){for(var w=0;w=x.length)return;var E,C,A,B,z,Y,K,M=j[w];typeof M=="string"||typeof M.content=="string"?(E=x[h],(K=(Y=typeof M=="string"?M:M.content).indexOf(E))!==-1&&(++h,C=Y.substring(0,K),z=p[E],A=void 0,(B={})["interpolation-punctuation"]=n,(B=t.tokenize(z,B)).length===3&&((A=[1,1]).push.apply(A,c(B[1],t.languages.javascript,"javascript")),B.splice.apply(B,A)),A=new t.Token("interpolation",B,a.alias,z),B=Y.substring(K+E.length),z=[],C&&z.push(C),z.push(A),B&&(b(Y=[B]),z.push.apply(z,Y)),typeof M=="string"?(j.splice.apply(j,[w,1].concat(z)),w+=z.length-1):M.content=z)):(K=M.content,Array.isArray(K)?b(K):b([K]))}}(f),new t.Token(N,f,"language-"+N,g)}t.languages.javascript["template-string"]=[l("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),l("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),l("svg",/\bsvg/.source),l("markdown",/\b(?:markdown|md)/.source),l("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),l("sql",/\bsql/.source),s].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(g){return typeof g=="string"?g:Array.isArray(g)?g.map(m).join(""):m(g.content)}t.hooks.add("after-tokenize",function(g){g.language in u&&function y(N){for(var h=0,p=N.length;h]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var s=t.languages.extend("typescript",{});delete s["class-name"],t.languages.typescript["class-name"].inside=s,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),t.languages.ts=t.languages.typescript}(k),function(t){var s=t.languages.javascript,r=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,a="(@(?:arg|argument|param|property)\\s+(?:"+r+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(a+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(a+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:s,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g,function(){return r})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+r),lookbehind:!0,inside:{string:s.string,number:s.number,boolean:s.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:s,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)}(k),function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(k),k.languages.n4js=k.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),k.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),k.languages.n4jsd=k.languages.n4js,function(t){function s(l,c){return RegExp(l.replace(//g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:s(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:s(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:s(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var r=["function","function-variable","method","method-variable","property-access"],a=0;a*\.{3}(?:[^{}]|)*\})/.source;function o(d,u){return d=d.replace(//g,function(){return r}).replace(//g,function(){return a}).replace(//g,function(){return n}),RegExp(d,u)}n=o(n).source,t.languages.jsx=t.languages.extend("markup",s),t.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=s.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function l(d){for(var u=[],m=0;m"&&u.push({tagName:c(g.content[0].content[1]),openedBraces:0}):0]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},k.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=k.languages.swift}),function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var s={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:s},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:s},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin}(k),k.languages.c=k.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),k.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),k.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},k.languages.c.string],char:k.languages.c.char,comment:k.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:k.languages.c}}}}),k.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete k.languages.c.boolean,k.languages.objectivec=k.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete k.languages.objectivec["class-name"],k.languages.objc=k.languages.objectivec,k.languages.reason=k.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),k.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete k.languages.reason.function,function(t){for(var s=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)s=s.replace(//g,function(){return s});s=s.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+s),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(k),k.languages.go=k.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),k.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete k.languages.go["class-name"],function(t){var s=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return s.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return s.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:s,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(k),k.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},k.languages.python["string-interpolation"].inside.interpolation.inside.rest=k.languages.python,k.languages.py=k.languages.python,k.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},k.languages.webmanifest=k.languages.json;var bd={};fd(bd,{dracula:()=>vd,duotoneDark:()=>wd,duotoneLight:()=>kd,github:()=>Ed,gruvboxMaterialDark:()=>tu,gruvboxMaterialLight:()=>ru,jettwaveDark:()=>Kd,jettwaveLight:()=>Zd,nightOwl:()=>Td,nightOwlLight:()=>Ad,oceanicNext:()=>Id,okaidia:()=>Ld,oneDark:()=>Xd,oneLight:()=>Jd,palenight:()=>Dd,shadesOfPurple:()=>$d,synthwave84:()=>Bd,ultramin:()=>Vd,vsDark:()=>an,vsLight:()=>Gd});var yd={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},vd=yd,jd={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},wd=jd,Nd={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},kd=Nd,Sd={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Ed=Sd,Cd={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Td=Cd,Rd={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},Ad=Rd,le={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},_d={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:le.keyword}},{types:["attr-value"],style:{color:le.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:le.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:le.primitive}},{types:["boolean"],style:{color:le.boolean}},{types:["tag"],style:{color:le.tag}},{types:["string"],style:{color:le.string}},{types:["punctuation"],style:{color:le.string}},{types:["selector","char","builtin","inserted"],style:{color:le.char}},{types:["function"],style:{color:le.function}},{types:["operator","entity","url","variable"],style:{color:le.variable}},{types:["keyword"],style:{color:le.keyword}},{types:["atrule","class-name"],style:{color:le.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},Id=_d,Fd={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},Ld=Fd,Pd={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Dd=Pd,Od={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},$d=Od,Md={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Bd=Md,zd={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Vd=zd,Ud={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},an=Ud,qd={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Gd=qd,Hd={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Kd=Hd,Wd={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Zd=Wd,Yd={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},Xd=Yd,Qd={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},Jd=Qd,eu={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},tu=eu,su={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},ru=su,au=t=>i.useCallback(s=>{var r=s,{className:a,style:n,line:o}=r,l=rn(r,["className","style","line"]);const c=Kt(ge({},l),{className:vs("token-line",a)});return typeof t=="object"&&"plain"in t&&(c.style=t.plain),typeof n=="object"&&(c.style=ge(ge({},c.style||{}),n)),c},[t]),nu=t=>{const s=i.useCallback(({types:r,empty:a})=>{if(t!=null){{if(r.length===1&&r[0]==="plain")return a!=null?{display:"inline-block"}:void 0;if(r.length===1&&a!=null)return t[r[0]]}return Object.assign(a!=null?{display:"inline-block"}:{},...r.map(n=>t[n]))}},[t]);return i.useCallback(r=>{var a=r,{token:n,className:o,style:l}=a,c=rn(a,["token","className","style"]);const d=Kt(ge({},c),{className:vs("token",...n.types,o),children:n.content,style:s(n)});return l!=null&&(d.style=ge(ge({},d.style||{}),l)),d},[s])},ou=/\r\n|\r|\n/,pr=t=>{t.length===0?t.push({types:["plain"],content:` -`,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=` -`,t[0].empty=!0)},mr=(t,s)=>{const r=t.length;return r>0&&t[r-1]===s?t:t.concat(s)},iu=t=>{const s=[[]],r=[t],a=[0],n=[t.length];let o=0,l=0,c=[];const d=[c];for(;l>-1;){for(;(o=a[l]++)0?m:["plain"],u=y):(m=mr(m,y.type),y.alias&&(m=mr(m,y.alias)),u=y.content),typeof u!="string"){l++,s.push(m),r.push(u),a.push(0),n.push(u.length);continue}const N=u.split(ou),h=N.length;c.push({types:m,content:N[0]});for(let p=1;pi.useMemo(()=>{if(r==null)return fr([s]);const n={code:s,grammar:r,language:a,tokens:[]};return t.hooks.run("before-tokenize",n),n.tokens=t.tokenize(s,r),t.hooks.run("after-tokenize",n),fr(n.tokens)},[s,r,a,t]),cu=(t,s)=>{const{plain:r}=t,a=t.styles.reduce((n,o)=>{const{languages:l,style:c}=o;return l&&!l.includes(s)||o.types.forEach(d=>{const u=ge(ge({},n[d]),c);n[d]=u}),n},{});return a.root=r,a.plain=Kt(ge({},r),{backgroundColor:void 0}),a},du=cu,uu=({children:t,language:s,code:r,theme:a,prism:n})=>{const o=s.toLowerCase(),l=du(a,o),c=au(l),d=nu(l),u=n.languages[o],m=lu({prism:n,language:o,code:r,grammar:u});return t({tokens:m,className:`prism-code language-${o}`,style:l!=null?l.root:{},getLineProps:c,getTokenProps:d})},pu=t=>i.createElement(uu,Kt(ge({},t),{prism:t.prism||k,theme:t.theme||an,code:t.code,language:t.language}));/*! Bundled license information: - -prismjs/prism.js: - (** - * Prism: Lightweight, robust, elegant syntax highlighting - * - * @license MIT - * @author Lea Verou - * @namespace - * @public - *) -*/const mu=(t,s)=>s.some(r=>{if(typeof r=="number")return t===r;const[a,n]=r.split(":").map(o=>parseInt(o));return a<=t&&t<=n}),fu=(t,s,r)=>r.some(([a,[n,o]])=>a===t&&n<=s&&s<=o),gu=(t,s)=>t.split(new RegExp(`(${s.map(([r])=>r).join("|")})`)).filter(Boolean),hu=t=>t.map(s=>{s=s.startsWith("/")?s:"/"+s;const[,r,a="0:Infinity"]=s.split("/"),[n,o=n]=a.split(":").map(l=>Number(l));return[r,[n,o]]}),nn=(t,s)=>()=>{const r=i.useContext(t);if(r===void 0)throw new Error(s);return r},Wt=t=>Object.assign(i.forwardRef(t),{displayName:t.displayName??t.name}),on=i.createContext(void 0),ln=i.createContext(void 0),cn=nn(on,'Could not find nearest component. Please wrap this component with a component imported from "react-code-block".'),Us=nn(ln,'Could not find nearest component. Please wrap this component with component imported from "react-code-block".'),ve=({code:t,words:s=[],lines:r=[],children:a,...n})=>{const o=i.useMemo(()=>hu(s),[s]);return e.jsx(on.Provider,{value:{code:t.trim(),words:o,lines:r,...n},children:a})},xu=({as:t,children:s,...r},a)=>{const{lines:n,words:o,...l}=cn(),c=t??"pre";return e.jsx(pu,{...l,children:d=>e.jsx(c,{...r,ref:a,children:d.tokens.map((u,m)=>{const g=m+1,y=mu(g,n);return e.jsx(ln.Provider,{value:{highlight:d,line:u,lineNumber:g},children:typeof s=="function"?s({isLineHighlighted:y,lineNumber:g},m):s},m)})})})},bu=({as:t,children:s,className:r,...a},n)=>{const{highlight:o,line:l}=Us(),{getLineProps:c}=o,d=t??"div";return e.jsx(d,{...c({line:l,className:r}),...a,ref:n,children:s})},yu=({as:t,children:s=({children:o})=>e.jsx("span",{children:o}),className:r,...a},n)=>{const{words:o}=cn(),{line:l,highlight:c,lineNumber:d}=Us(),{getTokenProps:u}=c,m=t??"span";return e.jsx(ze.Fragment,{children:l.map((g,y)=>{const{children:N,...h}=u({token:g,className:r}),p=o.length?gu(N,o):[N];return e.jsx(ze.Fragment,{children:p.map((f,x)=>e.jsx(m,{...h,...a,ref:n,children:s({children:f,isTokenHighlighted:fu(f,d,o)})},x))},y)})})},vu=({as:t,...s},r)=>{const{lineNumber:a}=Us(),n=t??"span";return e.jsx(n,{...s,ref:r,children:a})};ve.Code=Wt(xu);ve.LineContent=Wt(bu);ve.Token=Wt(yu);ve.LineNumber=Wt(vu);const ju={plain:{color:"var(--foreground)",backgroundColor:"var(--muted)"},styles:[{types:["comment"],style:{color:"#6e7781",fontStyle:"italic"}},{types:["keyword","selector","changed"],style:{color:"#cf222e"}},{types:["constant","number","builtin"],style:{color:"#0550ae"}},{types:["string","attr-value"],style:{color:"#0a3069"}},{types:["function","attr-name"],style:{color:"#8250df"}},{types:["tag","operator"],style:{color:"#116329"}},{types:["variable","property"],style:{color:"#953800"}},{types:["punctuation"],style:{color:"#24292f"}}]},wu={plain:{color:"var(--foreground)",backgroundColor:"var(--muted)"},styles:[{types:["comment"],style:{color:"#8b949e",fontStyle:"italic"}},{types:["keyword","selector","changed"],style:{color:"#ff7b72"}},{types:["constant","number","builtin"],style:{color:"#79c0ff"}},{types:["string","attr-value"],style:{color:"#a5d6ff"}},{types:["function","attr-name"],style:{color:"#d2a8ff"}},{types:["tag","operator"],style:{color:"#7ee787"}},{types:["variable","property"],style:{color:"#ffa657"}},{types:["punctuation"],style:{color:"#c9d1d9"}}]};function ns({code:t,language:s="typescript",fileName:r,className:a,maxLines:n=200}){const[o,l]=i.useState(!1),[c,d]=i.useState(!1),{theme:u}=Li(),m=async()=>{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)},g=t.split(` -`),y=g.length>n,N=c?t:g.slice(0,n).join(` -`);return e.jsxs("div",{className:v("relative group rounded-lg overflow-hidden",a),children:[r&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-muted/50",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e.jsxs(q,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:m,children:[o?e.jsx(Ge,{className:"h-4 w-4"}):e.jsx(Ir,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Copy code"})]})]}),e.jsx(ve,{code:N,language:s,theme:u==="dark"?wu:ju,children:e.jsx(ve.Code,{className:"bg-muted/50 p-4 text-sm whitespace-pre-wrap break-words",children:e.jsx(ve.LineContent,{className:"max-w-full",children:e.jsx(ve.Token,{})})})}),y&&e.jsx("div",{className:"flex justify-center p-2 border-t bg-muted/50",children:e.jsx(q,{variant:"ghost",size:"sm",onClick:()=>d(!c),className:"flex items-center gap-2",children:c?e.jsxs(e.Fragment,{children:["Show Less ",e.jsx(Ar,{className:"h-4 w-4"})]}):e.jsxs(e.Fragment,{children:["Show More (",g.length-n," more lines)"," ",e.jsx(it,{className:"h-4 w-4"})]})})})]})}function Nu(t){const[s,r]=i.useState(null),[a,n]=i.useState(!1),[o,l]=i.useState(null);return i.useEffect(()=>{if(!t){l("Node name is required");return}n(!0),l(null),fetch(re(`/api/v1/proxy/${t}/ui/api/v1/cluster/nodes/self/details`)).then(c=>{if(!c.ok)throw new Error(`Failed to fetch node details: ${c.statusText}`);return c.json()}).then(c=>{var d,u;c.target=((u=(d=c.config.match(/target:\s*([^\n]+)/))==null?void 0:d[1])==null?void 0:u.trim())||"",r(c),n(!1)}).catch(c=>{l(c instanceof Error?c.message:"An error occurred"),n(!1)})},[t]),{nodeDetails:s,isLoading:a,error:o}}function ku(t,s){const[r,a]=i.useState(!1),[n,o]=i.useState(null),[l,c]=i.useState("");return i.useEffect(()=>{if(!s){c("");return}if(!t)return;const d=new AbortController;async function u(){a(!0),o(null);try{const m=await fetch(re(`/api/v1/proxy/${t}/metrics`),{signal:d.signal});if(!m.ok)throw new Error(`Failed to fetch metrics: ${m.statusText}`);const g=await m.text();c(g)}catch(m){m instanceof Error?o(m.message):o("An unknown error occurred")}finally{a(!1)}}return u(),()=>{d.abort()}},[t,s]),{isLoading:r,error:n,metrics:l}}const Su={Running:"#10B981",Starting:"#F59E0B",New:"#3B82F6",Stopping:"#F59E0B",Terminated:"#6B7280",Failed:"#EF4444"};function Eu({services:t}){const s=i.useMemo(()=>{const a=t.reduce((n,{status:o})=>{const l=o;return n.set(l,(n.get(l)||0)+1),n},new Map);return Array.from(a.entries()).sort((n,o)=>o[1]-n[1]).map(([n,o])=>({name:n,value:o,color:Su[n]}))},[t]),r=i.useMemo(()=>t.length,[t]);return s.length===0?null:e.jsxs("div",{className:"h-[180px] w-full flex items-center",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none z-10",children:[e.jsx("div",{className:"text-2xl font-bold",children:r}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Services"})]}),e.jsx(dt,{width:"100%",height:180,children:e.jsxs(Ot,{margin:{top:0,right:0,bottom:0,left:0},children:[e.jsx($t,{data:s,cx:"50%",cy:"50%",labelLine:!1,outerRadius:70,innerRadius:50,dataKey:"value",paddingAngle:2,strokeWidth:2,children:s.map(a=>e.jsx(Mt,{fill:a.color,stroke:"hsl(var(--background))"},`cell-${a.name}`))}),e.jsx(ut,{content:({active:a,payload:n})=>{if(!a||!n||!n[0])return null;const o=n[0].payload;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg px-3 py-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),e.jsx("span",{className:"text-sm font-medium",children:o.name}),e.jsx("span",{className:"text-sm font-semibold",children:o.value})]})}})]})})]}),e.jsx("div",{className:"flex flex-col gap-1.5 min-w-[120px] pl-4",children:s.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a.color}}),e.jsx("span",{className:"text-muted-foreground",children:a.name})]}),e.jsx("span",{className:"font-medium tabular-nums",children:a.value})]},a.name))})]})}const Cu=t=>{switch(t){case"Running":return"text-green-600 dark:text-green-400";case"Starting":return"text-yellow-600 dark:text-yellow-400";case"Failed":return"text-red-600 dark:text-red-400";case"New":return"text-blue-600 dark:text-blue-400";case"Terminated":return"text-gray-600 dark:text-gray-400";default:return"text-gray-600 dark:text-gray-400"}};function Tu({services:t}){return e.jsx(mt,{className:"h-[180px] rounded-md border",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{children:[e.jsx(D,{children:"Service"}),e.jsx(D,{className:"text-right",children:"Status"})]})}),e.jsx(Ae,{children:t.map(s=>e.jsxs(X,{className:"hover:bg-muted/50",children:[e.jsx(F,{className:"font-medium",children:s.service}),e.jsx(F,{className:`text-right ${Cu(s.status)} font-medium`,children:s.status})]},s.service))})]})})}const Ru={aws:"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400","aws-dynamo":"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400",s3:"text-yellow-600 bg-yellow-100 dark:bg-yellow-950 dark:text-yellow-400",azure:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",gcp:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400","gcp-columnkey":"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",gcs:"text-blue-600 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",alibabacloud:"text-orange-600 bg-orange-100 dark:bg-orange-950 dark:text-orange-400",filesystem:"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400",local:"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400",boltdb:"text-emerald-600 bg-emerald-100 dark:bg-emerald-950 dark:text-emerald-400",cassandra:"text-blue-700 bg-blue-100 dark:bg-blue-950 dark:text-blue-400",bigtable:"text-red-600 bg-red-100 dark:bg-red-950 dark:text-red-400","bigtable-hashed":"text-red-600 bg-red-100 dark:bg-red-950 dark:text-red-400",bos:"text-cyan-600 bg-cyan-100 dark:bg-cyan-950 dark:text-cyan-400",cos:"text-green-600 bg-green-100 dark:bg-green-950 dark:text-green-400",swift:"text-orange-600 bg-orange-100 dark:bg-orange-950 dark:text-orange-400",inmemory:"text-purple-600 bg-purple-100 dark:bg-purple-950 dark:text-purple-400","grpc-store":"text-indigo-600 bg-indigo-100 dark:bg-indigo-950 dark:text-indigo-400"};function Au({type:t,className:s}){const r=t.toLowerCase(),a=Ru[r]||"text-gray-600 bg-gray-100 dark:bg-gray-800 dark:text-gray-400";return e.jsx("span",{className:v("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",a,s),children:r})}const _u=Ce("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ce=i.forwardRef(({className:t,...s},r)=>e.jsx(jr,{ref:r,className:v(_u(),t),...s}));ce.displayName=jr.displayName;function Iu(t){const[s,r]=i.useState("info"),[a,n]=i.useState(!1),[o,l]=i.useState(null),[c,d]=i.useState(!1),u=g=>{const y=g.message.match(/Current log level is (\w+)/);return(y==null?void 0:y[1])||"info"};return i.useEffect(()=>{async function g(){if(t){n(!0),l(null);try{const y=await fetch(re(`/api/v1/proxy/${t}/log_level`));if(!y.ok)throw new Error(`Failed to fetch log level: ${y.statusText}`);const N=await y.json();r(u(N))}catch(y){l(y instanceof Error?y.message:"Failed to fetch log level")}finally{n(!1)}}}g()},[t]),{logLevel:s,isLoading:a,error:o,success:c,setLogLevel:async g=>{if(t){n(!0),l(null),d(!1);try{const y=await fetch(re(`/api/v1/proxy/${t}/log_level?log_level=${g}`),{method:"POST"});if(!y.ok)throw new Error(`Failed to update log level: ${y.statusText}`);const N=await y.json();if(N.status==="success"&&N.message.includes(g))r(g),d(!0),setTimeout(()=>d(!1),3e3);else throw new Error("Failed to update log level: Unexpected response")}catch(y){l(y instanceof Error?y.message:"Failed to update log level")}finally{n(!1)}}}}}const Fu=["debug","info","warn","error"];function Lu({nodeName:t,className:s}){const{logLevel:r,isLoading:a,error:n,success:o,setLogLevel:l}=Iu(t),c=d=>{l(d)};return e.jsxs("div",{className:"relative flex items-center gap-2",children:[e.jsxs(Rt,{value:r,onValueChange:c,disabled:a,children:[e.jsx(tt,{className:v("w-[180px]",s,a&&"opacity-50 cursor-not-allowed"),children:e.jsx(At,{placeholder:"Select log level"})}),e.jsx(st,{children:Fu.map(d=>e.jsx(Ve,{value:d,children:d},d))})]}),e.jsx(zs,{children:e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsxs("div",{className:v("absolute -right-6 transition-all duration-300 ease-in-out",o||n?"opacity-100 translate-x-0":"opacity-0 translate-x-2"),children:[o&&e.jsx(Ge,{className:"h-4 w-4 text-green-500 animate-in zoom-in-50 duration-300"}),n&&e.jsx(ot,{className:"h-4 w-4 text-red-500 animate-in zoom-in-50 duration-300"})]})}),e.jsxs(qe,{side:"right",className:"text-xs",children:[o&&"Log level updated successfully",n&&n]})]})})]})}const dn=i.forwardRef(({className:t,...s},r)=>e.jsx(Vr,{className:v("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...s,ref:r,children:e.jsx(ui,{className:v("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));dn.displayName=Vr.displayName;function Pu(t){return ws({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"},child:[]}]})(t)}function Du(t){return ws({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"},child:[]}]})(t)}function Ou(t){return ws({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"},child:[]}]})(t)}const $u=t=>{const s=t.toLowerCase();return s.includes("darwin")||s.includes("mac")?e.jsx(Pu,{className:"h-4 w-4"}):s.includes("linux")?e.jsx(Du,{className:"h-4 w-4"}):s.includes("windows")?e.jsx(Ou,{className:"h-4 w-4"}):null},Mu=t=>{const s=t.toLowerCase();return s==="oss"?"bg-blue-500/20 text-blue-700 dark:bg-blue-500/30 dark:text-blue-300 hover:bg-blue-500/30":s==="enterprise"?"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/30 dark:text-yellow-300 hover:bg-yellow-500/30":""};function Bu({build:t,edition:s,os:r,arch:a}){const n=$u(r);return e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"Version Information"})}),e.jsx(te,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Version"}),e.jsx("p",{className:"text-sm",children:t.version})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Branch"}),e.jsx("p",{className:"text-sm",children:t.branch})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Go Version"}),e.jsx("p",{className:"text-sm",children:t.goVersion})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Edition"}),e.jsx("div",{children:e.jsx(ye,{className:Mu(s),children:s.toUpperCase()})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Architecture"}),e.jsx("p",{className:"text-sm",children:a})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"OS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[n,e.jsx("p",{className:"text-sm",children:r})]})]})]})]})})]})}function zu({nodeName:t,className:s}){const[r,a]=i.useState({isReady:!1,message:"Checking status..."}),[n,o]=i.useState(!0);return i.useEffect(()=>{const l=async()=>{try{const u=await fetch(re(`/api/v1/proxy/${t}/ready`)),m=await u.text();a({isReady:u.ok&&m.includes("ready"),message:u.ok?"Ready":m})}catch(u){a({isReady:!1,message:u instanceof Error?u.message:"Failed to check status"})}};l();const c=setInterval(l,3e3),d=setInterval(()=>{o(u=>!u)},1e3);return()=>{clearInterval(c),clearInterval(d)}},[t]),e.jsxs("div",{className:v("flex items-center gap-2",s),children:[e.jsx("span",{className:v("text-sm",r.isReady?"text-muted-foreground":"text-red-500"),children:r.message}),e.jsx("div",{className:v("h-2.5 w-2.5 rounded-full transition-opacity duration-150",r.isReady?"bg-green-500":"bg-red-500",n?"opacity-100":"opacity-30")})]})}const Vu=[{name:"allocs",description:"A sampling of all past memory allocations"},{name:"block",description:"Stack traces that led to blocking on synchronization primitives"},{name:"heap",description:"A sampling of memory allocations of live objects"},{name:"mutex",description:"Stack traces of holders of contended mutexes"},{name:"profile",urlSuffix:"?seconds=15",description:"CPU profile (15 seconds)",displayName:"profile"},{name:"goroutine",description:"Stack traces of all current goroutines (debug=1)",variants:[{suffix:"?debug=0",label:"Basic",description:"Basic goroutine info"},{suffix:"?debug=1",label:"Standard",description:"Standard goroutine stack traces"},{suffix:"?debug=2",label:"Full",description:"Full goroutine stack dump with additional info"}]},{name:"threadcreate",description:"Stack traces that led to the creation of new OS threads",urlSuffix:"?debug=1",displayName:"threadcreate"},{name:"trace",description:"A trace of execution of the current program",urlSuffix:"?debug=1",displayName:"trace"}];function Uu({nodeName:t}){const s=r=>{window.open(re(`/api/v1/proxy/${t}/debug/pprof/${r}`),"_blank")};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Profiling Tools:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Vu.map(r=>r.variants?r.variants.map(a=>e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsx(q,{variant:"outline",size:"sm",onClick:()=>s(`${r.name}${a.suffix}`),children:`${r.name} (${a.label})`})}),e.jsx(qe,{children:e.jsx("p",{children:a.description})})]},`${r.name}${a.suffix}`)):e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:e.jsx(q,{variant:"outline",size:"sm",onClick:()=>s(`${r.name}${r.urlSuffix||""}`),children:r.displayName||r.name})}),e.jsx(qe,{children:e.jsx("p",{children:r.description})})]},r.name))})]})}function qu(){const{nodeName:t}=Sr(),[s,r]=i.useState("config"),{nodeDetails:a,isLoading:n,error:o}=Nu(t),{metrics:l,isLoading:c,error:d}=ku(t,s==="raw-metrics"),[u,m]=i.useState(!1);return n?e.jsx("div",{className:"container space-y-6 p-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading..."})]})}):a?e.jsx(Se,{children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ne,{children:e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:e.jsxs("div",{className:"flex items-center gap-2",children:[a.target," - ",t,e.jsx(Bs,{text:t||""})]})})})}),e.jsx(zu,{nodeName:t||""})]})}),e.jsxs(te,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(Bu,{build:a.build,edition:a.edition,os:a.os,arch:a.arch}),e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"Cluster Information"})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Cluster ID"}),e.jsx("p",{className:"text-sm",children:a.clusterID})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Created"}),e.jsx("p",{className:"text-sm",children:Nt(a.clusterSeededAt,"PPpp")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{children:"Storage"}),e.jsx("p",{children:e.jsx(Au,{type:(a.metrics.store_object_type||"filesystem").toLowerCase(),className:""})})]})]})})]}),e.jsxs(ee,{children:[e.jsxs(se,{className:"flex flex-row items-center justify-between",children:[e.jsx(ne,{children:"Service Status"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ce,{htmlFor:"view-mode",children:"Table View"}),e.jsx(dn,{id:"view-mode",checked:u,onCheckedChange:m})]})]}),e.jsx(te,{children:u?e.jsx(Tu,{services:a.services}):e.jsx(Eu,{services:a.services})})]})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[e.jsx(ce,{children:"Log Level"}),e.jsx(Lu,{nodeName:t||""})]}),e.jsx(Uu,{nodeName:t||""})]}),e.jsx("div",{children:e.jsxs(id,{defaultValue:"config",onValueChange:r,children:[e.jsxs(en,{children:[e.jsx(vt,{value:"config",children:"Configuration"}),e.jsx(vt,{value:"metrics",children:"Analytics"}),e.jsx(vt,{value:"raw-metrics",children:"Raw Metrics"})]}),e.jsx(jt,{value:"config",className:"mt-6",children:e.jsx(ns,{language:"yaml",code:a.config,fileName:"loki.yaml"})}),e.jsx(jt,{value:"metrics",className:"mt-6",children:a.metrics&&e.jsx(ns,{code:JSON.stringify(a.metrics,null,2),language:"json",fileName:"analytics.json"})}),e.jsx(jt,{value:"raw-metrics",className:"mt-6",children:c?e.jsxs("div",{className:"flex items-center justify-center p-6",children:[e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading metrics..."})]}):d?e.jsx("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-200",children:d})}):l?e.jsx(ns,{code:l,language:"yaml",fileName:"metrics"}):null})]})})]})]})}):e.jsx("div",{className:"container space-y-6 p-6",children:e.jsx("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-400 p-4",children:e.jsx("div",{className:"flex",children:e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm text-red-700 dark:text-red-200",children:o||`Node "${t}" not found`})})})})})}function Gu(){return e.jsx(Ja,{children:e.jsx(qu,{})})}function _e(){return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[80vh] p-4",children:[e.jsx(qo,{className:"h-16 w-16 text-muted-foreground mb-6"}),e.jsx("h1",{className:"text-4xl font-bold text-center mb-4",children:"Coming Soon"}),e.jsx("p",{className:"text-lg text-muted-foreground text-center max-w-md",children:"We're working hard to bring you this feature. Stay tuned for updates!"})]})}const un=Ce("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Hu=i.forwardRef(({className:t,variant:s,size:r,...a},n)=>e.jsx(Ur,{ref:n,className:v(un({variant:s,size:r,className:t})),...a}));Hu.displayName=Ur.displayName;const pn=i.createContext({size:"default",variant:"default"}),mn=i.forwardRef(({className:t,variant:s,size:r,children:a,...n},o)=>e.jsx(qr,{ref:o,className:v("flex items-center justify-center gap-1",t),...n,children:e.jsx(pn.Provider,{value:{variant:s,size:r},children:a})}));mn.displayName=qr.displayName;const fn=i.forwardRef(({className:t,children:s,variant:r,size:a,...n},o)=>{const l=i.useContext(pn);return e.jsx(Gr,{ref:o,className:v(un({variant:l.variant||r,size:l.size||a}),t),...n,children:s})});fn.displayName=Gr.displayName;const It={Received:"received",Processing:"processed"},Ku=t=>{const{cluster:s}=pe(),r=i.useMemo(()=>$e(s==null?void 0:s.members,ja.compactor),[s==null?void 0:s.members]),{data:a,isLoading:n,error:o}=Bt({queryKey:["deletes",t,r],queryFn:async()=>{try{return(await Promise.all(t.map(async c=>{const d=await fetch(re(`/api/v1/proxy/${r}/compactor/ui/api/v1/deletes?status=${c}`));if(!d.ok){const u=await d.text();throw new Error(u||`HTTP error! status: ${d.status}`)}return d.json()}))).flat()}catch(l){throw l instanceof Error?l:new Error("Failed to fetch delete requests")}},enabled:!!r});return{data:a,isLoading:n,error:o}},Wu=({selectedStatus:t,onStatusChange:s,queryFilter:r,onQueryFilterChange:a})=>e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Status"}),e.jsx(mn,{type:"multiple",value:t,onValueChange:n=>{n.length>0&&s(n)},className:"justify-start",children:Object.entries(It).map(([n,o])=>e.jsx(fn,{value:o,"aria-label":`Toggle ${n.toLowerCase()} status`,className:"capitalize",children:n},o))})]}),e.jsx(be,{type:"search",placeholder:"Filter by query...",value:r,onChange:n=>a(n.target.value),className:"w-[300px]"})]}),Zu=({status:t})=>{const s=t===It.Received?"secondary":"default";return e.jsx(ye,{variant:s,className:"capitalize",children:t})},Yu=({start:t,end:s})=>{const r=ei(Xs(t/1e3),Xs(s/1e3)),a=n=>{const o=new Date(n);return Nt(new Date(o.getTime()+o.getTimezoneOffset()*6e4),"yyyy-MM-dd HH:mm:ss")};return e.jsxs(Ut,{children:[e.jsx(qt,{children:e.jsx("span",{className:"cursor-default",children:r})}),e.jsx(ft,{className:"w-fit",children:e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"From"}),e.jsx("span",{className:"font-mono",children:a(t)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-gray-100 rounded dark:bg-gray-700 w-14 text-center",children:"To"}),e.jsx("span",{className:"font-mono",children:a(s)})]})]})})})]})},Xu=({requests:t,sortField:s,sortDirection:r,onSort:a})=>{const n=[...t].sort((o,l)=>{let c=0,d,u;switch(s){case"status":c=o.status.localeCompare(l.status);break;case"user":c=o.user_id.localeCompare(l.user_id);break;case"createdAt":c=o.created_at-l.created_at;break;case"duration":d=o.end_time-o.start_time,u=l.end_time-l.start_time,c=d-u;break}return r==="asc"?c:-c});return e.jsx("div",{className:"rounded-md border bg-card",children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"w-[80px]",children:e.jsx(Z,{title:"Status",field:"status",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[100px]",children:e.jsx(Z,{title:"User",field:"user",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[200px]",children:e.jsx(Z,{title:"Created At",field:"createdAt",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[150px]",children:e.jsx(Z,{title:"Range",field:"duration",sortField:s,sortDirection:r,onSort:a})}),e.jsx(D,{className:"w-[100px]",children:"Deleted Lines"}),e.jsx(D,{children:"Query"})]})}),e.jsxs(Ae,{children:[n.map(o=>e.jsxs(X,{children:[e.jsx(F,{className:"px-4",children:e.jsx(Zu,{status:o.status})}),e.jsx(F,{children:o.user_id}),e.jsx(F,{children:e.jsx(Ms,{date:new Date(o.created_at)})}),e.jsx(F,{children:e.jsx(Yu,{start:o.start_time,end:o.end_time})}),e.jsx(F,{children:o.deleted_lines}),e.jsx(F,{children:e.jsx("code",{className:"font-mono text-sm whitespace-pre-wrap break-all",children:o.query})})]},`${o.request_id}-${o.start_time}-${o.end_time}`)),n.length===0&&e.jsx(X,{children:e.jsx(F,{colSpan:7,className:"h-24 text-center",children:e.jsx("div",{className:"text-muted-foreground",children:"No delete requests found"})})})]})]})})},Qu=()=>{const[t,s]=i.useState([It.Received,It.Processing]),[r,a]=i.useState(""),[n,o]=i.useState("createdAt"),[l,c]=i.useState("desc"),{data:d,isLoading:u,error:m}=Ku(t),g=i.useMemo(()=>!d||!r?d:d.filter(N=>N.query.toLowerCase().includes(r.toLowerCase())),[d,r]),y=N=>{N===n?c(l==="asc"?"desc":"asc"):(o(N),c("desc"))};return e.jsx(Se,{children:e.jsxs(ee,{className:"shadow-sm",children:[e.jsx(se,{children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight",children:"Delete Requests"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"View and manage delete requests in your cluster"})]}),e.jsx(q,{variant:"default",asChild:!0,children:e.jsxs(de,{to:"/tenants/deletes/new",children:[e.jsx(Go,{className:"mr-2 h-4 w-4"}),"New Delete Request"]})})]}),e.jsx(Wu,{selectedStatus:t,onStatusChange:s,queryFilter:r,onQueryFilterChange:a})]})}),e.jsx(te,{children:e.jsxs("div",{className:"space-y-4",children:[m&&e.jsxs(He,{variant:"destructive",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:m.message})]}),u&&e.jsx("div",{className:"flex items-center justify-center p-8",children:e.jsx(xe,{className:"h-16 w-16 animate-spin"})}),!u&&!m&&g&&e.jsx(Xu,{requests:g,sortField:n,sortDirection:l,onSort:y})]})})]})})},gn=Di,hn=i.createContext({}),Fe=({...t})=>e.jsx(hn.Provider,{value:{name:t.name},children:e.jsx(Oi,{...t})}),Zt=()=>{const t=i.useContext(hn),s=i.useContext(xn),{getFieldState:r,formState:a}=Pi(),n=r(t.name,a);if(!t)throw new Error("useFormField should be used within ");const{id:o}=s;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...n}},xn=i.createContext({}),je=i.forwardRef(({className:t,...s},r)=>{const a=i.useId();return e.jsx(xn.Provider,{value:{id:a},children:e.jsx("div",{ref:r,className:v("space-y-2",t),...s})})});je.displayName="FormItem";const he=i.forwardRef(({className:t,...s},r)=>{const{error:a,formItemId:n}=Zt();return e.jsx(ce,{ref:r,className:v(a&&"text-destructive",t),htmlFor:n,...s})});he.displayName="FormLabel";const we=i.forwardRef(({...t},s)=>{const{error:r,formItemId:a,formDescriptionId:n,formMessageId:o}=Zt();return e.jsx(Ee,{ref:s,id:a,"aria-describedby":r?`${n} ${o}`:`${n}`,"aria-invalid":!!r,...t})});we.displayName="FormControl";const bn=i.forwardRef(({className:t,...s},r)=>{const{formDescriptionId:a}=Zt();return e.jsx("p",{ref:r,id:a,className:v("text-[0.8rem] text-muted-foreground",t),...s})});bn.displayName="FormDescription";const Ne=i.forwardRef(({className:t,children:s,...r},a)=>{const{error:n,formMessageId:o}=Zt(),l=n?String(n==null?void 0:n.message):s;return l?e.jsx("p",{ref:a,id:o,className:v("text-[0.8rem] font-medium text-destructive",t),...r,children:l}):null});Ne.displayName="FormMessage";const yn=i.forwardRef(({className:t,...s},r)=>e.jsx("textarea",{className:v("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...s}));yn.displayName="Textarea";var Ju=function(t,s){for(var r={};t.length;){var a=t[0],n=a.code,o=a.message,l=a.path.join(".");if(!r[l])if("unionErrors"in a){var c=a.unionErrors[0].errors[0];r[l]={message:c.message,type:c.code}}else r[l]={message:o,type:n};if("unionErrors"in a&&a.unionErrors.forEach(function(m){return m.errors.forEach(function(g){return t.push(g)})}),s){var d=r[l].types,u=d&&d[a.code];r[l]=Bi(l,s,r,n,u?[].concat(u,a.message):a.message)}t.shift()}return r},vn=function(t,s,r){return r===void 0&&(r={}),function(a,n,o){try{return Promise.resolve(function(l,c){try{var d=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](a,s)).then(function(u){return o.shouldUseNativeValidation&&$i({},o),{errors:{},values:r.raw?a:u}})}catch(u){return c(u)}return d&&d.then?d.then(void 0,c):d}(0,function(l){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(l))return{values:{},errors:Mi(Ju(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}};const ep=ca({tenant_id:Xe().min(1,"Tenant ID is required"),query:Xe().min(1,"Query is required"),start_time:Js(),end_time:Js().refine(t=>t>new Date(Date.now()-7*24*60*60*1e3),"End time must be after start time")}),tp=()=>{const t=Ft(),s=_i(),[r,a]=i.useState(null),[n,o]=i.useState(!1),{cluster:l}=pe(),c=i.useMemo(()=>$e(l==null?void 0:l.members,ja.compactor),[l==null?void 0:l.members]),d=da({resolver:vn(ep),defaultValues:{tenant_id:"",query:"",start_time:new Date(Date.now()-7*24*60*60*1e3),end_time:new Date}}),u=i.useCallback(async(N,h=!1)=>{if(N.trim()){o(!0);try{const p=await fetch(re(`/api/v1/proxy/${c}/loki/api/v1/format_query?query=${N}`),{method:"POST"}),f=await p.json();if(!p.ok||f.status==="invalid-query")throw new Error(f.error||"Invalid LogQL query");d.clearErrors("query"),h&&d.setValue("query",f.data)}catch(p){d.setError("query",{message:p instanceof Error?p.message:"Invalid LogQL query"})}finally{o(!1)}}},[d,c]),m=i.useMemo(()=>Si(N=>u(N,!1),1e3),[u]),g=async N=>{const h=new URLSearchParams;h.append("query",N.query),h.append("start",Math.floor(N.start_time.getTime()/1e3).toString()),h.append("end",Math.floor(N.end_time.getTime()/1e3).toString());try{const p=await fetch(re(`/api/v1/proxy/${c}/compactor/ui/api/v1/deletes?${h.toString()}`),{method:"POST",headers:{"X-Scope-OrgID":N.tenant_id}});if(!p.ok){const f=await p.text();throw new Error(f||"Failed to create delete request")}await s.invalidateQueries({queryKey:["deletes"]}),t("/tenants/deletes")}catch(p){console.error("Error creating delete request:",p),a(p instanceof Error?p.message:"Failed to create delete request")}},y=i.useMemo(()=>{const N=d.watch("start_time"),h=d.watch("end_time");return ti(si({start:N,end:h}),{format:["years","months","weeks","days","hours","minutes"],zero:!1})},[d]);return e.jsx(Se,{children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"New Delete Request"})}),e.jsxs(te,{children:[r&&e.jsxs(He,{variant:"destructive",className:"mb-6",children:[e.jsx(ot,{className:"h-4 w-4"}),e.jsx(Ke,{children:"Error"}),e.jsx(We,{children:r})]}),e.jsx(gn,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit(g),className:"space-y-8",children:[e.jsx(Fe,{control:d.control,name:"tenant_id",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"TENANT ID"}),e.jsx(we,{children:e.jsx(be,{placeholder:"Enter tenant ID",...N})}),e.jsx(Ne,{})]})}),e.jsx(Fe,{control:d.control,name:"query",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"LOGQL QUERY"}),e.jsx(we,{children:e.jsxs("div",{className:"relative",children:[e.jsx(yn,{placeholder:'{app="example"}',className:"font-mono",...N,onChange:h=>{N.onChange(h),m(h.target.value)},onBlur:async h=>{N.onBlur(),h.target.value&&await u(h.target.value,!0)}}),n&&e.jsx("div",{className:"absolute right-3 top-3",children:e.jsx(xe,{className:"h-5 w-5 animate-spin"})})]})}),e.jsx(bn,{children:"Enter a LogQL query with labels in curly braces"}),e.jsx(Ne,{})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-8",children:[e.jsx(Fe,{control:d.control,name:"start_time",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"START TIME"}),e.jsx(we,{children:e.jsx(Qs,{selected:N.value,onChange:N.onChange,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,dateFormat:"yyyy-MM-dd HH:mm",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})}),e.jsx(Ne,{})]})}),e.jsx(Fe,{control:d.control,name:"end_time",render:({field:N})=>e.jsxs(je,{children:[e.jsx(he,{children:"END TIME"}),e.jsx(we,{children:e.jsx(Qs,{selected:N.value,onChange:N.onChange,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,dateFormat:"yyyy-MM-dd HH:mm",minDate:d.watch("start_time"),className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})}),e.jsx(Ne,{})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{children:"DURATION"}),e.jsx("div",{className:"h-10 flex items-center",children:e.jsx("span",{className:"text-sm text-muted-foreground",children:y})})]})]}),e.jsxs("div",{className:"flex justify-end space-x-3 pt-6 border-t",children:[e.jsx(q,{type:"button",variant:"outline",onClick:()=>t("/tenants/deletes"),children:"Cancel"}),e.jsx(q,{type:"submit",disabled:!d.formState.isValid||d.formState.isSubmitting,children:d.formState.isSubmitting?"Creating...":"Create Delete Request"})]})]})})]})]})})},sp={light:"",dark:".dark"},jn=i.createContext(null);function wn(){const t=i.useContext(jn);if(!t)throw new Error("useChart must be used within a ");return t}const Nn=i.forwardRef(({id:t,className:s,children:r,config:a,...n},o)=>{const l=i.useId(),c=`chart-${t||l.replace(/:/g,"")}`;return e.jsx(jn.Provider,{value:{config:a},children:e.jsxs("div",{"data-chart":c,ref:o,className:v("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",s),...n,children:[e.jsx(rp,{id:c,config:a}),e.jsx(dt,{children:r})]})})});Nn.displayName="Chart";const rp=({id:t,config:s})=>{const r=Object.entries(s).filter(([,a])=>a.theme||a.color);return r.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(sp).map(([a,n])=>` -${n} [data-chart=${t}] { -${r.map(([o,l])=>{var d;const c=((d=l.theme)==null?void 0:d[a])||l.color;return c?` --color-${o}: ${c};`:null}).join(` -`)} -} -`).join(` -`)}}):null},ap=ut,kn=i.forwardRef(({active:t,payload:s,className:r,indicator:a="dot",hideLabel:n=!1,hideIndicator:o=!1,label:l,labelFormatter:c,labelClassName:d,formatter:u,color:m,nameKey:g,labelKey:y},N)=>{const{config:h}=wn(),p=i.useMemo(()=>{var E;if(n||!(s!=null&&s.length))return null;const[x]=s,b=`${y||x.dataKey||x.name||"value"}`,j=gs(h,x,b),w=!y&&typeof l=="string"?((E=h[l])==null?void 0:E.label)||l:j==null?void 0:j.label;return c?e.jsx("div",{className:v("font-medium",d),children:c(w,s)}):w?e.jsx("div",{className:v("font-medium",d),children:w}):null},[l,c,s,n,d,h,y]);if(!t||!(s!=null&&s.length))return null;const f=s.length===1&&a!=="dot";return e.jsxs("div",{ref:N,className:v("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",r),children:[f?null:p,e.jsx("div",{className:"grid gap-1.5",children:s.map((x,b)=>{const j=`${g||x.name||x.dataKey||"value"}`,w=gs(h,x,j),E=m||x.payload.fill||x.color;return e.jsx("div",{className:v("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",a==="dot"&&"items-center"),children:u&&(x==null?void 0:x.value)!==void 0&&x.name?u(x.value,x.name,x,b,x.payload):e.jsxs(e.Fragment,{children:[w!=null&&w.icon?e.jsx(w.icon,{}):!o&&e.jsx("div",{className:v("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":f&&a==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),e.jsxs("div",{className:v("flex flex-1 justify-between leading-none",f?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[f?p:null,e.jsx("span",{className:"text-muted-foreground",children:(w==null?void 0:w.label)||x.name})]}),x.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:x.value.toLocaleString()})]})]})},x.dataKey)})})]})});kn.displayName="ChartTooltip";const np=i.forwardRef(({className:t,hideIcon:s=!1,payload:r,verticalAlign:a="bottom",nameKey:n},o)=>{const{config:l}=wn();return r!=null&&r.length?e.jsx("div",{ref:o,className:v("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",t),children:r.map(c=>{const d=`${n||c.dataKey||"value"}`,u=gs(l,c,d);return e.jsxs("div",{className:v("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!s?e.jsx(u.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),u==null?void 0:u.label]},c.value)})}):null});np.displayName="ChartLegend";function gs(t,s,r){if(typeof s!="object"||s===null)return;const a="payload"in s&&typeof s.payload=="object"&&s.payload!==null?s.payload:void 0;let n=r;return r in s&&typeof s[r]=="string"?n=s[r]:a&&r in a&&typeof a[r]=="string"&&(n=a[r]),n in t?t[n]:t[r]}const op=wi,ip=Ni,lp=ki,cp=ca({tenant:Xe().min(1,"Tenant ID is required"),since:Xe(),matcher:Xe().default("{}")}),dp=[{value:"1h",label:"Last 1 hour"},{value:"3h",label:"Last 3 hours"},{value:"6h",label:"Last 6 hours"},{value:"12h",label:"Last 12 hours"},{value:"24h",label:"Last 24 hours"}];function up({values:t,totalValues:s}){return e.jsx("div",{className:"space-y-2 py-2",children:t.map(({value:r,count:a})=>e.jsxs("div",{className:"grid grid-cols-[200px_1fr_80px] items-center gap-4",children:[e.jsx(ye,{variant:"outline",className:"font-mono text-xs justify-self-start overflow-hidden",children:r}),e.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${a/s*100}%`}})}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums justify-self-end",children:[(a/s*100).toFixed(1),"%"]})]},r))})}function pp(){const{cluster:t}=pe(),{toast:s}=Vt(),[r,a]=i.useState(null),[n,o]=i.useState("uniqueValues"),[l,c]=i.useState("desc"),[d,u]=i.useState("uniqueValues"),[m,g]=i.useState(new Set),y=da({resolver:vn(cp),defaultValues:{matcher:"{}",since:"1h"}}),N=$e(t==null?void 0:t.members,"query-frontend"),{isLoading:h,refetch:p}=Bt({queryKey:["analyze-labels"],queryFn:async()=>{try{const w=y.getValues(),E=new Date,C=new Date(E.getTime()-mp(w.since)),A=await fetch(re(`/api/v1/proxy/${N}/loki/api/v1/series?match[]=${encodeURIComponent(w.matcher)}&start=${C.getTime()*1e6}&end=${E.getTime()*1e6}`),{headers:{"X-Scope-OrgID":w.tenant}});if(!A.ok){const M=await A.text();throw new Error(M||"Failed to fetch series")}const B=await A.json(),z=new Map,Y=new Map;B.data.forEach(M=>{Object.entries(M).forEach(([W,T])=>{z.has(W)||(z.set(W,{uniqueValues:new Set,inStreams:0}),Y.set(W,new Map));const O=z.get(W),V=Y.get(W);O.uniqueValues.add(T),O.inStreams++,V.set(T,(V.get(T)||0)+1)})});const K=Array.from(z.entries()).map(([M,W])=>{const T=Array.from(Y.get(M).entries()).map(([O,V])=>({value:O,count:V})).sort((O,V)=>V.count-O.count).slice(0,5);return{name:M,uniqueValues:W.uniqueValues.size,inStreams:W.inStreams,sampleValues:T}});return K.sort((M,W)=>W.uniqueValues-M.uniqueValues),a({totalStreams:B.data.length,uniqueLabels:z.size,labels:K}),B}catch(w){throw s({variant:"destructive",title:"Error analyzing labels",description:w instanceof Error?w.message:"An unexpected error occurred"}),w}},enabled:!1});function f(){p()}const x=i.useMemo(()=>{const w=document.createElement("style"),E=(r==null?void 0:r.labels.slice(0,10).map((C,A)=>{const B=A*137.5%360;return`--chart-color-${A}: hsl(${B}, 70%, 50%);`}).join(` -`))||"";return w.textContent=`:root { ${E} }`,document.head.appendChild(w),()=>w.remove()},[r]);i.useEffect(()=>x,[x]);const b={value:{label:d==="uniqueValues"?"Unique Values":"Found In Streams",theme:{light:"var(--chart-color-0)",dark:"var(--chart-color-0)"}}},j=i.useMemo(()=>r?[...r.labels].sort((w,E)=>{let C=0;switch(n){case"name":C=w.name.localeCompare(E.name);break;case"uniqueValues":C=w.uniqueValues-E.uniqueValues;break;case"inStreams":C=w.inStreams-E.inStreams;break;case"cardinality":C=w.uniqueValues/w.inStreams-E.uniqueValues/E.inStreams;break}return l==="asc"?C:-C}):[],[r,n,l]);return e.jsxs("div",{className:"container mx-auto p-4 space-y-6",children:[e.jsxs(ee,{children:[e.jsxs(se,{children:[e.jsx(ne,{children:"Analyze Labels"}),e.jsx(Je,{children:"Analyze label distribution across your log streams"})]}),e.jsx(te,{children:e.jsx(gn,{...y,children:e.jsxs("form",{onSubmit:y.handleSubmit(f),className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(Fe,{control:y.control,name:"tenant",render:({field:w})=>e.jsxs(je,{className:"flex flex-col space-y-1.5",children:[e.jsx(he,{children:"Tenant ID"}),e.jsx(we,{children:e.jsx(be,{placeholder:"Enter tenant ID...",...w})}),e.jsx(Ne,{className:"text-xs"})]})}),e.jsx(Fe,{control:y.control,name:"since",render:({field:w})=>e.jsxs(je,{className:"flex flex-col space-y-1.5",children:[e.jsx(he,{children:"Time Range"}),e.jsxs(Rt,{onValueChange:w.onChange,defaultValue:w.value,children:[e.jsx(we,{children:e.jsx(tt,{children:e.jsx(At,{placeholder:"Select time range"})})}),e.jsx(st,{children:dp.map(E=>e.jsx(Ve,{value:E.value,children:E.label},E.value))})]}),e.jsx(Ne,{className:"text-xs"})]})}),e.jsx(Fe,{control:y.control,name:"matcher",render:({field:w})=>e.jsxs(je,{className:"flex flex-col space-y-1.5",children:[e.jsx(he,{children:"Matcher"}),e.jsx(we,{children:e.jsx(be,{placeholder:"Enter matcher... (default: {})",...w})}),e.jsx(Ne,{className:"text-xs"})]})}),e.jsx(q,{type:"submit",disabled:h,className:"self-end h-10",children:h?"Analyzing...":"Analyze"})]})})})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsxs(se,{className:"flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row",children:[e.jsxs("div",{className:"flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6",children:[e.jsx(ne,{children:"Label Distribution"}),e.jsx(Je,{children:"Top 20 labels by unique values"})]}),e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"relative z-30 flex flex-1 flex-col justify-center gap-1 px-6 py-4 text-left sm:px-8 sm:py-6",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Total Streams"}),e.jsx("span",{className:"text-lg font-bold leading-none sm:text-3xl",children:r.totalStreams.toLocaleString()})]}),e.jsxs("div",{className:"relative z-30 flex flex-1 flex-col justify-center gap-1 border-l px-6 py-4 text-left sm:px-8 sm:py-6",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Unique Labels"}),e.jsx("span",{className:"text-lg font-bold leading-none sm:text-3xl",children:r.uniqueLabels.toLocaleString()})]})]})]}),e.jsxs(te,{className:"px-2 sm:p-6",children:[e.jsx("div",{className:"mb-4",children:e.jsxs(Rt,{value:d,onValueChange:w=>u(w),children:[e.jsx(tt,{className:"w-[200px]",children:e.jsx(At,{placeholder:"Select metric"})}),e.jsxs(st,{children:[e.jsx(Ve,{value:"uniqueValues",children:"Unique Values"}),e.jsx(Ve,{value:"inStreams",children:"Found In Streams"})]})]})}),e.jsx(Nn,{config:b,className:"aspect-auto h-[500px] w-full",children:e.jsxs(Ei,{data:r.labels.slice(0,20).map((w,E)=>({name:w.name,value:d==="uniqueValues"?w.uniqueValues:w.inStreams,fill:`var(--chart-color-${E})`})),layout:"vertical",margin:{right:24},barSize:452/Math.min(20,r.labels.length)*.6,maxBarSize:24,children:[e.jsx(Ci,{horizontal:!1}),e.jsx(Ti,{dataKey:"name",type:"category",tickLine:!1,axisLine:!1,width:90,fontSize:11,interval:0}),e.jsx(Ri,{type:"number",tickLine:!1,axisLine:!1,tickMargin:8}),e.jsx(ap,{content:e.jsx(kn,{className:"w-[200px]"})}),e.jsx(Ai,{dataKey:"value",fillOpacity:.8,radius:[4,4,0,0]})]})})]})]}),e.jsxs(ee,{children:[e.jsx(se,{children:e.jsx(ne,{children:"Label Details"})}),e.jsx(te,{children:e.jsxs(Te,{children:[e.jsx(Re,{children:e.jsxs(X,{children:[e.jsx(D,{children:e.jsx(Z,{title:"Label Name",field:"name",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Unique Values",field:"uniqueValues",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Found In Streams",field:"inStreams",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})}),e.jsx(D,{children:e.jsx(Z,{title:"Cardinality %",field:"cardinality",sortField:n,sortDirection:l,onSort:w=>{w===n?c(l==="asc"?"desc":"asc"):(o(w),c("desc"))}})})]})}),e.jsx(Ae,{children:j.map(w=>e.jsx(op,{asChild:!0,open:m.has(w.name),onOpenChange:E=>{const C=new Set(m);E?C.add(w.name):C.delete(w.name),g(C)},children:e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsx(F,{className:"font-medium",children:e.jsxs(ip,{className:"flex items-center gap-2 hover:text-primary",children:[e.jsx(it,{className:v("h-4 w-4 transition-transform",m.has(w.name)&&"rotate-180")}),w.name]})}),e.jsx(F,{children:w.uniqueValues.toLocaleString()}),e.jsx(F,{children:w.inStreams.toLocaleString()}),e.jsxs(F,{children:[(w.uniqueValues/w.inStreams*100).toFixed(2),"%"]})]}),e.jsx(lp,{asChild:!0,children:e.jsx(X,{children:e.jsx(F,{colSpan:4,className:"border-t-0 bg-muted/5",children:e.jsx("div",{className:"px-4",children:e.jsx(up,{values:w.sampleValues,totalValues:w.inStreams})})})})})]})},w.name))})]})})]})]})]})}function mp(t){const s=parseInt(t),a=t.slice(-1)==="h"?36e5:0;return s*a}const Sn=[{path:"/",breadcrumb:"Home",element:e.jsx(dr,{})},{path:"/nodes",breadcrumb:"Nodes",element:e.jsx(dr,{})},{path:"/nodes/:nodeName",breadcrumb:Wi,element:e.jsx(Gu,{})},{path:"/versions",breadcrumb:"Versions",element:e.jsx(_e,{})},{path:"/rings",breadcrumb:"Rings",element:e.jsx(lr,{})},{path:"/rings/:ringName",breadcrumb:Zi,element:e.jsx(lr,{})},{path:"/storage",breadcrumb:"Storage",element:e.jsx(_e,{})},{path:"/storage/object",breadcrumb:"Object Storage",element:e.jsx(_e,{})},{path:"/storage/dataobj",breadcrumb:"Data Objects",element:e.jsx(Oc,{})},{path:"/storage/dataobj/metadata",breadcrumb:"File Metadata",element:e.jsx(Xc,{})},{path:"/tenants",breadcrumb:"Tenants",element:e.jsx(_e,{})},{path:"/tenants/deletes",breadcrumb:"Deletes",element:e.jsx(Qu,{})},{path:"/tenants/deletes/new",element:e.jsx(tp,{}),breadcrumb:"New Delete Request"},{path:"/tenants/analyze-labels",element:e.jsx(pp,{}),breadcrumb:"Analyze Labels"},{path:"/tenants/limits",breadcrumb:"Limits",element:e.jsx(_e,{})},{path:"/tenants/labels",breadcrumb:"Labels",element:e.jsx(_e,{})},{path:"/rules",breadcrumb:"Rules",element:e.jsx(_e,{})},{path:"/404",breadcrumb:"404",element:e.jsx(Yi,{})}];function fp(){const t=Eo(Sn,{disableDefaults:!0});return e.jsx(Ss,{children:e.jsx(Es,{children:t.map(({match:s,breadcrumb:r},a)=>e.jsxs(i.Fragment,{children:[e.jsx(kt,{className:a===0?"hidden md:block":"",children:a===t.length-1?e.jsx(fa,{children:r}):e.jsx(St,{asChild:!0,children:e.jsx(de,{to:s.pathname,children:r})})}),a{let l;return s?a(!0):l=setTimeout(()=>{a(!1)},500),()=>{l&&clearTimeout(l)}},[s]);const n=()=>{if(!(t!=null&&t.members))return"v0.0.0";const l=new Map;Object.values(t.members).forEach(u=>{if(!u.build.version)return;const m=u.build.version;l.set(m,(l.get(m)||0)+1)});let c="v0.0.0",d=0;return l.forEach((u,m)=>{u>d&&(d=u,c=m)}),c},o=()=>{if(!(t!=null&&t.members))return[];const l=new Set,c=new Map;return Object.values(t.members).forEach(d=>{const u=d.build.version;l.add(u),c.set(u,{revision:d.build.revision,branch:d.build.branch,buildUser:d.build.buildUser,buildDate:d.build.buildDate,goVersion:d.build.goVersion})}),Array.from(l).map(d=>({version:d??"v0.0.0",info:c.get(d)??{revision:"v0.0.0",branch:"v0.0.0",buildUser:"v0.0.0",buildDate:"v0.0.0",goVersion:"v0.0.0"}}))};return{mostCommonVersion:n(),versionInfos:o(),isLoading:r}}function hp(){const{mostCommonVersion:t,versionInfos:s,isLoading:r}=gp(),[a,n]=i.useState(!1),o=()=>s.map(({version:l,info:c})=>`Version: ${l} -Revision: ${c.revision} -Branch: ${c.branch} -Build User: ${c.buildUser} -Build Date: ${c.buildDate} -Go Version: ${c.goVersion} -`).join(` -`);return e.jsxs(Ut,{open:a,onOpenChange:n,children:[e.jsx(qt,{asChild:!0,children:e.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx("button",{onClick:()=>n(!a),className:v("transition-opacity duration-200 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded px-1 -mx-1",{"opacity-0":r,"opacity-100":!r}),children:t}),r&&e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3 w-3 animate-spin"}),"Loading..."]})]})}),e.jsx(ft,{side:"bottom",align:"start",className:"w-[400px]",children:e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"font-semibold",children:"Build Information"}),!r&&s.length>0&&e.jsx(Bs,{text:o()})]}),e.jsx("div",{className:v("transition-opacity duration-200",{"opacity-0":r,"opacity-100":!r}),children:s.length>0?s.map(({version:l,info:c})=>e.jsxs("div",{className:"mb-2 last:mb-0",children:[e.jsx("div",{className:"font-semibold",children:l}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("div",{children:["Revision: ",c.revision]}),e.jsxs("div",{children:["Branch: ",c.branch]}),e.jsxs("div",{children:["Build User: ",c.buildUser]}),e.jsxs("div",{children:["Build Date: ",c.buildDate]}),e.jsxs("div",{children:["Go Version: ",c.goVersion]})]})]},l)):e.jsx("div",{className:"text-sm text-muted-foreground",children:"No build information available"})}),r&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{children:"Loading build information..."})]})]})})]})}const os=768;function xp(){const[t,s]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${os-1}px)`),a=()=>{s(window.innerWidthr.removeEventListener("change",a)},[]),!!t}const qs=i.forwardRef(({className:t,orientation:s="horizontal",decorative:r=!0,...a},n)=>e.jsx(la,{ref:n,decorative:r,orientation:s,className:v("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));qs.displayName=la.displayName;const bp=Ns,yp=ks,En=i.forwardRef(({className:t,...s},r)=>e.jsx(lt,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s,ref:r}));En.displayName=lt.displayName;const vp=Ce("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Cn=i.forwardRef(({side:t="right",className:s,children:r,...a},n)=>e.jsxs(yp,{children:[e.jsx(En,{}),e.jsxs(ct,{ref:n,className:v(vp({side:t}),s),...a,children:[e.jsxs(oa,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(js,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));Cn.displayName=ct.displayName;const jp=i.forwardRef(({className:t,...s},r)=>e.jsx(Pt,{ref:r,className:v("text-lg font-semibold text-foreground",t),...s}));jp.displayName=Pt.displayName;const wp=i.forwardRef(({className:t,...s},r)=>e.jsx(Dt,{ref:r,className:v("text-sm text-muted-foreground",t),...s}));wp.displayName=Dt.displayName;function gr({className:t,...s}){return e.jsx("div",{className:v("animate-pulse rounded-md bg-primary/10",t),...s})}const Np="sidebar:state",kp=60*60*24*7,Sp="16rem",Ep="18rem",Cp="3rem",Tp="b",Tn=i.createContext(null);function Yt(){const t=i.useContext(Tn);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Rn=i.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:a,style:n,children:o,...l},c)=>{const d=xp(),[u,m]=i.useState(!1),[g,y]=i.useState(t),N=s??g,h=i.useCallback(b=>{const j=typeof b=="function"?b(N):b;r?r(j):y(j),document.cookie=`${Np}=${j}; path=/; max-age=${kp}`},[r,N]),p=i.useCallback(()=>d?m(b=>!b):h(b=>!b),[d,h,m]);i.useEffect(()=>{const b=j=>{j.key===Tp&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),p())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[p]);const f=N?"expanded":"collapsed",x=i.useMemo(()=>({state:f,open:N,setOpen:h,isMobile:d,openMobile:u,setOpenMobile:m,toggleSidebar:p}),[f,N,h,d,u,m,p]);return e.jsx(Tn.Provider,{value:x,children:e.jsx(zs,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":Sp,"--sidebar-width-icon":Cp,...n},className:v("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",a),ref:c,...l,children:o})})})});Rn.displayName="SidebarProvider";const An=i.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:a,children:n,...o},l)=>{const{isMobile:c,state:d,openMobile:u,setOpenMobile:m}=Yt();return r==="none"?e.jsx("div",{className:v("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",a),ref:l,...o,children:n}):c?e.jsx(bp,{open:u,onOpenChange:m,...o,children:e.jsx(Cn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ep},side:t,children:e.jsx("div",{className:"flex h-full w-full flex-col",children:n})})}):e.jsxs("div",{ref:l,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":s,"data-side":t,children:[e.jsx("div",{className:v("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),e.jsx("div",{className:v("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...o,children:e.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:n})})]})});An.displayName="Sidebar";const _n=i.forwardRef(({className:t,onClick:s,...r},a)=>{const{toggleSidebar:n}=Yt();return e.jsxs(q,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:v("h-7 w-7",t),onClick:o=>{s==null||s(o),n()},...r,children:[e.jsx(Ho,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});_n.displayName="SidebarTrigger";const In=i.forwardRef(({className:t,...s},r)=>{const{toggleSidebar:a}=Yt();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:v("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...s})});In.displayName="SidebarRail";const Fn=i.forwardRef(({className:t,...s},r)=>e.jsx("main",{ref:r,className:v("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...s}));Fn.displayName="SidebarInset";const Rp=i.forwardRef(({className:t,...s},r)=>e.jsx(be,{ref:r,"data-sidebar":"input",className:v("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...s}));Rp.displayName="SidebarInput";const Ln=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:v("flex flex-col gap-2 p-2",t),...s}));Ln.displayName="SidebarHeader";const Ap=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:v("flex flex-col gap-2 p-2",t),...s}));Ap.displayName="SidebarFooter";const _p=i.forwardRef(({className:t,...s},r)=>e.jsx(qs,{ref:r,"data-sidebar":"separator",className:v("mx-2 w-auto bg-sidebar-border",t),...s}));_p.displayName="SidebarSeparator";const Pn=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:v("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s}));Pn.displayName="SidebarContent";const Dn=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:v("relative flex w-full min-w-0 flex-col p-2",t),...s}));Dn.displayName="SidebarGroup";const Ip=i.forwardRef(({className:t,asChild:s=!1,...r},a)=>{const n=s?Ee:"div";return e.jsx(n,{ref:a,"data-sidebar":"group-label",className:v("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})});Ip.displayName="SidebarGroupLabel";const Fp=i.forwardRef(({className:t,asChild:s=!1,...r},a)=>{const n=s?Ee:"button";return e.jsx(n,{ref:a,"data-sidebar":"group-action",className:v("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...r})});Fp.displayName="SidebarGroupAction";const Lp=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:v("w-full text-sm",t),...s}));Lp.displayName="SidebarGroupContent";const hs=i.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:v("flex w-full min-w-0 flex-col gap-1",t),...s}));hs.displayName="SidebarMenu";const Gs=i.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:v("group/menu-item relative",t),...s}));Gs.displayName="SidebarMenuItem";const Pp=Ce("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Hs=i.forwardRef(({asChild:t=!1,isActive:s=!1,variant:r="default",size:a="default",tooltip:n,className:o,...l},c)=>{const d=t?Ee:"button",{isMobile:u,state:m}=Yt(),g=e.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":a,"data-active":s,className:v(Pp({variant:r,size:a}),o),...l});return n?(typeof n=="string"&&(n={children:n}),e.jsxs(rt,{children:[e.jsx(at,{asChild:!0,children:g}),e.jsx(qe,{side:"right",align:"center",hidden:m!=="collapsed"||u,...n})]})):g});Hs.displayName="SidebarMenuButton";const Dp=i.forwardRef(({className:t,asChild:s=!1,showOnHover:r=!1,...a},n)=>{const o=s?Ee:"button";return e.jsx(o,{ref:n,"data-sidebar":"menu-action",className:v("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...a})});Dp.displayName="SidebarMenuAction";const Op=i.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:v("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...s}));Op.displayName="SidebarMenuBadge";const $p=i.forwardRef(({className:t,showIcon:s=!1,...r},a)=>{const n=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:v("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[s&&e.jsx(gr,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(gr,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})});$p.displayName="SidebarMenuSkeleton";const On=i.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:v("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...s}));On.displayName="SidebarMenuSub";const $n=i.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$n.displayName="SidebarMenuSubItem";const Mn=i.forwardRef(({asChild:t=!1,size:s="md",isActive:r,className:a,...n},o)=>{const l=t?Ee:"a";return e.jsx(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:v("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",a),...n})});Mn.displayName="SidebarMenuSubButton";function Mp(t,s){const[r,a]=i.useState(s);return i.useEffect(()=>{if(!(t!=null&&t.members))return;const n=s.map(o=>o.title==="Rings"&&t.members?{...o,items:tl(t.members)}:o);a(n)},[t==null?void 0:t.members,s]),r}const is=[{title:"Cluster",url:"/nodes",icon:e.jsx(Ko,{className:"h-4 w-4"}),items:[{title:"Nodes",url:"/nodes"},{title:"Rollouts & Versions",url:"/versions"}]},{title:"Rings",url:"/rings",icon:e.jsx(Rr,{className:"h-4 w-4"}),items:[]},{title:"Storage",url:"/storage",icon:e.jsx(Wo,{className:"h-4 w-4"}),items:[{title:"Object Storage",url:"/storage/object"},{title:"Data Objects",url:"/storage/dataobj"}]},{title:"Tenants",url:"/tenants",icon:e.jsx(Zo,{className:"h-4 w-4"}),items:[{title:"Analyze Labels",url:"/tenants/analyze-labels"},{title:"Deletes",url:"/tenants/deletes"},{title:"Limits",url:"/tenants/limits"},{title:"Labels",url:"/tenants/labels"}]},{title:"Rules",url:"/rules",icon:e.jsx(Yo,{className:"h-4 w-4"}),items:[]},{title:"Documentation",url:"https://grafana.com/docs/loki/latest/",icon:e.jsx(Xo,{className:"h-4 w-4"}),items:[]}];function Bp(t){return e.jsx(In,{...t,className:v("after:bg-border/40 hover:after:bg-border","hover:bg-muted/50",t.className)})}const hr="loki-sidebar-open-sections",zp=i.memo(function({item:s,isOpen:r,isActive:a,onToggle:n}){return e.jsxs(Gs,{children:[e.jsx(Hs,{asChild:!0,isActive:a(s.url),onClick:()=>n(s.title),children:e.jsxs("div",{className:"flex items-center justify-between font-medium",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.icon,e.jsx(de,{to:`${s.url}`,target:s.url.includes("http")?"_blank":"_self",children:s.title})]}),s.items&&s.items.length>0&&e.jsx(it,{className:v("h-4 w-4 transition-transform duration-200",r?"rotate-0":"-rotate-90")})]})}),s.items&&s.items.length>0&&r&&e.jsx(On,{children:s.items.map(o=>e.jsx($n,{children:e.jsx(Mn,{asChild:!0,isActive:a(o.url),children:e.jsx(de,{to:`${o.url}`,children:o.title})})},o.title))})]})});function Vp({...t}){const s=Cs(),r=Co(),{cluster:a}=pe(),n=r.pathname.replace(s,"/"),[o,l]=i.useState(()=>{const m=localStorage.getItem(hr);if(m)try{return JSON.parse(m)}catch{return is.reduce((g,y)=>({...g,[y.title]:!0}),{})}return is.reduce((g,y)=>({...g,[y.title]:!0}),{})}),c=Mp(a,is),d=i.useCallback(m=>m==="/"?n==="/":n.startsWith(m),[n]),u=i.useCallback(m=>{l(g=>{const y={...g,[m]:!g[m]};return localStorage.setItem(hr,JSON.stringify(y)),y})},[]);return e.jsxs(An,{...t,children:[e.jsx(Ln,{className:"py-4",children:e.jsx(hs,{children:e.jsx(Gs,{children:e.jsx(Hs,{size:"lg",asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4",children:[e.jsx("img",{src:"https://grafana.com/media/docs/loki/logo-grafana-loki.png",alt:"Loki Logo",className:"h-7 w-7"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-sm font-semibold leading-none",children:"Grafana Loki"}),e.jsx(hp,{})]})]})})})})}),e.jsx(mt,{className:"flex-1",children:e.jsx(Pn,{children:e.jsx(Dn,{children:e.jsx(hs,{children:c.map(m=>e.jsx(i.Fragment,{children:e.jsx(zp,{item:m,isOpen:o[m.title],isActive:d,onToggle:u})},m.title))})})})}),e.jsx(Bp,{})]})}function Up(){const[t,s]=i.useState(!1);i.useEffect(()=>{const a=()=>{s(window.scrollY>300)};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[]);const r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return t?e.jsx(q,{onClick:r,size:"icon",className:"fixed bottom-8 right-8 rounded-full shadow-lg transition-all duration-300","aria-label":"Back to top",children:e.jsx(cs,{className:"h-4 w-4"})}):null}var Ks="ToastProvider",[Ws,qp,Gp]=yi("Toast"),[Bn,Lm]=br("Toast",[Gp]),[Hp,Xt]=Bn(Ks),zn=t=>{const{__scopeToast:s,label:r="Notification",duration:a=5e3,swipeDirection:n="right",swipeThreshold:o=50,children:l}=t,[c,d]=i.useState(null),[u,m]=i.useState(0),g=i.useRef(!1),y=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ks}\`. Expected non-empty \`string\`.`),e.jsx(Ws.Provider,{scope:s,children:e.jsx(Hp,{scope:s,label:r,duration:a,swipeDirection:n,swipeThreshold:o,toastCount:u,viewport:c,onViewportChange:d,onToastAdd:i.useCallback(()=>m(N=>N+1),[]),onToastRemove:i.useCallback(()=>m(N=>N-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:y,children:l})})};zn.displayName=Ks;var Vn="ToastViewport",Kp=["F8"],xs="toast.viewportPause",bs="toast.viewportResume",Un=i.forwardRef((t,s)=>{const{__scopeToast:r,hotkey:a=Kp,label:n="Notifications ({hotkey})",...o}=t,l=Xt(Vn,r),c=qp(r),d=i.useRef(null),u=i.useRef(null),m=i.useRef(null),g=i.useRef(null),y=wr(s,g,l.onViewportChange),N=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=l.toastCount>0;i.useEffect(()=>{const f=x=>{var j;a.length!==0&&a.every(w=>x[w]||x.code===w)&&((j=g.current)==null||j.focus())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]),i.useEffect(()=>{const f=d.current,x=g.current;if(h&&f&&x){const b=()=>{if(!l.isClosePausedRef.current){const C=new CustomEvent(xs);x.dispatchEvent(C),l.isClosePausedRef.current=!0}},j=()=>{if(l.isClosePausedRef.current){const C=new CustomEvent(bs);x.dispatchEvent(C),l.isClosePausedRef.current=!1}},w=C=>{!f.contains(C.relatedTarget)&&j()},E=()=>{f.contains(document.activeElement)||j()};return f.addEventListener("focusin",b),f.addEventListener("focusout",w),f.addEventListener("pointermove",b),f.addEventListener("pointerleave",E),window.addEventListener("blur",b),window.addEventListener("focus",j),()=>{f.removeEventListener("focusin",b),f.removeEventListener("focusout",w),f.removeEventListener("pointermove",b),f.removeEventListener("pointerleave",E),window.removeEventListener("blur",b),window.removeEventListener("focus",j)}}},[h,l.isClosePausedRef]);const p=i.useCallback(({tabbingDirection:f})=>{const b=c().map(j=>{const w=j.ref.current,E=[w,...om(w)];return f==="forwards"?E:E.reverse()});return(f==="forwards"?b.reverse():b).flat()},[c]);return i.useEffect(()=>{const f=g.current;if(f){const x=b=>{var E,C,A;const j=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!j){const B=document.activeElement,z=b.shiftKey;if(b.target===f&&z){(E=u.current)==null||E.focus();return}const M=p({tabbingDirection:z?"backwards":"forwards"}),W=M.findIndex(T=>T===B);ls(M.slice(W+1))?b.preventDefault():z?(C=u.current)==null||C.focus():(A=m.current)==null||A.focus()}};return f.addEventListener("keydown",x),()=>f.removeEventListener("keydown",x)}},[c,p]),e.jsxs(yo,{ref:d,role:"region","aria-label":n.replace("{hotkey}",N),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&e.jsx(ys,{ref:u,onFocusFromOutsideViewport:()=>{const f=p({tabbingDirection:"forwards"});ls(f)}}),e.jsx(Ws.Slot,{scope:r,children:e.jsx(ae.ol,{tabIndex:-1,...o,ref:y})}),h&&e.jsx(ys,{ref:m,onFocusFromOutsideViewport:()=>{const f=p({tabbingDirection:"backwards"});ls(f)}})]})});Un.displayName=Vn;var qn="ToastFocusProxy",ys=i.forwardRef((t,s)=>{const{__scopeToast:r,onFocusFromOutsideViewport:a,...n}=t,o=Xt(qn,r);return e.jsx(Nr,{"aria-hidden":!0,tabIndex:0,...n,ref:s,style:{position:"fixed"},onFocus:l=>{var u;const c=l.relatedTarget;!((u=o.viewport)!=null&&u.contains(c))&&a()}})});ys.displayName=qn;var Qt="Toast",Wp="toast.swipeStart",Zp="toast.swipeMove",Yp="toast.swipeCancel",Xp="toast.swipeEnd",Gn=i.forwardRef((t,s)=>{const{forceMount:r,open:a,defaultOpen:n,onOpenChange:o,...l}=t,[c=!0,d]=vo({prop:a,defaultProp:n,onChange:o});return e.jsx(jo,{present:r||c,children:e.jsx(em,{open:c,...l,ref:s,onClose:()=>d(!1),onPause:wt(t.onPause),onResume:wt(t.onResume),onSwipeStart:me(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(t.onSwipeMove,u=>{const{x:m,y:g}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:me(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(t.onSwipeEnd,u=>{const{x:m,y:g}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),d(!1)})})})});Gn.displayName=Qt;var[Qp,Jp]=Bn(Qt,{onClose(){}}),em=i.forwardRef((t,s)=>{const{__scopeToast:r,type:a="foreground",duration:n,open:o,onClose:l,onEscapeKeyDown:c,onPause:d,onResume:u,onSwipeStart:m,onSwipeMove:g,onSwipeCancel:y,onSwipeEnd:N,...h}=t,p=Xt(Qt,r),[f,x]=i.useState(null),b=wr(s,T=>x(T)),j=i.useRef(null),w=i.useRef(null),E=n||p.duration,C=i.useRef(0),A=i.useRef(E),B=i.useRef(0),{onToastAdd:z,onToastRemove:Y}=p,K=wt(()=>{var O;(f==null?void 0:f.contains(document.activeElement))&&((O=p.viewport)==null||O.focus()),l()}),M=i.useCallback(T=>{!T||T===1/0||(window.clearTimeout(B.current),C.current=new Date().getTime(),B.current=window.setTimeout(K,T))},[K]);i.useEffect(()=>{const T=p.viewport;if(T){const O=()=>{M(A.current),u==null||u()},V=()=>{const Q=new Date().getTime()-C.current;A.current=A.current-Q,window.clearTimeout(B.current),d==null||d()};return T.addEventListener(xs,V),T.addEventListener(bs,O),()=>{T.removeEventListener(xs,V),T.removeEventListener(bs,O)}}},[p.viewport,E,d,u,M]),i.useEffect(()=>{o&&!p.isClosePausedRef.current&&M(E)},[o,E,p.isClosePausedRef,M]),i.useEffect(()=>(z(),()=>Y()),[z,Y]);const W=i.useMemo(()=>f?Qn(f):null,[f]);return p.viewport?e.jsxs(e.Fragment,{children:[W&&e.jsx(tm,{__scopeToast:r,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:W}),e.jsx(Qp,{scope:r,onClose:K,children:kr.createPortal(e.jsx(Ws.ItemSlot,{scope:r,children:e.jsx(wo,{asChild:!0,onEscapeKeyDown:me(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||K(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:e.jsx(ae.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection,...h,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:me(t.onKeyDown,T=>{T.key==="Escape"&&(c==null||c(T.nativeEvent),T.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:me(t.onPointerDown,T=>{T.button===0&&(j.current={x:T.clientX,y:T.clientY})}),onPointerMove:me(t.onPointerMove,T=>{if(!j.current)return;const O=T.clientX-j.current.x,V=T.clientY-j.current.y,Q=!!w.current,_=["left","right"].includes(p.swipeDirection),I=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,P=_?I(0,O):0,U=_?0:I(0,V),S=T.pointerType==="touch"?10:2,R={x:P,y:U},$={originalEvent:T,delta:R};Q?(w.current=R,xt(Zp,g,$,{discrete:!1})):xr(R,p.swipeDirection,S)?(w.current=R,xt(Wp,m,$,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(O)>S||Math.abs(V)>S)&&(j.current=null)}),onPointerUp:me(t.onPointerUp,T=>{const O=w.current,V=T.target;if(V.hasPointerCapture(T.pointerId)&&V.releasePointerCapture(T.pointerId),w.current=null,j.current=null,O){const Q=T.currentTarget,_={originalEvent:T,delta:O};xr(O,p.swipeDirection,p.swipeThreshold)?xt(Xp,N,_,{discrete:!0}):xt(Yp,y,_,{discrete:!0}),Q.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),tm=t=>{const{__scopeToast:s,children:r,...a}=t,n=Xt(Qt,s),[o,l]=i.useState(!1),[c,d]=i.useState(!1);return am(()=>l(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:e.jsx(No,{asChild:!0,children:e.jsx(Nr,{...a,children:o&&e.jsxs(e.Fragment,{children:[n.label," ",r]})})})},sm="ToastTitle",Hn=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t;return e.jsx(ae.div,{...a,ref:s})});Hn.displayName=sm;var rm="ToastDescription",Kn=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t;return e.jsx(ae.div,{...a,ref:s})});Kn.displayName=rm;var Wn="ToastAction",Zn=i.forwardRef((t,s)=>{const{altText:r,...a}=t;return r.trim()?e.jsx(Xn,{altText:r,asChild:!0,children:e.jsx(Zs,{...a,ref:s})}):(console.error(`Invalid prop \`altText\` supplied to \`${Wn}\`. Expected non-empty \`string\`.`),null)});Zn.displayName=Wn;var Yn="ToastClose",Zs=i.forwardRef((t,s)=>{const{__scopeToast:r,...a}=t,n=Jp(Yn,r);return e.jsx(Xn,{asChild:!0,children:e.jsx(ae.button,{type:"button",...a,ref:s,onClick:me(t.onClick,n.onClose)})})});Zs.displayName=Yn;var Xn=i.forwardRef((t,s)=>{const{__scopeToast:r,altText:a,...n}=t;return e.jsx(ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:s})});function Qn(t){const s=[];return Array.from(t.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&s.push(a.textContent),nm(a)){const n=a.ariaHidden||a.hidden||a.style.display==="none",o=a.dataset.radixToastAnnounceExclude==="";if(!n)if(o){const l=a.dataset.radixToastAnnounceAlt;l&&s.push(l)}else s.push(...Qn(a))}}),s}function xt(t,s,r,{discrete:a}){const n=r.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});s&&n.addEventListener(t,s,{once:!0}),a?So(n,o):n.dispatchEvent(o)}var xr=(t,s,r=0)=>{const a=Math.abs(t.x),n=Math.abs(t.y),o=a>n;return s==="left"||s==="right"?o&&a>r:!o&&n>r};function am(t=()=>{}){const s=wt(t);ko(()=>{let r=0,a=0;return r=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(s)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(a)}},[s])}function nm(t){return t.nodeType===t.ELEMENT_NODE}function om(t){const s=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)s.push(r.currentNode);return s}function ls(t){const s=document.activeElement;return t.some(r=>r===s?!0:(r.focus(),document.activeElement!==s))}var im=zn,Jn=Un,eo=Gn,to=Hn,so=Kn,ro=Zn,ao=Zs;const lm=im,no=i.forwardRef(({className:t,...s},r)=>e.jsx(Jn,{ref:r,className:v("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...s}));no.displayName=Jn.displayName;const cm=Ce("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),oo=i.forwardRef(({className:t,variant:s,...r},a)=>e.jsx(eo,{ref:a,className:v(cm({variant:s}),t),...r}));oo.displayName=eo.displayName;const dm=i.forwardRef(({className:t,...s},r)=>e.jsx(ro,{ref:r,className:v("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...s}));dm.displayName=ro.displayName;const io=i.forwardRef(({className:t,...s},r)=>e.jsx(ao,{ref:r,className:v("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...s,children:e.jsx(js,{className:"h-4 w-4"})}));io.displayName=ao.displayName;const lo=i.forwardRef(({className:t,...s},r)=>e.jsx(to,{ref:r,className:v("text-sm font-semibold [&+div]:text-xs",t),...s}));lo.displayName=to.displayName;const co=i.forwardRef(({className:t,...s},r)=>e.jsx(so,{ref:r,className:v("text-sm opacity-90",t),...s}));co.displayName=so.displayName;function um(){const{toasts:t}=Vt();return e.jsxs(lm,{children:[t.map(function({id:s,title:r,description:a,action:n,...o}){return e.jsxs(oo,{...o,children:[e.jsxs("div",{className:"grid gap-1",children:[r&&e.jsx(lo,{children:r}),a&&e.jsx(co,{children:a})]}),n,e.jsx(io,{})]},s)}),e.jsx(no,{})]})}function pm({children:t}){return e.jsx("div",{className:"flex min-h-screen",children:e.jsxs(Rn,{children:[e.jsx(Vp,{}),e.jsxs(Fn,{children:[e.jsxs("header",{className:"flex h-16 shrink-0 items-center gap-2 border-b px-4",children:[e.jsx(_n,{}),e.jsx(qs,{orientation:"vertical",className:"mr-2 h-4"}),e.jsx(fp,{}),e.jsx("div",{className:"ml-auto px-4",children:e.jsx(Ki,{})})]}),e.jsx("main",{className:"flex flex-1 flex-col",children:t}),e.jsx(um,{}),e.jsx(Up,{})]})]})})}var mm=function(){return null};const fm=new Ii({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:5*60*1e3}}});function gm({children:t}){return e.jsxs(Fi,{client:fm,children:[t,e.jsx(mm,{initialIsOpen:!1})]})}function hm({children:t}){const[s,r]=i.useState(null),[a,n]=i.useState(null),[o,l]=i.useState(!0),c=i.useRef(!1),d=i.useCallback(async()=>{if(!c.current){c.current=!0,l(!0);try{const m=await fetch(re("/api/v1/cluster/nodes"));if(!m.ok)throw new Error(`Failed to fetch cluster data: ${m.statusText}`);const g=await m.json();r(g),n(null)}catch(m){n(m instanceof Error?m.message:"An unknown error occurred")}finally{l(!1),c.current=!1}}},[]),u=i.useCallback(async()=>{await d()},[d]);return i.useEffect(()=>{d()},[d]),e.jsx(xa.Provider,{value:{cluster:s,error:a,isLoading:o,refresh:u},children:t})}function xm(){return e.jsx(gm,{children:e.jsx(Gi,{defaultTheme:"dark",storageKey:"loki-ui-theme",children:e.jsx(hm,{children:e.jsx(pm,{children:e.jsx(To,{children:Sn.map(t=>e.jsx(Ro,{path:t.path,element:t.element},t.path))})})})})})}const bm=Cs(),ym=Ao([{path:"*",element:e.jsx(xm,{})}],{basename:bm,future:{v7_relativeSplatPath:!0}}),uo=document.getElementById("root");if(!uo)throw new Error("Root element not found");ua(uo).render(e.jsx(i.StrictMode,{children:e.jsx(_o,{router:ym,future:{v7_startTransition:!0}})})); diff --git a/pkg/ui/frontend/dist/assets/index-BbxlzNnT.js b/pkg/ui/frontend/dist/assets/index-BbxlzNnT.js new file mode 100644 index 0000000000..39e605f8c6 --- /dev/null +++ b/pkg/ui/frontend/dist/assets/index-BbxlzNnT.js @@ -0,0 +1,79 @@ +import{j as l,S as Qa,c as fp,P as ot,e as dl,l as js,B as Ny,E as mp,G as wy,T as Ey,H as Ty,I as gp,J as Ay,K as Ry,L as ky,M as pp,u as hp,N as Cy,V as xp,a as _y,g as Dy,b as si,d as Qt,O as Oy,n as zy,p as My,m as Ly}from"./radix-core-BQsrZC3d.js";import{r as g,u as hi,d as Rs,L as Rt,e as bp,R as fl,f as By,g as Uy,a as qy,h as Hy,i as Gy,j as Fy,k as Vy}from"./react-router-BDU20MeH.js";import{r as Yy,a as $y,g as Zy}from"./react-core-YHpNHmmd.js";import{t as Xy,c as vu,a as Ka}from"./ui-utils-CrpwsBu-.js";import{S as Qy,M as Ky,C as yp,R as Iy,H as Jy,a as pl,b as Py,A as Gg,c as cu,d as vp,e as xi,X as ju,f as jp,P as Wy,L as ma,g as ks,h as Sp,i as ev,j as tv,k as Cs,l as Np,F as av,m as nv,D as wp,n as Ep,o as lv,G as Su,p as sv,q as rv,r as iv,s as ov,t as cv,U as uv,u as dv,B as fv}from"./ui-icons-BqZLUD1y.js";import{f as mv,a as gv,b as Tp,c as ri,p as uu,i as bs,d as pv,e as Fg,g as hv,h as xv,D as Vg}from"./date-utils-D5i7Ep19.js";import{R as Ap,I as bv,T as Rp,a as yv,S as kp,b as Cp,P as vv,C as _p,V as jv,L as Dp,c as Op,d as Sv,e as Nv,f as zp,g as wv,h as Ev,i as Mp,j as Tv,k as Lp,l as Bp,m as Up}from"./radix-inputs-BPBG_BOm.js";import{S as qp,d as Hp,P as Av,C as Gp,e as Fp,f as Vp,g as Yp,h as $p,L as Zp,i as Xp,j as Rv,T as kv,k as Qp,V as Cv,l as _v,m as Kp,n as Dv,o as Ip,p as Jp,q as Pp,r as Ov,c as zv}from"./radix-navigation-D0pNP4jG.js";import{R as Nu,P as wu,O as _s,C as Ds,a as Wp,T as bi,D as yi,b as eh,c as Mv,d as Lv,e as Bv,f as Uv,g as qv,h as th}from"./radix-layout-CAue-YU5.js";import{R as Os,P as vi,a as ji,C as Si,T as zs,r as Hv,B as Gv,b as Fv,Y as Vv,X as Yv,c as $v}from"./data-viz-CL7w-2Lt.js";import{u as Ni,a as Zv,Q as Xv,b as Qv}from"./query-management-COQdG7OW.js";import{z as Kv}from"./theme-utils-DhlUe4T2.js";import{u as Iv,F as Jv,C as Pv,o as Wv,s as e1,a as t1,b as ah,c as ys,d as Yg,e as nh}from"./form-libs-BC53Arqz.js";(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function o(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(d){if(d.ep)return;d.ep=!0;const m=o(d);fetch(d.href,m)}})();var Jc={exports:{}},hs={},Pc={exports:{}},Wc={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $g;function a1(){return $g||($g=1,function(s){function i(B,Q){var Z=B.length;B.push(Q);e:for(;0>>1,P=B[I];if(0>>1;Id(X,Z))aed(ee,X)?(B[I]=ee,B[ae]=Z,I=ae):(B[I]=X,B[H]=Z,I=H);else if(aed(ee,Z))B[I]=ee,B[ae]=Z,I=ae;else break e}}return Q}function d(B,Q){var Z=B.sortIndex-Q.sortIndex;return Z!==0?Z:B.id-Q.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var p=Date,x=p.now();s.unstable_now=function(){return p.now()-x}}var b=[],y=[],v=1,w=null,R=3,q=!1,E=!1,j=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function z(B){for(var Q=o(y);Q!==null;){if(Q.callback===null)u(y);else if(Q.startTime<=B)u(y),Q.sortIndex=Q.expirationTime,i(b,Q);else break;Q=o(y)}}function $(B){if(j=!1,z(B),!E)if(o(b)!==null)E=!0,K||(K=!0,se());else{var Q=o(y);Q!==null&&ie($,Q.startTime-B)}}var K=!1,W=-1,ce=5,fe=-1;function Te(){return N?!0:!(s.unstable_now()-feB&&Te());){var I=w.callback;if(typeof I=="function"){w.callback=null,R=w.priorityLevel;var P=I(w.expirationTime<=B);if(B=s.unstable_now(),typeof P=="function"){w.callback=P,z(B),Q=!0;break t}w===o(b)&&u(b),z(B)}else u(b);w=o(b)}if(w!==null)Q=!0;else{var ue=o(y);ue!==null&&ie($,ue.startTime-B),Q=!1}}break e}finally{w=null,R=Z,q=!1}Q=void 0}}finally{Q?se():K=!1}}}var se;if(typeof D=="function")se=function(){D(ye)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,J=Ee.port2;Ee.port1.onmessage=ye,se=function(){J.postMessage(null)}}else se=function(){k(ye,0)};function ie(B,Q){W=k(function(){B(s.unstable_now())},Q)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(B){B.callback=null},s.unstable_forceFrameRate=function(B){0>B||125I?(B.sortIndex=Z,i(y,B),o(b)===null&&B===o(y)&&(j?(C(W),W=-1):j=!0,ie($,Z-I))):(B.sortIndex=P,i(b,B),E||q||(E=!0,K||(K=!0,se()))),B},s.unstable_shouldYield=Te,s.unstable_wrapCallback=function(B){var Q=R;return function(){var Z=R;R=Q;try{return B.apply(this,arguments)}finally{R=Z}}}}(Wc)),Wc}var Zg;function n1(){return Zg||(Zg=1,Pc.exports=a1()),Pc.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Xg;function l1(){if(Xg)return hs;Xg=1;var s=n1(),i=Yy(),o=$y();function u(e){var t="https://react.dev/errors/"+e;if(1P||(e.current=I[P],I[P]=null,P--)}function X(e,t){P++,I[P]=e.current,e.current=t}var ae=ue(null),ee=ue(null),ge=ue(null),je=ue(null);function Ye(e,t){switch(X(ge,t),X(ee,e),X(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?pg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=pg(t),e=hg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ae),X(ae,e)}function Oe(){H(ae),H(ee),H(ge)}function ha(e){e.memoizedState!==null&&X(je,e);var t=ae.current,a=hg(t,e.type);t!==a&&(X(ee,e),X(ae,a))}function Us(e){ee.current===e&&(H(ae),H(ee)),je.current===e&&(H(je),ds._currentValue=Z)}var Li=Object.prototype.hasOwnProperty,Bi=s.unstable_scheduleCallback,Ui=s.unstable_cancelCallback,tb=s.unstable_shouldYield,ab=s.unstable_requestPaint,Ft=s.unstable_now,nb=s.unstable_getCurrentPriorityLevel,Qu=s.unstable_ImmediatePriority,Ku=s.unstable_UserBlockingPriority,qs=s.unstable_NormalPriority,lb=s.unstable_LowPriority,Iu=s.unstable_IdlePriority,sb=s.log,rb=s.unstable_setDisableYieldValue,yl=null,xt=null;function xa(e){if(typeof sb=="function"&&rb(e),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(yl,e)}catch{}}var bt=Math.clz32?Math.clz32:cb,ib=Math.log,ob=Math.LN2;function cb(e){return e>>>=0,e===0?32:31-(ib(e)/ob|0)|0}var Hs=256,Gs=4194304;function Wa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fs(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var h=n&134217727;return h!==0?(n=h&~c,n!==0?r=Wa(n):(f&=h,f!==0?r=Wa(f):a||(a=h&~e,a!==0&&(r=Wa(a))))):(h=n&~c,h!==0?r=Wa(h):f!==0?r=Wa(f):a||(a=n&~e,a!==0&&(r=Wa(a)))),r===0?0:t!==0&&t!==r&&(t&c)===0&&(c=r&-r,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:r}function vl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ub(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ju(){var e=Hs;return Hs<<=1,(Hs&4194048)===0&&(Hs=256),e}function Pu(){var e=Gs;return Gs<<=1,(Gs&62914560)===0&&(Gs=4194304),e}function qi(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function jl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function db(e,t,a,n,r,c){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var h=e.entanglements,S=e.expirationTimes,O=e.hiddenUpdates;for(a=f&~a;0)":-1r||S[n]!==O[r]){var G=` +`+S[n].replace(" at new "," at ");return e.displayName&&G.includes("")&&(G=G.replace("",e.displayName)),G}while(1<=n&&0<=r);break}}}finally{$i=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?kn(a):""}function xb(e){switch(e.tag){case 26:case 27:case 5:return kn(e.type);case 16:return kn("Lazy");case 13:return kn("Suspense");case 19:return kn("SuspenseList");case 0:case 15:return Zi(e.type,!1);case 11:return Zi(e.type.render,!1);case 1:return Zi(e.type,!0);case 31:return kn("Activity");default:return""}}function od(e){try{var t="";do t+=xb(e),e=e.return;while(e);return t}catch(a){return` +Error generating stack: `+a.message+` +`+a.stack}}function kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bb(e){var t=cd(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,c=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(f){n=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $s(e){e._valueTracker||(e._valueTracker=bb(e))}function ud(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=cd(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Zs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var yb=/[\n"\\]/g;function Ct(e){return e.replace(yb,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xi(e,t,a,n,r,c,f,h){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kt(t)):e.value!==""+kt(t)&&(e.value=""+kt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Qi(e,f,kt(t)):a!=null?Qi(e,f,kt(a)):n!=null&&e.removeAttribute("value"),r==null&&c!=null&&(e.defaultChecked=!!c),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+kt(h):e.removeAttribute("name")}function dd(e,t,a,n,r,c,f,h){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null))return;a=a!=null?""+kt(a):"",t=t!=null?""+kt(t):a,h||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=h?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f)}function Qi(e,t,a){t==="number"&&Zs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Cn(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wi=!1;if(Pt)try{var El={};Object.defineProperty(El,"passive",{get:function(){Wi=!0}}),window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{Wi=!1}var ya=null,eo=null,Qs=null;function bd(){if(Qs)return Qs;var e,t=eo,a=t.length,n,r="value"in ya?ya.value:ya.textContent,c=r.length;for(e=0;e=Rl),wd=" ",Ed=!1;function Td(e,t){switch(e){case"keyup":return Xb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ad(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function Kb(e,t){switch(e){case"compositionend":return Ad(t);case"keypress":return t.which!==32?null:(Ed=!0,wd);case"textInput":return e=t.data,e===wd&&Ed?null:e;default:return null}}function Ib(e,t){if(zn)return e==="compositionend"||!so&&Td(e,t)?(e=bd(),Qs=eo=ya=null,zn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Md(a)}}function Bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Zs(e.document)}return t}function oo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var l0=Pt&&"documentMode"in document&&11>=document.documentMode,Mn=null,co=null,Dl=null,uo=!1;function qd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;uo||Mn==null||Mn!==Zs(n)||(n=Mn,"selectionStart"in n&&oo(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Dl&&_l(Dl,n)||(Dl=n,n=Ur(co,"onSelect"),0>=f,r-=f,ea=1<<32-bt(t)+r|a<c?c:8;var f=B.T,h={};B.T=h,Io(e,!1,t,a);try{var S=r(),O=B.S;if(O!==null&&O(h,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var G=m0(S,n);Xl(e,t,G,wt(e))}else Xl(e,t,n,wt(e))}catch(Y){Xl(e,t,{then:function(){},status:"rejected",reason:Y},wt())}finally{Q.p=c,B.T=f}}function b0(){}function Qo(e,t,a,n){if(e.tag!==5)throw Error(u(476));var r=Gf(e).queue;Hf(e,r,t,Z,a===null?b0:function(){return Ff(e),a(n)})}function Gf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:Z},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ff(e){var t=Gf(e).next.queue;Xl(e,t,{},wt())}function Ko(){return it(ds)}function Vf(){return Ze().memoizedState}function Yf(){return Ze().memoizedState}function y0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=wt();e=Sa(a);var n=Na(t,e,a);n!==null&&(Et(n,t,a),Gl(n,t,a)),t={cache:Eo()},e.payload=t;return}t=t.return}}function v0(e,t,a){var n=wt();a={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},br(e)?Zf(t,a):(a=po(e,t,a,n),a!==null&&(Et(a,e,n),Xf(a,t,n)))}function $f(e,t,a){var n=wt();Xl(e,t,a,n)}function Xl(e,t,a,n){var r={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(br(e))Zf(t,r);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,h=c(f,a);if(r.hasEagerState=!0,r.eagerState=h,yt(h,f))return tr(e,t,r,0),ze===null&&er(),!1}catch{}finally{}if(a=po(e,t,r,n),a!==null)return Et(a,e,n),Xf(a,t,n),!0}return!1}function Io(e,t,a,n){if(n={lane:2,revertLane:Rc(),action:n,hasEagerState:!1,eagerState:null,next:null},br(e)){if(t)throw Error(u(479))}else t=po(e,a,n,2),t!==null&&Et(t,e,2)}function br(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Zf(e,t){$n=fr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Xf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,ed(e,a)}}var yr={readContext:it,use:gr,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe},Qf={readContext:it,use:gr,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:_f,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,xr(4194308,4,Mf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return xr(4194308,4,e,t)},useInsertionEffect:function(e,t){xr(4,2,e,t)},useMemo:function(e,t){var a=mt();t=t===void 0?null:t;var n=e();if(mn){xa(!0);try{e()}finally{xa(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=mt();if(a!==void 0){var r=a(t);if(mn){xa(!0);try{a(t)}finally{xa(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=v0.bind(null,pe,e),[n.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,a=$f.bind(null,pe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Zo,useDeferredValue:function(e,t){var a=mt();return Xo(a,e,t)},useTransition:function(){var e=Yo(!1);return e=Hf.bind(null,pe,e.queue,!0,!1),mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=pe,r=mt();if(Ne){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),ze===null)throw Error(u(349));(ve&124)!==0||pf(n,t,a)}r.memoizedState=a;var c={value:a,getSnapshot:t};return r.queue=c,_f(xf.bind(null,n,c,e),[e]),n.flags|=2048,Xn(9,hr(),hf.bind(null,n,c,a,t),null),a},useId:function(){var e=mt(),t=ze.identifierPrefix;if(Ne){var a=ta,n=ea;a=(n&~(1<<32-bt(n)-1)).toString(32)+a,t="«"+t+"R"+a,a=mr++,0oe?(Pe=ne,ne=null):Pe=ne.sibling;var Se=M(A,ne,_[oe],F);if(Se===null){ne===null&&(ne=Pe);break}e&&ne&&Se.alternate===null&&t(A,ne),T=c(Se,T,oe),he===null?te=Se:he.sibling=Se,he=Se,ne=Pe}if(oe===_.length)return a(A,ne),Ne&&rn(A,oe),te;if(ne===null){for(;oe<_.length;oe++)ne=Y(A,_[oe],F),ne!==null&&(T=c(ne,T,oe),he===null?te=ne:he.sibling=ne,he=ne);return Ne&&rn(A,oe),te}for(ne=n(ne);oe<_.length;oe++)Pe=U(ne,A,oe,_[oe],F),Pe!==null&&(e&&Pe.alternate!==null&&ne.delete(Pe.key===null?oe:Pe.key),T=c(Pe,T,oe),he===null?te=Pe:he.sibling=Pe,he=Pe);return e&&ne.forEach(function(Ha){return t(A,Ha)}),Ne&&rn(A,oe),te}function re(A,T,_,F){if(_==null)throw Error(u(151));for(var te=null,he=null,ne=T,oe=T=0,Pe=null,Se=_.next();ne!==null&&!Se.done;oe++,Se=_.next()){ne.index>oe?(Pe=ne,ne=null):Pe=ne.sibling;var Ha=M(A,ne,Se.value,F);if(Ha===null){ne===null&&(ne=Pe);break}e&&ne&&Ha.alternate===null&&t(A,ne),T=c(Ha,T,oe),he===null?te=Ha:he.sibling=Ha,he=Ha,ne=Pe}if(Se.done)return a(A,ne),Ne&&rn(A,oe),te;if(ne===null){for(;!Se.done;oe++,Se=_.next())Se=Y(A,Se.value,F),Se!==null&&(T=c(Se,T,oe),he===null?te=Se:he.sibling=Se,he=Se);return Ne&&rn(A,oe),te}for(ne=n(ne);!Se.done;oe++,Se=_.next())Se=U(ne,A,oe,Se.value,F),Se!==null&&(e&&Se.alternate!==null&&ne.delete(Se.key===null?oe:Se.key),T=c(Se,T,oe),he===null?te=Se:he.sibling=Se,he=Se);return e&&ne.forEach(function(Sy){return t(A,Sy)}),Ne&&rn(A,oe),te}function _e(A,T,_,F){if(typeof _=="object"&&_!==null&&_.type===E&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case R:e:{for(var te=_.key;T!==null;){if(T.key===te){if(te=_.type,te===E){if(T.tag===7){a(A,T.sibling),F=r(T,_.props.children),F.return=A,A=F;break e}}else if(T.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===ce&&If(te)===T.type){a(A,T.sibling),F=r(T,_.props),Kl(F,_),F.return=A,A=F;break e}a(A,T);break}else t(A,T);T=T.sibling}_.type===E?(F=ln(_.props.children,A.mode,F,_.key),F.return=A,A=F):(F=nr(_.type,_.key,_.props,null,A.mode,F),Kl(F,_),F.return=A,A=F)}return f(A);case q:e:{for(te=_.key;T!==null;){if(T.key===te)if(T.tag===4&&T.stateNode.containerInfo===_.containerInfo&&T.stateNode.implementation===_.implementation){a(A,T.sibling),F=r(T,_.children||[]),F.return=A,A=F;break e}else{a(A,T);break}else t(A,T);T=T.sibling}F=bo(_,A.mode,F),F.return=A,A=F}return f(A);case ce:return te=_._init,_=te(_._payload),_e(A,T,_,F)}if(ie(_))return de(A,T,_,F);if(se(_)){if(te=se(_),typeof te!="function")throw Error(u(150));return _=te.call(_),re(A,T,_,F)}if(typeof _.then=="function")return _e(A,T,vr(_),F);if(_.$$typeof===D)return _e(A,T,ir(A,_),F);jr(A,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,T!==null&&T.tag===6?(a(A,T.sibling),F=r(T,_),F.return=A,A=F):(a(A,T),F=xo(_,A.mode,F),F.return=A,A=F),f(A)):a(A,T)}return function(A,T,_,F){try{Ql=0;var te=_e(A,T,_,F);return Qn=null,te}catch(ne){if(ne===ql||ne===cr)throw ne;var he=vt(29,ne,null,A.mode);return he.lanes=F,he.return=A,he}finally{}}}var Kn=Jf(!0),Pf=Jf(!1),Mt=ue(null),Yt=null;function Ea(e){var t=e.alternate;X(Qe,Qe.current&1),X(Mt,e),Yt===null&&(t===null||Yn.current!==null||t.memoizedState!==null)&&(Yt=e)}function Wf(e){if(e.tag===22){if(X(Qe,Qe.current),X(Mt,e),Yt===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Yt=e)}}else Ta()}function Ta(){X(Qe,Qe.current),X(Mt,Mt.current)}function sa(e){H(Mt),Yt===e&&(Yt=null),H(Qe)}var Qe=ue(0);function Sr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Hc(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Jo(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Po={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=wt(),r=Sa(n);r.payload=t,a!=null&&(r.callback=a),t=Na(e,r,n),t!==null&&(Et(t,e,n),Gl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=wt(),r=Sa(n);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=Na(e,r,n),t!==null&&(Et(t,e,n),Gl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=wt(),n=Sa(a);n.tag=2,t!=null&&(n.callback=t),t=Na(e,n,a),t!==null&&(Et(t,e,a),Gl(t,e,a))}};function em(e,t,a,n,r,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,f):t.prototype&&t.prototype.isPureReactComponent?!_l(a,n)||!_l(r,c):!0}function tm(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Po.enqueueReplaceState(t,t.state,null)}function gn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=v({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}var Nr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function am(e){Nr(e)}function nm(e){console.error(e)}function lm(e){Nr(e)}function wr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function sm(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Wo(e,t,a){return a=Sa(a),a.tag=3,a.payload={element:null},a.callback=function(){wr(e,t)},a}function rm(e){return e=Sa(e),e.tag=3,e}function im(e,t,a,n){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var c=n.value;e.payload=function(){return r(c)},e.callback=function(){sm(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){sm(t,a,n),typeof r!="function"&&(Da===null?Da=new Set([this]):Da.add(this));var h=n.stack;this.componentDidCatch(n.value,{componentStack:h!==null?h:""})})}function S0(e,t,a,n,r){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Ll(t,a,r,!0),a=Mt.current,a!==null){switch(a.tag){case 13:return Yt===null?Nc():a.alternate===null&&He===0&&(He=3),a.flags&=-257,a.flags|=65536,a.lanes=r,n===Ro?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Ec(e,n,r)),!1;case 22:return a.flags|=65536,n===Ro?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Ec(e,n,r)),!1}throw Error(u(435,a.tag))}return Ec(e,n,r),Nc(),!1}if(Ne)return t=Mt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,n!==jo&&(e=Error(u(422),{cause:n}),Ml(_t(e,a)))):(n!==jo&&(t=Error(u(423),{cause:n}),Ml(_t(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,n=_t(n,a),r=Wo(e.stateNode,n,r),_o(e,r),He!==4&&(He=2)),!1;var c=Error(u(520),{cause:n});if(c=_t(c,a),as===null?as=[c]:as.push(c),He!==4&&(He=2),t===null)return!0;n=_t(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Wo(a.stateNode,n,e),_o(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Da===null||!Da.has(c))))return a.flags|=65536,r&=-r,a.lanes|=r,r=rm(r),im(r,e,a,n),_o(a,r),!1}a=a.return}while(a!==null);return!1}var om=Error(u(461)),Ie=!1;function tt(e,t,a,n){t.child=e===null?Pf(t,null,a,n):Kn(t,e.child,a,n)}function cm(e,t,a,n,r){a=a.render;var c=t.ref;if("ref"in n){var f={};for(var h in n)h!=="ref"&&(f[h]=n[h])}else f=n;return dn(t),n=Lo(e,t,a,f,c,r),h=Bo(),e!==null&&!Ie?(Uo(e,t,r),ra(e,t,r)):(Ne&&h&&yo(t),t.flags|=1,tt(e,t,n,r),t.child)}function um(e,t,a,n,r){if(e===null){var c=a.type;return typeof c=="function"&&!ho(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,dm(e,t,c,n,r)):(e=nr(a.type,null,n,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!ic(e,r)){var f=c.memoizedProps;if(a=a.compare,a=a!==null?a:_l,a(f,n)&&e.ref===t.ref)return ra(e,t,r)}return t.flags|=1,e=Wt(c,n),e.ref=t.ref,e.return=t,t.child=e}function dm(e,t,a,n,r){if(e!==null){var c=e.memoizedProps;if(_l(c,n)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=n=c,ic(e,r))(e.flags&131072)!==0&&(Ie=!0);else return t.lanes=e.lanes,ra(e,t,r)}return ec(e,t,a,n,r)}function fm(e,t,a){var n=t.pendingProps,r=n.children,c=e!==null?e.memoizedState:null;if(n.mode==="hidden"){if((t.flags&128)!==0){if(n=c!==null?c.baseLanes|a:a,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;t.childLanes=c&~n}else t.childLanes=0,t.child=null;return mm(e,t,n,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&or(t,c!==null?c.cachePool:null),c!==null?df(t,c):Oo(),Wf(t);else return t.lanes=t.childLanes=536870912,mm(e,t,c!==null?c.baseLanes|a:a,a)}else c!==null?(or(t,c.cachePool),df(t,c),Ta(),t.memoizedState=null):(e!==null&&or(t,null),Oo(),Ta());return tt(e,t,r,a),t.child}function mm(e,t,a,n){var r=Ao();return r=r===null?null:{parent:Xe._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&or(t,null),Oo(),Wf(t),e!==null&&Ll(e,t,n,!0),null}function Er(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ec(e,t,a,n,r){return dn(t),a=Lo(e,t,a,n,void 0,r),n=Bo(),e!==null&&!Ie?(Uo(e,t,r),ra(e,t,r)):(Ne&&n&&yo(t),t.flags|=1,tt(e,t,a,r),t.child)}function gm(e,t,a,n,r,c){return dn(t),t.updateQueue=null,a=mf(t,n,a,r),ff(e),n=Bo(),e!==null&&!Ie?(Uo(e,t,c),ra(e,t,c)):(Ne&&n&&yo(t),t.flags|=1,tt(e,t,a,c),t.child)}function pm(e,t,a,n,r){if(dn(t),t.stateNode===null){var c=qn,f=a.contextType;typeof f=="object"&&f!==null&&(c=it(f)),c=new a(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Po,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},ko(t),f=a.contextType,c.context=typeof f=="object"&&f!==null?it(f):qn,c.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Jo(t,a,f,n),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&Po.enqueueReplaceState(c,c.state,null),Vl(t,n,c,r),Fl(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var h=t.memoizedProps,S=gn(a,h);c.props=S;var O=c.context,G=a.contextType;f=qn,typeof G=="object"&&G!==null&&(f=it(G));var Y=a.getDerivedStateFromProps;G=typeof Y=="function"||typeof c.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,G||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h||O!==f)&&tm(t,c,n,f),ja=!1;var M=t.memoizedState;c.state=M,Vl(t,n,c,r),Fl(),O=t.memoizedState,h||M!==O||ja?(typeof Y=="function"&&(Jo(t,a,Y,n),O=t.memoizedState),(S=ja||em(t,a,S,n,M,O,f))?(G||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=O),c.props=n,c.state=O,c.context=f,n=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,Co(e,t),f=t.memoizedProps,G=gn(a,f),c.props=G,Y=t.pendingProps,M=c.context,O=a.contextType,S=qn,typeof O=="object"&&O!==null&&(S=it(O)),h=a.getDerivedStateFromProps,(O=typeof h=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==Y||M!==S)&&tm(t,c,n,S),ja=!1,M=t.memoizedState,c.state=M,Vl(t,n,c,r),Fl();var U=t.memoizedState;f!==Y||M!==U||ja||e!==null&&e.dependencies!==null&&rr(e.dependencies)?(typeof h=="function"&&(Jo(t,a,h,n),U=t.memoizedState),(G=ja||em(t,a,G,n,M,U,S)||e!==null&&e.dependencies!==null&&rr(e.dependencies))?(O||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,U,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,U,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=U),c.props=n,c.state=U,c.context=S,n=G):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),n=!1)}return c=n,Er(e,t),n=(t.flags&128)!==0,c||n?(c=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&n?(t.child=Kn(t,e.child,null,r),t.child=Kn(t,null,a,r)):tt(e,t,a,r),t.memoizedState=c.state,e=t.child):e=ra(e,t,r),e}function hm(e,t,a,n){return zl(),t.flags|=256,tt(e,t,a,n),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:af()}}function nc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Lt),e}function xm(e,t,a){var n=t.pendingProps,r=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),f&&(r=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ne){if(r?Ea(t):Ta(),Ne){var h=qe,S;if(S=h){e:{for(S=h,h=Vt;S.nodeType!==8;){if(!h){h=null;break e}if(S=Ht(S.nextSibling),S===null){h=null;break e}}h=S}h!==null?(t.memoizedState={dehydrated:h,treeContext:sn!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},S=vt(18,null,null,0),S.stateNode=h,S.return=t,t.child=S,ct=t,qe=null,S=!0):S=!1}S||cn(t)}if(h=t.memoizedState,h!==null&&(h=h.dehydrated,h!==null))return Hc(h)?t.lanes=32:t.lanes=536870912,null;sa(t)}return h=n.children,n=n.fallback,r?(Ta(),r=t.mode,h=Tr({mode:"hidden",children:h},r),n=ln(n,r,a,null),h.return=t,n.return=t,h.sibling=n,t.child=h,r=t.child,r.memoizedState=ac(a),r.childLanes=nc(e,f,a),t.memoizedState=tc,n):(Ea(t),lc(t,h))}if(S=e.memoizedState,S!==null&&(h=S.dehydrated,h!==null)){if(c)t.flags&256?(Ea(t),t.flags&=-257,t=sc(e,t,a)):t.memoizedState!==null?(Ta(),t.child=e.child,t.flags|=128,t=null):(Ta(),r=n.fallback,h=t.mode,n=Tr({mode:"visible",children:n.children},h),r=ln(r,h,a,null),r.flags|=2,n.return=t,r.return=t,n.sibling=r,t.child=n,Kn(t,e.child,null,a),n=t.child,n.memoizedState=ac(a),n.childLanes=nc(e,f,a),t.memoizedState=tc,t=r);else if(Ea(t),Hc(h)){if(f=h.nextSibling&&h.nextSibling.dataset,f)var O=f.dgst;f=O,n=Error(u(419)),n.stack="",n.digest=f,Ml({value:n,source:null,stack:null}),t=sc(e,t,a)}else if(Ie||Ll(e,t,a,!1),f=(a&e.childLanes)!==0,Ie||f){if(f=ze,f!==null&&(n=a&-a,n=(n&42)!==0?1:Hi(n),n=(n&(f.suspendedLanes|a))!==0?0:n,n!==0&&n!==S.retryLane))throw S.retryLane=n,Un(e,n),Et(f,e,n),om;h.data==="$?"||Nc(),t=sc(e,t,a)}else h.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,qe=Ht(h.nextSibling),ct=t,Ne=!0,on=null,Vt=!1,e!==null&&(Ot[zt++]=ea,Ot[zt++]=ta,Ot[zt++]=sn,ea=e.id,ta=e.overflow,sn=t),t=lc(t,n.children),t.flags|=4096);return t}return r?(Ta(),r=n.fallback,h=t.mode,S=e.child,O=S.sibling,n=Wt(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,O!==null?r=Wt(O,r):(r=ln(r,h,a,null),r.flags|=2),r.return=t,n.return=t,n.sibling=r,t.child=n,n=r,r=t.child,h=e.child.memoizedState,h===null?h=ac(a):(S=h.cachePool,S!==null?(O=Xe._currentValue,S=S.parent!==O?{parent:O,pool:O}:S):S=af(),h={baseLanes:h.baseLanes|a,cachePool:S}),r.memoizedState=h,r.childLanes=nc(e,f,a),t.memoizedState=tc,n):(Ea(t),a=e.child,e=a.sibling,a=Wt(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function lc(e,t){return t=Tr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Tr(e,t){return e=vt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function sc(e,t,a){return Kn(t,e.child,null,a),e=lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bm(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),No(e.return,t,a)}function rc(e,t,a,n,r){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:r}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=n,c.tail=a,c.tailMode=r)}function ym(e,t,a){var n=t.pendingProps,r=n.revealOrder,c=n.tail;if(tt(e,t,n.children,a),n=Qe.current,(n&2)!==0)n=n&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bm(e,a,t);else if(e.tag===19)bm(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(X(Qe,n),r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&Sr(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),rc(t,!1,r,a,c);break;case"backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Sr(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}rc(t,!0,a,null,c);break;case"together":rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ra(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),_a|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Ll(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=Wt(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Wt(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ic(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&rr(e)))}function N0(e,t,a){switch(t.tag){case 3:Ye(t,t.stateNode.containerInfo),va(t,Xe,e.memoizedState.cache),zl();break;case 27:case 5:ha(t);break;case 4:Ye(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ea(t),t.flags|=128,null):(a&t.child.childLanes)!==0?xm(e,t,a):(Ea(t),e=ra(e,t,a),e!==null?e.sibling:null);Ea(t);break;case 19:var r=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Ll(e,t,a,!1),n=(a&t.childLanes)!==0),r){if(n)return ym(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),X(Qe,Qe.current),n)break;return null;case 22:case 23:return t.lanes=0,fm(e,t,a);case 24:va(t,Xe,e.memoizedState.cache)}return ra(e,t,a)}function vm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ie=!0;else{if(!ic(e,a)&&(t.flags&128)===0)return Ie=!1,N0(e,t,a);Ie=(e.flags&131072)!==0}else Ie=!1,Ne&&(t.flags&1048576)!==0&&Kd(t,sr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,r=n._init;if(n=r(n._payload),t.type=n,typeof n=="function")ho(n)?(e=gn(n,e),t.tag=1,t=pm(null,t,n,e,a)):(t.tag=0,t=ec(null,t,n,e,a));else{if(n!=null){if(r=n.$$typeof,r===z){t.tag=11,t=cm(null,t,n,e,a);break e}else if(r===W){t.tag=14,t=um(null,t,n,e,a);break e}}throw t=J(n)||n,Error(u(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,r=gn(n,t.pendingProps),pm(e,t,n,r,a);case 3:e:{if(Ye(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var c=t.memoizedState;r=c.element,Co(e,t),Vl(t,n,null,a);var f=t.memoizedState;if(n=f.cache,va(t,Xe,n),n!==c.cache&&wo(t,[Xe],a,!0),Fl(),n=f.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=hm(e,t,n,a);break e}else if(n!==r){r=_t(Error(u(424)),t),Ml(r),t=hm(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(qe=Ht(e.firstChild),ct=t,Ne=!0,on=null,Vt=!0,a=Pf(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(zl(),n===r){t=ra(e,t,a);break e}tt(e,t,n,a)}t=t.child}return t;case 26:return Er(e,t),e===null?(a=wg(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ne||(a=t.type,e=t.pendingProps,n=Hr(ge.current).createElement(a),n[rt]=t,n[dt]=e,nt(n,a,e),Ke(n),t.stateNode=n):t.memoizedState=wg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ha(t),e===null&&Ne&&(n=t.stateNode=jg(t.type,t.pendingProps,ge.current),ct=t,Vt=!0,r=qe,Ma(t.type)?(Gc=r,qe=Ht(n.firstChild)):qe=r),tt(e,t,t.pendingProps.children,a),Er(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ne&&((r=n=qe)&&(n=J0(n,t.type,t.pendingProps,Vt),n!==null?(t.stateNode=n,ct=t,qe=Ht(n.firstChild),Vt=!1,r=!0):r=!1),r||cn(t)),ha(t),r=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,n=c.children,Bc(r,c)?n=null:f!==null&&Bc(r,f)&&(t.flags|=32),t.memoizedState!==null&&(r=Lo(e,t,p0,null,null,a),ds._currentValue=r),Er(e,t),tt(e,t,n,a),t.child;case 6:return e===null&&Ne&&((e=a=qe)&&(a=P0(a,t.pendingProps,Vt),a!==null?(t.stateNode=a,ct=t,qe=null,e=!0):e=!1),e||cn(t)),null;case 13:return xm(e,t,a);case 4:return Ye(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Kn(t,null,n,a):tt(e,t,n,a),t.child;case 11:return cm(e,t,t.type,t.pendingProps,a);case 7:return tt(e,t,t.pendingProps,a),t.child;case 8:return tt(e,t,t.pendingProps.children,a),t.child;case 12:return tt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,va(t,t.type,n.value),tt(e,t,n.children,a),t.child;case 9:return r=t.type._context,n=t.pendingProps.children,dn(t),r=it(r),n=n(r),t.flags|=1,tt(e,t,n,a),t.child;case 14:return um(e,t,t.type,t.pendingProps,a);case 15:return dm(e,t,t.type,t.pendingProps,a);case 19:return ym(e,t,a);case 31:return n=t.pendingProps,a=t.mode,n={mode:n.mode,children:n.children},e===null?(a=Tr(n,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Wt(e.child,n),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return fm(e,t,a);case 24:return dn(t),n=it(Xe),e===null?(r=Ao(),r===null&&(r=ze,c=Eo(),r.pooledCache=c,c.refCount++,c!==null&&(r.pooledCacheLanes|=a),r=c),t.memoizedState={parent:n,cache:r},ko(t),va(t,Xe,r)):((e.lanes&a)!==0&&(Co(e,t),Vl(t,null,null,a),Fl()),r=e.memoizedState,c=t.memoizedState,r.parent!==n?(r={parent:n,cache:n},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),va(t,Xe,n)):(n=c.cache,va(t,Xe,n),n!==r.cache&&wo(t,[Xe],a,!0))),tt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ia(e){e.flags|=4}function jm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kg(t)){if(t=Mt.current,t!==null&&((ve&4194048)===ve?Yt!==null:(ve&62914560)!==ve&&(ve&536870912)===0||t!==Yt))throw Hl=Ro,nf;e.flags|=8192}}function Ar(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pu():536870912,e.lanes|=t,Wn|=t)}function Il(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags&65011712,n|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,n|=r.subtreeFlags,n|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function w0(e,t,a){var n=t.pendingProps;switch(vo(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),na(Xe),Oe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Pd())),Be(t),null;case 26:return a=t.memoizedState,e===null?(ia(t),a!==null?(Be(t),jm(t,a)):(Be(t),t.flags&=-16777217)):a?a!==e.memoizedState?(ia(t),Be(t),jm(t,a)):(Be(t),t.flags&=-16777217):(e.memoizedProps!==n&&ia(t),Be(t),t.flags&=-16777217),null;case 27:Us(t),a=ge.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ia(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Be(t),null}e=ae.current,Ol(t)?Id(t):(e=jg(r,n,a),t.stateNode=e,ia(t))}return Be(t),null;case 5:if(Us(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ia(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Be(t),null}if(e=ae.current,Ol(t))Id(t);else{switch(r=Hr(ge.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=r.createElement("div"),e.innerHTML=" - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/pkg/ui/frontend/src/hooks/use-ring.ts b/pkg/ui/frontend/src/hooks/use-ring.ts index d6cf29893b..361bbcc3e9 100644 --- a/pkg/ui/frontend/src/hooks/use-ring.ts +++ b/pkg/ui/frontend/src/hooks/use-ring.ts @@ -7,6 +7,8 @@ export const AVAILABLE_RINGS: Array<{ id: RingType; title: string }> = [ { id: RingTypes.INGESTER, title: "Ingester" }, { id: RingTypes.PARTITION_INGESTER, title: "Partition Ingester" }, { id: RingTypes.DISTRIBUTOR, title: "Distributor" }, + { id: RingTypes.INGEST_LIMITS_FRONTEND, title: "Ingest Limits Frontend" }, + { id: RingTypes.INGEST_LIMITS, title: "Ingest Limits" }, { id: RingTypes.PATTERN_INGESTER, title: "Pattern Ingester" }, { id: RingTypes.QUERY_SCHEDULER, title: "Scheduler" }, { id: RingTypes.COMPACTOR, title: "Compactor" }, diff --git a/pkg/ui/frontend/src/lib/ring-utils.ts b/pkg/ui/frontend/src/lib/ring-utils.ts index 42a93fb910..4306d119e3 100644 --- a/pkg/ui/frontend/src/lib/ring-utils.ts +++ b/pkg/ui/frontend/src/lib/ring-utils.ts @@ -122,6 +122,18 @@ export const RingServices: Record< ringPath: "/distributor/ring", needsTokens: false, }, + "ingest-limits-frontend": { + title: "Ingest Limits Frontend", + ringName: RingTypes.INGEST_LIMITS_FRONTEND, + ringPath: "/ingest-limits-frontend/ring", + needsTokens: false, + }, + "ingest-limits": { + title: "Ingest Limits", + ringName: RingTypes.INGEST_LIMITS, + ringPath: "/ingest-limits/ring", + needsTokens: false, + }, "pattern-ingester": { title: "Pattern Ingester", ringName: RingTypes.PATTERN_INGESTER, diff --git a/pkg/ui/frontend/src/types/ring.ts b/pkg/ui/frontend/src/types/ring.ts index fa8b89be97..bff22c002a 100644 --- a/pkg/ui/frontend/src/types/ring.ts +++ b/pkg/ui/frontend/src/types/ring.ts @@ -20,6 +20,8 @@ export const RingTypes: Record = { INGESTER: "ingester", PARTITION_INGESTER: "partition-ingester", DISTRIBUTOR: "distributor", + INGEST_LIMITS_FRONTEND: "ingest-limits-frontend", + INGEST_LIMITS: "ingest-limits", PATTERN_INGESTER: "pattern-ingester", QUERY_SCHEDULER: "query-scheduler", COMPACTOR: "compactor",