@usex/mikrotik-mcp 4.17.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +5 -1
- package/dist/index.js +1 -1
- package/dist/shared/{cli-1ftjz1jx.js → cli-7jxnfmp0.js} +1 -1
- package/dist/shared/{cli-v75jtv6p.js → cli-dv2kmsh2.js} +51 -12
- package/dist/shared/{library-ydfn3v4j.js → library-77r1j24d.js} +1 -1
- package/dist/shared/{library-qma8metz.js → library-7m2c1g1y.js} +23 -11
- package/dist/ui/observability.html +25 -25
- package/package.json +1 -1
- package/schemas/tool-catalog.json +1 -1
|
@@ -74,18 +74,18 @@ Error generating stack: `+e.message+`
|
|
|
74
74
|
`},Ed=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Dd=function(){v.useEffect(function(){return document.body.setAttribute(wd,(Ed()+1).toString()),function(){var e=Ed()-1;e<=0?document.body.removeAttribute(wd):document.body.setAttribute(wd,e.toString())}},[])},Od=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Dd();var a=v.useMemo(function(){return Sd(i)},[i]);return v.createElement(Cd,{styles:Td(a,!t,i,n?``:`!important`)})},kd=!1;if(typeof window<`u`)try{var Ad=Object.defineProperty({},"passive",{get:function(){return kd=!0,!0}});window.addEventListener(`test`,Ad,Ad),window.removeEventListener(`test`,Ad,Ad)}catch{kd=!1}var jd=kd?{passive:!1}:!1,Md=function(e){return e.tagName===`TEXTAREA`},Nd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Md(e)&&n[t]===`visible`)},Pd=function(e){return Nd(e,`overflowY`)},Fd=function(e){return Nd(e,`overflowX`)},Id=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zd(e,r)){var i=Bd(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ld=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Rd=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zd=function(e,t){return e===`v`?Pd(t):Fd(t)},Bd=function(e,t){return e===`v`?Ld(t):Rd(t)},Vd=function(e,t){return e===`h`&&t===`rtl`?-1:1},Hd=function(e,t,n,r,i){var a=Vd(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Bd(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zd(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ud=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wd=function(e){return[e.deltaX,e.deltaY]},Gd=function(e){return e&&`current`in e?e.current:e},Kd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qd=function(e){return`
|
|
75
75
|
.block-interactivity-${e} {pointer-events: none;}
|
|
76
76
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
77
|
-
`},Jd=0,Yd=[];function Xd(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Jd++)[0],a=v.useState(vd)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=qu([e.lockRef.current],(e.shards||[]).map(Gd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ud(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Id(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Id(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Hd(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Yd.length||Yd[Yd.length-1]!==a)){var r=`deltaY`in n?Wd(n):Ud(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Kd(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Gd).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Ud(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Wd(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Ud(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Yd.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,jd),document.addEventListener(`touchmove`,c,jd),document.addEventListener(`touchstart`,u,jd),function(){Yd=Yd.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,jd),document.removeEventListener(`touchmove`,c,jd),document.removeEventListener(`touchstart`,u,jd)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:qd(i)}):null,p?v.createElement(Od,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qd=sd(cd,Xd),$d=v.forwardRef(function(e,t){return v.createElement(ud,Gu({},e,{ref:t,sideCar:Qd}))});$d.classNames=ud.classNames;var ef=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tf=new WeakMap,nf=new WeakMap,rf={},af=0,of=function(e){return e&&(e.host||of(e.parentNode))},sf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=of(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},cf=function(e,t,n,r){var i=sf(t,Array.isArray(e)?e:[e]);rf[n]||(rf[n]=new WeakMap);var a=rf[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(tf.get(e)||0)+1,l=(a.get(e)||0)+1;tf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&nf.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),af++,function(){o.forEach(function(e){var t=tf.get(e)-1,i=a.get(e)-1;tf.set(e,t),a.set(e,i),t||(nf.has(e)||e.removeAttribute(r),nf.delete(e)),i||e.removeAttribute(n)}),af--,af||(tf=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf={})}},lf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ef(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),cf(r,i,n,`aria-hidden`)):function(){return null}},uf=`Dialog`,[df,ff]=Vl(uf),[pf,mf]=df(uf),hf=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=Kl({prop:r,defaultProp:i??!1,onChange:a,caller:uf});return(0,W.jsx)(pf,{scope:t,triggerRef:s,contentRef:c,contentId:iu(),titleId:iu(),descriptionId:iu(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};hf.displayName=uf;var gf=`DialogTrigger`,_f=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(gf,n),a=yl(t,i.triggerRef);return(0,W.jsx)(Il.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Lf(i.open),...r,ref:a,onClick:G(e.onClick,i.onOpenToggle)})});_f.displayName=gf;var vf=`DialogPortal`,[yf,bf]=df(vf,{forceMount:void 0}),xf=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=mf(vf,t);return(0,W.jsx)(yf,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,W.jsx)(Xl,{present:n||a.open,children:(0,W.jsx)(Bu,{asChild:!0,container:i,children:e})}))})};xf.displayName=vf;var Sf=`DialogOverlay`,Cf=v.forwardRef((e,t)=>{let n=bf(Sf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=mf(Sf,e.__scopeDialog);return a.modal?(0,W.jsx)(Xl,{present:r||a.open,children:(0,W.jsx)(Tf,{...i,ref:t})}):null});Cf.displayName=Sf;var wf=bl(`DialogOverlay.RemoveScroll`),Tf=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(Sf,n),a=yl(t,_u());return(0,W.jsx)($d,{as:wf,allowPinchZoom:!0,shards:[i.contentRef],children:(0,W.jsx)(Il.div,{"data-state":Lf(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),Ef=`DialogContent`,Df=v.forwardRef((e,t)=>{let n=bf(Ef,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=mf(Ef,e.__scopeDialog);return(0,W.jsx)(Xl,{present:r||a.open,children:a.modal?(0,W.jsx)(Of,{...i,ref:t}):(0,W.jsx)(kf,{...i,ref:t})})});Df.displayName=Ef;var Of=v.forwardRef((e,t)=>{let n=mf(Ef,e.__scopeDialog),r=v.useRef(null),i=yl(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return lf(e)},[]),(0,W.jsx)(Af,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})}),kf=v.forwardRef((e,t)=>{let n=mf(Ef,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,W.jsx)(Af,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Af=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=mf(Ef,n);return Uu(),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(Du,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(mu,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Lf(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),jf=`DialogTitle`,Mf=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(jf,n);return(0,W.jsx)(Il.h2,{id:i.titleId,...r,ref:t})});Mf.displayName=jf;var Nf=`DialogDescription`,Pf=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(Nf,n);return(0,W.jsx)(Il.p,{id:i.descriptionId,...r,ref:t})});Pf.displayName=Nf;var Ff=`DialogClose`,If=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(Ff,n);return(0,W.jsx)(Il.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})});If.displayName=Ff;function Lf(e){return e?`open`:`closed`}var Rf=`AlertDialog`,[zf,Bf]=Vl(Rf,[ff]),Vf=ff(),Hf=e=>{let{__scopeAlertDialog:t,...n}=e,r=Vf(t);return(0,W.jsx)(hf,{...r,...n,modal:!0})};Hf.displayName=Rf;var Uf=`AlertDialogTrigger`,Wf=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(_f,{...i,...r,ref:t})});Wf.displayName=Uf;var Gf=`AlertDialogPortal`,Kf=e=>{let{__scopeAlertDialog:t,...n}=e,r=Vf(t);return(0,W.jsx)(xf,{...r,...n})};Kf.displayName=Gf;var qf=`AlertDialogOverlay`,Jf=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(Cf,{...i,...r,ref:t})});Jf.displayName=qf;var Yf=`AlertDialogContent`,[Xf,Zf]=zf(Yf),Qf=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Vf(n),o=yl(t,v.useRef(null)),s=v.useRef(null);return(0,W.jsx)(Xf,{scope:n,cancelRef:s,children:(0,W.jsx)(Df,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:G(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})});Qf.displayName=Yf;var $f=`AlertDialogTitle`,ep=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(Mf,{...i,...r,ref:t})});ep.displayName=$f;var tp=`AlertDialogDescription`,np=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(Pf,{...i,...r,ref:t})});np.displayName=tp;var rp=`AlertDialogAction`,ip=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(If,{...i,...r,ref:t})});ip.displayName=rp;var ap=`AlertDialogCancel`,op=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Zf(ap,n),a=Vf(n),o=yl(t,i);return(0,W.jsx)(If,{...a,...r,ref:o})});op.displayName=ap;var sp=Hf,cp=Wf,lp=Kf,up=Jf,dp=Qf,fp=ip,pp=op,mp=ep,hp=np;function gp(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function _p(e){let[t,n]=v.useState(void 0);return Wl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var vp=`Checkbox`,[yp,bp]=Vl(vp),[xp,Sp]=yp(vp);function Cp(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Kl({prop:n,defaultProp:i??!1,onChange:c,caller:vp}),[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useRef(!1),b=m?!!o||!!m.closest(`form`):!0,x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:Mp(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:_};return(0,W.jsx)(xp,{scope:t,...x,children:jp(d)?d(x):r})}var wp=`CheckboxTrigger`,Tp=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=Sp(wp,e),h=yl(i,u),g=v.useRef(c);return v.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,W.jsx)(Il.button,{type:`button`,role:`checkbox`,"aria-checked":Mp(c)?`mixed`:c,"aria-required":l,"data-state":Np(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:G(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:G(n,e=>{d(e=>Mp(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Tp.displayName=wp;var Ep=v.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(Cp,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Tp,{...d,ref:t,__scopeCheckbox:n}),e&&(0,W.jsx)(Ap,{__scopeCheckbox:n})]})})});Ep.displayName=vp;var Dp=`CheckboxIndicator`,Op=v.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Sp(Dp,n);return(0,W.jsx)(Xl,{present:r||Mp(a.checked)||a.checked===!0,children:(0,W.jsx)(Il.span,{"data-state":Np(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});Op.displayName=Dp;var kp=`CheckboxBubbleInput`,Ap=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Sp(kp,e),m=yl(n,p),h=gp(a),g=_p(r);v.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Mp(a),n.call(e,Mp(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=v.useRef(Mp(a)?!1:a);return(0,W.jsx)(Il.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});Ap.displayName=kp;function jp(e){return typeof e==`function`}function Mp(e){return e===`indeterminate`}function Np(e){return Mp(e)?`indeterminate`:e?`checked`:`unchecked`}var Pp=[`top`,`right`,`bottom`,`left`],Fp=Math.min,Ip=Math.max,Lp=Math.round,Rp=Math.floor,zp=e=>({x:e,y:e}),Bp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Vp(e,t,n){return Ip(e,Fp(t,n))}function Hp(e,t){return typeof e==`function`?e(t):e}function Up(e){return e.split(`-`)[0]}function Wp(e){return e.split(`-`)[1]}function Gp(e){return e===`x`?`y`:`x`}function Kp(e){return e===`y`?`height`:`width`}function qp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Jp(e){return Gp(qp(e))}function Yp(e,t,n){n===void 0&&(n=!1);let r=Wp(e),i=Jp(e),a=Kp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=im(o)),[o,im(o)]}function Xp(e){let t=im(e);return[Zp(e),t,Zp(t)]}function Zp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Qp=[`left`,`right`],$p=[`right`,`left`],em=[`top`,`bottom`],tm=[`bottom`,`top`];function nm(e,t,n){switch(e){case`top`:case`bottom`:return n?t?$p:Qp:t?Qp:$p;case`left`:case`right`:return t?em:tm;default:return[]}}function rm(e,t,n,r){let i=Wp(e),a=nm(Up(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Zp)))),a}function im(e){let t=Up(e);return Bp[t]+e.slice(t.length)}function am(e){return{top:0,right:0,bottom:0,left:0,...e}}function om(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:am(e)}function sm(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function cm(e,t,n){let{reference:r,floating:i}=e,a=qp(t),o=Jp(t),s=Kp(o),c=Up(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Wp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function lm(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Hp(t,e),p=om(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=sm(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=sm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var um=50,dm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:lm},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=cm(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<um&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=cm(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fm=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Hp(e,t)||{};if(l==null)return{};let d=om(u),f={x:n,y:r},p=Jp(i),m=Kp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Fp(d[_],T),D=Fp(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Vp(O,A,k),M=!c.arrow&&Wp(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),pm=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Hp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Up(r),_=qp(o),v=Up(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[im(o)]:Xp(o)),x=p!==`none`;!d&&x&&b.push(...rm(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Yp(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==qp(t))||T.every(e=>qp(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=qp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function mm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hm(e){return Pp.some(t=>e[t]>=0)}var gm=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Hp(e,t);switch(i){case`referenceHidden`:{let e=mm(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:hm(e)}}}case`escaped`:{let e=mm(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:hm(e)}}}default:return{}}}}},_m=new Set([`left`,`top`]);async function vm(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Up(n),s=Wp(n),c=qp(n)===`y`,l=_m.has(o)?-1:1,u=a&&c?-1:1,d=Hp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ym=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await vm(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},bm=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Hp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=qp(Up(i)),p=Gp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Vp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Vp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},xm=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Hp(e,t),u={x:n,y:r},d=qp(i),f=Gp(d),p=u[f],m=u[d],h=Hp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=_m.has(Up(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Sm=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Hp(e,t),u=await o.detectOverflow(t,l),d=Up(i),f=Wp(i),p=qp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Fp(h-u[g],v),x=Fp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ip(u.left,0),t=Ip(u.right,0),n=Ip(u.top,0),r=Ip(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ip(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ip(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Cm(){return typeof window<`u`}function wm(e){return Dm(e)?(e.nodeName||``).toLowerCase():`#document`}function Tm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Em(e){return((Dm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Dm(e){return Cm()?e instanceof Node||e instanceof Tm(e).Node:!1}function Om(e){return Cm()?e instanceof Element||e instanceof Tm(e).Element:!1}function km(e){return Cm()?e instanceof HTMLElement||e instanceof Tm(e).HTMLElement:!1}function Am(e){return!Cm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Tm(e).ShadowRoot}function jm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Hm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Mm(e){return/^(table|td|th)$/.test(wm(e))}function Nm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Pm=/transform|translate|scale|rotate|perspective|filter/,Fm=/paint|layout|strict|content/,Im=e=>!!e&&e!==`none`,Lm;function Rm(e){let t=Om(e)?Hm(e):e;return Im(t.transform)||Im(t.translate)||Im(t.scale)||Im(t.rotate)||Im(t.perspective)||!Bm()&&(Im(t.backdropFilter)||Im(t.filter))||Pm.test(t.willChange||``)||Fm.test(t.contain||``)}function zm(e){let t=Wm(e);for(;km(t)&&!Vm(t);){if(Rm(t))return t;if(Nm(t))return null;t=Wm(t)}return null}function Bm(){return Lm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Lm}function Vm(e){return/^(html|body|#document)$/.test(wm(e))}function Hm(e){return Tm(e).getComputedStyle(e)}function Um(e){return Om(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wm(e){if(wm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Am(e)&&e.host||Em(e);return Am(t)?t.host:t}function Gm(e){let t=Wm(e);return Vm(t)?e.ownerDocument?e.ownerDocument.body:e.body:km(t)&&jm(t)?t:Gm(t)}function Km(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Gm(e),i=r===e.ownerDocument?.body,a=Tm(r);if(i){let e=qm(a);return t.concat(a,a.visualViewport||[],jm(r)?r:[],e&&n?Km(e):[])}else return t.concat(r,Km(r,[],n))}function qm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jm(e){let t=Hm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=km(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Lp(n)!==a||Lp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ym(e){return Om(e)?e:e.contextElement}function Xm(e){let t=Ym(e);if(!km(t))return zp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jm(t),o=(a?Lp(n.width):n.width)/r,s=(a?Lp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Zm=zp(0);function Qm(e){let t=Tm(e);return!Bm()||!t.visualViewport?Zm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $m(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tm(e)?!1:t}function eh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ym(e),o=zp(1);t&&(r?Om(r)&&(o=Xm(r)):o=Xm(e));let s=$m(a,n,r)?Qm(a):zp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Tm(a),t=r&&Om(r)?Tm(r):r,n=e,i=qm(n);for(;i&&r&&t!==n;){let e=Xm(i),t=i.getBoundingClientRect(),r=Hm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Tm(i),i=qm(n)}}return sm({width:u,height:d,x:c,y:l})}function th(e,t){let n=Um(e).scrollLeft;return t?t.left+n:eh(Em(e)).left+n}function nh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-th(e,n),y:n.top+t.scrollTop}}function rh(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Em(r),s=t?Nm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=zp(1),u=zp(0),d=km(r);if((d||!d&&!a)&&((wm(r)!==`body`||jm(o))&&(c=Um(r)),d)){let e=eh(r);l=Xm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?nh(o,c):zp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ih(e){return Array.from(e.getClientRects())}function ah(e){let t=Em(e),n=Um(e),r=e.ownerDocument.body,i=Ip(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ip(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+th(e),s=-n.scrollTop;return Hm(r).direction===`rtl`&&(o+=Ip(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var oh=25;function sh(e,t){let n=Tm(e),r=Em(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Bm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=th(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=oh&&(a-=o)}else l<=oh&&(a+=l);return{width:a,height:o,x:s,y:c}}function ch(e,t){let n=eh(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=km(e)?Xm(e):zp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function lh(e,t,n){let r;if(t===`viewport`)r=sh(e,n);else if(t===`document`)r=ah(Em(e));else if(Om(t))r=ch(t,n);else{let n=Qm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return sm(r)}function uh(e,t){let n=Wm(e);return n===t||!Om(n)||Vm(n)?!1:Hm(n).position===`fixed`||uh(n,t)}function dh(e,t){let n=t.get(e);if(n)return n;let r=Km(e,[],!1).filter(e=>Om(e)&&wm(e)!==`body`),i=null,a=Hm(e).position===`fixed`,o=a?Wm(e):e;for(;Om(o)&&!Vm(o);){let t=Hm(o),n=Rm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||jm(o)&&!n&&uh(e,o))?r=r.filter(e=>e!==o):i=t,o=Wm(o)}return t.set(e,r),r}function fh(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Nm(t)?[]:dh(t,this._c):[].concat(n),r],o=lh(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=lh(t,a[e],i);s=Ip(n.top,s),c=Fp(n.right,c),l=Fp(n.bottom,l),u=Ip(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ph(e){let{width:t,height:n}=Jm(e);return{width:t,height:n}}function mh(e,t,n){let r=km(t),i=Em(t),a=n===`fixed`,o=eh(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=zp(0);function l(){c.x=th(i)}if(r||!r&&!a)if((wm(t)!==`body`||jm(i))&&(s=Um(t)),r){let e=eh(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?nh(i,s):zp(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function hh(e){return Hm(e).position===`static`}function gh(e,t){if(!km(e)||Hm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Em(e)===n&&(n=n.ownerDocument.body),n}function _h(e,t){let n=Tm(e);if(Nm(e))return n;if(!km(e)){let t=Wm(e);for(;t&&!Vm(t);){if(Om(t)&&!hh(t))return t;t=Wm(t)}return n}let r=gh(e,t);for(;r&&Mm(r)&&hh(r);)r=gh(r,t);return r&&Vm(r)&&hh(r)&&!Rm(r)?n:r||zm(e)||n}var vh=async function(e){let t=this.getOffsetParent||_h,n=this.getDimensions,r=await n(e.floating);return{reference:mh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yh(e){return Hm(e).direction===`rtl`}var bh={convertOffsetParentRelativeRectToViewportRelativeRect:rh,getDocumentElement:Em,getClippingRect:fh,getOffsetParent:_h,getElementRects:vh,getClientRects:ih,getDimensions:ph,getScale:Xm,isElement:Om,isRTL:yh};function xh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sh(e,t){let n=null,r,i=Em(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Rp(d),h=Rp(i.clientWidth-(u+f)),g=Rp(i.clientHeight-(d+p)),_=Rp(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ip(0,Fp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!xh(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ch(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ym(e),u=i||a?[...l?Km(l):[],...t?Km(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Sh(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?eh(e):null;c&&g();function g(){let t=eh(e);h&&!xh(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wh=ym,Th=bm,Eh=pm,Dh=Sm,Oh=gm,kh=fm,Ah=xm,jh=(e,t,n)=>{let r=new Map,i={platform:bh,...n},a={...i.platform,_c:r};return dm(e,t,{...i,platform:a})},Mh=typeof document<`u`?v.useLayoutEffect:function(){};function Nh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Nh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ph(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fh(e,t){let n=Ph(e);return Math.round(t*n)/n}function Ih(e){let t=v.useRef(e);return Mh(()=>{t.current=e}),t}function Lh(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Nh(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Ih(c),O=Ih(i),k=Ih(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jh(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Nh(T.current,t)&&(T.current=t,Fl.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Mh(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Mh(()=>(j.current=!0,()=>{j.current=!1}),[]),Mh(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Fh(N.floating,u.x),r=Fh(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ph(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Rh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kh({element:r.current,padding:i}).fn(n):r?kh({element:r,padding:i}).fn(n):{}}}},zh=(e,t)=>{let n=wh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bh=(e,t)=>{let n=Th(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vh=(e,t)=>({fn:Ah(e).fn,options:[e,t]}),Hh=(e,t)=>{let n=Eh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uh=(e,t)=>{let n=Dh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wh=(e,t)=>{let n=Oh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gh=(e,t)=>{let n=Rh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kh=`Arrow`,qh=v.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,W.jsx)(Il.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,W.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qh.displayName=Kh;var Jh=qh,Yh=`Popper`,[Xh,Zh]=Vl(Yh),[Qh,$h]=Xh(Yh),eg=e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,W.jsx)(Qh,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};eg.displayName=Yh;var tg=`PopperAnchor`,ng=v.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$h(tg,n),o=v.useRef(null),s=a.onAnchorChange,c=yl(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&fg(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,W.jsx)(Il.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});ng.displayName=tg;var rg=`PopperContent`,[ig,ag]=Xh(rg),og=v.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=$h(rg,n),[_,y]=v.useState(null),b=yl(t,y),[x,S]=v.useState(null),C=_p(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(ug),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Lh({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Ch(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[zh({mainAxis:i+T,alignmentAxis:o}),c&&Bh({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Vh():void 0,...A}),c&&Hh({...A}),Uh({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Gh({element:x,padding:s}),dg({arrowWidth:w,arrowHeight:T}),f&&Wh({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;Wl(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,R]=fg(N),ee=su(m);Wl(()=>{P&&ee?.()},[P,ee]);let te=F.arrow?.x,z=F.arrow?.y,B=F.arrow?.centerOffset!==0,[V,ne]=v.useState();return Wl(()=>{_&&ne(window.getComputedStyle(_).zIndex)},[_]),(0,W.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:V,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,W.jsx)(ig,{scope:n,placedSide:L,placedAlign:R,onArrowChange:S,arrowX:te,arrowY:z,shouldHideArrow:B,children:(0,W.jsx)(Il.div,{"data-side":L,"data-align":R,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});og.displayName=rg;var sg=`PopperArrow`,cg={top:`bottom`,right:`left`,bottom:`top`,left:`right`},lg=v.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=ag(sg,n),a=cg[i.placedSide];return(0,W.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,W.jsx)(Jh,{...r,ref:t,style:{...r.style,display:`block`}})})});lg.displayName=sg;function ug(e){return e!==null}var dg=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=fg(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function fg(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var pg=eg,mg=ng,hg=og,gg=lg,_g=!1;function vg(){let[e,t]=v.useState(_g);return v.useEffect(()=>{_g||(_g=!0,t(!0))},[]),e}var yg=v.useSyncExternalStore;function bg(){return()=>{}}function xg(){return yg(bg,()=>!0,()=>!1)}var Sg=typeof yg==`function`?xg:vg,Cg=`rovingFocusGroup.onEntryFocus`,wg={bubbles:!1,cancelable:!0},Tg=`RovingFocusGroup`,[Eg,Dg,Og]=Ul(Tg),[kg,Ag]=Vl(Tg,[Og]),[eee,tee]=kg(Tg),jg=v.forwardRef((e,t)=>(0,W.jsx)(Eg.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(Eg.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(nee,{...e,ref:t})})}));jg.displayName=Tg;var nee=v.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),p=yl(t,f),m=ou(a),[h,g]=Kl({prop:o,defaultProp:s??null,onChange:c,caller:Tg}),[_,y]=v.useState(!1),b=su(l),x=Dg(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Cg,b),()=>e.removeEventListener(Cg,b)},[b]),(0,W.jsx)(eee,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,W.jsx)(Il.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:G(e.onMouseDown,()=>{S.current=!0}),onFocus:G(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Cg,wg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Pg([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:G(e.onBlur,()=>y(!1))})})}),Mg=`RovingFocusGroupItem`,Ng=v.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=iu(),l=a||c,u=tee(Mg,n),d=u.currentTabStopId===l,f=Dg(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Sg();return Wl(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,W.jsx)(Eg.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,W.jsx)(Il.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:G(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=aee(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?oee(n,r+1):n.slice(r+1)}setTimeout(()=>Pg(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ng.displayName=Mg;var ree={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function iee(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function aee(e,t,n){let r=iee(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ree[r]}function Pg(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function oee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var see=jg,Fg=Ng,Ig=`Label`,Lg=v.forwardRef((e,t)=>(0,W.jsx)(Il.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Lg.displayName=Ig;var Rg=Lg;function zg(e,[t,n]){return Math.min(n,Math.max(t,e))}var Bg=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Vg=[` `,`Enter`],Hg=`Select`,[Ug,Wg,Gg]=Ul(Hg),[Kg,cee]=Vl(Hg,[Gg,Zh]),qg=Zh(),[Jg,Yg]=Kg(Hg),[Xg,Zg]=Kg(Hg),Qg=`SelectProvider`;function $g(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=qg(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=ou(l),[T,E]=Kl({prop:r,defaultProp:i??!1,onChange:a,caller:Hg}),[D,O]=Kl({prop:o,defaultProp:s,onChange:c,caller:Hg}),k=v.useRef(null),A=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=()=>O(A.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=_?!!m||!!_.closest(`form`):!0,[M,N]=v.useState(new Set),P=iu(),F=Array.from(M).map(e=>e.props.value).join(`;`),I=v.useCallback(e=>{N(t=>new Set(t).add(e))},[]),L=v.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),R={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:P,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:F,isFormControl:j};return(0,W.jsx)(pg,{...g,children:(0,W.jsx)(Jg,{scope:t,...R,children:(0,W.jsx)(Ug.Provider,{scope:t,children:(0,W.jsx)(Xg,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:$_(h)?h(R):n})})})})}$g.displayName=Qg;var e_=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,W.jsx)($g,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[n,e?(0,W.jsx)(Q_,{__scopeSelect:t}):null]})})};e_.displayName=Hg;var t_=`SelectTrigger`,n_=v.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=qg(n),o=Yg(t_,n),s=o.disabled||r,c=yl(t,o.onTriggerChange),l=Wg(n),u=v.useRef(`touch`),[d,f,p]=tv(e=>{let t=l().filter(e=>!e.disabled),n=nv(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,W.jsx)(mg,{asChild:!0,...a,children:(0,W.jsx)(Il.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":ev(o.value)?``:void 0,...i,ref:c,onClick:G(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:G(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:G(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Bg.includes(e.key)&&(m(),e.preventDefault())})})})});n_.displayName=t_;var r_=`SelectValue`,i_=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Yg(r_,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=yl(t,c.onValueNodeChange);Wl(()=>{l(u)},[l,u]);let f=ev(c.value);return(0,W.jsx)(Il.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,W.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});i_.displayName=r_;var a_=`SelectIcon`,o_=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,W.jsx)(Il.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});o_.displayName=a_;var s_=`SelectPortal`,[c_,l_]=Kg(s_,{forceMount:void 0}),u_=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,W.jsx)(c_,{scope:e.__scopeSelect,forceMount:n,children:(0,W.jsx)(Bu,{asChild:!0,...r})})};u_.displayName=s_;var d_=`SelectContent`,f_=v.forwardRef((e,t)=>{let n=l_(d_,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Yg(d_,e.__scopeSelect),[o,s]=v.useState();return Wl(()=>{s(new DocumentFragment)},[]),(0,W.jsx)(Xl,{present:r||a.open,children:({present:e})=>e?(0,W.jsx)(y_,{...i,ref:t}):(0,W.jsx)(p_,{...i,fragment:o})})});f_.displayName=d_;var p_=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?Fl.createPortal((0,W.jsx)(h_,{scope:n,children:(0,W.jsx)(Ug.Slot,{scope:n,children:(0,W.jsx)(`div`,{ref:t,children:r})})}),i):null});p_.displayName=`SelectContentFragment`;var m_=10,[h_,g_]=Kg(d_),__=`SelectContentImpl`,v_=bl(`SelectContent.RemoveScroll`),y_=v.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Yg(d_,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=yl(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=Wg(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return lf(b)},[b]),Uu();let N=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=v.useCallback(()=>N([T,b]),[N,T,b]);v.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,F,I]),v.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,R]=tv(e=>{let t=k().filter(e=>!e.disabled),n=nv(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ee=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),te=v.useCallback(()=>b?.focus(),[b]),z=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),B=r===`popper`?C_:x_,V=B===C_?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,W.jsx)(h_,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ee,selectedItem:T,onItemLeave:te,itemTextRefCallback:z,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:L,children:(0,W.jsx)($d,{as:v_,allowPinchZoom:!0,children:(0,W.jsx)(Du,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:G(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,W.jsx)(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,W.jsx)(B,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...V,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:G(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&R(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});y_.displayName=__;var b_=`SelectItemAlignedPosition`,x_=v.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Yg(d_,n),o=g_(d_,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=yl(t,u),f=Wg(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-m_,d=zg(a,[m_,Math.max(m_,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-m_,d=zg(a,[m_,Math.max(m_,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-m_*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-m_,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${m_}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Wl(()=>b(),[b]);let[x,S]=v.useState();return Wl(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,W.jsx)(w_,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,W.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,W.jsx)(Il.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});x_.displayName=b_;var S_=`SelectPopperPosition`,C_=v.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=m_,...a}=e,o=qg(n);return(0,W.jsx)(hg,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});C_.displayName=S_;var[w_,T_]=Kg(d_,{}),E_=`SelectViewport`,D_=v.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=g_(E_,n),o=T_(E_,n),s=yl(t,a.onViewportChange),c=v.useRef(0);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,W.jsx)(Ug.Slot,{scope:n,children:(0,W.jsx)(Il.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:G(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-m_*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});D_.displayName=E_;var O_=`SelectGroup`,[k_,A_]=Kg(O_),j_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=iu();return(0,W.jsx)(k_,{scope:n,id:i,children:(0,W.jsx)(Il.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});j_.displayName=O_;var M_=`SelectLabel`,N_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=A_(M_,n);return(0,W.jsx)(Il.div,{id:i.id,...r,ref:t})});N_.displayName=M_;var P_=`SelectItem`,[F_,I_]=Kg(P_),L_=v.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Yg(P_,n),c=g_(P_,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=yl(t,su(e=>c.itemRefCallback?.(e,r,i))),h=iu(),g=v.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,W.jsx)(F_,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,W.jsx)(Ug.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,W.jsx)(Il.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:G(o.onFocus,()=>p(!0)),onBlur:G(o.onBlur,()=>p(!1)),onClick:G(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:G(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:G(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:G(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:G(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Vg.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});L_.displayName=P_;var R_=`SelectItemText`,z_=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Yg(R_,n),s=g_(R_,n),c=I_(R_,n),l=Zg(R_,n),[u,d]=v.useState(null),f=su(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=yl(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,W.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Wl(()=>(g(h),()=>_(h)),[g,_,h]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Il.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!ev(o.value)?Fl.createPortal(a.children,o.valueNode):null]})});z_.displayName=R_;var B_=`SelectItemIndicator`,V_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return I_(B_,n).isSelected?(0,W.jsx)(Il.span,{"aria-hidden":!0,...r,ref:t}):null});V_.displayName=B_;var H_=`SelectScrollUpButton`,U_=v.forwardRef((e,t)=>{let n=g_(H_,e.__scopeSelect),r=T_(H_,e.__scopeSelect),[i,a]=v.useState(!1),o=yl(t,r.onScrollButtonChange);return Wl(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(K_,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});U_.displayName=H_;var W_=`SelectScrollDownButton`,G_=v.forwardRef((e,t)=>{let n=g_(W_,e.__scopeSelect),r=T_(W_,e.__scopeSelect),[i,a]=v.useState(!1),o=yl(t,r.onScrollButtonChange);return Wl(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(K_,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});G_.displayName=W_;var K_=v.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=g_(`SelectScrollButton`,n),o=v.useRef(null),s=Wg(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Wl(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,W.jsx)(Il.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:G(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:G(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:G(i.onPointerLeave,()=>{c()})})}),q_=`SelectSeparator`,J_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,W.jsx)(Il.div,{"aria-hidden":!0,...r,ref:t})});J_.displayName=q_;var Y_=`SelectArrow`,X_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=qg(n);return g_(Y_,n).position===`popper`?(0,W.jsx)(gg,{...i,...r,ref:t}):null});X_.displayName=Y_;var Z_=`SelectBubbleInput`,Q_=v.forwardRef(({__scopeSelect:e,...t},n)=>{let r=Yg(Z_,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=yl(n,p),h=i??``,g=gp(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,W.jsxs)(Il.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Rl,...t.style},ref:m,defaultValue:h,children:[ev(i)&&!_?(0,W.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});Q_.displayName=Z_;function $_(e){return typeof e==`function`}function ev(e){return e===``||e===void 0}function tv(e){let t=su(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function nv(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=rv(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function rv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var iv=`Separator`,av=`horizontal`,ov=[`horizontal`,`vertical`],sv=v.forwardRef((e,t)=>{let{decorative:n,orientation:r=av,...i}=e,a=cv(r)?r:av,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,W.jsx)(Il.div,{"data-orientation":a,...o,...i,ref:t})});sv.displayName=iv;function cv(e){return ov.includes(e)}var lv=sv,uv=`Switch`,[dv,lee]=Vl(uv),[fv,pv]=dv(uv);function mv(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Kl({prop:n,defaultProp:i??!1,onChange:c,caller:uv}),[m,h]=v.useState(null),[g,_]=v.useState(null),y={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v.useRef(!1),required:l,defaultChecked:i,isFormControl:m?!!o||!!m.closest(`form`):!0,bubbleInput:g,setBubbleInput:_};return(0,W.jsx)(fv,{scope:t,...y,children:Sv(d)?d(y):r})}var hv=`SwitchTrigger`,gv=v.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=pv(hv,e),h=yl(r,u),g=v.useRef(c);return v.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,W.jsx)(Il.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Cv(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:G(t,e=>{d(e=>!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});gv.displayName=hv;var _v=v.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(mv,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(gv,{...d,ref:t,__scopeSwitch:n}),e&&(0,W.jsx)(xv,{__scopeSwitch:n})]})})});_v.displayName=uv;var vv=`SwitchThumb`,yv=v.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=pv(vv,n);return(0,W.jsx)(Il.span,{"data-state":Cv(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});yv.displayName=vv;var bv=`SwitchBubbleInput`,xv=v.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=pv(bv,e),m=yl(n,p),h=gp(a),g=_p(r);v.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[f,h,a,i]);let _=v.useRef(a);return(0,W.jsx)(Il.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});xv.displayName=bv;function Sv(e){return typeof e==`function`}function Cv(e){return e?`checked`:`unchecked`}var wv=`Tabs`,[Tv,uee]=Vl(wv,[Ag]),Ev=Ag(),[Dv,Ov]=Tv(wv),kv=v.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ou(s),[d,f]=Kl({prop:r,onChange:i,defaultProp:a??``,caller:wv});return(0,W.jsx)(Dv,{scope:n,baseId:iu(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,W.jsx)(Il.div,{dir:u,"data-orientation":o,...l,ref:t})})});kv.displayName=wv;var Av=`TabsList`,jv=v.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Ov(Av,n),o=Ev(n);return(0,W.jsx)(see,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,W.jsx)(Il.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});jv.displayName=Av;var Mv=`TabsTrigger`,Nv=v.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ov(Mv,n),s=Ev(n),c=Iv(o.baseId,r),l=Lv(o.baseId,r),u=r===o.value;return(0,W.jsx)(Fg,{asChild:!0,...s,focusable:!i,active:u,children:(0,W.jsx)(Il.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:G(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:G(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:G(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Nv.displayName=Mv;var Pv=`TabsContent`,Fv=v.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Ov(Pv,n),c=Iv(s.baseId,r),l=Lv(s.baseId,r),u=r===s.value,d=v.useRef(u);return v.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,W.jsx)(Xl,{present:i||u,children:({present:n})=>(0,W.jsx)(Il.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});Fv.displayName=Pv;function Iv(e,t){return`${e}-trigger-${t}`}function Lv(e,t){return`${e}-content-${t}`}var dee=kv,Rv=jv,zv=Nv,Bv=Fv;function Vv(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Vv(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Hv(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Vv(e))&&(r&&(r+=` `),r+=t);return r}var Uv=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Wv=(e,t)=>({classGroupId:e,validator:t}),Gv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kv=`-`,qv=[],Jv=`arbitrary..`,Yv=e=>{let t=Qv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Zv(e);let n=e.split(Kv);return Xv(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Uv(i,t):t:i||qv}return n[e]||qv}}},Xv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Xv(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Kv):e.slice(t).join(Kv),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Zv=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Jv+r:void 0})(),Qv=e=>{let{theme:t,classGroups:n}=e;return $v(n,t)},$v=(e,t)=>{let n=Gv();for(let r in e){let i=e[r];ey(i,n,r,t)}return n},ey=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ty(i,t,n,r)}},ty=(e,t,n,r)=>{if(typeof e==`string`){ny(e,t,n);return}if(typeof e==`function`){ry(e,t,n,r);return}iy(e,t,n,r)},ny=(e,t,n)=>{let r=e===``?t:ay(t,e);r.classGroupId=n},ry=(e,t,n,r)=>{if(oy(e)){ey(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Wv(n,e))},iy=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ey(o,ay(t,a),n,r)}},ay=(e,t)=>{let n=e,r=t.split(Kv),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Gv(),n.nextPart.set(t,i)),n=i}return n},oy=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,sy=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},cy=`!`,ly=`:`,uy=[],dy=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),fy=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ly){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(cy)?(c=s.slice(0,-1),l=!0):s.startsWith(cy)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return dy(t,l,c,u)};if(t){let e=t+ly,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):dy(uy,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},py=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},my=e=>({cache:sy(e.cacheSize),parseClassName:fy(e),sortModifiers:py(e),postfixLookupClassGroupIds:hy(e),...Yv(e)}),hy=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},gy=/\s+/,_y=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(gy),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+cy:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},vy=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=yy(n))&&(i&&(i+=` `),i+=r);return i},yy=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=yy(e[r]))&&(n&&(n+=` `),n+=t);return n},by=(e,...t)=>{let n,r,i,a,o=o=>(n=my(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=_y(e,n);return i(e,a),a};return a=o,(...e)=>a(vy(...e))},xy=[],Sy=e=>{let t=t=>t[e]||xy;return t.isThemeGetter=!0,t},Cy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ty=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ey=e=>Ty.test(e),Dy=e=>!!e&&!Number.isNaN(Number(e)),Oy=e=>!!e&&Number.isInteger(Number(e)),ky=e=>e.endsWith(`%`)&&Dy(e.slice(0,-1)),Ay=e=>fee.test(e),jy=()=>!0,_ee=e=>pee.test(e)&&!mee.test(e),My=()=>!1,vee=e=>hee.test(e),yee=e=>gee.test(e),bee=e=>!K(e)&&!q(e),xee=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),See=e=>Ky(e,Xy,My),K=e=>Cy.test(e),Ny=e=>Ky(e,Zy,_ee),Py=e=>Ky(e,Qy,Dy),Cee=e=>Ky(e,eb,jy),Fy=e=>Ky(e,$y,My),Iy=e=>Ky(e,Jy,My),Ly=e=>Ky(e,Yy,yee),Ry=e=>Ky(e,tb,vee),q=e=>wy.test(e),zy=e=>qy(e,Zy),By=e=>qy(e,$y),Vy=e=>qy(e,Jy),Hy=e=>qy(e,Xy),Uy=e=>qy(e,Yy),Wy=e=>qy(e,tb,!0),Gy=e=>qy(e,eb,!0),Ky=(e,t,n)=>{let r=Cy.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qy=(e,t,n=!1)=>{let r=wy.exec(e);return r?r[1]?t(r[1]):n:!1},Jy=e=>e===`position`||e===`percentage`,Yy=e=>e===`image`||e===`url`,Xy=e=>e===`length`||e===`size`||e===`bg-size`,Zy=e=>e===`length`,Qy=e=>e===`number`,$y=e=>e===`family-name`,eb=e=>e===`number`||e===`weight`,tb=e=>e===`shadow`,nb=by(()=>{let e=Sy(`color`),t=Sy(`font`),n=Sy(`text`),r=Sy(`font-weight`),i=Sy(`tracking`),a=Sy(`leading`),o=Sy(`breakpoint`),s=Sy(`container`),c=Sy(`spacing`),l=Sy(`radius`),u=Sy(`shadow`),d=Sy(`inset-shadow`),f=Sy(`text-shadow`),p=Sy(`drop-shadow`),m=Sy(`blur`),h=Sy(`perspective`),g=Sy(`aspect`),_=Sy(`ease`),v=Sy(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),q,K],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[q,K,c],T=()=>[Ey,`full`,`auto`,...w()],E=()=>[Oy,`none`,`subgrid`,q,K],D=()=>[`auto`,{span:[`full`,Oy,q,K]},Oy,q,K],O=()=>[Oy,`auto`,q,K],k=()=>[`auto`,`min`,`max`,`fr`,q,K],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Ey,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Ey,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Ey,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,q,K],L=()=>[...b(),Vy,Iy,{position:[q,K]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,Hy,See,{size:[q,K]}],te=()=>[ky,zy,Ny],z=()=>[``,`none`,`full`,l,q,K],B=()=>[``,Dy,zy,Ny],V=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],re=()=>[Dy,ky,Vy,Iy],ie=()=>[``,`none`,m,q,K],ae=()=>[`none`,Dy,q,K],oe=()=>[`none`,Dy,q,K],se=()=>[Dy,q,K],H=()=>[Ey,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ay],breakpoint:[Ay],color:[jy],container:[Ay],"drop-shadow":[Ay],ease:[`in`,`out`,`in-out`],font:[bee],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ay],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ay],shadow:[Ay],spacing:[`px`,Dy],text:[Ay],"text-shadow":[Ay],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ey,K,q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,q,K]}],"container-named":[xee],columns:[{columns:[Dy,K,q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Oy,`auto`,q,K]}],basis:[{basis:[Ey,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Dy,Ey,`auto`,`initial`,`none`,K]}],grow:[{grow:[``,Dy,q,K]}],shrink:[{shrink:[``,Dy,q,K]}],order:[{order:[Oy,`first`,`last`,`none`,q,K]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,zy,Ny]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gy,Cee]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ky,K]}],"font-family":[{font:[By,Fy,t]}],"font-features":[{"font-features":[K]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,q,K]}],"line-clamp":[{"line-clamp":[Dy,`none`,q,Py]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,q,K]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,q,K]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[Dy,`from-font`,`auto`,q,Ny]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Dy,`auto`,q,K]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Oy,q,K]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q,K]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q,K]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Oy,q,K],radial:[``,q,K],conic:[Oy,q,K]},Uy,Ly]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Dy,q,K]}],"outline-w":[{outline:[``,Dy,zy,Ny]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Wy,Ry]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Wy,Ry]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Dy,Ny]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Wy,Ry]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Dy,q,K]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Dy]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[q,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Dy]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,q,K]}],filter:[{filter:[``,`none`,q,K]}],blur:[{blur:ie()}],brightness:[{brightness:[Dy,q,K]}],contrast:[{contrast:[Dy,q,K]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Wy,Ry]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Dy,q,K]}],"hue-rotate":[{"hue-rotate":[Dy,q,K]}],invert:[{invert:[``,Dy,q,K]}],saturate:[{saturate:[Dy,q,K]}],sepia:[{sepia:[``,Dy,q,K]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,q,K]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Dy,q,K]}],"backdrop-contrast":[{"backdrop-contrast":[Dy,q,K]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Dy,q,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Dy,q,K]}],"backdrop-invert":[{"backdrop-invert":[``,Dy,q,K]}],"backdrop-opacity":[{"backdrop-opacity":[Dy,q,K]}],"backdrop-saturate":[{"backdrop-saturate":[Dy,q,K]}],"backdrop-sepia":[{"backdrop-sepia":[``,Dy,q,K]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,q,K]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Dy,`initial`,q,K]}],ease:[{ease:[`linear`,`initial`,_,q,K]}],delay:[{delay:[Dy,q,K]}],animate:[{animate:[`none`,v,q,K]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,q,K]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":[`scale-3d`],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[q,K,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[Oy,q,K]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q,K]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q,K]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Dy,zy,Ny,Py]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function J(...e){return nb(Hv(e))}var rb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ib=Hv,ab=(e,t)=>n=>{if(t?.variants==null)return ib(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=rb(t)||rb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ib(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ob=ab(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function sb({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,W.jsx)(r?xl:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:J(ob({variant:t,size:n,className:e})),...i})}function cb(e){return(0,W.jsx)(sp,{"data-slot":`alert-dialog`,...e})}function lb(e){return(0,W.jsx)(cp,{"data-slot":`alert-dialog-trigger`,...e})}function wee(e){return(0,W.jsx)(lp,{"data-slot":`alert-dialog-portal`,...e})}function Tee({className:e,...t}){return(0,W.jsx)(up,{"data-slot":`alert-dialog-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t})}function ub({className:e,...t}){return(0,W.jsxs)(wee,{children:[(0,W.jsx)(Tee,{}),(0,W.jsx)(dp,{"data-slot":`alert-dialog-content`,className:J(`bg-background fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border 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 sm:max-w-lg`,e),...t})]})}function db({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function fb({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function pb({className:e,...t}){return(0,W.jsx)(mp,{"data-slot":`alert-dialog-title`,className:J(`text-lg font-semibold`,e),...t})}function mb({className:e,...t}){return(0,W.jsx)(hp,{"data-slot":`alert-dialog-description`,className:J(`text-muted-foreground text-sm`,e),...t})}function hb({className:e,...t}){return(0,W.jsx)(fp,{className:J(ob(),e),...t})}function gb({className:e,...t}){return(0,W.jsx)(pp,{className:J(ob({variant:`outline`}),e),...t})}function _b({className:e,...t}){return(0,W.jsx)(Ep,{"data-slot":`checkbox`,className:J(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,W.jsx)(Op,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,W.jsx)(Nc,{className:`size-3.5`})})})}function vb({className:e,...t}){return(0,W.jsx)(Rg,{"data-slot":`label`,className:J(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function yb(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var bb=e=>{switch(e){case`success`:return Cb;case`info`:return Tb;case`warning`:return wb;case`error`:return Eb;default:return null}},xb=Array(12).fill(0),Sb=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},xb.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Cb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),wb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Tb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Eb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Db=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ob=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},kb=1,Ab=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:kb++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Mb(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||kb++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},jb=(e,t)=>{let n=t?.id||kb++;return Ab.addToast({title:e,...t,id:n}),n},Mb=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Y=Object.assign(jb,{success:Ab.success,info:Ab.info,warning:Ab.warning,error:Ab.error,custom:Ab.custom,message:Ab.message,promise:Ab.promise,dismiss:Ab.dismiss,loading:Ab.loading},{getHistory:()=>Ab.toasts,getToasts:()=>Ab.getActiveToasts()});yb(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Nb(e){return e.label!==void 0}var Pb=3,Fb=`24px`,Ib=`16px`,Lb=4e3,Rb=356,zb=14,Bb=45,Vb=200;function Hb(...e){return e.filter(Boolean).join(` `)}function Ub(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Wb=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=v.useState(null),[k,A]=v.useState(null),[j,M]=v.useState(!1),[N,P]=v.useState(!1),[F,I]=v.useState(!1),[L,R]=v.useState(!1),[ee,te]=v.useState(!1),[z,B]=v.useState(0),[V,ne]=v.useState(0),re=v.useRef(n.duration||b||Lb),ie=v.useRef(null),ae=v.useRef(null),oe=c===0,se=c+1<=o,H=n.type,ce=n.dismissible!==!1,le=n.className||``,ue=n.descriptionClassName||``,de=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),fe=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),pe=v.useMemo(()=>n.duration||b||Lb,[n.duration,b]),me=v.useRef(0),he=v.useRef(0),ge=v.useRef(0),_e=v.useRef(null),[ve,ye]=x.split(`-`),be=v.useMemo(()=>s.reduce((e,t,n)=>n>=de?e:e+t.height,0),[s,de]),xe=Ob(),Se=n.invert||t,Ce=H===`loading`;he.current=v.useMemo(()=>de*S+be,[de,be]),v.useEffect(()=>{re.current=pe},[pe]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!j)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let we=v.useCallback(()=>{P(!0),B(he.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Vb)},[n,d,a,he]);v.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||xe?(()=>{if(ge.current<me.current){let e=new Date().getTime()-me.current;re.current-=e}ge.current=new Date().getTime()})():re.current!==1/0&&(me.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),we()},re.current)),()=>clearTimeout(e)},[u,i,n,H,xe,we]),v.useEffect(()=>{n.delete&&(we(),n.onDismiss==null||n.onDismiss.call(n,n))},[we,n.delete]);function Te(){return T?.loading?v.createElement(`div`,{className:Hb(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},T.loading):v.createElement(Sb,{className:Hb(w?.loader,n?.classNames?.loader),visible:H===`loading`})}let Ee=n.icon||T?.[H]||bb(H);return v.createElement(`li`,{tabIndex:0,ref:ae,className:Hb(_,le,w?.toast,n?.classNames?.toast,w?.default,w?.[H],n?.classNames?.[H]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":N,"data-visible":se,"data-y-position":ve,"data-x-position":ye,"data-index":c,"data-front":oe,"data-swiping":F,"data-dismissible":ce,"data-type":H,"data-invert":Se,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?z:he.current}px`,"--initial-height":C?`auto`:`${V}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),_e.current=null},onPointerDown:e=>{e.button!==2&&(Ce||!ce||(ie.current=new Date,B(he.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),_e.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(L||!ce)return;_e.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Bb||a>.11){B(he.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),we(),R(!0);return}else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}te(!1),I(!1),O(null)},onPointerMove:t=>{var n,r;if(!_e.current||!ce||window.getSelection()?.toString().length>0)return;let i=t.clientY-_e.current.y,a=t.clientX-_e.current.x,o=e.swipeDirections??Ub(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&te(!0),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ae.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},fe&&!n.jsx&&H!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":Ce,"data-close-button":!0,onClick:Ce||!ce?()=>{}:()=>{we(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Hb(w?.closeButton,n?.classNames?.closeButton)},T?.close??Db):null,(H||n.icon||n.promise)&&n.icon!==null&&(T?.[H]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:Hb(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Te():null,n.type===`loading`?null:Ee):null,v.createElement(`div`,{"data-content":``,className:Hb(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:Hb(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:Hb(y,ue,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&Nb(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Nb(n.cancel)&&ce&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),we())},className:Hb(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&Nb(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Nb(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&we())},className:Hb(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Gb(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Kb(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ib:Fb;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Eee=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Pb,toastOptions:g,dir:_=Gb(),gap:y=zb,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=v.useState([]),w=v.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=v.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=v.useState([]),[O,k]=v.useState(!1),[A,j]=v.useState(!1),[M,N]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=v.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=v.useRef(null),L=v.useRef(!1),R=v.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Ab.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>Ab.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Fl.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),v.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{S.length<=1&&k(!1)},[S]),v.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),v.createElement(`section`,{ref:t,"aria-label":`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?v.createElement(`ol`,{key:t,dir:_===`auto`?Gb():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Rb}px`,"--gap":`${y}px`,...m,...Kb(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(Wb,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:y,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),qb=`mt-theme`;function Dee(){try{return localStorage.getItem(qb)===`light`?`light`:`dark`}catch{return`dark`}}function Jb(){let[e,t]=(0,v.useState)(Dee);return(0,v.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e===`dark`)},[e]),[e,(0,v.useCallback)(e=>{t(e);try{localStorage.setItem(qb,e)}catch{}},[])]}function Oee(){let[e,t]=Jb(),n=e===`dark`?`light`:`dark`;return(0,W.jsx)(sb,{variant:`ghost`,size:`icon-sm`,onClick:()=>t(n),title:`Switch to ${n} theme`,"aria-label":`Switch to ${n} theme`,children:e===`dark`?(0,W.jsx)(dl,{}):(0,W.jsx)(qc,{})})}function kee(e){let[t]=Jb();return(0,W.jsx)(Eee,{theme:t,className:`toaster group`,position:`bottom-right`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`,error:`group-[.toast]:text-destructive`,success:`group-[.toast]:text-foreground`}},...e})}function Yb({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,W.jsx)(`table`,{"data-slot":`table`,className:J(`w-full caption-bottom text-sm`,e),...t})})}function Xb({className:e,...t}){return(0,W.jsx)(`thead`,{"data-slot":`table-header`,className:J(`[&_tr]:border-b`,e),...t})}function Zb({className:e,...t}){return(0,W.jsx)(`tbody`,{"data-slot":`table-body`,className:J(`[&_tr:last-child]:border-0`,e),...t})}function Qb({className:e,...t}){return(0,W.jsx)(`tr`,{"data-slot":`table-row`,className:J(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function $b({className:e,...t}){return(0,W.jsx)(`th`,{"data-slot":`table-head`,className:J(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function ex({className:e,...t}){return(0,W.jsx)(`td`,{"data-slot":`table-cell`,className:J(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function tx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card`,className:J(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function nx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-header`,className:J(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function rx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-title`,className:J(`leading-none font-semibold`,e),...t})}function ix({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-content`,className:J(`px-6`,e),...t})}function ax({title:e,extra:t,children:n,className:r}){return(0,W.jsxs)(tx,{className:J(`gap-0 py-5`,r),children:[e!=null&&(0,W.jsxs)(nx,{className:`flex flex-row items-center gap-3 px-5 pb-3`,children:[(0,W.jsx)(rx,{className:`text-base font-semibold`,children:e}),t!=null&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex-1`}),t]})]}),(0,W.jsx)(ix,{className:`px-5`,children:n})]})}function ox({k:e,v:t,sub:n,cls:r}){return(0,W.jsxs)(tx,{className:`gap-1 px-4 py-3`,children:[(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs tracking-wide uppercase`,children:e}),(0,W.jsxs)(`div`,{className:J(`text-2xl font-semibold tabular-nums`,r),children:[t,n!=null&&(0,W.jsxs)(`small`,{className:`text-muted-foreground ml-1 text-sm`,children:[` `,n]})]})]})}function sx({rows:e}){let t=Math.max(1,...e.map(e=>e.value));return(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_1fr_auto] items-center gap-3`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,title:e.label,children:e.label}),(0,W.jsx)(`div`,{className:`bg-muted h-2 overflow-hidden rounded-full`,children:(0,W.jsx)(`div`,{className:J(`h-full rounded-full`,!e.color&&`bg-brand`),style:{width:`${e.value/t*100}%`,background:e.color}})}),(0,W.jsx)(`span`,{className:`text-xs tabular-nums`,children:e.sub??String(e.value)})]},e.label))})}function cx({text:e,label:t=`Copy`,className:n,icon:r=!1,title:i}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>void(s.current&&clearTimeout(s.current)),[]),(0,W.jsxs)(sb,{type:`button`,variant:`outline`,size:r?`icon-sm`:`sm`,className:n,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>o(!1),1400)},()=>{})},title:i??`Copy to clipboard`,"aria-label":i??`Copy to clipboard`,children:[a?(0,W.jsx)(Nc,{className:`text-success`}):r?(0,W.jsx)(zc,{}):t,a&&(0,W.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:`Copied!`})]})}var lx=[50,100,200,500,1e3,2e3],ux=e=>e<1?`<1ms`:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`;function dx(e){let t=[`B`,`KiB`,`MiB`,`GiB`],n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n++;return`${r.toFixed(+!!n)} ${t[n]}`}var fx=e=>new Date(e).toLocaleTimeString(void 0,{hour12:!1}),px=e=>e.toLocaleString(),mx=e=>e==null?`?`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e),hx={cpu:`var(--chart-1)`,mem:`var(--chart-5)`,disk:`var(--chart-2)`,latency:`var(--chart-4)`},gx={READ:`var(--chart-3)`,WRITE:`var(--chart-1)`,WRITE_IDEMPOTENT:`var(--chart-2)`,DESTRUCTIVE:`var(--chart-4)`,DANGEROUS:`var(--destructive)`},_x={READ:`border-chart-3/40 text-chart-3`,WRITE:`border-chart-1/40 text-chart-1`,WRITE_IDEMPOTENT:`border-chart-2/40 text-chart-2`,DESTRUCTIVE:`border-chart-4/40 text-chart-4`,DANGEROUS:`border-destructive/40 text-destructive`},vx=[[`5m`,3e5],[`15m`,9e5],[`1h`,36e5],[`6h`,216e5],[`24h`,864e5]],yx=1e4,bx=ab(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function xx({className:e,variant:t,...n}){return(0,W.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:J(bx({variant:t}),e),...n})}function Sx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-description`,className:J(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Cx=ab(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function wx({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,W.jsx)(n?xl:`span`,{"data-slot":`badge`,"data-variant":t,className:J(Cx({variant:t}),e),...r})}function Tx({className:e,type:t,...n}){return(0,W.jsx)(`input`,{type:t,"data-slot":`input`,className:J(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function Ex({...e}){return(0,W.jsx)(e_,{"data-slot":`select`,...e})}function Dx({...e}){return(0,W.jsx)(i_,{"data-slot":`select-value`,...e})}function Ox({className:e,size:t=`default`,children:n,...r}){return(0,W.jsxs)(n_,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,W.jsx)(o_,{asChild:!0,children:(0,W.jsx)(Pc,{className:`size-4 opacity-50`})})]})}function kx({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,W.jsx)(u_,{children:(0,W.jsxs)(f_,{"data-slot":`select-content`,className:J(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`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`,e),position:n,align:r,...i,children:[(0,W.jsx)(jx,{}),(0,W.jsx)(D_,{className:J(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,W.jsx)(Mx,{})]})})}function Ax({className:e,children:t,...n}){return(0,W.jsxs)(L_,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,W.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,W.jsx)(V_,{children:(0,W.jsx)(Nc,{className:`size-4`})})}),(0,W.jsx)(z_,{children:t})]})}function jx({className:e,...t}){return(0,W.jsx)(U_,{"data-slot":`select-scroll-up-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,W.jsx)(Ic,{className:`size-4`})})}function Mx({className:e,...t}){return(0,W.jsx)(G_,{"data-slot":`select-scroll-down-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,W.jsx)(Pc,{className:`size-4`})})}var Nx={default:`default`,secondary:`secondary`,error:`destructive`,success:`ghost`,warning:`ghost`,accent:`ghost`},Px={default:``,secondary:``,error:``,success:`bg-success text-white hover:bg-success/90`,warning:`bg-warning text-white hover:bg-warning/90`,accent:`bg-brand text-brand-foreground hover:bg-brand/90`},Fx={default:`border bg-transparent text-foreground hover:bg-accent`,secondary:`border bg-transparent text-muted-foreground hover:bg-accent`,error:`border border-destructive/40 bg-transparent text-destructive hover:bg-destructive/10`,success:`border border-success/40 bg-transparent text-success hover:bg-success/10`,warning:`border border-warning/40 bg-transparent text-warning hover:bg-warning/10`,accent:`border border-brand/40 bg-transparent text-brand hover:bg-brand/10`};function X({type:e=`default`,size:t=`md`,ghost:n=!1,loading:r=!1,icon:i,className:a,children:o,disabled:s,...c}){return(0,W.jsxs)(sb,{type:`button`,variant:n?`ghost`:Nx[e],size:t===`sm`?`sm`:`default`,className:J(n?Fx[e]:Px[e],a),disabled:s||r,...c,children:[r?(0,W.jsx)(Ux,{small:!0}):i,o!=null&&(0,W.jsx)(`span`,{children:o})]})}var Ix={default:``,secondary:`text-muted-foreground`,success:`border-success/40 text-success`,warning:`border-warning/40 text-warning`,error:`border-destructive/40 text-destructive`,accent:`border-brand/40 text-brand`};function Lx({type:e=`default`,label:t,children:n,className:r}){let i=t===!1?null:t??e;return(0,W.jsx)(xx,{role:`note`,className:J(Ix[e],r),children:(0,W.jsxs)(Sx,{className:`text-current`,children:[i!=null&&(0,W.jsxs)(`b`,{className:`font-semibold`,children:[i,`:`]}),` `,n]})})}var Rx={default:`default`,secondary:`secondary`,error:`destructive`,success:`outline`,warning:`outline`,accent:`outline`},zx={default:``,secondary:``,error:``,success:`border-success/40 text-success`,warning:`border-warning/40 text-warning`,accent:`border-brand/40 text-brand`};function Bx({type:e=`default`,children:t,className:n}){return(0,W.jsx)(wx,{variant:Rx[e],className:J(`font-mono`,zx[e],n),children:t})}var Vx={default:`bg-muted-foreground`,secondary:`bg-muted-foreground/60`,success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,accent:`bg-brand`};function Hx({type:e=`default`,pulse:t=!1,color:n,className:r}){return(0,W.jsx)(`span`,{className:J(`inline-block size-2 shrink-0 rounded-full`,!n&&Vx[e],t&&`animate-pulse`,r),style:n?{background:n}:void 0})}function Ux({small:e=!1}){return(0,W.jsx)(Gc,{className:J(`animate-spin`,e?`size-3`:`size-4`),"aria-label":`loading`})}function Wx({className:e,...t}){return(0,W.jsx)(Tx,{className:J(`font-mono`,e),...t})}var Gx=`\0empty`,Kx=e=>e===``?Gx:e,qx=e=>e===Gx?``:e;function Jx({value:e,onValueChange:t,options:n,placeholder:r,className:i,disabled:a,size:o=`md`,"aria-label":s}){return(0,W.jsxs)(Ex,{value:Kx(e),onValueChange:e=>t(qx(e)),disabled:a,children:[(0,W.jsx)(Ox,{size:o===`sm`?`sm`:`default`,"aria-label":s,className:J(`font-mono`,i),children:(0,W.jsx)(Dx,{placeholder:r})}),(0,W.jsx)(kx,{children:n.map(e=>(0,W.jsx)(Ax,{value:Kx(e.value),className:`font-mono`,children:e.label},e.value))})]})}function Yx({children:e,className:t,hoverable:n=!1}){return(0,W.jsx)(tx,{className:J(`gap-0 py-0`,n&&`transition-colors hover:border-brand/40`,t),children:e})}function Xx(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)({show_sensitive:!1,verbose:!1,compact:!1,terse:!1}),C=(0,v.useRef)(null),w=(0,v.useCallback)(()=>{gc(`/api/backups`).then(e=>{t(e),p(t=>t||e.devices[0]||``)}).catch(()=>t({dir:``,devices:[],backups:[]}))},[]);(0,v.useEffect)(()=>w(),[w]);let T=(e,t)=>_c(e,t).catch(()=>({error:`request failed`})),E=async()=>{a(!0),r(`Capturing /export…`);let e=await _c(`/api/backups/create`,{device:f||void 0,label:y.trim()||void 0,show_sensitive:x.show_sensitive,verbose:x.verbose,compact:x.verbose?!1:x.compact,terse:x.terse}).catch(()=>({error:`request failed`}));a(!1),r(e.ok?`Created ${e.name} (${e.bytes} bytes)`:`Create failed: ${e.error}`),e.ok?(Y.success(`Backup created`),w()):Y.error(`Create failed: ${e.error}`)},D=e=>S(t=>({...t,[e]:!t[e]})),O=async e=>{let t=await e.text(),n=await T(`/api/backups/upload`,{name:e.name,content:t});r(n.ok?`Uploaded ${n.name}`:`Upload failed: ${n.error}`),n.ok?(Y.success(`Backup uploaded`),w()):Y.error(`Upload failed: ${n.error}`)},k=async e=>{s(null);let t=await T(`/api/backups/delete`,{name:e});r(t.ok?`Deleted ${e}`:`Delete failed: ${t.error}`),t.ok?(Y.success(`Backup deleted`),w()):Y.error(`Delete failed: ${t.error}`)},A=async()=>{if(!u)return;let{name:e,value:t}=u;if(d(null),!t||t===e)return;let n=await T(`/api/backups/rename`,{name:e,new_name:t});r(n.ok?`Renamed to ${n.name}`:`Rename failed: ${n.error}`),n.ok?(Y.success(`Backup renamed`),w()):Y.error(`Rename failed: ${n.error}`)},j=async e=>{if(!c)return;a(!0),r(e?`Restoring in Safe Mode…`:`Dry-run restore in Safe Mode…`);let t=await _c(`/api/backups/restore`,{name:c,device:f||void 0,confirm:e}).catch(()=>({ok:!1,message:`request failed`}));a(!1),r(t.ok?t.committed?`Restored ${c} → ${f}: ${t.message}`:`Dry-run OK (${t.applied} cmds, rolled back). Click “Restore (commit)” to apply for real.`:`Restore failed: ${t.message}`),t.ok?Y.success(t.committed?`Backup restored`:`Dry-run restore OK`):Y.error(`Restore failed: ${t.message}`),t.ok&&e&&l(null)},M=e=>{gc(`/api/backups/get?name=${encodeURIComponent(e)}`).then(h).catch(()=>{})},N=async()=>{if(g===null)return;let t=g.trim();if(!t||t===e?.dir){_(null);return}a(!0);let n=await _c(`/api/backups/dir`,{dir:t}).catch(()=>({error:`request failed`}));a(!1),_(null),n.ok?(r(n.persisted?`Backup path saved → ${n.dir}`:n.warning??`Path applied → ${n.dir}`),Y.success(`Backup directory updated`)):(r(`Path change failed: ${n.error}`),Y.error(`Path change failed: ${n.error}`)),n.ok&&w()};if(!e)return(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading backups…`});let P=e.devices.length===0?[{value:``,label:`no devices`}]:e.devices.map(e=>({value:e,label:e}));return(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(ax,{title:`Local backup vault`,className:`reveal`,extra:g===null?(0,W.jsxs)(`span`,{className:`inline-flex max-w-[min(60vw,520px)] items-center gap-2 text-muted-foreground text-[11px]`,children:[(0,W.jsx)(`span`,{className:`truncate`,title:e.dir,children:e.dir}),(0,W.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 whitespace-nowrap text-brand hover:underline`,title:`Change backup directory`,onClick:()=>_(e.dir),children:[(0,W.jsx)(Xc,{className:`size-3`}),` edit path`]})]}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`w-[min(48vw,380px)] text-xs`,value:g,autoFocus:!0,spellCheck:!1,placeholder:`~/.mikrotik-mcp/backups`,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&N(),e.key===`Escape`&&_(null)}}),(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>void N(),disabled:i,children:`Save path`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>_(null),children:`Cancel`})]}),children:[n&&(0,W.jsx)(`div`,{className:`mb-3 font-mono text-xs text-muted-foreground`,children:n}),(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Jx,{value:f,onValueChange:p,"aria-label":`Device`,options:P}),(0,W.jsx)(X,{type:`accent`,size:`sm`,icon:(0,W.jsx)(Qc,{}),onClick:()=>void E(),disabled:i||!f,children:`Create backup`}),(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(ml,{}),onClick:()=>C.current?.click(),children:`Upload .rsc`}),(0,W.jsx)(`input`,{ref:C,type:`file`,accept:`.rsc,text/plain`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&O(t),e.currentTarget.value=``}}),(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(nl,{}),onClick:w,children:`Refresh`})]}),(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(Wx,{className:`max-w-[200px] text-xs`,value:y,spellCheck:!1,placeholder:`label (optional), e.g. pre-upgrade`,onChange:e=>b(e.target.value)}),[[`show_sensitive`,`show-sensitive`,`Include secrets (keys/passwords)`],[`verbose`,`verbose`,`Include every parameter, even defaults`],[`compact`,`compact`,`Only non-default values (ignored if verbose)`],[`terse`,`terse`,`One machine-readable line per item`]].map(([e,t,n])=>{let r=e===`compact`&&x.verbose;return(0,W.jsxs)(`label`,{className:J(`inline-flex cursor-pointer items-center gap-1.5 rounded-full border px-2.5 py-1.5 font-mono text-[11px] select-none`,x[e]?`border-brand/55 bg-brand/10 text-foreground`:`border-border bg-muted/40 text-muted-foreground`,r&&`cursor-not-allowed opacity-45`),title:n,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`accent-brand`,checked:x[e],disabled:r,onChange:()=>D(e)}),t]},e)})]}),c&&(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2 rounded-md border border-warning/45 bg-warning/10 px-3 py-2.5 text-xs`,children:[(0,W.jsxs)(`strong`,{children:[`Restore `,c]}),` onto`,` `,(0,W.jsx)(Jx,{value:f,onValueChange:p,size:`sm`,"aria-label":`Restore target device`,options:e.devices.map(e=>({value:e,label:e}))}),` `,`via Safe Mode (auto-reverts on lock-out).`,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>void j(!1),disabled:i,children:`Dry-run`}),(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>void j(!0),disabled:i,children:`Restore (commit)`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>l(null),children:`Cancel`})]}),e.backups.length===0?(0,W.jsx)(`div`,{className:`p-3 text-muted-foreground text-[11px]`,children:"No backups yet. Click “Create backup” to capture this device’s config, or upload a `.rsc`."}):(0,W.jsx)(`div`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border`,children:(0,W.jsxs)(Yb,{className:`min-w-[980px] table-fixed`,children:[(0,W.jsx)(Xb,{className:`bg-card sticky top-0 z-10`,children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`name`}),(0,W.jsx)($b,{className:`w-[130px]`,children:`device`}),(0,W.jsx)($b,{className:`w-[90px] text-right`,children:`size`}),(0,W.jsx)($b,{className:`w-[170px]`,children:`captured`}),(0,W.jsx)($b,{className:`w-[380px]`,children:`actions`})]})}),(0,W.jsx)(Zb,{children:e.backups.map(e=>(0,W.jsxs)(Qb,{"data-state":m?.name===e.name?`selected`:void 0,children:[(0,W.jsx)(ex,{className:`truncate font-mono`,title:e.name,children:e.name}),(0,W.jsx)(ex,{className:`truncate`,children:e.device??`—`}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:dx(e.bytes)}),(0,W.jsx)(ex,{className:`tabular-nums whitespace-nowrap`,children:new Date(e.modified).toLocaleString(void 0,{hour12:!1})}),(0,W.jsx)(ex,{onClick:e=>e.stopPropagation(),children:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>M(e.name),children:`view`}),(0,W.jsx)(`a`,{className:`inline-flex items-center rounded-md border border-border px-2 py-1 text-xs hover:bg-accent`,href:hc(`/api/backups/raw?name=${encodeURIComponent(e.name)}`),download:e.name,title:`Download`,children:(0,W.jsx)(Vc,{className:`size-3.5`})}),u?.name===e.name?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Wx,{className:`inline-block w-[120px] text-xs`,value:u.value,autoFocus:!0,onChange:t=>d({name:e.name,value:t.target.value}),onKeyDown:e=>e.key===`Enter`&&void A()}),(0,W.jsx)(X,{type:`accent`,size:`sm`,icon:(0,W.jsx)(Nc,{}),onClick:()=>void A()}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,icon:(0,W.jsx)(gl,{}),onClick:()=>d(null)})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>d({name:e.name,value:e.name}),children:`rename`}),(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>l(e.name),children:`restore`})]}),o===e.name?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{type:`error`,size:`sm`,ghost:!0,icon:(0,W.jsx)(Nc,{}),onClick:()=>void k(e.name)}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,icon:(0,W.jsx)(gl,{}),onClick:()=>s(null)})]}):(0,W.jsx)(X,{type:`error`,size:`sm`,ghost:!0,icon:(0,W.jsx)(fl,{}),onClick:()=>s(e.name)})]})})]},e.name))})]})})]}),m&&(0,W.jsx)(ax,{title:`Backup · ${m.name}`,className:`reveal`,extra:(0,W.jsx)(X,{type:`secondary`,size:`sm`,icon:(0,W.jsx)(gl,{}),onClick:()=>h(null),children:`Close`}),children:(0,W.jsx)(`pre`,{className:`m-0 overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap`,style:{maxHeight:460},children:m.content||`(empty)`})})]})}function Zx({className:e,orientation:t=`horizontal`,...n}){return(0,W.jsx)(dee,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:J(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Qx=ab(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Aee({className:e,variant:t=`default`,...n}){return(0,W.jsx)(Rv,{"data-slot":`tabs-list`,"data-variant":t,className:J(Qx({variant:t}),e),...n})}function jee({className:e,...t}){return(0,W.jsx)(zv,{"data-slot":`tabs-trigger`,className:J(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function $x({className:e,...t}){return(0,W.jsx)(Bv,{"data-slot":`tabs-content`,className:J(`flex-1 outline-none`,e),...t})}var eS=`http://www.w3.org/2000/svg`,tS=864e5,nS=e=>new Date(e).toISOString().slice(0,10);function rS(){let e=new Date;return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}function Mee(e){return new Date(`${e}T00:00:00Z`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`})}function iS({endpoint:e,days:t=90}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0);(0,v.useEffect)(()=>{let t=!0;return a(!0),gc(e).then(e=>{t&&r(e)}).catch(()=>{t&&r(null)}).finally(()=>{t&&a(!1)}),()=>{t=!1}},[e]);let o=(0,v.useMemo)(()=>{let e=new Map((n?.series??[]).map(e=>[e.day,e])),r=rS(),i=[];for(let n=t-1;n>=0;n--){let t=nS(r-n*tS),a=e.get(t);i.push(a??{day:t,rx:0,tx:0})}return i},[n,t]);if(i)return(0,W.jsx)(`div`,{className:`px-1 py-4 text-[12.5px] text-muted-foreground`,children:`loading usage…`});if(!((n?.totalRx??0)+(n?.totalTx??0)>0))return(0,W.jsx)(`div`,{className:`px-1 py-4 text-[12.5px] text-muted-foreground`,children:`No usage recorded yet. The dashboard samples on a configurable interval (1 minute by default — see the RADIUS & UM Settings tab); history fills in over time (kept ~3 months).`});let s=Math.max(1,...o.flatMap(e=>[e.rx,e.tx])),c=e=>8+e*624/Math.max(1,o.length-1),l=e=>142-e/s*134,u=e=>o.map((t,n)=>`${c(n).toFixed(1)},${l(e(t)).toFixed(1)}`).join(` `),d=e=>{let t=c(0).toFixed(1),n=c(o.length-1).toFixed(1);return`${t},${142 .toFixed(1)} ${u(e)} ${n},${142 .toFixed(1)}`};return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1.5 flex items-baseline gap-3.5 text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`font-semibold text-chart-3`,children:[`↓ `,dx(n?.totalRx??0),` down`]}),(0,W.jsxs)(`span`,{className:`font-semibold text-chart-4`,children:[`↑ `,dx(n?.totalTx??0),` up`]}),(0,W.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`· peak/day `,dx(s),` · last `,t,` days`]})]}),(0,W.jsxs)(`svg`,{className:`block h-40 w-full rounded-md border border-border bg-card`,viewBox:`0 0 640 150`,preserveAspectRatio:`none`,xmlns:eS,role:`img`,children:[(0,W.jsx)(`polygon`,{className:`fill-chart-3/20`,points:d(e=>e.rx)}),(0,W.jsx)(`polygon`,{className:`fill-chart-4/15`,points:d(e=>e.tx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-chart-3 stroke-2 [vector-effect:non-scaling-stroke]`,points:u(e=>e.rx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-chart-4 stroke-2 [vector-effect:non-scaling-stroke]`,points:u(e=>e.tx)})]})]})}var aS=53,oS=12,sS=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],cS=[`var(--muted)`,`color-mix(in srgb, var(--chart-3) 30%, var(--muted))`,`color-mix(in srgb, var(--chart-3) 50%, var(--muted))`,`color-mix(in srgb, var(--chart-3) 72%, transparent)`,`var(--chart-3)`];function lS({endpoint:e,label:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),o=(0,v.useRef)(null);(0,v.useEffect)(()=>{let t=!0;return gc(e).then(e=>{t&&r(e)}).catch(()=>{t&&r({days:[],total:0,max:0})}),()=>{t=!1}},[e]);let{cells:s,monthLabels:c}=(0,v.useMemo)(()=>{let e=new Map((n?.days??[]).map(e=>[e.day,e.count])),t=rS(),r=t-(new Date(t).getUTCDay()+(aS-1)*7)*tS,i=[],a=[],o=-1;for(let n=0;n<aS*7;n++){let s=r+n*tS;if(s>t)break;let c=Math.floor(n/7),l=new Date(s).getUTCDay(),u=nS(s);if(i.push({day:u,count:e.get(u)??0,col:c,row:l,ms:s}),l===0){let e=new Date(s).getUTCMonth();e!==o&&(a.push({col:c,text:sS[e]}),o=e)}}return{cells:i,monthLabels:a}},[n]),l=Math.max(1,n?.max??1),u=e=>e<=0?0:Math.min(4,Math.ceil(e/l*4)),d=(e,t)=>{let n=o.current;if(!n)return;let r=e.currentTarget.getBoundingClientRect(),i=n.getBoundingClientRect();a({left:r.left-i.left+r.width/2,top:r.top-i.top,day:t.day,count:t.count,lvl:u(t.count)})};return(0,W.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,W.jsxs)(`div`,{className:`mb-1.5 flex items-baseline gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-[12.5px] font-semibold`,children:t??`Connections`}),(0,W.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:n?`${n.total} total`:`…`})]}),(0,W.jsx)(`div`,{className:`overflow-x-auto pb-1`,onMouseLeave:()=>a(null),children:(0,W.jsxs)(`svg`,{className:`block`,viewBox:`0 0 823 121`,width:823,height:121,xmlns:eS,role:`img`,children:[c.map(e=>(0,W.jsx)(`text`,{className:`fill-muted-foreground text-[9px]`,x:28+e.col*15,y:11,children:e.text},`${e.col}-${e.text}`)),[`Mon`,`Wed`,`Fri`].map((e,t)=>(0,W.jsx)(`text`,{className:`fill-muted-foreground text-[9px]`,x:0,y:16+(t*2+1)*15+oS-2,children:e},e)),s.map(e=>(0,W.jsx)(`rect`,{className:`cursor-pointer stroke-1 [transition:stroke_0.1s_ease] ${i?.day===e.day?`stroke-foreground stroke-[1.5px]`:`stroke-border/60`}`,style:{fill:cS[u(e.count)]},x:28+e.col*15,y:16+e.row*15,width:oS,height:oS,rx:2,onMouseEnter:t=>d(t,e)},e.day))]})}),i&&(0,W.jsxs)(`div`,{className:`pointer-events-none absolute z-30 min-w-[150px] -translate-x-1/2 translate-y-[calc(-100%-9px)] rounded-[10px] border border-chart-3/35 bg-popover px-2.5 py-2 shadow-xl`,style:{left:i.left,top:i.top},role:`tooltip`,children:[(0,W.jsx)(`span`,{className:`absolute -bottom-1.5 left-1/2 size-[11px] -translate-x-1/2 rotate-45 border-r border-b border-chart-3/35 bg-popover`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,W.jsx)(`span`,{className:`inline-block size-[12px] rounded-[2px]`,style:{background:cS[i.lvl]}}),(0,W.jsx)(`b`,{className:`font-semibold`,children:i.count===0?`No connections`:`${i.count} connection${i.count===1?``:`s`}`})]}),(0,W.jsx)(`div`,{className:`mt-[3px] text-[11.5px] text-muted-foreground tabular-nums`,children:Mee(i.day)})]}),(0,W.jsxs)(`div`,{className:`mt-2 flex items-center gap-1 text-[11px] text-muted-foreground`,children:[`Less`,[0,1,2,3,4].map(e=>(0,W.jsx)(`span`,{className:`inline-block size-[11px] rounded-[2px]`,style:{background:cS[e]}},e)),`More`]})]})}var uS=e=>(e.flags??``).includes(`X`)||e.disabled===`yes`;function dS(e,t){return e[t.idKey]||e.name||e.address||e.user||`(row)`}var fS=`mb-3.5 rounded-md border border-border bg-card p-3.5`,pS=`mb-2.5 text-[13px] font-semibold`,mS=`grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-x-3.5 gap-y-2.5`,hS=`mt-3.5 flex items-center gap-2.5`,gS=`flex flex-col gap-1`,_S=`text-[11.5px] text-muted-foreground`;function vS({config:e,device:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)({}),m=(0,v.useCallback)(async()=>{try{let n=t?`?device=${encodeURIComponent(t)}`:``;r(await gc(`/api/aaa/list/${e.slug}${n}`)),a(null)}catch(e){a(e instanceof Error?e.message:String(e))}},[e.slug,t]);(0,v.useEffect)(()=>{r(null),d(null),m()},[m]);let h=(0,v.useCallback)(async(n,r)=>{s(!0),a(null);try{let i=await _c(`/api/aaa/${n}`,{device:t,slug:e.slug,...r}),o=n===`add`?`Entry added`:n===`update`?`Entry saved`:n===`remove`?`Entry removed`:n===`toggle`?r.enable?`Entry enabled`:`Entry disabled`:`Done`;return i.ok?(await m(),Y.success(o),!0):(a(i.message),Y.error(i.message||`${o} failed`),!1)}catch(e){return a(e instanceof Error?e.message:String(e)),Y.error(e instanceof Error?e.message:`Action failed`),!1}finally{s(!1)}},[t,e.slug,m]),g=()=>{d(`new`),p({})},_=t=>{d(t[e.idKey]);let n={};for(let r of e.fields)r.type!==`password`&&(r.key===`disabled`?n.disabled=uS(t)?`yes`:`no`:t[r.key]!=null&&(n[r.key]=t[r.key]));p(n)},y=async()=>{(u===`new`?await h(`add`,{fields:f}):await h(`update`,{id:u,fields:f}))&&d(null)},b=(0,v.useMemo)(()=>{let t=n?.rows??[],r=c.trim().toLowerCase();return r?t.filter(t=>e.columns.some(e=>(t[e.key]??``).toLowerCase().includes(r))):t},[n,c,e.columns]);return n&&!n.available?(0,W.jsxs)(Lx,{type:`warning`,label:`User Manager not installed`,children:[`This device doesn't have the `,(0,W.jsx)(`code`,{children:`user-manager`}),` package. Install it (System → Packages) and reboot to manage the built-in RADIUS server here.`]}):(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2.5`,children:[(0,W.jsx)(Wx,{className:`w-[200px]`,placeholder:`Filter…`,value:c,onChange:e=>l(e.target.value)}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[b.length,` rows`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:()=>void m(),children:`Refresh`}),(0,W.jsx)(X,{size:`sm`,type:`accent`,icon:(0,W.jsx)(Qc,{}),onClick:g,children:`Add`})]}),i&&(0,W.jsx)(Lx,{type:`error`,className:`mb-2.5`,children:i}),u&&(0,W.jsxs)(`div`,{className:fS,children:[(0,W.jsx)(`div`,{className:pS,children:u===`new`?`New ${e.slug}`:`Edit ${u}`}),(0,W.jsx)(`div`,{className:mS,children:e.fields.map(e=>(0,W.jsxs)(`label`,{className:gS,children:[(0,W.jsxs)(`span`,{className:_S,children:[e.label,e.required&&u===`new`?` *`:``]}),e.type===`bool`?(0,W.jsx)(Jx,{value:f[e.key]??``,onValueChange:t=>p({...f,[e.key]:t}),options:[{value:``,label:`—`},{value:`no`,label:`no`},{value:`yes`,label:`yes`}]}):e.type===`select`?(0,W.jsx)(Jx,{value:f[e.key]??``,onValueChange:t=>p({...f,[e.key]:t}),options:[{value:``,label:`—`},...(e.options??[]).map(e=>({value:e,label:e}))]}):(0,W.jsx)(Wx,{type:e.type===`password`?`password`:e.type===`number`?`number`:`text`,placeholder:e.placeholder??(e.type===`password`?`(unchanged)`:``),value:f[e.key]??``,onChange:t=>p({...f,[e.key]:t.target.value})})]},e.key))}),(0,W.jsxs)(`div`,{className:hS,children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:o,onClick:()=>void y(),children:u===`new`?`Create`:`Save`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>d(null),children:`Cancel`})]})]}),n?b.length===0?(0,W.jsx)(`div`,{className:`px-1 py-5 text-muted-foreground text-[11px]`,children:e.empty??`Nothing here yet.`}):(0,W.jsxs)(Yb,{className:`text-[13px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[e.columns.map(e=>(0,W.jsx)($b,{children:e.label},e.key)),(0,W.jsx)($b,{className:`text-right`,children:`Actions`})]})}),(0,W.jsx)(Zb,{children:b.map(t=>{let n=t[e.idKey],r=uS(t);return(0,W.jsxs)(Qb,{children:[e.columns.map(e=>(0,W.jsx)(ex,{className:J(r&&`text-muted-foreground`),title:t[e.key]??``,children:e.key===`_status`?(0,W.jsx)(Bx,{type:r?`secondary`:`success`,children:r?`disabled`:`enabled`}):t[e.key]??``},e.key)),(0,W.jsx)(ex,{className:`text-right`,children:(0,W.jsxs)(`span`,{className:`flex justify-end gap-1.5`,children:[e.toggle&&(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:o,onClick:()=>void h(`toggle`,{id:n,enable:r}),children:r?`Enable`:`Disable`}),!e.addOnly&&(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:o,onClick:()=>_(t),children:`Edit`}),(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,disabled:o,onClick:()=>void h(`remove`,{id:n}),children:`Remove`})]})})]},n||dS(t,e))})})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading…`})]})}var yS=[`user`,`calling-station-id`,`nas-ip-address`,`started`,`ended`,`uptime`,`download`,`upload`,`status`];function bS({device:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),s=(0,v.useCallback)(async()=>{try{let t=e?`?device=${encodeURIComponent(e)}`:``;n(await gc(`/api/aaa/list/um-sessions${t}`)),i(null)}catch(e){i(e instanceof Error?e.message:String(e))}},[e]);if((0,v.useEffect)(()=>{n(null),s();let e=setInterval(()=>void s(),1e4);return()=>clearInterval(e)},[s]),t&&!t.available)return(0,W.jsxs)(Lx,{type:`warning`,label:`User Manager not installed`,children:[`The `,(0,W.jsx)(`code`,{children:`user-manager`}),` package isn't installed on this device.`]});let c=(t?.rows??[]).filter(e=>!a.trim()||(e.user??``).toLowerCase().includes(a.trim().toLowerCase()));return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2.5`,children:[(0,W.jsx)(Wx,{className:`w-[200px]`,placeholder:`Filter by user…`,value:a,onChange:e=>o(e.target.value)}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[c.length,` sessions`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:()=>void s(),children:`Refresh`})]}),r&&(0,W.jsx)(Lx,{type:`error`,children:r}),t?c.length===0?(0,W.jsx)(`div`,{className:`px-1 py-5 text-muted-foreground text-[11px]`,children:`No accounting sessions recorded.`}):(0,W.jsxs)(Yb,{className:`text-[13px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsx)(Qb,{children:yS.map(e=>(0,W.jsx)($b,{children:e.replace(/-/g,` `)},e))})}),(0,W.jsx)(Zb,{children:c.map((e,t)=>(0,W.jsx)(Qb,{children:yS.map(t=>(0,W.jsx)(ex,{title:e[t]??``,children:e[t]??``},t))},e[`.id`]||t))})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading…`})]})}function xS({device:e,getPath:t,setPath:n,fields:r,title:i,unwrap:a,extra:o}){let[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!0),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),_=(0,v.useCallback)(async()=>{let{available:n,row:r}=a(await gc(`${t}${e?`?device=${encodeURIComponent(e)}`:``}`).catch(()=>null));u(n),c(r),f({})},[e,t,a]);(0,v.useEffect)(()=>{_()},[_]);let y=async()=>{g(!0),m(null);try{let t=await _c(n,{device:e,fields:d});m(t.message),t.ok?(await _(),Y.success(`Settings saved`)):Y.error(t.message||`Save failed`)}catch(e){Y.error(e instanceof Error?e.message:`Save failed`)}finally{g(!1)}};return l?(0,W.jsxs)(`div`,{className:fS,children:[(0,W.jsx)(`div`,{className:pS,children:i}),s&&(0,W.jsx)(`div`,{className:`mb-3 text-muted-foreground text-xs`,children:r.map(e=>`${e.label}: ${s[e.key]??`—`}`).join(` · `)}),(0,W.jsx)(`div`,{className:mS,children:r.map(e=>(0,W.jsxs)(`label`,{className:gS,children:[(0,W.jsx)(`span`,{className:_S,children:e.label}),e.type===`bool`?(0,W.jsx)(Jx,{value:d[e.key]??``,onValueChange:t=>f({...d,[e.key]:t}),options:[{value:``,label:`(unchanged)`},{value:`no`,label:`no`},{value:`yes`,label:`yes`}]}):(0,W.jsx)(Wx,{type:e.type===`number`?`number`:`text`,placeholder:e.placeholder??s?.[e.key]??``,value:d[e.key]??``,onChange:t=>f({...d,[e.key]:t.target.value})})]},e.key))}),(0,W.jsxs)(`div`,{className:hS,children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:h,onClick:()=>void y(),children:`Save`}),o,p&&(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:p})]})]}):(0,W.jsxs)(Lx,{type:`warning`,label:`Not available`,children:[i,` is not available on this device.`]})}var SS={slug:`radius`,idKey:`.id`,toggle:!0,columns:[{key:`address`,label:`Address`},{key:`service`,label:`Service`},{key:`authentication-port`,label:`Auth`},{key:`accounting-port`,label:`Acct`},{key:`protocol`,label:`Proto`},{key:`_status`,label:`Status`}],empty:`No RADIUS servers configured.`,fields:[{key:`address`,label:`Address`,required:!0,placeholder:`1.2.3.4 or host`},{key:`secret`,label:`Secret`,type:`password`,required:!0},{key:`service`,label:`Service`,required:!0,placeholder:`login,ppp,hotspot,wireless,dhcp,ipsec,dot1x`},{key:`authentication-port`,label:`Auth port`,type:`number`,placeholder:`1812`},{key:`accounting-port`,label:`Acct port`,type:`number`,placeholder:`1813`},{key:`timeout`,label:`Timeout`,placeholder:`300ms`},{key:`src-address`,label:`Src address`},{key:`realm`,label:`Realm`},{key:`called-id`,label:`Called ID`},{key:`domain`,label:`Domain`},{key:`protocol`,label:`Protocol`,type:`select`,options:[`udp`,`radsec`]},{key:`certificate`,label:`Certificate`},{key:`accounting-backup`,label:`Acct backup`,type:`bool`},{key:`comment`,label:`Comment`},{key:`disabled`,label:`Disabled`,type:`bool`}]},CS={slug:`um-users`,idKey:`name`,toggle:!0,columns:[{key:`name`,label:`Name`},{key:`group`,label:`Group`},{key:`shared-users`,label:`Shared`},{key:`caller-id`,label:`Caller ID`},{key:`comment`,label:`Comment`},{key:`_status`,label:`Status`}],empty:`No RADIUS users.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`password`,label:`Password`,type:`password`,required:!0},{key:`group`,label:`Group`},{key:`shared-users`,label:`Shared users`,type:`number`,placeholder:`1`},{key:`attributes`,label:`RADIUS attributes`},{key:`caller-id`,label:`Caller ID (MAC)`},{key:`otp-secret`,label:`OTP secret`,type:`password`},{key:`comment`,label:`Comment`},{key:`disabled`,label:`Disabled`,type:`bool`}]},wS={slug:`um-profiles`,idKey:`name`,columns:[{key:`name`,label:`Name`},{key:`name-for-users`,label:`Display`},{key:`validity`,label:`Validity`},{key:`price`,label:`Price`},{key:`starts-when`,label:`Starts`}],empty:`No service profiles.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`name-for-users`,label:`Display name`},{key:`validity`,label:`Validity`,placeholder:`30d`},{key:`price`,label:`Price`,type:`number`},{key:`starts-when`,label:`Starts when`,type:`select`,options:[`assigned`,`first-auth`]},{key:`override-shared-users`,label:`Override shared-users`},{key:`comment`,label:`Comment`}]},TS={slug:`um-limitations`,idKey:`name`,columns:[{key:`name`,label:`Name`},{key:`rate-limit-rx`,label:`Rate ↓`},{key:`rate-limit-tx`,label:`Rate ↑`},{key:`transfer-limit`,label:`Transfer`},{key:`uptime-limit`,label:`Uptime`}],empty:`No limitation templates.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`rate-limit-rx`,label:`Download rate`,placeholder:`10M`},{key:`rate-limit-tx`,label:`Upload rate`,placeholder:`10M`},{key:`rate-limit-min-rx`,label:`Min download (CIR)`,placeholder:`2M`},{key:`rate-limit-min-tx`,label:`Min upload (CIR)`,placeholder:`2M`},{key:`rate-limit-burst-rx`,label:`Burst download`,placeholder:`20M`},{key:`rate-limit-burst-tx`,label:`Burst upload`,placeholder:`20M`},{key:`rate-limit-burst-threshold-rx`,label:`Burst thr. ↓`},{key:`rate-limit-burst-threshold-tx`,label:`Burst thr. ↑`},{key:`rate-limit-burst-time-rx`,label:`Burst time ↓`,placeholder:`10s`},{key:`rate-limit-burst-time-tx`,label:`Burst time ↑`,placeholder:`10s`},{key:`rate-limit-priority`,label:`Priority (1-8)`,type:`number`},{key:`download-limit`,label:`Download cap`,placeholder:`5G`},{key:`upload-limit`,label:`Upload cap`,placeholder:`5G`},{key:`transfer-limit`,label:`Total transfer cap`,placeholder:`10G`},{key:`uptime-limit`,label:`Uptime cap`,placeholder:`1d`},{key:`reset-counters-interval`,label:`Reset interval`},{key:`reset-counters-start-time`,label:`Reset start time`},{key:`comment`,label:`Comment`}]},ES={slug:`um-routers`,idKey:`name`,toggle:!0,columns:[{key:`name`,label:`Name`},{key:`address`,label:`Address`},{key:`coa-port`,label:`CoA port`},{key:`protocol`,label:`Proto`},{key:`comment`,label:`Comment`},{key:`_status`,label:`Status`}],empty:`No NAS clients registered.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`address`,label:`Address`,required:!0,placeholder:`192.168.88.1`},{key:`shared-secret`,label:`Shared secret`,type:`password`,required:!0},{key:`coa-port`,label:`CoA port`,type:`number`},{key:`protocol`,label:`Protocol`,placeholder:`radius`},{key:`comment`,label:`Comment`},{key:`disabled`,label:`Disabled`,type:`bool`}]},DS={slug:`um-user-profiles`,idKey:`.id`,addOnly:!0,columns:[{key:`user`,label:`User`},{key:`profile`,label:`Profile`},{key:`state`,label:`State`},{key:`end-time`,label:`Ends`}],empty:`No profile assignments.`,fields:[{key:`user`,label:`User`,required:!0},{key:`profile`,label:`Profile`,required:!0}]},OS=[{id:`radius`,label:`RADIUS Servers`},{id:`users`,label:`Users`},{id:`profiles`,label:`Profiles`},{id:`limitations`,label:`Limitations`},{id:`nas`,label:`NAS Clients`},{id:`assignments`,label:`Assignments`},{id:`sessions`,label:`Sessions`},{id:`usage`,label:`Usage & Heatmap`},{id:`settings`,label:`Settings`}],kS=[{key:`accept`,label:`Accept CoA`,type:`bool`},{key:`port`,label:`CoA port`,type:`number`,placeholder:`3799`}],AS=[{key:`enabled`,label:`Enabled`,type:`bool`},{key:`use-profiles`,label:`Use profiles`,type:`bool`},{key:`certificate`,label:`Certificate`},{key:`authentication-port`,label:`Auth port`,type:`number`},{key:`accounting-port`,label:`Acct port`,type:`number`}];function jS({device:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/usage/um-users${e?`?device=${encodeURIComponent(e)}`:``}`).then(e=>{n(e.users),i(t=>t||e.users[0]||``)}).catch(()=>n([]))},[e]);let a=e?`&device=${encodeURIComponent(e)}`:``;return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`User`}),(0,W.jsx)(Jx,{value:r,onValueChange:i,"aria-label":`User`,options:t&&t.length>0?t.map(e=>({value:e,label:e})):[{value:``,label:`— no sessions recorded yet —`}]})]}),t&&t.length===0?(0,W.jsx)(Lx,{type:`secondary`,label:`No data yet`,children:`No User Manager sessions have been recorded yet. The dashboard ingests sessions on a configurable interval (1 minute by default — change it under the Settings tab) and keeps them forever, so usage and the heatmap fill in over time.`}):r&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:`Download / upload · last 3 months`}),(0,W.jsx)(iS,{endpoint:`/api/usage/um-user?user=${encodeURIComponent(r)}${a}&days=90`,days:90})]}),(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsxs)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:[`Connection heatmap · `,r]}),(0,W.jsx)(lS,{endpoint:`/api/usage/heatmap?user=${encodeURIComponent(r)}${a}&days=371`,label:`${r} — connections`})]}),(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:`All users · connections`}),(0,W.jsx)(lS,{endpoint:`/api/usage/heatmap?days=371${a}`,label:`All users`})]})]})]})}function MS(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),c=(0,v.useCallback)(async()=>{try{let e=await gc(`/api/usage/sampler`);r(e.intervalMs)}catch{r(null)}},[]);(0,v.useEffect)(()=>{c()},[c]);let l=async()=>{let n=Number(e);if(!Number.isFinite(n)||n<=0){s(`Enter a positive number of minutes.`),Y.error(`Enter a positive number of minutes`);return}a(!0),s(null);try{let e=await _c(`/api/usage/sampler`,{intervalMs:Math.round(n*6e4)});r(e.intervalMs),t(``),s(`Now sampling every ${NS(e.intervalMs)}.`),Y.success(`Now sampling every ${NS(e.intervalMs)}`)}catch(e){s(e instanceof Error?e.message:String(e)),Y.error(e instanceof Error?e.message:`Save failed`)}finally{a(!1)}};return(0,W.jsxs)(`div`,{className:`rounded-md border border-border bg-card p-3.5`,children:[(0,W.jsx)(`div`,{className:pS,children:`Usage sampling`}),(0,W.jsxs)(`div`,{className:`mb-3 text-muted-foreground text-xs`,children:[`How often client traffic + User Manager sessions are recorded into the usage history. Current: `,n==null?`…`:NS(n),` · default 1 minute · range 30s–6h.`]}),(0,W.jsx)(`div`,{className:mS,children:(0,W.jsxs)(`label`,{className:gS,children:[(0,W.jsx)(`span`,{className:_S,children:`Interval (minutes)`}),(0,W.jsx)(Wx,{type:`number`,step:`0.5`,min:`0.5`,placeholder:n?String(n/6e4):`1`,value:e,onChange:e=>t(e.target.value)})]})}),(0,W.jsxs)(`div`,{className:hS,children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:i,onClick:()=>void l(),children:`Save`}),[1,5,10,30].map(e=>(0,W.jsxs)(X,{size:`sm`,ghost:!0,onClick:()=>{t(String(e))},children:[e,`m`]},e)),o&&(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:o})]})]})}function NS(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=e/6e4;return`${Number.isInteger(t)?t:t.toFixed(1)} min`}function PS(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`radius`);(0,v.useEffect)(()=>{gc(`/api/devices`).then(e=>{t(e),r(t=>t||e.defaultDevice||e.devices[0]?.name||``)}).catch(()=>t({server:``,defaultDevice:``,devices:[]}))},[]);let o=e?.devices??[];return(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsx)(ax,{title:`RADIUS & User Manager`,className:`reveal`,extra:o.length>1?(0,W.jsx)(Jx,{value:n,onValueChange:r,"aria-label":`Router`,options:o.map(e=>({value:e.name,label:`${e.name}${e.isDefault?` (default)`:``}`}))}):void 0,children:(0,W.jsxs)(Zx,{value:i,onValueChange:e=>a(e),children:[(0,W.jsx)(Aee,{variant:`line`,className:`mb-3.5 h-auto w-full flex-wrap justify-start border-b border-border`,children:OS.map(e=>(0,W.jsx)(jee,{value:e.id,children:e.label},e.id))}),(0,W.jsx)($x,{value:`radius`,children:(0,W.jsx)(vS,{config:SS,device:n})}),(0,W.jsx)($x,{value:`users`,children:(0,W.jsx)(vS,{config:CS,device:n})}),(0,W.jsx)($x,{value:`profiles`,children:(0,W.jsx)(vS,{config:wS,device:n})}),(0,W.jsx)($x,{value:`limitations`,children:(0,W.jsx)(vS,{config:TS,device:n})}),(0,W.jsx)($x,{value:`nas`,children:(0,W.jsx)(vS,{config:ES,device:n})}),(0,W.jsx)($x,{value:`assignments`,children:(0,W.jsx)(vS,{config:DS,device:n})}),(0,W.jsx)($x,{value:`sessions`,children:(0,W.jsx)(bS,{device:n})}),(0,W.jsx)($x,{value:`usage`,children:(0,W.jsx)(jS,{device:n})}),(0,W.jsx)($x,{value:`settings`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(xS,{device:n,getPath:`/api/aaa/radius-incoming`,setPath:`/api/aaa/radius-incoming`,title:`RADIUS Incoming (CoA listener)`,fields:kS,unwrap:e=>({available:!0,row:e??{}}),extra:(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>void _c(`/api/aaa/radius-reset-counters`,{device:n}).then(()=>Y.success(`Counters reset`)).catch(()=>Y.error(`Reset counters failed`)),children:`Reset RADIUS counters`})}),(0,W.jsx)(xS,{device:n,getPath:`/api/aaa/um-settings`,setPath:`/api/aaa/um-settings`,title:`User Manager (built-in RADIUS server)`,fields:AS,unwrap:e=>{let t=e??{};return{available:t.available!==!1,row:t.settings??{}}}}),(0,W.jsx)(MS,{})]})})]})})})}function FS({className:e,...t}){return(0,W.jsx)(`textarea`,{"data-slot":`textarea`,className:J(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}var IS={add:`+`,set:`~`,remove:`−`,enable:`▲`,disable:`▽`,move:`⇅`},LS={high:`border-l-destructive`,medium:`border-l-warning`,low:`border-l-success`};function RS(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),c=async()=>{s(!0),a(null);let t=await _c(`/api/plan`,{script:e}).catch(()=>({error:`request failed`}));if(s(!1),t.error||!t.plan){a(t.error??`no plan produced`),r(null),Y.error(t.error??`no plan produced`);return}r({plan:t.plan,text:t.text??``}),Y.success(`Plan ready`)},l=n?.plan.grade??``,u=l===`critical`||l===`high`;return(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(ax,{title:`Change plan — dry-run`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`terraform-style preview · pure analysis, never touches a device`}),children:[(0,W.jsx)(FS,{className:`min-h-40 resize-y font-mono text-xs leading-relaxed`,spellCheck:!1,placeholder:`Paste intended RouterOS commands, one per line, e.g.
|
|
77
|
+
`},Jd=0,Yd=[];function Xd(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Jd++)[0],a=v.useState(vd)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=qu([e.lockRef.current],(e.shards||[]).map(Gd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ud(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Id(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Id(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Hd(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!Yd.length||Yd[Yd.length-1]!==a)){var r=`deltaY`in n?Wd(n):Ud(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Kd(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Gd).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Zd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=Ud(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,Wd(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,Ud(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return Yd.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,jd),document.addEventListener(`touchmove`,c,jd),document.addEventListener(`touchstart`,u,jd),function(){Yd=Yd.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,jd),document.removeEventListener(`touchmove`,c,jd),document.removeEventListener(`touchstart`,u,jd)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:qd(i)}):null,p?v.createElement(Od,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Qd=sd(cd,Xd),$d=v.forwardRef(function(e,t){return v.createElement(ud,Gu({},e,{ref:t,sideCar:Qd}))});$d.classNames=ud.classNames;var ef=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tf=new WeakMap,nf=new WeakMap,rf={},af=0,of=function(e){return e&&(e.host||of(e.parentNode))},sf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=of(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},cf=function(e,t,n,r){var i=sf(t,Array.isArray(e)?e:[e]);rf[n]||(rf[n]=new WeakMap);var a=rf[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(tf.get(e)||0)+1,l=(a.get(e)||0)+1;tf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&nf.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),af++,function(){o.forEach(function(e){var t=tf.get(e)-1,i=a.get(e)-1;tf.set(e,t),a.set(e,i),t||(nf.has(e)||e.removeAttribute(r),nf.delete(e)),i||e.removeAttribute(n)}),af--,af||(tf=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf={})}},lf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ef(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),cf(r,i,n,`aria-hidden`)):function(){return null}},uf=`Dialog`,[df,ff]=Vl(uf),[pf,mf]=df(uf),hf=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=Kl({prop:r,defaultProp:i??!1,onChange:a,caller:uf});return(0,W.jsx)(pf,{scope:t,triggerRef:s,contentRef:c,contentId:iu(),titleId:iu(),descriptionId:iu(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};hf.displayName=uf;var gf=`DialogTrigger`,_f=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(gf,n),a=yl(t,i.triggerRef);return(0,W.jsx)(Il.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Lf(i.open),...r,ref:a,onClick:G(e.onClick,i.onOpenToggle)})});_f.displayName=gf;var vf=`DialogPortal`,[yf,bf]=df(vf,{forceMount:void 0}),xf=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=mf(vf,t);return(0,W.jsx)(yf,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,W.jsx)(Xl,{present:n||a.open,children:(0,W.jsx)(Bu,{asChild:!0,container:i,children:e})}))})};xf.displayName=vf;var Sf=`DialogOverlay`,Cf=v.forwardRef((e,t)=>{let n=bf(Sf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=mf(Sf,e.__scopeDialog);return a.modal?(0,W.jsx)(Xl,{present:r||a.open,children:(0,W.jsx)(Tf,{...i,ref:t})}):null});Cf.displayName=Sf;var wf=bl(`DialogOverlay.RemoveScroll`),Tf=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(Sf,n),a=yl(t,_u());return(0,W.jsx)($d,{as:wf,allowPinchZoom:!0,shards:[i.contentRef],children:(0,W.jsx)(Il.div,{"data-state":Lf(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),Ef=`DialogContent`,Df=v.forwardRef((e,t)=>{let n=bf(Ef,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=mf(Ef,e.__scopeDialog);return(0,W.jsx)(Xl,{present:r||a.open,children:a.modal?(0,W.jsx)(Of,{...i,ref:t}):(0,W.jsx)(kf,{...i,ref:t})})});Df.displayName=Ef;var Of=v.forwardRef((e,t)=>{let n=mf(Ef,e.__scopeDialog),r=v.useRef(null),i=yl(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return lf(e)},[]),(0,W.jsx)(Af,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})}),kf=v.forwardRef((e,t)=>{let n=mf(Ef,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,W.jsx)(Af,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Af=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=mf(Ef,n);return Uu(),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(Du,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(mu,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Lf(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),jf=`DialogTitle`,Mf=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(jf,n);return(0,W.jsx)(Il.h2,{id:i.titleId,...r,ref:t})});Mf.displayName=jf;var Nf=`DialogDescription`,Pf=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(Nf,n);return(0,W.jsx)(Il.p,{id:i.descriptionId,...r,ref:t})});Pf.displayName=Nf;var Ff=`DialogClose`,If=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=mf(Ff,n);return(0,W.jsx)(Il.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})});If.displayName=Ff;function Lf(e){return e?`open`:`closed`}var Rf=`AlertDialog`,[zf,Bf]=Vl(Rf,[ff]),Vf=ff(),Hf=e=>{let{__scopeAlertDialog:t,...n}=e,r=Vf(t);return(0,W.jsx)(hf,{...r,...n,modal:!0})};Hf.displayName=Rf;var Uf=`AlertDialogTrigger`,Wf=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(_f,{...i,...r,ref:t})});Wf.displayName=Uf;var Gf=`AlertDialogPortal`,Kf=e=>{let{__scopeAlertDialog:t,...n}=e,r=Vf(t);return(0,W.jsx)(xf,{...r,...n})};Kf.displayName=Gf;var qf=`AlertDialogOverlay`,Jf=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(Cf,{...i,...r,ref:t})});Jf.displayName=qf;var Yf=`AlertDialogContent`,[Xf,Zf]=zf(Yf),Qf=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Vf(n),o=yl(t,v.useRef(null)),s=v.useRef(null);return(0,W.jsx)(Xf,{scope:n,cancelRef:s,children:(0,W.jsx)(Df,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:G(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})});Qf.displayName=Yf;var $f=`AlertDialogTitle`,ep=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(Mf,{...i,...r,ref:t})});ep.displayName=$f;var tp=`AlertDialogDescription`,np=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(Pf,{...i,...r,ref:t})});np.displayName=tp;var rp=`AlertDialogAction`,ip=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Vf(n);return(0,W.jsx)(If,{...i,...r,ref:t})});ip.displayName=rp;var ap=`AlertDialogCancel`,op=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Zf(ap,n),a=Vf(n),o=yl(t,i);return(0,W.jsx)(If,{...a,...r,ref:o})});op.displayName=ap;var sp=Hf,cp=Wf,lp=Kf,up=Jf,dp=Qf,fp=ip,pp=op,mp=ep,hp=np;function gp(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function _p(e){let[t,n]=v.useState(void 0);return Wl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var vp=`Checkbox`,[yp,bp]=Vl(vp),[xp,Sp]=yp(vp);function Cp(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Kl({prop:n,defaultProp:i??!1,onChange:c,caller:vp}),[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useRef(!1),b=m?!!o||!!m.closest(`form`):!0,x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:Mp(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:_};return(0,W.jsx)(xp,{scope:t,...x,children:jp(d)?d(x):r})}var wp=`CheckboxTrigger`,Tp=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=Sp(wp,e),h=yl(i,u),g=v.useRef(c);return v.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,W.jsx)(Il.button,{type:`button`,role:`checkbox`,"aria-checked":Mp(c)?`mixed`:c,"aria-required":l,"data-state":Np(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:G(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:G(n,e=>{d(e=>Mp(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Tp.displayName=wp;var Ep=v.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(Cp,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Tp,{...d,ref:t,__scopeCheckbox:n}),e&&(0,W.jsx)(Ap,{__scopeCheckbox:n})]})})});Ep.displayName=vp;var Dp=`CheckboxIndicator`,Op=v.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Sp(Dp,n);return(0,W.jsx)(Xl,{present:r||Mp(a.checked)||a.checked===!0,children:(0,W.jsx)(Il.span,{"data-state":Np(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});Op.displayName=Dp;var kp=`CheckboxBubbleInput`,Ap=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Sp(kp,e),m=yl(n,p),h=gp(a),g=_p(r);v.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=Mp(a),n.call(e,Mp(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=v.useRef(Mp(a)?!1:a);return(0,W.jsx)(Il.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});Ap.displayName=kp;function jp(e){return typeof e==`function`}function Mp(e){return e===`indeterminate`}function Np(e){return Mp(e)?`indeterminate`:e?`checked`:`unchecked`}var Pp=[`top`,`right`,`bottom`,`left`],Fp=Math.min,Ip=Math.max,Lp=Math.round,Rp=Math.floor,zp=e=>({x:e,y:e}),Bp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Vp(e,t,n){return Ip(e,Fp(t,n))}function Hp(e,t){return typeof e==`function`?e(t):e}function Up(e){return e.split(`-`)[0]}function Wp(e){return e.split(`-`)[1]}function Gp(e){return e===`x`?`y`:`x`}function Kp(e){return e===`y`?`height`:`width`}function qp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Jp(e){return Gp(qp(e))}function Yp(e,t,n){n===void 0&&(n=!1);let r=Wp(e),i=Jp(e),a=Kp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=im(o)),[o,im(o)]}function Xp(e){let t=im(e);return[Zp(e),t,Zp(t)]}function Zp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Qp=[`left`,`right`],$p=[`right`,`left`],em=[`top`,`bottom`],tm=[`bottom`,`top`];function nm(e,t,n){switch(e){case`top`:case`bottom`:return n?t?$p:Qp:t?Qp:$p;case`left`:case`right`:return t?em:tm;default:return[]}}function rm(e,t,n,r){let i=Wp(e),a=nm(Up(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Zp)))),a}function im(e){let t=Up(e);return Bp[t]+e.slice(t.length)}function am(e){return{top:0,right:0,bottom:0,left:0,...e}}function om(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:am(e)}function sm(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function cm(e,t,n){let{reference:r,floating:i}=e,a=qp(t),o=Jp(t),s=Kp(o),c=Up(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Wp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function lm(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Hp(t,e),p=om(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=sm(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=sm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var um=50,dm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:lm},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=cm(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<um&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=cm(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fm=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Hp(e,t)||{};if(l==null)return{};let d=om(u),f={x:n,y:r},p=Jp(i),m=Kp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Fp(d[_],T),D=Fp(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Vp(O,A,k),M=!c.arrow&&Wp(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),pm=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Hp(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Up(r),_=qp(o),v=Up(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[im(o)]:Xp(o)),x=p!==`none`;!d&&x&&b.push(...rm(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Yp(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==qp(t))||T.every(e=>qp(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=qp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function mm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hm(e){return Pp.some(t=>e[t]>=0)}var gm=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Hp(e,t);switch(i){case`referenceHidden`:{let e=mm(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:hm(e)}}}case`escaped`:{let e=mm(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:hm(e)}}}default:return{}}}}},_m=new Set([`left`,`top`]);async function vm(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Up(n),s=Wp(n),c=qp(n)===`y`,l=_m.has(o)?-1:1,u=a&&c?-1:1,d=Hp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ym=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await vm(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},bm=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Hp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=qp(Up(i)),p=Gp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Vp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Vp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},xm=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Hp(e,t),u={x:n,y:r},d=qp(i),f=Gp(d),p=u[f],m=u[d],h=Hp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=_m.has(Up(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Sm=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Hp(e,t),u=await o.detectOverflow(t,l),d=Up(i),f=Wp(i),p=qp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Fp(h-u[g],v),x=Fp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ip(u.left,0),t=Ip(u.right,0),n=Ip(u.top,0),r=Ip(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ip(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ip(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Cm(){return typeof window<`u`}function wm(e){return Dm(e)?(e.nodeName||``).toLowerCase():`#document`}function Tm(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Em(e){return((Dm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Dm(e){return Cm()?e instanceof Node||e instanceof Tm(e).Node:!1}function Om(e){return Cm()?e instanceof Element||e instanceof Tm(e).Element:!1}function km(e){return Cm()?e instanceof HTMLElement||e instanceof Tm(e).HTMLElement:!1}function Am(e){return!Cm()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Tm(e).ShadowRoot}function jm(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Hm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Mm(e){return/^(table|td|th)$/.test(wm(e))}function Nm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Pm=/transform|translate|scale|rotate|perspective|filter/,Fm=/paint|layout|strict|content/,Im=e=>!!e&&e!==`none`,Lm;function Rm(e){let t=Om(e)?Hm(e):e;return Im(t.transform)||Im(t.translate)||Im(t.scale)||Im(t.rotate)||Im(t.perspective)||!Bm()&&(Im(t.backdropFilter)||Im(t.filter))||Pm.test(t.willChange||``)||Fm.test(t.contain||``)}function zm(e){let t=Wm(e);for(;km(t)&&!Vm(t);){if(Rm(t))return t;if(Nm(t))return null;t=Wm(t)}return null}function Bm(){return Lm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Lm}function Vm(e){return/^(html|body|#document)$/.test(wm(e))}function Hm(e){return Tm(e).getComputedStyle(e)}function Um(e){return Om(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wm(e){if(wm(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Am(e)&&e.host||Em(e);return Am(t)?t.host:t}function Gm(e){let t=Wm(e);return Vm(t)?e.ownerDocument?e.ownerDocument.body:e.body:km(t)&&jm(t)?t:Gm(t)}function Km(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Gm(e),i=r===e.ownerDocument?.body,a=Tm(r);if(i){let e=qm(a);return t.concat(a,a.visualViewport||[],jm(r)?r:[],e&&n?Km(e):[])}else return t.concat(r,Km(r,[],n))}function qm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jm(e){let t=Hm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=km(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Lp(n)!==a||Lp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ym(e){return Om(e)?e:e.contextElement}function Xm(e){let t=Ym(e);if(!km(t))return zp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jm(t),o=(a?Lp(n.width):n.width)/r,s=(a?Lp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Zm=zp(0);function Qm(e){let t=Tm(e);return!Bm()||!t.visualViewport?Zm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $m(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tm(e)?!1:t}function eh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ym(e),o=zp(1);t&&(r?Om(r)&&(o=Xm(r)):o=Xm(e));let s=$m(a,n,r)?Qm(a):zp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Tm(a),t=r&&Om(r)?Tm(r):r,n=e,i=qm(n);for(;i&&r&&t!==n;){let e=Xm(i),t=i.getBoundingClientRect(),r=Hm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Tm(i),i=qm(n)}}return sm({width:u,height:d,x:c,y:l})}function th(e,t){let n=Um(e).scrollLeft;return t?t.left+n:eh(Em(e)).left+n}function nh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-th(e,n),y:n.top+t.scrollTop}}function rh(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Em(r),s=t?Nm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=zp(1),u=zp(0),d=km(r);if((d||!d&&!a)&&((wm(r)!==`body`||jm(o))&&(c=Um(r)),d)){let e=eh(r);l=Xm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?nh(o,c):zp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ih(e){return Array.from(e.getClientRects())}function ah(e){let t=Em(e),n=Um(e),r=e.ownerDocument.body,i=Ip(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ip(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+th(e),s=-n.scrollTop;return Hm(r).direction===`rtl`&&(o+=Ip(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var oh=25;function sh(e,t){let n=Tm(e),r=Em(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Bm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=th(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=oh&&(a-=o)}else l<=oh&&(a+=l);return{width:a,height:o,x:s,y:c}}function ch(e,t){let n=eh(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=km(e)?Xm(e):zp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function lh(e,t,n){let r;if(t===`viewport`)r=sh(e,n);else if(t===`document`)r=ah(Em(e));else if(Om(t))r=ch(t,n);else{let n=Qm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return sm(r)}function uh(e,t){let n=Wm(e);return n===t||!Om(n)||Vm(n)?!1:Hm(n).position===`fixed`||uh(n,t)}function dh(e,t){let n=t.get(e);if(n)return n;let r=Km(e,[],!1).filter(e=>Om(e)&&wm(e)!==`body`),i=null,a=Hm(e).position===`fixed`,o=a?Wm(e):e;for(;Om(o)&&!Vm(o);){let t=Hm(o),n=Rm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||jm(o)&&!n&&uh(e,o))?r=r.filter(e=>e!==o):i=t,o=Wm(o)}return t.set(e,r),r}function fh(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Nm(t)?[]:dh(t,this._c):[].concat(n),r],o=lh(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=lh(t,a[e],i);s=Ip(n.top,s),c=Fp(n.right,c),l=Fp(n.bottom,l),u=Ip(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ph(e){let{width:t,height:n}=Jm(e);return{width:t,height:n}}function mh(e,t,n){let r=km(t),i=Em(t),a=n===`fixed`,o=eh(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=zp(0);function l(){c.x=th(i)}if(r||!r&&!a)if((wm(t)!==`body`||jm(i))&&(s=Um(t)),r){let e=eh(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?nh(i,s):zp(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function hh(e){return Hm(e).position===`static`}function gh(e,t){if(!km(e)||Hm(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Em(e)===n&&(n=n.ownerDocument.body),n}function _h(e,t){let n=Tm(e);if(Nm(e))return n;if(!km(e)){let t=Wm(e);for(;t&&!Vm(t);){if(Om(t)&&!hh(t))return t;t=Wm(t)}return n}let r=gh(e,t);for(;r&&Mm(r)&&hh(r);)r=gh(r,t);return r&&Vm(r)&&hh(r)&&!Rm(r)?n:r||zm(e)||n}var vh=async function(e){let t=this.getOffsetParent||_h,n=this.getDimensions,r=await n(e.floating);return{reference:mh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yh(e){return Hm(e).direction===`rtl`}var bh={convertOffsetParentRelativeRectToViewportRelativeRect:rh,getDocumentElement:Em,getClippingRect:fh,getOffsetParent:_h,getElementRects:vh,getClientRects:ih,getDimensions:ph,getScale:Xm,isElement:Om,isRTL:yh};function xh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sh(e,t){let n=null,r,i=Em(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Rp(d),h=Rp(i.clientWidth-(u+f)),g=Rp(i.clientHeight-(d+p)),_=Rp(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ip(0,Fp(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!xh(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ch(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ym(e),u=i||a?[...l?Km(l):[],...t?Km(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Sh(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?eh(e):null;c&&g();function g(){let t=eh(e);h&&!xh(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wh=ym,Th=bm,Eh=pm,Dh=Sm,Oh=gm,kh=fm,Ah=xm,jh=(e,t,n)=>{let r=new Map,i={platform:bh,...n},a={...i.platform,_c:r};return dm(e,t,{...i,platform:a})},Mh=typeof document<`u`?v.useLayoutEffect:function(){};function Nh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Nh(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ph(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fh(e,t){let n=Ph(e);return Math.round(t*n)/n}function Ih(e){let t=v.useRef(e);return Mh(()=>{t.current=e}),t}function Lh(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Nh(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=Ih(c),O=Ih(i),k=Ih(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jh(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Nh(T.current,t)&&(T.current=t,Fl.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Mh(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Mh(()=>(j.current=!0,()=>{j.current=!1}),[]),Mh(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Fh(N.floating,u.x),r=Fh(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ph(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Rh=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kh({element:r.current,padding:i}).fn(n):r?kh({element:r,padding:i}).fn(n):{}}}},zh=(e,t)=>{let n=wh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bh=(e,t)=>{let n=Th(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vh=(e,t)=>({fn:Ah(e).fn,options:[e,t]}),Hh=(e,t)=>{let n=Eh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uh=(e,t)=>{let n=Dh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wh=(e,t)=>{let n=Oh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gh=(e,t)=>{let n=Rh(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kh=`Arrow`,qh=v.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,W.jsx)(Il.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,W.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qh.displayName=Kh;var Jh=qh,Yh=`Popper`,[Xh,Zh]=Vl(Yh),[Qh,$h]=Xh(Yh),eg=e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,W.jsx)(Qh,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};eg.displayName=Yh;var tg=`PopperAnchor`,ng=v.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$h(tg,n),o=v.useRef(null),s=a.onAnchorChange,c=yl(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&fg(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,W.jsx)(Il.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});ng.displayName=tg;var rg=`PopperContent`,[ig,ag]=Xh(rg),og=v.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=$h(rg,n),[_,y]=v.useState(null),b=yl(t,y),[x,S]=v.useState(null),C=_p(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(ug),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Lh({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Ch(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[zh({mainAxis:i+T,alignmentAxis:o}),c&&Bh({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Vh():void 0,...A}),c&&Hh({...A}),Uh({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Gh({element:x,padding:s}),dg({arrowWidth:w,arrowHeight:T}),f&&Wh({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=g.setPlacementState;Wl(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,R]=fg(N),ee=su(m);Wl(()=>{P&&ee?.()},[P,ee]);let te=F.arrow?.x,z=F.arrow?.y,B=F.arrow?.centerOffset!==0,[V,ne]=v.useState();return Wl(()=>{_&&ne(window.getComputedStyle(_).zIndex)},[_]),(0,W.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:V,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,W.jsx)(ig,{scope:n,placedSide:L,placedAlign:R,onArrowChange:S,arrowX:te,arrowY:z,shouldHideArrow:B,children:(0,W.jsx)(Il.div,{"data-side":L,"data-align":R,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});og.displayName=rg;var sg=`PopperArrow`,cg={top:`bottom`,right:`left`,bottom:`top`,left:`right`},lg=v.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=ag(sg,n),a=cg[i.placedSide];return(0,W.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,W.jsx)(Jh,{...r,ref:t,style:{...r.style,display:`block`}})})});lg.displayName=sg;function ug(e){return e!==null}var dg=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=fg(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function fg(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var pg=eg,mg=ng,hg=og,gg=lg,_g=!1;function vg(){let[e,t]=v.useState(_g);return v.useEffect(()=>{_g||(_g=!0,t(!0))},[]),e}var yg=v.useSyncExternalStore;function bg(){return()=>{}}function xg(){return yg(bg,()=>!0,()=>!1)}var Sg=typeof yg==`function`?xg:vg,Cg=`rovingFocusGroup.onEntryFocus`,wg={bubbles:!1,cancelable:!0},Tg=`RovingFocusGroup`,[Eg,Dg,Og]=Ul(Tg),[kg,Ag]=Vl(Tg,[Og]),[eee,tee]=kg(Tg),jg=v.forwardRef((e,t)=>(0,W.jsx)(Eg.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(Eg.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(nee,{...e,ref:t})})}));jg.displayName=Tg;var nee=v.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),p=yl(t,f),m=ou(a),[h,g]=Kl({prop:o,defaultProp:s??null,onChange:c,caller:Tg}),[_,y]=v.useState(!1),b=su(l),x=Dg(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Cg,b),()=>e.removeEventListener(Cg,b)},[b]),(0,W.jsx)(eee,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,W.jsx)(Il.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:G(e.onMouseDown,()=>{S.current=!0}),onFocus:G(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Cg,wg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Pg([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:G(e.onBlur,()=>y(!1))})})}),Mg=`RovingFocusGroupItem`,Ng=v.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=iu(),l=a||c,u=tee(Mg,n),d=u.currentTabStopId===l,f=Dg(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Sg();return Wl(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,W.jsx)(Eg.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,W.jsx)(Il.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:G(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:G(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:G(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=aee(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?oee(n,r+1):n.slice(r+1)}setTimeout(()=>Pg(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ng.displayName=Mg;var ree={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function iee(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function aee(e,t,n){let r=iee(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ree[r]}function Pg(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function oee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fg=jg,Ig=Ng,Lg=`Label`,Rg=v.forwardRef((e,t)=>(0,W.jsx)(Il.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Rg.displayName=Lg;var zg=Rg;function Bg(e,[t,n]){return Math.min(n,Math.max(t,e))}var Vg=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Hg=[` `,`Enter`],Ug=`Select`,[Wg,Gg,Kg]=Ul(Ug),[qg,see]=Vl(Ug,[Kg,Zh]),Jg=Zh(),[Yg,Xg]=qg(Ug),[Zg,Qg]=qg(Ug),$g=`SelectProvider`;function e_(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=Jg(t),[_,y]=v.useState(null),[b,x]=v.useState(null),[S,C]=v.useState(!1),w=ou(l),[T,E]=Kl({prop:r,defaultProp:i??!1,onChange:a,caller:Ug}),[D,O]=Kl({prop:o,defaultProp:s,onChange:c,caller:Ug}),k=v.useRef(null),A=v.useRef(D);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=()=>O(A.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,O]);let j=_?!!m||!!_.closest(`form`):!0,[M,N]=v.useState(new Set),P=iu(),F=Array.from(M).map(e=>e.props.value).join(`;`),I=v.useCallback(e=>{N(t=>new Set(t).add(e))},[]),L=v.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),R={required:p,trigger:_,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:P,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:F,isFormControl:j};return(0,W.jsx)(pg,{...g,children:(0,W.jsx)(Yg,{scope:t,...R,children:(0,W.jsx)(Wg.Provider,{scope:t,children:(0,W.jsx)(Zg,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:ev(h)?h(R):n})})})})}e_.displayName=$g;var t_=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,W.jsx)(e_,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[n,e?(0,W.jsx)($_,{__scopeSelect:t}):null]})})};t_.displayName=Ug;var n_=`SelectTrigger`,r_=v.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Jg(n),o=Xg(n_,n),s=o.disabled||r,c=yl(t,o.onTriggerChange),l=Gg(n),u=v.useRef(`touch`),[d,f,p]=nv(e=>{let t=l().filter(e=>!e.disabled),n=rv(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,W.jsx)(mg,{asChild:!0,...a,children:(0,W.jsx)(Il.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":tv(o.value)?``:void 0,...i,ref:c,onClick:G(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:G(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:G(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Vg.includes(e.key)&&(m(),e.preventDefault())})})})});r_.displayName=n_;var i_=`SelectValue`,a_=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Xg(i_,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=yl(t,c.onValueNodeChange);Wl(()=>{l(u)},[l,u]);let f=tv(c.value);return(0,W.jsx)(Il.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,W.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});a_.displayName=i_;var o_=`SelectIcon`,s_=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,W.jsx)(Il.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});s_.displayName=o_;var c_=`SelectPortal`,[l_,u_]=qg(c_,{forceMount:void 0}),d_=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,W.jsx)(l_,{scope:e.__scopeSelect,forceMount:n,children:(0,W.jsx)(Bu,{asChild:!0,...r})})};d_.displayName=c_;var f_=`SelectContent`,p_=v.forwardRef((e,t)=>{let n=u_(f_,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Xg(f_,e.__scopeSelect),[o,s]=v.useState();return Wl(()=>{s(new DocumentFragment)},[]),(0,W.jsx)(Xl,{present:r||a.open,children:({present:e})=>e?(0,W.jsx)(b_,{...i,ref:t}):(0,W.jsx)(m_,{...i,fragment:o})})});p_.displayName=f_;var m_=v.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?Fl.createPortal((0,W.jsx)(g_,{scope:n,children:(0,W.jsx)(Wg.Slot,{scope:n,children:(0,W.jsx)(`div`,{ref:t,children:r})})}),i):null});m_.displayName=`SelectContentFragment`;var h_=10,[g_,__]=qg(f_),v_=`SelectContentImpl`,y_=bl(`SelectContent.RemoveScroll`),b_=v.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,y=Xg(f_,n),[b,x]=v.useState(null),[S,C]=v.useState(null),w=yl(t,x),[T,E]=v.useState(null),[D,O]=v.useState(null),k=Gg(n),[A,j]=v.useState(!1),M=v.useRef(!1);v.useEffect(()=>{if(b)return lf(b)},[b]),Uu();let N=v.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=v.useCallback(()=>N([T,b]),[N,T,b]);v.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=y;v.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,F,I]),v.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,R]=nv(e=>{let t=k().filter(e=>!e.disabled),n=rv(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ee=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),te=v.useCallback(()=>b?.focus(),[b]),z=v.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),B=r===`popper`?w_:S_,V=B===w_?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,W.jsx)(g_,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ee,selectedItem:T,onItemLeave:te,itemTextRefCallback:z,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:L,children:(0,W.jsx)($d,{as:y_,allowPinchZoom:!0,children:(0,W.jsx)(Du,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:G(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,W.jsx)(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,W.jsx)(B,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),..._,...V,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:G(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&R(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});b_.displayName=v_;var x_=`SelectItemAlignedPosition`,S_=v.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Xg(f_,n),o=__(f_,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=yl(t,u),f=Gg(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:y}=o,b=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-h_,d=Bg(a,[h_,Math.max(h_,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-h_,d=Bg(a,[h_,Math.max(h_,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-h_*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-h_,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${h_}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Wl(()=>b(),[b]);let[x,S]=v.useState();return Wl(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,W.jsx)(T_,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:v.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,W.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,W.jsx)(Il.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});S_.displayName=x_;var C_=`SelectPopperPosition`,w_=v.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=h_,...a}=e,o=Jg(n);return(0,W.jsx)(hg,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});w_.displayName=C_;var[T_,E_]=qg(f_,{}),D_=`SelectViewport`,O_=v.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=__(D_,n),o=E_(D_,n),s=yl(t,a.onViewportChange),c=v.useRef(0);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,W.jsx)(Wg.Slot,{scope:n,children:(0,W.jsx)(Il.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:G(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-h_*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});O_.displayName=D_;var k_=`SelectGroup`,[A_,j_]=qg(k_),M_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=iu();return(0,W.jsx)(A_,{scope:n,id:i,children:(0,W.jsx)(Il.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});M_.displayName=k_;var N_=`SelectLabel`,P_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=j_(N_,n);return(0,W.jsx)(Il.div,{id:i.id,...r,ref:t})});P_.displayName=N_;var F_=`SelectItem`,[I_,L_]=qg(F_),R_=v.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Xg(F_,n),c=__(F_,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=yl(t,su(e=>c.itemRefCallback?.(e,r,i))),h=iu(),g=v.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,W.jsx)(I_,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,W.jsx)(Wg.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,W.jsx)(Il.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:G(o.onFocus,()=>p(!0)),onBlur:G(o.onBlur,()=>p(!1)),onClick:G(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:G(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:G(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:G(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:G(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(Hg.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});R_.displayName=F_;var z_=`SelectItemText`,B_=v.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Xg(z_,n),s=__(z_,n),c=L_(z_,n),l=Qg(z_,n),[u,d]=v.useState(null),f=su(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=yl(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,W.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Wl(()=>(g(h),()=>_(h)),[g,_,h]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Il.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!tv(o.value)?Fl.createPortal(a.children,o.valueNode):null]})});B_.displayName=z_;var V_=`SelectItemIndicator`,H_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return L_(V_,n).isSelected?(0,W.jsx)(Il.span,{"aria-hidden":!0,...r,ref:t}):null});H_.displayName=V_;var U_=`SelectScrollUpButton`,W_=v.forwardRef((e,t)=>{let n=__(U_,e.__scopeSelect),r=E_(U_,e.__scopeSelect),[i,a]=v.useState(!1),o=yl(t,r.onScrollButtonChange);return Wl(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(q_,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});W_.displayName=U_;var G_=`SelectScrollDownButton`,K_=v.forwardRef((e,t)=>{let n=__(G_,e.__scopeSelect),r=E_(G_,e.__scopeSelect),[i,a]=v.useState(!1),o=yl(t,r.onScrollButtonChange);return Wl(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(q_,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});K_.displayName=G_;var q_=v.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=__(`SelectScrollButton`,n),o=v.useRef(null),s=Gg(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Wl(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,W.jsx)(Il.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:G(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:G(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:G(i.onPointerLeave,()=>{c()})})}),J_=`SelectSeparator`,Y_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,W.jsx)(Il.div,{"aria-hidden":!0,...r,ref:t})});Y_.displayName=J_;var X_=`SelectArrow`,Z_=v.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Jg(n);return __(X_,n).position===`popper`?(0,W.jsx)(gg,{...i,...r,ref:t}):null});Z_.displayName=X_;var Q_=`SelectBubbleInput`,$_=v.forwardRef(({__scopeSelect:e,...t},n)=>{let r=Xg(Q_,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=yl(n,p),h=i??``,g=gp(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,W.jsxs)(Il.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Rl,...t.style},ref:m,defaultValue:h,children:[tv(i)&&!_?(0,W.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});$_.displayName=Q_;function ev(e){return typeof e==`function`}function tv(e){return e===``||e===void 0}function nv(e){let t=su(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function rv(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=iv(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function iv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var av=`Separator`,ov=`horizontal`,sv=[`horizontal`,`vertical`],cv=v.forwardRef((e,t)=>{let{decorative:n,orientation:r=ov,...i}=e,a=lv(r)?r:ov,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,W.jsx)(Il.div,{"data-orientation":a,...o,...i,ref:t})});cv.displayName=av;function lv(e){return sv.includes(e)}var uv=cv,dv=`Switch`,[fv,cee]=Vl(dv),[pv,mv]=fv(dv);function hv(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Kl({prop:n,defaultProp:i??!1,onChange:c,caller:dv}),[m,h]=v.useState(null),[g,_]=v.useState(null),y={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v.useRef(!1),required:l,defaultChecked:i,isFormControl:m?!!o||!!m.closest(`form`):!0,bubbleInput:g,setBubbleInput:_};return(0,W.jsx)(pv,{scope:t,...y,children:Cv(d)?d(y):r})}var gv=`SwitchTrigger`,_v=v.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=mv(gv,e),h=yl(r,u),g=v.useRef(c);return v.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,W.jsx)(Il.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":wv(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:G(t,e=>{d(e=>!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});_v.displayName=gv;var vv=v.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(hv,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(_v,{...d,ref:t,__scopeSwitch:n}),e&&(0,W.jsx)(Sv,{__scopeSwitch:n})]})})});vv.displayName=dv;var yv=`SwitchThumb`,bv=v.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=mv(yv,n);return(0,W.jsx)(Il.span,{"data-state":wv(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});bv.displayName=yv;var xv=`SwitchBubbleInput`,Sv=v.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=mv(xv,e),m=yl(n,p),h=gp(a),g=_p(r);v.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[f,h,a,i]);let _=v.useRef(a);return(0,W.jsx)(Il.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});Sv.displayName=xv;function Cv(e){return typeof e==`function`}function wv(e){return e?`checked`:`unchecked`}var Tv=`Tabs`,[Ev,lee]=Vl(Tv,[Ag]),Dv=Ag(),[Ov,kv]=Ev(Tv),Av=v.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ou(s),[d,f]=Kl({prop:r,onChange:i,defaultProp:a??``,caller:Tv});return(0,W.jsx)(Ov,{scope:n,baseId:iu(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,W.jsx)(Il.div,{dir:u,"data-orientation":o,...l,ref:t})})});Av.displayName=Tv;var jv=`TabsList`,Mv=v.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=kv(jv,n),o=Dv(n);return(0,W.jsx)(Fg,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,W.jsx)(Il.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Mv.displayName=jv;var Nv=`TabsTrigger`,Pv=v.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=kv(Nv,n),s=Dv(n),c=Lv(o.baseId,r),l=Rv(o.baseId,r),u=r===o.value;return(0,W.jsx)(Ig,{asChild:!0,...s,focusable:!i,active:u,children:(0,W.jsx)(Il.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:G(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:G(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:G(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Pv.displayName=Nv;var Fv=`TabsContent`,Iv=v.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=kv(Fv,n),c=Lv(s.baseId,r),l=Rv(s.baseId,r),u=r===s.value,d=v.useRef(u);return v.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,W.jsx)(Xl,{present:i||u,children:({present:n})=>(0,W.jsx)(Il.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});Iv.displayName=Fv;function Lv(e,t){return`${e}-trigger-${t}`}function Rv(e,t){return`${e}-content-${t}`}var uee=Av,zv=Mv,Bv=Pv,Vv=Iv;function Hv(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Hv(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Uv(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Hv(e))&&(r&&(r+=` `),r+=t);return r}var Wv=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gv=(e,t)=>({classGroupId:e,validator:t}),Kv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qv=`-`,Jv=[],Yv=`arbitrary..`,Xv=e=>{let t=$v(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Qv(e);let n=e.split(qv);return Zv(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Wv(i,t):t:i||Jv}return n[e]||Jv}}},Zv=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Zv(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(qv):e.slice(t).join(qv),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Qv=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Yv+r:void 0})(),$v=e=>{let{theme:t,classGroups:n}=e;return ey(n,t)},ey=(e,t)=>{let n=Kv();for(let r in e){let i=e[r];ty(i,n,r,t)}return n},ty=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ny(i,t,n,r)}},ny=(e,t,n,r)=>{if(typeof e==`string`){ry(e,t,n);return}if(typeof e==`function`){iy(e,t,n,r);return}ay(e,t,n,r)},ry=(e,t,n)=>{let r=e===``?t:oy(t,e);r.classGroupId=n},iy=(e,t,n,r)=>{if(sy(e)){ty(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gv(n,e))},ay=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ty(o,oy(t,a),n,r)}},oy=(e,t)=>{let n=e,r=t.split(qv),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Kv(),n.nextPart.set(t,i)),n=i}return n},sy=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,cy=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ly=`!`,uy=`:`,dy=[],fy=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),py=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===uy){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ly)?(c=s.slice(0,-1),l=!0):s.startsWith(ly)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return fy(t,l,c,u)};if(t){let e=t+uy,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fy(dy,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},my=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hy=e=>({cache:cy(e.cacheSize),parseClassName:py(e),sortModifiers:my(e),postfixLookupClassGroupIds:gy(e),...Xv(e)}),gy=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},_y=/\s+/,vy=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_y),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ly:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},yy=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=by(n))&&(i&&(i+=` `),i+=r);return i},by=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=by(e[r]))&&(n&&(n+=` `),n+=t);return n},xy=(e,...t)=>{let n,r,i,a,o=o=>(n=hy(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=vy(e,n);return i(e,a),a};return a=o,(...e)=>a(yy(...e))},Sy=[],Cy=e=>{let t=t=>t[e]||Sy;return t.isThemeGetter=!0,t},wy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ty=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ey=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dy=e=>Ey.test(e),Oy=e=>!!e&&!Number.isNaN(Number(e)),ky=e=>!!e&&Number.isInteger(Number(e)),Ay=e=>e.endsWith(`%`)&&Oy(e.slice(0,-1)),jy=e=>dee.test(e),My=()=>!0,gee=e=>fee.test(e)&&!pee.test(e),Ny=()=>!1,_ee=e=>mee.test(e),vee=e=>hee.test(e),yee=e=>!K(e)&&!q(e),bee=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),xee=e=>Ky(e,Xy,Ny),K=e=>wy.test(e),Py=e=>Ky(e,Zy,gee),Fy=e=>Ky(e,Qy,Oy),See=e=>Ky(e,eb,My),Cee=e=>Ky(e,$y,Ny),Iy=e=>Ky(e,Jy,Ny),Ly=e=>Ky(e,Yy,vee),Ry=e=>Ky(e,tb,_ee),q=e=>Ty.test(e),zy=e=>qy(e,Zy),By=e=>qy(e,$y),Vy=e=>qy(e,Jy),Hy=e=>qy(e,Xy),Uy=e=>qy(e,Yy),Wy=e=>qy(e,tb,!0),Gy=e=>qy(e,eb,!0),Ky=(e,t,n)=>{let r=wy.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qy=(e,t,n=!1)=>{let r=Ty.exec(e);return r?r[1]?t(r[1]):n:!1},Jy=e=>e===`position`||e===`percentage`,Yy=e=>e===`image`||e===`url`,Xy=e=>e===`length`||e===`size`||e===`bg-size`,Zy=e=>e===`length`,Qy=e=>e===`number`,$y=e=>e===`family-name`,eb=e=>e===`number`||e===`weight`,tb=e=>e===`shadow`,nb=xy(()=>{let e=Cy(`color`),t=Cy(`font`),n=Cy(`text`),r=Cy(`font-weight`),i=Cy(`tracking`),a=Cy(`leading`),o=Cy(`breakpoint`),s=Cy(`container`),c=Cy(`spacing`),l=Cy(`radius`),u=Cy(`shadow`),d=Cy(`inset-shadow`),f=Cy(`text-shadow`),p=Cy(`drop-shadow`),m=Cy(`blur`),h=Cy(`perspective`),g=Cy(`aspect`),_=Cy(`ease`),v=Cy(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),q,K],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[q,K,c],T=()=>[Dy,`full`,`auto`,...w()],E=()=>[ky,`none`,`subgrid`,q,K],D=()=>[`auto`,{span:[`full`,ky,q,K]},ky,q,K],O=()=>[ky,`auto`,q,K],k=()=>[`auto`,`min`,`max`,`fr`,q,K],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Dy,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Dy,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Dy,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,q,K],L=()=>[...b(),Vy,Iy,{position:[q,K]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,Hy,xee,{size:[q,K]}],te=()=>[Ay,zy,Py],z=()=>[``,`none`,`full`,l,q,K],B=()=>[``,Oy,zy,Py],V=()=>[`solid`,`dashed`,`dotted`,`double`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],re=()=>[Oy,Ay,Vy,Iy],ie=()=>[``,`none`,m,q,K],ae=()=>[`none`,Oy,q,K],oe=()=>[`none`,Oy,q,K],se=()=>[Oy,q,K],H=()=>[Dy,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[jy],breakpoint:[jy],color:[My],container:[jy],"drop-shadow":[jy],ease:[`in`,`out`,`in-out`],font:[yee],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[jy],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[jy],shadow:[jy],spacing:[`px`,Oy],text:[jy],"text-shadow":[jy],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Dy,K,q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,q,K]}],"container-named":[bee],columns:[{columns:[Oy,K,q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ky,`auto`,q,K]}],basis:[{basis:[Dy,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Oy,Dy,`auto`,`initial`,`none`,K]}],grow:[{grow:[``,Oy,q,K]}],shrink:[{shrink:[``,Oy,q,K]}],order:[{order:[ky,`first`,`last`,`none`,q,K]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,zy,Py]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gy,See]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ay,K]}],"font-family":[{font:[By,Cee,t]}],"font-features":[{"font-features":[K]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,q,K]}],"line-clamp":[{"line-clamp":[Oy,`none`,q,Fy]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,q,K]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,q,K]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[Oy,`from-font`,`auto`,q,Py]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Oy,`auto`,q,K]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ky,q,K]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q,K]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q,K]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ky,q,K],radial:[``,q,K],conic:[ky,q,K]},Uy,Ly]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-bs":[{"border-bs":B()}],"border-w-be":[{"border-be":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Oy,q,K]}],"outline-w":[{outline:[``,Oy,zy,Py]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Wy,Ry]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Wy,Ry]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Oy,Py]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Wy,Ry]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Oy,q,K]}],"mix-blend":[{"mix-blend":[...ne(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Oy]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[q,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Oy]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,q,K]}],filter:[{filter:[``,`none`,q,K]}],blur:[{blur:ie()}],brightness:[{brightness:[Oy,q,K]}],contrast:[{contrast:[Oy,q,K]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Wy,Ry]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Oy,q,K]}],"hue-rotate":[{"hue-rotate":[Oy,q,K]}],invert:[{invert:[``,Oy,q,K]}],saturate:[{saturate:[Oy,q,K]}],sepia:[{sepia:[``,Oy,q,K]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,q,K]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Oy,q,K]}],"backdrop-contrast":[{"backdrop-contrast":[Oy,q,K]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Oy,q,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oy,q,K]}],"backdrop-invert":[{"backdrop-invert":[``,Oy,q,K]}],"backdrop-opacity":[{"backdrop-opacity":[Oy,q,K]}],"backdrop-saturate":[{"backdrop-saturate":[Oy,q,K]}],"backdrop-sepia":[{"backdrop-sepia":[``,Oy,q,K]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,q,K]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Oy,`initial`,q,K]}],ease:[{ease:[`linear`,`initial`,_,q,K]}],delay:[{delay:[Oy,q,K]}],animate:[{animate:[`none`,v,q,K]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,q,K]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":[`scale-3d`],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[q,K,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[ky,q,K]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q,K]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q,K]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Oy,zy,Py,Fy]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function J(...e){return nb(Uv(e))}var rb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ib=Uv,ab=(e,t)=>n=>{if(t?.variants==null)return ib(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=rb(t)||rb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ib(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ob=ab(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function sb({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,W.jsx)(r?xl:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:J(ob({variant:t,size:n,className:e})),...i})}function cb(e){return(0,W.jsx)(sp,{"data-slot":`alert-dialog`,...e})}function lb(e){return(0,W.jsx)(cp,{"data-slot":`alert-dialog-trigger`,...e})}function wee(e){return(0,W.jsx)(lp,{"data-slot":`alert-dialog-portal`,...e})}function Tee({className:e,...t}){return(0,W.jsx)(up,{"data-slot":`alert-dialog-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t})}function ub({className:e,...t}){return(0,W.jsxs)(wee,{children:[(0,W.jsx)(Tee,{}),(0,W.jsx)(dp,{"data-slot":`alert-dialog-content`,className:J(`bg-background fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border 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 sm:max-w-lg`,e),...t})]})}function db({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function fb({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function pb({className:e,...t}){return(0,W.jsx)(mp,{"data-slot":`alert-dialog-title`,className:J(`text-lg font-semibold`,e),...t})}function mb({className:e,...t}){return(0,W.jsx)(hp,{"data-slot":`alert-dialog-description`,className:J(`text-muted-foreground text-sm`,e),...t})}function hb({className:e,...t}){return(0,W.jsx)(fp,{className:J(ob(),e),...t})}function gb({className:e,...t}){return(0,W.jsx)(pp,{className:J(ob({variant:`outline`}),e),...t})}function _b({className:e,...t}){return(0,W.jsx)(Ep,{"data-slot":`checkbox`,className:J(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,W.jsx)(Op,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,W.jsx)(Nc,{className:`size-3.5`})})})}function vb({className:e,...t}){return(0,W.jsx)(zg,{"data-slot":`label`,className:J(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function yb(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var bb=e=>{switch(e){case`success`:return Cb;case`info`:return Tb;case`warning`:return wb;case`error`:return Eb;default:return null}},xb=Array(12).fill(0),Sb=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},xb.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Cb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),wb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Tb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Eb=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},v.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Db=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ob=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},kb=1,Ab=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:kb++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Mb(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||kb++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},jb=(e,t)=>{let n=t?.id||kb++;return Ab.addToast({title:e,...t,id:n}),n},Mb=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Y=Object.assign(jb,{success:Ab.success,info:Ab.info,warning:Ab.warning,error:Ab.error,custom:Ab.custom,message:Ab.message,promise:Ab.promise,dismiss:Ab.dismiss,loading:Ab.loading},{getHistory:()=>Ab.toasts,getToasts:()=>Ab.getActiveToasts()});yb(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Nb(e){return e.label!==void 0}var Pb=3,Fb=`24px`,Ib=`16px`,Lb=4e3,Rb=356,zb=14,Bb=45,Vb=200;function Hb(...e){return e.filter(Boolean).join(` `)}function Ub(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Wb=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=v.useState(null),[k,A]=v.useState(null),[j,M]=v.useState(!1),[N,P]=v.useState(!1),[F,I]=v.useState(!1),[L,R]=v.useState(!1),[ee,te]=v.useState(!1),[z,B]=v.useState(0),[V,ne]=v.useState(0),re=v.useRef(n.duration||b||Lb),ie=v.useRef(null),ae=v.useRef(null),oe=c===0,se=c+1<=o,H=n.type,ce=n.dismissible!==!1,le=n.className||``,ue=n.descriptionClassName||``,de=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),fe=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),pe=v.useMemo(()=>n.duration||b||Lb,[n.duration,b]),me=v.useRef(0),he=v.useRef(0),ge=v.useRef(0),_e=v.useRef(null),[ve,ye]=x.split(`-`),be=v.useMemo(()=>s.reduce((e,t,n)=>n>=de?e:e+t.height,0),[s,de]),xe=Ob(),Se=n.invert||t,Ce=H===`loading`;he.current=v.useMemo(()=>de*S+be,[de,be]),v.useEffect(()=>{re.current=pe},[pe]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!j)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let we=v.useCallback(()=>{P(!0),B(he.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Vb)},[n,d,a,he]);v.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||xe?(()=>{if(ge.current<me.current){let e=new Date().getTime()-me.current;re.current-=e}ge.current=new Date().getTime()})():re.current!==1/0&&(me.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),we()},re.current)),()=>clearTimeout(e)},[u,i,n,H,xe,we]),v.useEffect(()=>{n.delete&&(we(),n.onDismiss==null||n.onDismiss.call(n,n))},[we,n.delete]);function Te(){return T?.loading?v.createElement(`div`,{className:Hb(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},T.loading):v.createElement(Sb,{className:Hb(w?.loader,n?.classNames?.loader),visible:H===`loading`})}let Ee=n.icon||T?.[H]||bb(H);return v.createElement(`li`,{tabIndex:0,ref:ae,className:Hb(_,le,w?.toast,n?.classNames?.toast,w?.default,w?.[H],n?.classNames?.[H]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":N,"data-visible":se,"data-y-position":ve,"data-x-position":ye,"data-index":c,"data-front":oe,"data-swiping":F,"data-dismissible":ce,"data-type":H,"data-invert":Se,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?z:he.current}px`,"--initial-height":C?`auto`:`${V}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),_e.current=null},onPointerDown:e=>{e.button!==2&&(Ce||!ce||(ie.current=new Date,B(he.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),_e.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(L||!ce)return;_e.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Bb||a>.11){B(he.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),we(),R(!0);return}else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}te(!1),I(!1),O(null)},onPointerMove:t=>{var n,r;if(!_e.current||!ce||window.getSelection()?.toString().length>0)return;let i=t.clientY-_e.current.y,a=t.clientX-_e.current.x,o=e.swipeDirections??Ub(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&te(!0),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ae.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},fe&&!n.jsx&&H!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":Ce,"data-close-button":!0,onClick:Ce||!ce?()=>{}:()=>{we(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Hb(w?.closeButton,n?.classNames?.closeButton)},T?.close??Db):null,(H||n.icon||n.promise)&&n.icon!==null&&(T?.[H]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:Hb(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Te():null,n.type===`loading`?null:Ee):null,v.createElement(`div`,{"data-content":``,className:Hb(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:Hb(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:Hb(y,ue,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&Nb(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Nb(n.cancel)&&ce&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),we())},className:Hb(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&Nb(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Nb(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&we())},className:Hb(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Gb(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Kb(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ib:Fb;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Eee=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Pb,toastOptions:g,dir:_=Gb(),gap:y=zb,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=v.useState([]),w=v.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=v.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=v.useState([]),[O,k]=v.useState(!1),[A,j]=v.useState(!1),[M,N]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=v.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=v.useRef(null),L=v.useRef(!1),R=v.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Ab.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>Ab.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Fl.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),v.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{S.length<=1&&k(!1)},[S]),v.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),v.createElement(`section`,{ref:t,"aria-label":`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?v.createElement(`ol`,{key:t,dir:_===`auto`?Gb():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Rb}px`,"--gap":`${y}px`,...m,...Kb(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(Wb,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:y,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),qb=`mt-theme`;function Dee(){try{return localStorage.getItem(qb)===`light`?`light`:`dark`}catch{return`dark`}}function Jb(){let[e,t]=(0,v.useState)(Dee);return(0,v.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e===`dark`)},[e]),[e,(0,v.useCallback)(e=>{t(e);try{localStorage.setItem(qb,e)}catch{}},[])]}function Oee(){let[e,t]=Jb(),n=e===`dark`?`light`:`dark`;return(0,W.jsx)(sb,{variant:`ghost`,size:`icon-sm`,onClick:()=>t(n),title:`Switch to ${n} theme`,"aria-label":`Switch to ${n} theme`,children:e===`dark`?(0,W.jsx)(dl,{}):(0,W.jsx)(qc,{})})}function kee(e){let[t]=Jb();return(0,W.jsx)(Eee,{theme:t,className:`toaster group`,position:`bottom-right`,toastOptions:{classNames:{toast:`group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border group-[.toaster]:shadow-lg`,description:`group-[.toast]:text-muted-foreground`,actionButton:`group-[.toast]:bg-primary group-[.toast]:text-primary-foreground`,cancelButton:`group-[.toast]:bg-muted group-[.toast]:text-muted-foreground`,error:`group-[.toast]:text-destructive`,success:`group-[.toast]:text-foreground`}},...e})}function Yb({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,W.jsx)(`table`,{"data-slot":`table`,className:J(`w-full caption-bottom text-sm`,e),...t})})}function Xb({className:e,...t}){return(0,W.jsx)(`thead`,{"data-slot":`table-header`,className:J(`[&_tr]:border-b`,e),...t})}function Zb({className:e,...t}){return(0,W.jsx)(`tbody`,{"data-slot":`table-body`,className:J(`[&_tr:last-child]:border-0`,e),...t})}function Qb({className:e,...t}){return(0,W.jsx)(`tr`,{"data-slot":`table-row`,className:J(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function $b({className:e,...t}){return(0,W.jsx)(`th`,{"data-slot":`table-head`,className:J(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function ex({className:e,...t}){return(0,W.jsx)(`td`,{"data-slot":`table-cell`,className:J(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function tx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card`,className:J(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function nx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-header`,className:J(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function rx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-title`,className:J(`leading-none font-semibold`,e),...t})}function ix({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-content`,className:J(`px-6`,e),...t})}function ax({title:e,extra:t,children:n,className:r}){return(0,W.jsxs)(tx,{className:J(`gap-0 py-5`,r),children:[e!=null&&(0,W.jsxs)(nx,{className:`flex flex-row items-center gap-3 px-5 pb-3`,children:[(0,W.jsx)(rx,{className:`text-base font-semibold`,children:e}),t!=null&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex-1`}),t]})]}),(0,W.jsx)(ix,{className:`px-5`,children:n})]})}function ox({k:e,v:t,sub:n,cls:r}){return(0,W.jsxs)(tx,{className:`gap-1 px-4 py-3`,children:[(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs tracking-wide uppercase`,children:e}),(0,W.jsxs)(`div`,{className:J(`text-2xl font-semibold tabular-nums`,r),children:[t,n!=null&&(0,W.jsxs)(`small`,{className:`text-muted-foreground ml-1 text-sm`,children:[` `,n]})]})]})}function sx({rows:e}){let t=Math.max(1,...e.map(e=>e.value));return(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_1fr_auto] items-center gap-3`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,title:e.label,children:e.label}),(0,W.jsx)(`div`,{className:`bg-muted h-2 overflow-hidden rounded-full`,children:(0,W.jsx)(`div`,{className:J(`h-full rounded-full`,!e.color&&`bg-brand`),style:{width:`${e.value/t*100}%`,background:e.color}})}),(0,W.jsx)(`span`,{className:`text-xs tabular-nums`,children:e.sub??String(e.value)})]},e.label))})}function cx({text:e,label:t=`Copy`,className:n,icon:r=!1,title:i}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>void(s.current&&clearTimeout(s.current)),[]),(0,W.jsxs)(sb,{type:`button`,variant:`outline`,size:r?`icon-sm`:`sm`,className:n,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{o(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>o(!1),1400)},()=>{})},title:i??`Copy to clipboard`,"aria-label":i??`Copy to clipboard`,children:[a?(0,W.jsx)(Nc,{className:`text-success`}):r?(0,W.jsx)(zc,{}):t,a&&(0,W.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:`Copied!`})]})}var lx=[50,100,200,500,1e3,2e3],ux=e=>e<1?`<1ms`:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`;function dx(e){let t=[`B`,`KiB`,`MiB`,`GiB`],n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n++;return`${r.toFixed(+!!n)} ${t[n]}`}var fx=e=>new Date(e).toLocaleTimeString(void 0,{hour12:!1}),px=e=>e.toLocaleString(),mx=e=>e==null?`?`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e),hx={cpu:`var(--chart-1)`,mem:`var(--chart-5)`,disk:`var(--chart-2)`,latency:`var(--chart-4)`},gx={READ:`var(--chart-3)`,WRITE:`var(--chart-1)`,WRITE_IDEMPOTENT:`var(--chart-2)`,DESTRUCTIVE:`var(--chart-4)`,DANGEROUS:`var(--destructive)`},_x={READ:`border-chart-3/40 text-chart-3`,WRITE:`border-chart-1/40 text-chart-1`,WRITE_IDEMPOTENT:`border-chart-2/40 text-chart-2`,DESTRUCTIVE:`border-chart-4/40 text-chart-4`,DANGEROUS:`border-destructive/40 text-destructive`},vx=[[`5m`,3e5],[`15m`,9e5],[`1h`,36e5],[`6h`,216e5],[`24h`,864e5]],yx=1e4,bx=ab(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function xx({className:e,variant:t,...n}){return(0,W.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:J(bx({variant:t}),e),...n})}function Sx({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-description`,className:J(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Cx=ab(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function wx({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,W.jsx)(n?xl:`span`,{"data-slot":`badge`,"data-variant":t,className:J(Cx({variant:t}),e),...r})}function Tx({className:e,type:t,...n}){return(0,W.jsx)(`input`,{type:t,"data-slot":`input`,className:J(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function Ex({...e}){return(0,W.jsx)(t_,{"data-slot":`select`,...e})}function Dx({...e}){return(0,W.jsx)(a_,{"data-slot":`select-value`,...e})}function Ox({className:e,size:t=`default`,children:n,...r}){return(0,W.jsxs)(r_,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,W.jsx)(s_,{asChild:!0,children:(0,W.jsx)(Pc,{className:`size-4 opacity-50`})})]})}function kx({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,W.jsx)(d_,{children:(0,W.jsxs)(p_,{"data-slot":`select-content`,className:J(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`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`,e),position:n,align:r,...i,children:[(0,W.jsx)(jx,{}),(0,W.jsx)(O_,{className:J(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,W.jsx)(Mx,{})]})})}function Ax({className:e,children:t,...n}){return(0,W.jsxs)(R_,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,W.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,W.jsx)(H_,{children:(0,W.jsx)(Nc,{className:`size-4`})})}),(0,W.jsx)(B_,{children:t})]})}function jx({className:e,...t}){return(0,W.jsx)(W_,{"data-slot":`select-scroll-up-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,W.jsx)(Ic,{className:`size-4`})})}function Mx({className:e,...t}){return(0,W.jsx)(K_,{"data-slot":`select-scroll-down-button`,className:J(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,W.jsx)(Pc,{className:`size-4`})})}var Nx={default:`default`,secondary:`secondary`,error:`destructive`,success:`ghost`,warning:`ghost`,accent:`ghost`},Px={default:``,secondary:``,error:``,success:`bg-success text-white hover:bg-success/90`,warning:`bg-warning text-white hover:bg-warning/90`,accent:`bg-brand text-brand-foreground hover:bg-brand/90`},Fx={default:`border bg-transparent text-foreground hover:bg-accent`,secondary:`border bg-transparent text-muted-foreground hover:bg-accent`,error:`border border-destructive/40 bg-transparent text-destructive hover:bg-destructive/10`,success:`border border-success/40 bg-transparent text-success hover:bg-success/10`,warning:`border border-warning/40 bg-transparent text-warning hover:bg-warning/10`,accent:`border border-brand/40 bg-transparent text-brand hover:bg-brand/10`};function X({type:e=`default`,size:t=`md`,ghost:n=!1,loading:r=!1,icon:i,className:a,children:o,disabled:s,...c}){return(0,W.jsxs)(sb,{type:`button`,variant:n?`ghost`:Nx[e],size:t===`sm`?`sm`:`default`,className:J(n?Fx[e]:Px[e],a),disabled:s||r,...c,children:[r?(0,W.jsx)(Ux,{small:!0}):i,o!=null&&(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:o})]})}var Ix={default:``,secondary:`text-muted-foreground`,success:`border-success/40 text-success`,warning:`border-warning/40 text-warning`,error:`border-destructive/40 text-destructive`,accent:`border-brand/40 text-brand`};function Lx({type:e=`default`,label:t,children:n,className:r}){let i=t===!1?null:t??e;return(0,W.jsx)(xx,{role:`note`,className:J(Ix[e],r),children:(0,W.jsxs)(Sx,{className:`text-current`,children:[i!=null&&(0,W.jsxs)(`b`,{className:`font-semibold`,children:[i,`:`]}),` `,n]})})}var Rx={default:`default`,secondary:`secondary`,error:`destructive`,success:`outline`,warning:`outline`,accent:`outline`},zx={default:``,secondary:``,error:``,success:`border-success/40 text-success`,warning:`border-warning/40 text-warning`,accent:`border-brand/40 text-brand`};function Bx({type:e=`default`,children:t,className:n}){return(0,W.jsx)(wx,{variant:Rx[e],className:J(`font-mono`,zx[e],n),children:t})}var Vx={default:`bg-muted-foreground`,secondary:`bg-muted-foreground/60`,success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,accent:`bg-brand`};function Hx({type:e=`default`,pulse:t=!1,color:n,className:r}){return(0,W.jsx)(`span`,{className:J(`inline-block size-2 shrink-0 rounded-full`,!n&&Vx[e],t&&`animate-pulse`,r),style:n?{background:n}:void 0})}function Ux({small:e=!1}){return(0,W.jsx)(Gc,{className:J(`animate-spin`,e?`size-3`:`size-4`),"aria-label":`loading`})}function Wx({className:e,...t}){return(0,W.jsx)(Tx,{className:J(`font-mono`,e),...t})}var Gx=`\0empty`,Kx=e=>e===``?Gx:e,qx=e=>e===Gx?``:e;function Jx({value:e,onValueChange:t,options:n,placeholder:r,className:i,disabled:a,size:o=`md`,"aria-label":s}){return(0,W.jsxs)(Ex,{value:Kx(e),onValueChange:e=>t(qx(e)),disabled:a,children:[(0,W.jsx)(Ox,{size:o===`sm`?`sm`:`default`,"aria-label":s,className:J(`font-mono`,i),children:(0,W.jsx)(Dx,{placeholder:r})}),(0,W.jsx)(kx,{children:n.map(e=>(0,W.jsx)(Ax,{value:Kx(e.value),className:`font-mono`,children:e.label},e.value))})]})}function Yx({children:e,className:t,hoverable:n=!1}){return(0,W.jsx)(tx,{className:J(`gap-0 py-0`,n&&`transition-colors hover:border-brand/40`,t),children:e})}function Xx(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)({show_sensitive:!1,verbose:!1,compact:!1,terse:!1}),C=(0,v.useRef)(null),w=(0,v.useCallback)(()=>{gc(`/api/backups`).then(e=>{t(e),p(t=>t||e.devices[0]||``)}).catch(()=>t({dir:``,devices:[],backups:[]}))},[]);(0,v.useEffect)(()=>w(),[w]);let T=(e,t)=>_c(e,t).catch(()=>({error:`request failed`})),E=async()=>{a(!0),r(`Capturing /export…`);let e=await _c(`/api/backups/create`,{device:f||void 0,label:y.trim()||void 0,show_sensitive:x.show_sensitive,verbose:x.verbose,compact:x.verbose?!1:x.compact,terse:x.terse}).catch(()=>({error:`request failed`}));a(!1),r(e.ok?`Created ${e.name} (${e.bytes} bytes)`:`Create failed: ${e.error}`),e.ok?(Y.success(`Backup created`),w()):Y.error(`Create failed: ${e.error}`)},D=e=>S(t=>({...t,[e]:!t[e]})),O=async e=>{let t=await e.text(),n=await T(`/api/backups/upload`,{name:e.name,content:t});r(n.ok?`Uploaded ${n.name}`:`Upload failed: ${n.error}`),n.ok?(Y.success(`Backup uploaded`),w()):Y.error(`Upload failed: ${n.error}`)},k=async e=>{s(null);let t=await T(`/api/backups/delete`,{name:e});r(t.ok?`Deleted ${e}`:`Delete failed: ${t.error}`),t.ok?(Y.success(`Backup deleted`),w()):Y.error(`Delete failed: ${t.error}`)},A=async()=>{if(!u)return;let{name:e,value:t}=u;if(d(null),!t||t===e)return;let n=await T(`/api/backups/rename`,{name:e,new_name:t});r(n.ok?`Renamed to ${n.name}`:`Rename failed: ${n.error}`),n.ok?(Y.success(`Backup renamed`),w()):Y.error(`Rename failed: ${n.error}`)},j=async e=>{if(!c)return;a(!0),r(e?`Restoring in Safe Mode…`:`Dry-run restore in Safe Mode…`);let t=await _c(`/api/backups/restore`,{name:c,device:f||void 0,confirm:e}).catch(()=>({ok:!1,message:`request failed`}));a(!1),r(t.ok?t.committed?`Restored ${c} → ${f}: ${t.message}`:`Dry-run OK (${t.applied} cmds, rolled back). Click “Restore (commit)” to apply for real.`:`Restore failed: ${t.message}`),t.ok?Y.success(t.committed?`Backup restored`:`Dry-run restore OK`):Y.error(`Restore failed: ${t.message}`),t.ok&&e&&l(null)},M=e=>{gc(`/api/backups/get?name=${encodeURIComponent(e)}`).then(h).catch(()=>{})},N=async()=>{if(g===null)return;let t=g.trim();if(!t||t===e?.dir){_(null);return}a(!0);let n=await _c(`/api/backups/dir`,{dir:t}).catch(()=>({error:`request failed`}));a(!1),_(null),n.ok?(r(n.persisted?`Backup path saved → ${n.dir}`:n.warning??`Path applied → ${n.dir}`),Y.success(`Backup directory updated`)):(r(`Path change failed: ${n.error}`),Y.error(`Path change failed: ${n.error}`)),n.ok&&w()};if(!e)return(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading backups…`});let P=e.devices.length===0?[{value:``,label:`no devices`}]:e.devices.map(e=>({value:e,label:e}));return(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(ax,{title:`Local backup vault`,className:`reveal`,extra:g===null?(0,W.jsxs)(`span`,{className:`inline-flex max-w-[min(60vw,520px)] items-center gap-2 text-muted-foreground text-[11px]`,children:[(0,W.jsx)(`span`,{className:`truncate`,title:e.dir,children:e.dir}),(0,W.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 whitespace-nowrap text-brand hover:underline`,title:`Change backup directory`,onClick:()=>_(e.dir),children:[(0,W.jsx)(Xc,{className:`size-3`}),` edit path`]})]}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`w-[min(48vw,380px)] text-xs`,value:g,autoFocus:!0,spellCheck:!1,placeholder:`~/.mikrotik-mcp/backups`,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&N(),e.key===`Escape`&&_(null)}}),(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>void N(),disabled:i,children:`Save path`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>_(null),children:`Cancel`})]}),children:[n&&(0,W.jsx)(`div`,{className:`mb-3 font-mono text-xs text-muted-foreground`,children:n}),(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Jx,{value:f,onValueChange:p,"aria-label":`Device`,options:P}),(0,W.jsx)(X,{type:`accent`,size:`sm`,icon:(0,W.jsx)(Qc,{}),onClick:()=>void E(),disabled:i||!f,children:`Create backup`}),(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(ml,{}),onClick:()=>C.current?.click(),children:`Upload .rsc`}),(0,W.jsx)(`input`,{ref:C,type:`file`,accept:`.rsc,text/plain`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&O(t),e.currentTarget.value=``}}),(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(nl,{}),onClick:w,children:`Refresh`})]}),(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(Wx,{className:`max-w-[200px] text-xs`,value:y,spellCheck:!1,placeholder:`label (optional), e.g. pre-upgrade`,onChange:e=>b(e.target.value)}),[[`show_sensitive`,`show-sensitive`,`Include secrets (keys/passwords)`],[`verbose`,`verbose`,`Include every parameter, even defaults`],[`compact`,`compact`,`Only non-default values (ignored if verbose)`],[`terse`,`terse`,`One machine-readable line per item`]].map(([e,t,n])=>{let r=e===`compact`&&x.verbose;return(0,W.jsxs)(`label`,{className:J(`inline-flex cursor-pointer items-center gap-1.5 rounded-full border px-2.5 py-1.5 font-mono text-[11px] select-none`,x[e]?`border-brand/55 bg-brand/10 text-foreground`:`border-border bg-muted/40 text-muted-foreground`,r&&`cursor-not-allowed opacity-45`),title:n,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`accent-brand`,checked:x[e],disabled:r,onChange:()=>D(e)}),t]},e)})]}),c&&(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2 rounded-md border border-warning/45 bg-warning/10 px-3 py-2.5 text-xs`,children:[(0,W.jsxs)(`strong`,{children:[`Restore `,c]}),` onto`,` `,(0,W.jsx)(Jx,{value:f,onValueChange:p,size:`sm`,"aria-label":`Restore target device`,options:e.devices.map(e=>({value:e,label:e}))}),` `,`via Safe Mode (auto-reverts on lock-out).`,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>void j(!1),disabled:i,children:`Dry-run`}),(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>void j(!0),disabled:i,children:`Restore (commit)`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>l(null),children:`Cancel`})]}),e.backups.length===0?(0,W.jsx)(`div`,{className:`p-3 text-muted-foreground text-[11px]`,children:"No backups yet. Click “Create backup” to capture this device’s config, or upload a `.rsc`."}):(0,W.jsx)(`div`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border`,children:(0,W.jsxs)(Yb,{className:`min-w-[980px] table-fixed`,children:[(0,W.jsx)(Xb,{className:`bg-card sticky top-0 z-10`,children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`name`}),(0,W.jsx)($b,{className:`w-[130px]`,children:`device`}),(0,W.jsx)($b,{className:`w-[90px] text-right`,children:`size`}),(0,W.jsx)($b,{className:`w-[170px]`,children:`captured`}),(0,W.jsx)($b,{className:`w-[380px]`,children:`actions`})]})}),(0,W.jsx)(Zb,{children:e.backups.map(e=>(0,W.jsxs)(Qb,{"data-state":m?.name===e.name?`selected`:void 0,children:[(0,W.jsx)(ex,{className:`truncate font-mono`,title:e.name,children:e.name}),(0,W.jsx)(ex,{className:`truncate`,children:e.device??`—`}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:dx(e.bytes)}),(0,W.jsx)(ex,{className:`tabular-nums whitespace-nowrap`,children:new Date(e.modified).toLocaleString(void 0,{hour12:!1})}),(0,W.jsx)(ex,{onClick:e=>e.stopPropagation(),children:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>M(e.name),children:`view`}),(0,W.jsx)(`a`,{className:`inline-flex items-center rounded-md border border-border px-2 py-1 text-xs hover:bg-accent`,href:hc(`/api/backups/raw?name=${encodeURIComponent(e.name)}`),download:e.name,title:`Download`,children:(0,W.jsx)(Vc,{className:`size-3.5`})}),u?.name===e.name?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Wx,{className:`inline-block w-[120px] text-xs`,value:u.value,autoFocus:!0,onChange:t=>d({name:e.name,value:t.target.value}),onKeyDown:e=>e.key===`Enter`&&void A()}),(0,W.jsx)(X,{type:`accent`,size:`sm`,icon:(0,W.jsx)(Nc,{}),onClick:()=>void A()}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,icon:(0,W.jsx)(gl,{}),onClick:()=>d(null)})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>d({name:e.name,value:e.name}),children:`rename`}),(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>l(e.name),children:`restore`})]}),o===e.name?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{type:`error`,size:`sm`,ghost:!0,icon:(0,W.jsx)(Nc,{}),onClick:()=>void k(e.name)}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,icon:(0,W.jsx)(gl,{}),onClick:()=>s(null)})]}):(0,W.jsx)(X,{type:`error`,size:`sm`,ghost:!0,icon:(0,W.jsx)(fl,{}),onClick:()=>s(e.name)})]})})]},e.name))})]})})]}),m&&(0,W.jsx)(ax,{title:`Backup · ${m.name}`,className:`reveal`,extra:(0,W.jsx)(X,{type:`secondary`,size:`sm`,icon:(0,W.jsx)(gl,{}),onClick:()=>h(null),children:`Close`}),children:(0,W.jsx)(`pre`,{className:`m-0 overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap`,style:{maxHeight:460},children:m.content||`(empty)`})})]})}function Zx({className:e,orientation:t=`horizontal`,...n}){return(0,W.jsx)(uee,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:J(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Qx=ab(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Aee({className:e,variant:t=`default`,...n}){return(0,W.jsx)(zv,{"data-slot":`tabs-list`,"data-variant":t,className:J(Qx({variant:t}),e),...n})}function jee({className:e,...t}){return(0,W.jsx)(Bv,{"data-slot":`tabs-trigger`,className:J(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function $x({className:e,...t}){return(0,W.jsx)(Vv,{"data-slot":`tabs-content`,className:J(`flex-1 outline-none`,e),...t})}var eS=`http://www.w3.org/2000/svg`,tS=864e5,nS=e=>new Date(e).toISOString().slice(0,10);function rS(){let e=new Date;return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}function Mee(e){return new Date(`${e}T00:00:00Z`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`})}function iS({endpoint:e,days:t=90}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!0);(0,v.useEffect)(()=>{let t=!0;return a(!0),gc(e).then(e=>{t&&r(e)}).catch(()=>{t&&r(null)}).finally(()=>{t&&a(!1)}),()=>{t=!1}},[e]);let o=(0,v.useMemo)(()=>{let e=new Map((n?.series??[]).map(e=>[e.day,e])),r=rS(),i=[];for(let n=t-1;n>=0;n--){let t=nS(r-n*tS),a=e.get(t);i.push(a??{day:t,rx:0,tx:0})}return i},[n,t]);if(i)return(0,W.jsx)(`div`,{className:`px-1 py-4 text-[12.5px] text-muted-foreground`,children:`loading usage…`});if(!((n?.totalRx??0)+(n?.totalTx??0)>0))return(0,W.jsx)(`div`,{className:`px-1 py-4 text-[12.5px] text-muted-foreground`,children:`No usage recorded yet. The dashboard samples on a configurable interval (1 minute by default — see the RADIUS & UM Settings tab); history fills in over time (kept ~3 months).`});let s=Math.max(1,...o.flatMap(e=>[e.rx,e.tx])),c=e=>8+e*624/Math.max(1,o.length-1),l=e=>142-e/s*134,u=e=>o.map((t,n)=>`${c(n).toFixed(1)},${l(e(t)).toFixed(1)}`).join(` `),d=e=>{let t=c(0).toFixed(1),n=c(o.length-1).toFixed(1);return`${t},${142 .toFixed(1)} ${u(e)} ${n},${142 .toFixed(1)}`};return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1.5 flex items-baseline gap-3.5 text-xs tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`font-semibold text-chart-3`,children:[`↓ `,dx(n?.totalRx??0),` down`]}),(0,W.jsxs)(`span`,{className:`font-semibold text-chart-4`,children:[`↑ `,dx(n?.totalTx??0),` up`]}),(0,W.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`· peak/day `,dx(s),` · last `,t,` days`]})]}),(0,W.jsxs)(`svg`,{className:`block h-40 w-full rounded-md border border-border bg-card`,viewBox:`0 0 640 150`,preserveAspectRatio:`none`,xmlns:eS,role:`img`,children:[(0,W.jsx)(`polygon`,{className:`fill-chart-3/20`,points:d(e=>e.rx)}),(0,W.jsx)(`polygon`,{className:`fill-chart-4/15`,points:d(e=>e.tx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-chart-3 stroke-2 [vector-effect:non-scaling-stroke]`,points:u(e=>e.rx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-chart-4 stroke-2 [vector-effect:non-scaling-stroke]`,points:u(e=>e.tx)})]})]})}var aS=53,oS=12,sS=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],cS=[`var(--muted)`,`color-mix(in srgb, var(--chart-3) 30%, var(--muted))`,`color-mix(in srgb, var(--chart-3) 50%, var(--muted))`,`color-mix(in srgb, var(--chart-3) 72%, transparent)`,`var(--chart-3)`];function lS({endpoint:e,label:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),o=(0,v.useRef)(null);(0,v.useEffect)(()=>{let t=!0;return gc(e).then(e=>{t&&r(e)}).catch(()=>{t&&r({days:[],total:0,max:0})}),()=>{t=!1}},[e]);let{cells:s,monthLabels:c}=(0,v.useMemo)(()=>{let e=new Map((n?.days??[]).map(e=>[e.day,e.count])),t=rS(),r=t-(new Date(t).getUTCDay()+(aS-1)*7)*tS,i=[],a=[],o=-1;for(let n=0;n<aS*7;n++){let s=r+n*tS;if(s>t)break;let c=Math.floor(n/7),l=new Date(s).getUTCDay(),u=nS(s);if(i.push({day:u,count:e.get(u)??0,col:c,row:l,ms:s}),l===0){let e=new Date(s).getUTCMonth();e!==o&&(a.push({col:c,text:sS[e]}),o=e)}}return{cells:i,monthLabels:a}},[n]),l=Math.max(1,n?.max??1),u=e=>e<=0?0:Math.min(4,Math.ceil(e/l*4)),d=(e,t)=>{let n=o.current;if(!n)return;let r=e.currentTarget.getBoundingClientRect(),i=n.getBoundingClientRect();a({left:r.left-i.left+r.width/2,top:r.top-i.top,day:t.day,count:t.count,lvl:u(t.count)})};return(0,W.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,W.jsxs)(`div`,{className:`mb-1.5 flex items-baseline gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-[12.5px] font-semibold`,children:t??`Connections`}),(0,W.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:n?`${n.total} total`:`…`})]}),(0,W.jsx)(`div`,{className:`overflow-x-auto pb-1`,onMouseLeave:()=>a(null),children:(0,W.jsxs)(`svg`,{className:`block`,viewBox:`0 0 823 121`,width:823,height:121,xmlns:eS,role:`img`,children:[c.map(e=>(0,W.jsx)(`text`,{className:`fill-muted-foreground text-[9px]`,x:28+e.col*15,y:11,children:e.text},`${e.col}-${e.text}`)),[`Mon`,`Wed`,`Fri`].map((e,t)=>(0,W.jsx)(`text`,{className:`fill-muted-foreground text-[9px]`,x:0,y:16+(t*2+1)*15+oS-2,children:e},e)),s.map(e=>(0,W.jsx)(`rect`,{className:`cursor-pointer stroke-1 [transition:stroke_0.1s_ease] ${i?.day===e.day?`stroke-foreground stroke-[1.5px]`:`stroke-border/60`}`,style:{fill:cS[u(e.count)]},x:28+e.col*15,y:16+e.row*15,width:oS,height:oS,rx:2,onMouseEnter:t=>d(t,e)},e.day))]})}),i&&(0,W.jsxs)(`div`,{className:`pointer-events-none absolute z-30 min-w-[150px] -translate-x-1/2 translate-y-[calc(-100%-9px)] rounded-[10px] border border-chart-3/35 bg-popover px-2.5 py-2 shadow-xl`,style:{left:i.left,top:i.top},role:`tooltip`,children:[(0,W.jsx)(`span`,{className:`absolute -bottom-1.5 left-1/2 size-[11px] -translate-x-1/2 rotate-45 border-r border-b border-chart-3/35 bg-popover`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,W.jsx)(`span`,{className:`inline-block size-[12px] rounded-[2px]`,style:{background:cS[i.lvl]}}),(0,W.jsx)(`b`,{className:`font-semibold`,children:i.count===0?`No connections`:`${i.count} connection${i.count===1?``:`s`}`})]}),(0,W.jsx)(`div`,{className:`mt-[3px] text-[11.5px] text-muted-foreground tabular-nums`,children:Mee(i.day)})]}),(0,W.jsxs)(`div`,{className:`mt-2 flex items-center gap-1 text-[11px] text-muted-foreground`,children:[`Less`,[0,1,2,3,4].map(e=>(0,W.jsx)(`span`,{className:`inline-block size-[11px] rounded-[2px]`,style:{background:cS[e]}},e)),`More`]})]})}var uS=e=>(e.flags??``).includes(`X`)||e.disabled===`yes`;function dS(e,t){return e[t.idKey]||e.name||e.address||e.user||`(row)`}var fS=`mb-3.5 rounded-md border border-border bg-card p-3.5`,pS=`mb-2.5 text-[13px] font-semibold`,mS=`grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-x-3.5 gap-y-2.5`,hS=`mt-3.5 flex items-center gap-2.5`,gS=`flex flex-col gap-1`,_S=`text-[11.5px] text-muted-foreground`;function vS({config:e,device:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)({}),m=(0,v.useCallback)(async()=>{try{let n=t?`?device=${encodeURIComponent(t)}`:``;r(await gc(`/api/aaa/list/${e.slug}${n}`)),a(null)}catch(e){a(e instanceof Error?e.message:String(e))}},[e.slug,t]);(0,v.useEffect)(()=>{r(null),d(null),m()},[m]);let h=(0,v.useCallback)(async(n,r)=>{s(!0),a(null);try{let i=await _c(`/api/aaa/${n}`,{device:t,slug:e.slug,...r}),o=n===`add`?`Entry added`:n===`update`?`Entry saved`:n===`remove`?`Entry removed`:n===`toggle`?r.enable?`Entry enabled`:`Entry disabled`:`Done`;return i.ok?(await m(),Y.success(o),!0):(a(i.message),Y.error(i.message||`${o} failed`),!1)}catch(e){return a(e instanceof Error?e.message:String(e)),Y.error(e instanceof Error?e.message:`Action failed`),!1}finally{s(!1)}},[t,e.slug,m]),g=()=>{d(`new`),p({})},_=t=>{d(t[e.idKey]);let n={};for(let r of e.fields)r.type!==`password`&&(r.key===`disabled`?n.disabled=uS(t)?`yes`:`no`:t[r.key]!=null&&(n[r.key]=t[r.key]));p(n)},y=async()=>{(u===`new`?await h(`add`,{fields:f}):await h(`update`,{id:u,fields:f}))&&d(null)},b=(0,v.useMemo)(()=>{let t=n?.rows??[],r=c.trim().toLowerCase();return r?t.filter(t=>e.columns.some(e=>(t[e.key]??``).toLowerCase().includes(r))):t},[n,c,e.columns]);return n&&!n.available?(0,W.jsxs)(Lx,{type:`warning`,label:`User Manager not installed`,children:[`This device doesn't have the `,(0,W.jsx)(`code`,{children:`user-manager`}),` package. Install it (System → Packages) and reboot to manage the built-in RADIUS server here.`]}):(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2.5`,children:[(0,W.jsx)(Wx,{className:`w-[200px]`,placeholder:`Filter…`,value:c,onChange:e=>l(e.target.value)}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[b.length,` rows`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:()=>void m(),children:`Refresh`}),(0,W.jsx)(X,{size:`sm`,type:`accent`,icon:(0,W.jsx)(Qc,{}),onClick:g,children:`Add`})]}),i&&(0,W.jsx)(Lx,{type:`error`,className:`mb-2.5`,children:i}),u&&(0,W.jsxs)(`div`,{className:fS,children:[(0,W.jsx)(`div`,{className:pS,children:u===`new`?`New ${e.slug}`:`Edit ${u}`}),(0,W.jsx)(`div`,{className:mS,children:e.fields.map(e=>(0,W.jsxs)(`label`,{className:gS,children:[(0,W.jsxs)(`span`,{className:_S,children:[e.label,e.required&&u===`new`?` *`:``]}),e.type===`bool`?(0,W.jsx)(Jx,{value:f[e.key]??``,onValueChange:t=>p({...f,[e.key]:t}),options:[{value:``,label:`—`},{value:`no`,label:`no`},{value:`yes`,label:`yes`}]}):e.type===`select`?(0,W.jsx)(Jx,{value:f[e.key]??``,onValueChange:t=>p({...f,[e.key]:t}),options:[{value:``,label:`—`},...(e.options??[]).map(e=>({value:e,label:e}))]}):(0,W.jsx)(Wx,{type:e.type===`password`?`password`:e.type===`number`?`number`:`text`,placeholder:e.placeholder??(e.type===`password`?`(unchanged)`:``),value:f[e.key]??``,onChange:t=>p({...f,[e.key]:t.target.value})})]},e.key))}),(0,W.jsxs)(`div`,{className:hS,children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:o,onClick:()=>void y(),children:u===`new`?`Create`:`Save`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>d(null),children:`Cancel`})]})]}),n?b.length===0?(0,W.jsx)(`div`,{className:`px-1 py-5 text-muted-foreground text-[11px]`,children:e.empty??`Nothing here yet.`}):(0,W.jsxs)(Yb,{className:`text-[13px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[e.columns.map(e=>(0,W.jsx)($b,{children:e.label},e.key)),(0,W.jsx)($b,{className:`text-right`,children:`Actions`})]})}),(0,W.jsx)(Zb,{children:b.map(t=>{let n=t[e.idKey],r=uS(t);return(0,W.jsxs)(Qb,{children:[e.columns.map(e=>(0,W.jsx)(ex,{className:J(r&&`text-muted-foreground`),title:t[e.key]??``,children:e.key===`_status`?(0,W.jsx)(Bx,{type:r?`secondary`:`success`,children:r?`disabled`:`enabled`}):t[e.key]??``},e.key)),(0,W.jsx)(ex,{className:`text-right`,children:(0,W.jsxs)(`span`,{className:`flex justify-end gap-1.5`,children:[e.toggle&&(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:o,onClick:()=>void h(`toggle`,{id:n,enable:r}),children:r?`Enable`:`Disable`}),!e.addOnly&&(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:o,onClick:()=>_(t),children:`Edit`}),(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,disabled:o,onClick:()=>void h(`remove`,{id:n}),children:`Remove`})]})})]},n||dS(t,e))})})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading…`})]})}var yS=[`user`,`calling-station-id`,`nas-ip-address`,`started`,`ended`,`uptime`,`download`,`upload`,`status`];function bS({device:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),s=(0,v.useCallback)(async()=>{try{let t=e?`?device=${encodeURIComponent(e)}`:``;n(await gc(`/api/aaa/list/um-sessions${t}`)),i(null)}catch(e){i(e instanceof Error?e.message:String(e))}},[e]);if((0,v.useEffect)(()=>{n(null),s();let e=setInterval(()=>void s(),1e4);return()=>clearInterval(e)},[s]),t&&!t.available)return(0,W.jsxs)(Lx,{type:`warning`,label:`User Manager not installed`,children:[`The `,(0,W.jsx)(`code`,{children:`user-manager`}),` package isn't installed on this device.`]});let c=(t?.rows??[]).filter(e=>!a.trim()||(e.user??``).toLowerCase().includes(a.trim().toLowerCase()));return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2.5`,children:[(0,W.jsx)(Wx,{className:`w-[200px]`,placeholder:`Filter by user…`,value:a,onChange:e=>o(e.target.value)}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[c.length,` sessions`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:()=>void s(),children:`Refresh`})]}),r&&(0,W.jsx)(Lx,{type:`error`,children:r}),t?c.length===0?(0,W.jsx)(`div`,{className:`px-1 py-5 text-muted-foreground text-[11px]`,children:`No accounting sessions recorded.`}):(0,W.jsxs)(Yb,{className:`text-[13px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsx)(Qb,{children:yS.map(e=>(0,W.jsx)($b,{children:e.replace(/-/g,` `)},e))})}),(0,W.jsx)(Zb,{children:c.map((e,t)=>(0,W.jsx)(Qb,{children:yS.map(t=>(0,W.jsx)(ex,{title:e[t]??``,children:e[t]??``},t))},e[`.id`]||t))})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading…`})]})}function xS({device:e,getPath:t,setPath:n,fields:r,title:i,unwrap:a,extra:o}){let[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!0),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),_=(0,v.useCallback)(async()=>{let{available:n,row:r}=a(await gc(`${t}${e?`?device=${encodeURIComponent(e)}`:``}`).catch(()=>null));u(n),c(r),f({})},[e,t,a]);(0,v.useEffect)(()=>{_()},[_]);let y=async()=>{g(!0),m(null);try{let t=await _c(n,{device:e,fields:d});m(t.message),t.ok?(await _(),Y.success(`Settings saved`)):Y.error(t.message||`Save failed`)}catch(e){Y.error(e instanceof Error?e.message:`Save failed`)}finally{g(!1)}};return l?(0,W.jsxs)(`div`,{className:fS,children:[(0,W.jsx)(`div`,{className:pS,children:i}),s&&(0,W.jsx)(`div`,{className:`mb-3 text-muted-foreground text-xs`,children:r.map(e=>`${e.label}: ${s[e.key]??`—`}`).join(` · `)}),(0,W.jsx)(`div`,{className:mS,children:r.map(e=>(0,W.jsxs)(`label`,{className:gS,children:[(0,W.jsx)(`span`,{className:_S,children:e.label}),e.type===`bool`?(0,W.jsx)(Jx,{value:d[e.key]??``,onValueChange:t=>f({...d,[e.key]:t}),options:[{value:``,label:`(unchanged)`},{value:`no`,label:`no`},{value:`yes`,label:`yes`}]}):(0,W.jsx)(Wx,{type:e.type===`number`?`number`:`text`,placeholder:e.placeholder??s?.[e.key]??``,value:d[e.key]??``,onChange:t=>f({...d,[e.key]:t.target.value})})]},e.key))}),(0,W.jsxs)(`div`,{className:hS,children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:h,onClick:()=>void y(),children:`Save`}),o,p&&(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:p})]})]}):(0,W.jsxs)(Lx,{type:`warning`,label:`Not available`,children:[i,` is not available on this device.`]})}var SS={slug:`radius`,idKey:`.id`,toggle:!0,columns:[{key:`address`,label:`Address`},{key:`service`,label:`Service`},{key:`authentication-port`,label:`Auth`},{key:`accounting-port`,label:`Acct`},{key:`protocol`,label:`Proto`},{key:`_status`,label:`Status`}],empty:`No RADIUS servers configured.`,fields:[{key:`address`,label:`Address`,required:!0,placeholder:`1.2.3.4 or host`},{key:`secret`,label:`Secret`,type:`password`,required:!0},{key:`service`,label:`Service`,required:!0,placeholder:`login,ppp,hotspot,wireless,dhcp,ipsec,dot1x`},{key:`authentication-port`,label:`Auth port`,type:`number`,placeholder:`1812`},{key:`accounting-port`,label:`Acct port`,type:`number`,placeholder:`1813`},{key:`timeout`,label:`Timeout`,placeholder:`300ms`},{key:`src-address`,label:`Src address`},{key:`realm`,label:`Realm`},{key:`called-id`,label:`Called ID`},{key:`domain`,label:`Domain`},{key:`protocol`,label:`Protocol`,type:`select`,options:[`udp`,`radsec`]},{key:`certificate`,label:`Certificate`},{key:`accounting-backup`,label:`Acct backup`,type:`bool`},{key:`comment`,label:`Comment`},{key:`disabled`,label:`Disabled`,type:`bool`}]},CS={slug:`um-users`,idKey:`name`,toggle:!0,columns:[{key:`name`,label:`Name`},{key:`group`,label:`Group`},{key:`shared-users`,label:`Shared`},{key:`caller-id`,label:`Caller ID`},{key:`comment`,label:`Comment`},{key:`_status`,label:`Status`}],empty:`No RADIUS users.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`password`,label:`Password`,type:`password`,required:!0},{key:`group`,label:`Group`},{key:`shared-users`,label:`Shared users`,type:`number`,placeholder:`1`},{key:`attributes`,label:`RADIUS attributes`},{key:`caller-id`,label:`Caller ID (MAC)`},{key:`otp-secret`,label:`OTP secret`,type:`password`},{key:`comment`,label:`Comment`},{key:`disabled`,label:`Disabled`,type:`bool`}]},wS={slug:`um-profiles`,idKey:`name`,columns:[{key:`name`,label:`Name`},{key:`name-for-users`,label:`Display`},{key:`validity`,label:`Validity`},{key:`price`,label:`Price`},{key:`starts-when`,label:`Starts`}],empty:`No service profiles.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`name-for-users`,label:`Display name`},{key:`validity`,label:`Validity`,placeholder:`30d`},{key:`price`,label:`Price`,type:`number`},{key:`starts-when`,label:`Starts when`,type:`select`,options:[`assigned`,`first-auth`]},{key:`override-shared-users`,label:`Override shared-users`},{key:`comment`,label:`Comment`}]},TS={slug:`um-limitations`,idKey:`name`,columns:[{key:`name`,label:`Name`},{key:`rate-limit-rx`,label:`Rate ↓`},{key:`rate-limit-tx`,label:`Rate ↑`},{key:`transfer-limit`,label:`Transfer`},{key:`uptime-limit`,label:`Uptime`}],empty:`No limitation templates.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`rate-limit-rx`,label:`Download rate`,placeholder:`10M`},{key:`rate-limit-tx`,label:`Upload rate`,placeholder:`10M`},{key:`rate-limit-min-rx`,label:`Min download (CIR)`,placeholder:`2M`},{key:`rate-limit-min-tx`,label:`Min upload (CIR)`,placeholder:`2M`},{key:`rate-limit-burst-rx`,label:`Burst download`,placeholder:`20M`},{key:`rate-limit-burst-tx`,label:`Burst upload`,placeholder:`20M`},{key:`rate-limit-burst-threshold-rx`,label:`Burst thr. ↓`},{key:`rate-limit-burst-threshold-tx`,label:`Burst thr. ↑`},{key:`rate-limit-burst-time-rx`,label:`Burst time ↓`,placeholder:`10s`},{key:`rate-limit-burst-time-tx`,label:`Burst time ↑`,placeholder:`10s`},{key:`rate-limit-priority`,label:`Priority (1-8)`,type:`number`},{key:`download-limit`,label:`Download cap`,placeholder:`5G`},{key:`upload-limit`,label:`Upload cap`,placeholder:`5G`},{key:`transfer-limit`,label:`Total transfer cap`,placeholder:`10G`},{key:`uptime-limit`,label:`Uptime cap`,placeholder:`1d`},{key:`reset-counters-interval`,label:`Reset interval`},{key:`reset-counters-start-time`,label:`Reset start time`},{key:`comment`,label:`Comment`}]},ES={slug:`um-routers`,idKey:`name`,toggle:!0,columns:[{key:`name`,label:`Name`},{key:`address`,label:`Address`},{key:`coa-port`,label:`CoA port`},{key:`protocol`,label:`Proto`},{key:`comment`,label:`Comment`},{key:`_status`,label:`Status`}],empty:`No NAS clients registered.`,fields:[{key:`name`,label:`Name`,required:!0},{key:`address`,label:`Address`,required:!0,placeholder:`192.168.88.1`},{key:`shared-secret`,label:`Shared secret`,type:`password`,required:!0},{key:`coa-port`,label:`CoA port`,type:`number`},{key:`protocol`,label:`Protocol`,placeholder:`radius`},{key:`comment`,label:`Comment`},{key:`disabled`,label:`Disabled`,type:`bool`}]},DS={slug:`um-user-profiles`,idKey:`.id`,addOnly:!0,columns:[{key:`user`,label:`User`},{key:`profile`,label:`Profile`},{key:`state`,label:`State`},{key:`end-time`,label:`Ends`}],empty:`No profile assignments.`,fields:[{key:`user`,label:`User`,required:!0},{key:`profile`,label:`Profile`,required:!0}]},OS=[{id:`radius`,label:`RADIUS Servers`},{id:`users`,label:`Users`},{id:`profiles`,label:`Profiles`},{id:`limitations`,label:`Limitations`},{id:`nas`,label:`NAS Clients`},{id:`assignments`,label:`Assignments`},{id:`sessions`,label:`Sessions`},{id:`usage`,label:`Usage & Heatmap`},{id:`settings`,label:`Settings`}],kS=[{key:`accept`,label:`Accept CoA`,type:`bool`},{key:`port`,label:`CoA port`,type:`number`,placeholder:`3799`}],AS=[{key:`enabled`,label:`Enabled`,type:`bool`},{key:`use-profiles`,label:`Use profiles`,type:`bool`},{key:`certificate`,label:`Certificate`},{key:`authentication-port`,label:`Auth port`,type:`number`},{key:`accounting-port`,label:`Acct port`,type:`number`}];function jS({device:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/usage/um-users${e?`?device=${encodeURIComponent(e)}`:``}`).then(e=>{n(e.users),i(t=>t||e.users[0]||``)}).catch(()=>n([]))},[e]);let a=e?`&device=${encodeURIComponent(e)}`:``;return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`User`}),(0,W.jsx)(Jx,{value:r,onValueChange:i,"aria-label":`User`,options:t&&t.length>0?t.map(e=>({value:e,label:e})):[{value:``,label:`— no sessions recorded yet —`}]})]}),t&&t.length===0?(0,W.jsx)(Lx,{type:`secondary`,label:`No data yet`,children:`No User Manager sessions have been recorded yet. The dashboard ingests sessions on a configurable interval (1 minute by default — change it under the Settings tab) and keeps them forever, so usage and the heatmap fill in over time.`}):r&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:`Download / upload · last 3 months`}),(0,W.jsx)(iS,{endpoint:`/api/usage/um-user?user=${encodeURIComponent(r)}${a}&days=90`,days:90})]}),(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsxs)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:[`Connection heatmap · `,r]}),(0,W.jsx)(lS,{endpoint:`/api/usage/heatmap?user=${encodeURIComponent(r)}${a}&days=371`,label:`${r} — connections`})]}),(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:`All users · connections`}),(0,W.jsx)(lS,{endpoint:`/api/usage/heatmap?days=371${a}`,label:`All users`})]})]})]})}function MS(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),c=(0,v.useCallback)(async()=>{try{let e=await gc(`/api/usage/sampler`);r(e.intervalMs)}catch{r(null)}},[]);(0,v.useEffect)(()=>{c()},[c]);let l=async()=>{let n=Number(e);if(!Number.isFinite(n)||n<=0){s(`Enter a positive number of minutes.`),Y.error(`Enter a positive number of minutes`);return}a(!0),s(null);try{let e=await _c(`/api/usage/sampler`,{intervalMs:Math.round(n*6e4)});r(e.intervalMs),t(``),s(`Now sampling every ${NS(e.intervalMs)}.`),Y.success(`Now sampling every ${NS(e.intervalMs)}`)}catch(e){s(e instanceof Error?e.message:String(e)),Y.error(e instanceof Error?e.message:`Save failed`)}finally{a(!1)}};return(0,W.jsxs)(`div`,{className:`rounded-md border border-border bg-card p-3.5`,children:[(0,W.jsx)(`div`,{className:pS,children:`Usage sampling`}),(0,W.jsxs)(`div`,{className:`mb-3 text-muted-foreground text-xs`,children:[`How often client traffic + User Manager sessions are recorded into the usage history. Current: `,n==null?`…`:NS(n),` · default 1 minute · range 30s–6h.`]}),(0,W.jsx)(`div`,{className:mS,children:(0,W.jsxs)(`label`,{className:gS,children:[(0,W.jsx)(`span`,{className:_S,children:`Interval (minutes)`}),(0,W.jsx)(Wx,{type:`number`,step:`0.5`,min:`0.5`,placeholder:n?String(n/6e4):`1`,value:e,onChange:e=>t(e.target.value)})]})}),(0,W.jsxs)(`div`,{className:hS,children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:i,onClick:()=>void l(),children:`Save`}),[1,5,10,30].map(e=>(0,W.jsxs)(X,{size:`sm`,ghost:!0,onClick:()=>{t(String(e))},children:[e,`m`]},e)),o&&(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:o})]})]})}function NS(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=e/6e4;return`${Number.isInteger(t)?t:t.toFixed(1)} min`}function PS(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`radius`);(0,v.useEffect)(()=>{gc(`/api/devices`).then(e=>{t(e),r(t=>t||e.defaultDevice||e.devices[0]?.name||``)}).catch(()=>t({server:``,defaultDevice:``,devices:[]}))},[]);let o=e?.devices??[];return(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsx)(ax,{title:`RADIUS & User Manager`,className:`reveal`,extra:o.length>1?(0,W.jsx)(Jx,{value:n,onValueChange:r,"aria-label":`Router`,options:o.map(e=>({value:e.name,label:`${e.name}${e.isDefault?` (default)`:``}`}))}):void 0,children:(0,W.jsxs)(Zx,{value:i,onValueChange:e=>a(e),children:[(0,W.jsx)(Aee,{variant:`line`,className:`mb-3.5 h-auto w-full flex-wrap justify-start border-b border-border`,children:OS.map(e=>(0,W.jsx)(jee,{value:e.id,children:e.label},e.id))}),(0,W.jsx)($x,{value:`radius`,children:(0,W.jsx)(vS,{config:SS,device:n})}),(0,W.jsx)($x,{value:`users`,children:(0,W.jsx)(vS,{config:CS,device:n})}),(0,W.jsx)($x,{value:`profiles`,children:(0,W.jsx)(vS,{config:wS,device:n})}),(0,W.jsx)($x,{value:`limitations`,children:(0,W.jsx)(vS,{config:TS,device:n})}),(0,W.jsx)($x,{value:`nas`,children:(0,W.jsx)(vS,{config:ES,device:n})}),(0,W.jsx)($x,{value:`assignments`,children:(0,W.jsx)(vS,{config:DS,device:n})}),(0,W.jsx)($x,{value:`sessions`,children:(0,W.jsx)(bS,{device:n})}),(0,W.jsx)($x,{value:`usage`,children:(0,W.jsx)(jS,{device:n})}),(0,W.jsx)($x,{value:`settings`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(xS,{device:n,getPath:`/api/aaa/radius-incoming`,setPath:`/api/aaa/radius-incoming`,title:`RADIUS Incoming (CoA listener)`,fields:kS,unwrap:e=>({available:!0,row:e??{}}),extra:(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>void _c(`/api/aaa/radius-reset-counters`,{device:n}).then(()=>Y.success(`Counters reset`)).catch(()=>Y.error(`Reset counters failed`)),children:`Reset RADIUS counters`})}),(0,W.jsx)(xS,{device:n,getPath:`/api/aaa/um-settings`,setPath:`/api/aaa/um-settings`,title:`User Manager (built-in RADIUS server)`,fields:AS,unwrap:e=>{let t=e??{};return{available:t.available!==!1,row:t.settings??{}}}}),(0,W.jsx)(MS,{})]})})]})})})}function FS({className:e,...t}){return(0,W.jsx)(`textarea`,{"data-slot":`textarea`,className:J(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}var IS={add:`+`,set:`~`,remove:`−`,enable:`▲`,disable:`▽`,move:`⇅`},LS={high:`border-l-destructive`,medium:`border-l-warning`,low:`border-l-success`};function RS(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),c=async()=>{s(!0),a(null);let t=await _c(`/api/plan`,{script:e}).catch(()=>({error:`request failed`}));if(s(!1),t.error||!t.plan){a(t.error??`no plan produced`),r(null),Y.error(t.error??`no plan produced`);return}r({plan:t.plan,text:t.text??``}),Y.success(`Plan ready`)},l=n?.plan.grade??``,u=l===`critical`||l===`high`;return(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(ax,{title:`Change plan — dry-run`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`terraform-style preview · pure analysis, never touches a device`}),children:[(0,W.jsx)(FS,{className:`min-h-40 resize-y font-mono text-xs leading-relaxed`,spellCheck:!1,placeholder:`Paste intended RouterOS commands, one per line, e.g.
|
|
78
78
|
/ip firewall filter add chain=input action=drop in-interface=WAN
|
|
79
79
|
/ip address add address=10.0.0.1/24 interface=ether1
|
|
80
|
-
/ip address remove [find address=192.168.88.1/24]`,value:e,onChange:e=>t(e.target.value)}),(0,W.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(X,{type:`accent`,size:`sm`,icon:(0,W.jsx)(Zc,{}),loading:o,onClick:()=>void c(),disabled:o||!e.trim(),children:o?`Planning…`:`Plan`}),i&&(0,W.jsx)(`span`,{className:`text-destructive text-xs`,children:i})]})]}),n&&(0,W.jsxs)(ax,{title:`Plan`,className:`reveal`,extra:(0,W.jsxs)(`span`,{className:J(`rounded-full border px-2.5 py-1 font-mono text-[11px]`,u?`border-destructive/45 bg-destructive/10 text-destructive`:`border-success/45 bg-success/10 text-success`),children:[`risk `,n.plan.riskScore,` · `,l]}),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground`,children:[(0,W.jsxs)(`span`,{children:[`+`,n.plan.counts.add,` to add`]}),(0,W.jsxs)(`span`,{children:[`~`,n.plan.counts.modify,` to modify`]}),(0,W.jsxs)(`span`,{children:[`-`,n.plan.counts.remove,` to remove`]}),n.plan.reordered&&(0,W.jsx)(`span`,{children:`· reordered into a safe sequence`})]}),n.plan.warnings.length>0&&(0,W.jsx)(`div`,{className:`my-2.5 grid gap-1`,children:n.plan.warnings.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-warning text-xs`,children:[(0,W.jsx)(pl,{className:`size-3.5 shrink-0`}),` `,e]},t))}),(0,W.jsx)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:n.plan.steps.map(e=>(0,W.jsxs)(`div`,{className:J(`flex items-center gap-2.5 rounded-md border border-border border-l-[3px] bg-muted/40 px-3 py-2 font-mono text-xs`,LS[e.risk]??`border-l-border`),children:[(0,W.jsx)(`span`,{className:`grid size-[18px] flex-none place-items-center rounded bg-brand/15 font-bold text-brand`,children:IS[e.op]??`•`}),(0,W.jsx)(`code`,{className:`flex-1 [overflow-wrap:anywhere] text-foreground`,children:e.command}),e.lockoutRisk&&(0,W.jsx)(`span`,{className:`rounded-full border border-destructive/45 px-1.5 py-px text-[10px] text-destructive`,children:`⚠ lock-out`}),(0,W.jsx)(`span`,{className:`text-[10px] tracking-wide text-muted-foreground uppercase`,children:e.risk})]},e.index))})]})]})}var zS=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function BS(e){return typeof e==`string`?zS.includes(e):!1}var VS=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function HS(e){return typeof e==`string`?VS.has(e):!1}function US(e){return typeof e==`string`&&e.startsWith(`data-`)}function WS(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(HS(n)||US(n))&&(t[n]=e[n]);return t}function GS(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return WS(t)}return typeof e==`object`&&!Array.isArray(e)?WS(e):null}function KS(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(HS(n)||US(n)||BS(n))&&(t[n]=e[n]);return t}function qS(e){return e==null?null:(0,v.isValidElement)(e)?KS(e.props):typeof e==`object`&&!Array.isArray(e)?KS(e):null}var JS=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function YS(){return YS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YS.apply(null,arguments)}function XS(e,t){if(e==null)return{};var n,r,i=ZS(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZS(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var QS=(0,v.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=XS(e,JS),d=a||{width:r,height:i,x:0,y:0},f=Hv(`recharts-surface`,o);return v.createElement(`svg`,YS({},KS(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),v.createElement(`title`,null,c),v.createElement(`desc`,null,l),n)}),$S=[`children`,`className`];function eC(){return eC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eC.apply(null,arguments)}function tC(e,t){if(e==null)return{};var n,r,i=nC(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nC(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rC=v.forwardRef((e,t)=>{var n=e.children,r=e.className,i=tC(e,$S),a=Hv(`recharts-layer`,r);return v.createElement(`g`,eC({className:a},KS(i),{ref:t}),n)}),iC=(0,v.createContext)(null);function aC(e){return function(){return e}}var oC=Math.PI,sC=2*oC,cC=1e-6,lC=sC-cC;function uC(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function dC(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return uC;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var fC=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?uC:dC(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>cC)if(!(Math.abs(u*s-c*l)>cC)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((oC-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>cC&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>cC||Math.abs(this._y1-l)>cC)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%sC+sC),d>lC?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>cC&&this._append`A${n},${n},0,${+(d>=oC)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function pC(){return new fC}pC.prototype=fC.prototype;function mC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new fC(t)}Array.prototype.slice;function hC(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function gC(e){this._context=e}gC.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 _C(e){return new gC(e)}function vC(e){return e[0]}function yC(e){return e[1]}function bC(e,t){var n=aC(!0),r=null,i=_C,a=null,o=mC(s);e=typeof e==`function`?e:e===void 0?vC:aC(e),t=typeof t==`function`?t:t===void 0?yC:aC(t);function s(s){var c,l=(s=hC(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:aC(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:aC(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:aC(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function xC(e,t,n){var r=null,i=aC(!0),a=null,o=_C,s=null,c=mC(l);e=typeof e==`function`?e:e===void 0?vC:aC(+e),t=typeof t==`function`?t:aC(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?yC:aC(+n);function l(l){var u,d,f,p=(l=hC(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return bC().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:aC(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:aC(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:aC(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:aC(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:aC(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:aC(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:aC(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var SC=class{constructor(e,t){this._context=e,this._x=t}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(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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function CC(e){return new SC(e,!0)}function wC(e){return new SC(e,!1)}function TC(){}function EC(e,t,n){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+n)/6)}function DC(e){this._context=e}DC.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:EC(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:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OC(e){return new DC(e)}function kC(e){this._context=e}kC.prototype={areaStart:TC,areaEnd:TC,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:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AC(e){return new kC(e)}function jC(e){this._context=e}jC.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 n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MC(e){return new jC(e)}function NC(e){this._context=e}NC.prototype={areaStart:TC,areaEnd:TC,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 PC(e){return new NC(e)}function FC(e){return e<0?-1:1}function IC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(FC(a)+FC(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function LC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function RC(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function zC(e){this._context=e}zC.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:RC(this,this._t0,LC(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 n=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,RC(this,LC(this,n=IC(this,e,t)),n);break;default:RC(this,this._t0,n=IC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function BC(e){this._context=new VC(e)}(BC.prototype=Object.create(zC.prototype)).point=function(e,t){zC.prototype.point.call(this,t,e)};function VC(e){this._context=e}VC.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,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function HC(e){return new zC(e)}function UC(e){return new BC(e)}function WC(e){this._context=e}WC.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,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=GC(e),i=GC(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function GC(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function KC(e){return new WC(e)}function qC(e,t){this._context=e,this._t=t}qC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function JC(e){return new qC(e,.5)}function YC(e){return new qC(e,0)}function XC(e){return new qC(e,1)}function ZC(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function QC(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function $C(e,t){return e[t]}function ew(e){let t=[];return t.key=e,t}function tw(){var e=aC([]),t=QC,n=ZC,r=$C;function i(i){var a=Array.from(e.apply(this,arguments),ew),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=hC(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:aC(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:aC(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?QC:typeof e==`function`?e:aC(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??ZC,i):n},i}function nw(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}ZC(e,t)}}function rw(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}ZC(e,t)}}function iw(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,ZC(e,t)}}function aw(e){return e===`__proto__`}function ow(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function sw(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function cw(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(cw).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function lw(e){if(Array.isArray(e))return e.map(sw);if(typeof e==`symbol`)return[e];e=cw(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}function uw(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(aw(t))return n;let r=e[t];return r===void 0?ow(t)?uw(e,lw(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=sw(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Nee(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),aw(t))return n;let r=e[t];return r===void 0?n:r}}}function Nee(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||aw(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var Pee=4;function dw(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pee),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function fw(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+dw(i)+n},``)}var pw=e=>e===0?0:e>0?1:-1,mw=e=>typeof e==`number`&&e!=+e,hw=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,Z=e=>(typeof e==`number`||e instanceof Number)&&!mw(e),gw=e=>Z(e)||typeof e==`string`,_w=0,vw=e=>{var t=++_w;return`${e||``}${t}`},yw=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Z(e)&&typeof e!=`string`)return n;var i;if(hw(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return mw(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},bw=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function xw(e,t,n){return Z(e)&&Z(t)?dw(e+n*(t-e)):t}function Sw(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):uw(e,t))===n)}var Cw=e=>e==null,ww=e=>Cw(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Tw(e){return e!=null}function Ew(){}var Dw=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Ow=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,v.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{BS(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},kw=(e,t,n)=>r=>(e(t,n,r),null),Aw=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];BS(i)&&typeof a==`function`&&(r||={},r[i]=kw(a,t,n))}),r};function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jw(Object(n),!0).forEach(function(t){Nw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nw(e,t,n){return(t=Pw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pw(e){var t=Fw(e,`string`);return typeof t==`symbol`?t:t+``}function Fw(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Iw(e,t){var n=Mw({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Lw(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Rw(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function zw(e){return e}function Bw(e){return function(t){return uw(t,e)}}function Vw(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Hw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uw(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Ww(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Gw=`[object RegExp]`,Kw=`[object String]`,qw=`[object Number]`,Jw=`[object Boolean]`,Yw=`[object Arguments]`,Xw=`[object Symbol]`,Zw=`[object Date]`,Qw=`[object Map]`,$w=`[object Set]`,eT=`[object Array]`,tT=`[object ArrayBuffer]`,nT=`[object Object]`,rT=`[object DataView]`,iT=`[object Uint8Array]`,aT=`[object Uint8ClampedArray]`,oT=`[object Uint16Array]`,sT=`[object Uint32Array]`,cT=`[object Int8Array]`,lT=`[object Int16Array]`,uT=`[object Int32Array]`,dT=`[object Float32Array]`,fT=`[object Float64Array]`,pT=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function mT(e){return pT.Buffer!==void 0&&pT.Buffer.isBuffer(e)}function hT(e,t){return gT(e,void 0,e,new Map,t)}function gT(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Vw(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=gT(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,gT(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(gT(a,void 0,n,r,i));return t}if(mT(e))return e.subarray();if(Hw(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=gT(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),_T(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),_T(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),_T(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,_T(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),_T(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),_T(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),_T(t,e,n,r,i),t}if(typeof e==`object`&&vT(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),_T(t,e,n,r,i),t}return e}function _T(e,t,n=e,r,i){let a=[...Object.keys(t),...Uw(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=gT(t[s],s,n,r,i))}}function vT(e){switch(Ww(e)){case Yw:case eT:case tT:case rT:case Jw:case Zw:case dT:case fT:case cT:case lT:case uT:case Qw:case qw:case nT:case Gw:case $w:case Kw:case Xw:case iT:case aT:case oT:case sT:return!0;default:return!1}}function yT(e){return gT(e,void 0,e,new Map,void 0)}function bT(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function xT(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function ST(e,t,n){return typeof n==`function`?CT(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?CT(t,r,e,s,!1):!!c},new Map,!0):ST(e,t,()=>void 0)}function CT(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return wT(e,t,n,r);case`function`:return Object.keys(t).length>0?CT(e,{...t},n,r,i):bT(e,t);default:return xT(e)&&i?typeof t==`string`?t===``:!0:bT(e,t)}}function wT(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return ET(e,t,n,r);if(t instanceof Map)return TT(e,t,n,r);if(t instanceof Set)return DT(e,t,n,r);let i=Object.keys(t);if(e==null||Vw(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!Vw(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function TT(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function ET(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function DT(e,t,n,r){return t.size===0?!0:e instanceof Set?ET([...e],[...t],n,r):!1}function OT(e,t){return ST(e,t,()=>void 0)}function kT(e){return e=yT(e),t=>OT(t,e)}function AT(e,t){return hT(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Ww(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),_T(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case qw:case Kw:case Jw:{let t=new e.constructor(e?.valueOf());return _T(t,e),t}case Yw:{let t={};return _T(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function jT(e){return AT(e)}var MT=/^(?:0|[1-9]\d*)$/;function NT(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return MT.test(e)}}function PT(e){return typeof e==`object`&&!!e&&Ww(e)===`[object Arguments]`}function FT(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&ow(t)&&e?.[t]==null?lw(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||PT(r))&&NT(t)&&t<r.length))return!1;r=r[t]}return!0}function IT(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=sw(e);break}return t=jT(t),function(n){let r=uw(n,e);return r===void 0?FT(n,e):t===void 0?r===void 0:OT(r,t)}}function LT(e){if(e==null)return zw;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?IT(e[0],e[1]):kT(e);case`string`:case`symbol`:case`number`:return Bw(e)}}function RT(e){return Number.isSafeInteger(e)&&e>=0}function zT(e){return e!=null&&typeof e!=`function`&&RT(e.length)}function BT(e){return typeof e==`object`&&!!e}function VT(e){return BT(e)&&zT(e)}function HT(e,t=zw){return VT(e)?Lw(Array.from(e),Rw(LT(t),1)):[]}function UT(e,t,n){return t===!0?HT(e,n):typeof t==`function`?HT(e,t):e}var WT=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),GT=o(((e,t)=>{t.exports=WT()})),KT=o((e=>{var t=d(),n=GT();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),qT=o(((e,t)=>{t.exports=KT()})),JT=(0,v.createContext)(null),YT=qT(),XT=e=>e,ZT=()=>{var e=(0,v.useContext)(JT);return e?e.store.dispatch:XT},QT=()=>{},$T=()=>QT,eE=(e,t)=>e===t;function Q(e){var t=(0,v.useContext)(JT),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:QT,[t,e]);return(0,YT.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:$T,t?t.store.getState:QT,t?t.store.getState:QT,n,eE)}function tE(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function nE(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var rE=e=>Array.isArray(e)?e:[e];function iE(e){let t=Array.isArray(e[0])?e[0]:e;return nE(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function aE(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var oE=class{constructor(e){this.value=e}deref(){return this.value}},sE=typeof WeakRef>`u`?oE:WeakRef,cE=0,lE=1;function uE(){return{s:cE,v:void 0,o:null,p:null}}function dE(e){return e instanceof sE?e.deref():e}function fE(e,t={}){let n=uE(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=uE(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=uE(),e.set(n,t)):t=r}}let s=t,c;if(t.s===lE)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=dE(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new sE(c):c}return s.s=lE,s.v=c,c}return o.clearCache=()=>{n=uE(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function pE(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),tE(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=fE,argsMemoizeOptions:u=[]}={...n,...a},d=rE(c),f=rE(u),p=iE(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=aE(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=pE(fE);function mE(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function hE(e,t,n){return xT(n)&&(typeof t==`number`&&zT(n)&&NT(t)&&t<n.length||typeof t==`string`&&t in n)?bT(n[t],e):!1}function gE(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var _E=(e,t,n)=>{if(e!==t){let r=gE(e),i=gE(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0};function vE(e){return typeof e==`symbol`||e instanceof Symbol}var yE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bE=/^\w*$/;function xE(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||vE(e)?!0:typeof e==`string`&&(bE.test(e)||!yE.test(e))||t!=null&&Object.hasOwn(t,e)}function SE(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||xE(e)?e:{key:e,path:lw(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=_E(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function CE(e,...t){let n=t.length;return n>1&&hE(e,t[0],t[1])?t=[]:n>2&&hE(t[0],t[1],t[2])&&(t=[t[0]]),SE(e,mE(t),[`asc`])}var wE=e=>e.legend.settings,TE=e=>e.legend.size;$([e=>e.legend.payload,wE],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?CE(r,n):r});function EE(e,t){return jE(e)||AE(e,t)||OE(e,t)||DE()}function DE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
80
|
+
/ip address remove [find address=192.168.88.1/24]`,value:e,onChange:e=>t(e.target.value)}),(0,W.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(X,{type:`accent`,size:`sm`,icon:(0,W.jsx)(Zc,{}),loading:o,onClick:()=>void c(),disabled:o||!e.trim(),children:o?`Planning…`:`Plan`}),i&&(0,W.jsx)(`span`,{className:`text-destructive text-xs`,children:i})]})]}),n&&(0,W.jsxs)(ax,{title:`Plan`,className:`reveal`,extra:(0,W.jsxs)(`span`,{className:J(`rounded-full border px-2.5 py-1 font-mono text-[11px]`,u?`border-destructive/45 bg-destructive/10 text-destructive`:`border-success/45 bg-success/10 text-success`),children:[`risk `,n.plan.riskScore,` · `,l]}),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground`,children:[(0,W.jsxs)(`span`,{children:[`+`,n.plan.counts.add,` to add`]}),(0,W.jsxs)(`span`,{children:[`~`,n.plan.counts.modify,` to modify`]}),(0,W.jsxs)(`span`,{children:[`-`,n.plan.counts.remove,` to remove`]}),n.plan.reordered&&(0,W.jsx)(`span`,{children:`· reordered into a safe sequence`})]}),n.plan.warnings.length>0&&(0,W.jsx)(`div`,{className:`my-2.5 grid gap-1`,children:n.plan.warnings.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 text-warning text-xs`,children:[(0,W.jsx)(pl,{className:`size-3.5 shrink-0`}),` `,e]},t))}),(0,W.jsx)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:n.plan.steps.map(e=>(0,W.jsxs)(`div`,{className:J(`flex items-center gap-2.5 rounded-md border border-border border-l-[3px] bg-muted/40 px-3 py-2 font-mono text-xs`,LS[e.risk]??`border-l-border`),children:[(0,W.jsx)(`span`,{className:`grid size-[18px] flex-none place-items-center rounded bg-brand/15 font-bold text-brand`,children:IS[e.op]??`•`}),(0,W.jsx)(`code`,{className:`flex-1 [overflow-wrap:anywhere] text-foreground`,children:e.command}),e.lockoutRisk&&(0,W.jsx)(`span`,{className:`rounded-full border border-destructive/45 px-1.5 py-px text-[10px] text-destructive`,children:`⚠ lock-out`}),(0,W.jsx)(`span`,{className:`text-[10px] tracking-wide text-muted-foreground uppercase`,children:e.risk})]},e.index))})]})]})}var zS=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function BS(e){return typeof e==`string`?zS.includes(e):!1}var VS=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function HS(e){return typeof e==`string`?VS.has(e):!1}function US(e){return typeof e==`string`&&e.startsWith(`data-`)}function WS(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(HS(n)||US(n))&&(t[n]=e[n]);return t}function GS(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return WS(t)}return typeof e==`object`&&!Array.isArray(e)?WS(e):null}function KS(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(HS(n)||US(n)||BS(n))&&(t[n]=e[n]);return t}function qS(e){return e==null?null:(0,v.isValidElement)(e)?KS(e.props):typeof e==`object`&&!Array.isArray(e)?KS(e):null}var JS=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function YS(){return YS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YS.apply(null,arguments)}function XS(e,t){if(e==null)return{};var n,r,i=ZS(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZS(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var QS=(0,v.forwardRef)((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,l=e.desc,u=XS(e,JS),d=a||{width:r,height:i,x:0,y:0},f=Uv(`recharts-surface`,o);return v.createElement(`svg`,YS({},KS(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),v.createElement(`title`,null,c),v.createElement(`desc`,null,l),n)}),$S=[`children`,`className`];function eC(){return eC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eC.apply(null,arguments)}function tC(e,t){if(e==null)return{};var n,r,i=nC(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nC(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rC=v.forwardRef((e,t)=>{var n=e.children,r=e.className,i=tC(e,$S),a=Uv(`recharts-layer`,r);return v.createElement(`g`,eC({className:a},KS(i),{ref:t}),n)}),iC=(0,v.createContext)(null);function aC(e){return function(){return e}}var oC=Math.PI,sC=2*oC,cC=1e-6,lC=sC-cC;function uC(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function dC(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return uC;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var fC=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?uC:dC(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>cC)if(!(Math.abs(u*s-c*l)>cC)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((oC-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>cC&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>cC||Math.abs(this._y1-l)>cC)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%sC+sC),d>lC?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>cC&&this._append`A${n},${n},0,${+(d>=oC)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function pC(){return new fC}pC.prototype=fC.prototype;function mC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new fC(t)}Array.prototype.slice;function hC(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function gC(e){this._context=e}gC.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 _C(e){return new gC(e)}function vC(e){return e[0]}function yC(e){return e[1]}function bC(e,t){var n=aC(!0),r=null,i=_C,a=null,o=mC(s);e=typeof e==`function`?e:e===void 0?vC:aC(e),t=typeof t==`function`?t:t===void 0?yC:aC(t);function s(s){var c,l=(s=hC(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:aC(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:aC(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:aC(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function xC(e,t,n){var r=null,i=aC(!0),a=null,o=_C,s=null,c=mC(l);e=typeof e==`function`?e:e===void 0?vC:aC(+e),t=typeof t==`function`?t:aC(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?yC:aC(+n);function l(l){var u,d,f,p=(l=hC(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return bC().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:aC(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:aC(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:aC(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:aC(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:aC(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:aC(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:aC(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var SC=class{constructor(e,t){this._context=e,this._x=t}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(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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function CC(e){return new SC(e,!0)}function wC(e){return new SC(e,!1)}function TC(){}function EC(e,t,n){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+n)/6)}function DC(e){this._context=e}DC.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:EC(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:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OC(e){return new DC(e)}function kC(e){this._context=e}kC.prototype={areaStart:TC,areaEnd:TC,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:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AC(e){return new kC(e)}function jC(e){this._context=e}jC.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 n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:EC(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MC(e){return new jC(e)}function NC(e){this._context=e}NC.prototype={areaStart:TC,areaEnd:TC,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 PC(e){return new NC(e)}function FC(e){return e<0?-1:1}function IC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(FC(a)+FC(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function LC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function RC(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function zC(e){this._context=e}zC.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:RC(this,this._t0,LC(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 n=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,RC(this,LC(this,n=IC(this,e,t)),n);break;default:RC(this,this._t0,n=IC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function BC(e){this._context=new VC(e)}(BC.prototype=Object.create(zC.prototype)).point=function(e,t){zC.prototype.point.call(this,t,e)};function VC(e){this._context=e}VC.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,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function HC(e){return new zC(e)}function UC(e){return new BC(e)}function WC(e){this._context=e}WC.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,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=GC(e),i=GC(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function GC(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function KC(e){return new WC(e)}function qC(e,t){this._context=e,this._t=t}qC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function JC(e){return new qC(e,.5)}function YC(e){return new qC(e,0)}function XC(e){return new qC(e,1)}function ZC(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function QC(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function $C(e,t){return e[t]}function ew(e){let t=[];return t.key=e,t}function tw(){var e=aC([]),t=QC,n=ZC,r=$C;function i(i){var a=Array.from(e.apply(this,arguments),ew),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=hC(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:aC(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:aC(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?QC:typeof e==`function`?e:aC(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??ZC,i):n},i}function nw(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}ZC(e,t)}}function rw(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}ZC(e,t)}}function iw(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,ZC(e,t)}}function aw(e){return e===`__proto__`}function ow(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function sw(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function cw(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(cw).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function lw(e){if(Array.isArray(e))return e.map(sw);if(typeof e==`symbol`)return[e];e=cw(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}function uw(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(aw(t))return n;let r=e[t];return r===void 0?ow(t)?uw(e,lw(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=sw(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Nee(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),aw(t))return n;let r=e[t];return r===void 0?n:r}}}function Nee(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||aw(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var Pee=4;function dw(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pee),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function fw(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+dw(i)+n},``)}var pw=e=>e===0?0:e>0?1:-1,mw=e=>typeof e==`number`&&e!=+e,hw=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,Z=e=>(typeof e==`number`||e instanceof Number)&&!mw(e),gw=e=>Z(e)||typeof e==`string`,_w=0,vw=e=>{var t=++_w;return`${e||``}${t}`},yw=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Z(e)&&typeof e!=`string`)return n;var i;if(hw(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return mw(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},bw=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function xw(e,t,n){return Z(e)&&Z(t)?dw(e+n*(t-e)):t}function Sw(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):uw(e,t))===n)}var Cw=e=>e==null,ww=e=>Cw(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Tw(e){return e!=null}function Ew(){}var Dw=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,Ow=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,v.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{BS(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},kw=(e,t,n)=>r=>(e(t,n,r),null),Aw=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];BS(i)&&typeof a==`function`&&(r||={},r[i]=kw(a,t,n))}),r};function jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jw(Object(n),!0).forEach(function(t){Nw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nw(e,t,n){return(t=Pw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pw(e){var t=Fw(e,`string`);return typeof t==`symbol`?t:t+``}function Fw(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Iw(e,t){var n=Mw({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function Lw(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Rw(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function zw(e){return e}function Bw(e){return function(t){return uw(t,e)}}function Vw(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Hw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Uw(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Ww(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Gw=`[object RegExp]`,Kw=`[object String]`,qw=`[object Number]`,Jw=`[object Boolean]`,Yw=`[object Arguments]`,Xw=`[object Symbol]`,Zw=`[object Date]`,Qw=`[object Map]`,$w=`[object Set]`,eT=`[object Array]`,tT=`[object ArrayBuffer]`,nT=`[object Object]`,rT=`[object DataView]`,iT=`[object Uint8Array]`,aT=`[object Uint8ClampedArray]`,oT=`[object Uint16Array]`,sT=`[object Uint32Array]`,cT=`[object Int8Array]`,lT=`[object Int16Array]`,uT=`[object Int32Array]`,dT=`[object Float32Array]`,fT=`[object Float64Array]`,pT=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function mT(e){return pT.Buffer!==void 0&&pT.Buffer.isBuffer(e)}function hT(e,t){return gT(e,void 0,e,new Map,t)}function gT(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Vw(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=gT(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,gT(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(gT(a,void 0,n,r,i));return t}if(mT(e))return e.subarray();if(Hw(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=gT(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),_T(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),_T(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),_T(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,_T(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),_T(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),_T(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),_T(t,e,n,r,i),t}if(typeof e==`object`&&vT(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),_T(t,e,n,r,i),t}return e}function _T(e,t,n=e,r,i){let a=[...Object.keys(t),...Uw(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=gT(t[s],s,n,r,i))}}function vT(e){switch(Ww(e)){case Yw:case eT:case tT:case rT:case Jw:case Zw:case dT:case fT:case cT:case lT:case uT:case Qw:case qw:case nT:case Gw:case $w:case Kw:case Xw:case iT:case aT:case oT:case sT:return!0;default:return!1}}function yT(e){return gT(e,void 0,e,new Map,void 0)}function bT(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function xT(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function ST(e,t,n){return typeof n==`function`?CT(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?CT(t,r,e,s,!1):!!c},new Map,!0):ST(e,t,()=>void 0)}function CT(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return wT(e,t,n,r);case`function`:return Object.keys(t).length>0?CT(e,{...t},n,r,i):bT(e,t);default:return xT(e)&&i?typeof t==`string`?t===``:!0:bT(e,t)}}function wT(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return ET(e,t,n,r);if(t instanceof Map)return TT(e,t,n,r);if(t instanceof Set)return DT(e,t,n,r);let i=Object.keys(t);if(e==null||Vw(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!Vw(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function TT(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function ET(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function DT(e,t,n,r){return t.size===0?!0:e instanceof Set?ET([...e],[...t],n,r):!1}function OT(e,t){return ST(e,t,()=>void 0)}function kT(e){return e=yT(e),t=>OT(t,e)}function AT(e,t){return hT(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Ww(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),_T(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case qw:case Kw:case Jw:{let t=new e.constructor(e?.valueOf());return _T(t,e),t}case Yw:{let t={};return _T(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function jT(e){return AT(e)}var MT=/^(?:0|[1-9]\d*)$/;function NT(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return MT.test(e)}}function PT(e){return typeof e==`object`&&!!e&&Ww(e)===`[object Arguments]`}function FT(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&ow(t)&&e?.[t]==null?lw(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||PT(r))&&NT(t)&&t<r.length))return!1;r=r[t]}return!0}function IT(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=sw(e);break}return t=jT(t),function(n){let r=uw(n,e);return r===void 0?FT(n,e):t===void 0?r===void 0:OT(r,t)}}function LT(e){if(e==null)return zw;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?IT(e[0],e[1]):kT(e);case`string`:case`symbol`:case`number`:return Bw(e)}}function RT(e){return Number.isSafeInteger(e)&&e>=0}function zT(e){return e!=null&&typeof e!=`function`&&RT(e.length)}function BT(e){return typeof e==`object`&&!!e}function VT(e){return BT(e)&&zT(e)}function HT(e,t=zw){return VT(e)?Lw(Array.from(e),Rw(LT(t),1)):[]}function UT(e,t,n){return t===!0?HT(e,n):typeof t==`function`?HT(e,t):e}var WT=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),GT=o(((e,t)=>{t.exports=WT()})),KT=o((e=>{var t=d(),n=GT();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),qT=o(((e,t)=>{t.exports=KT()})),JT=(0,v.createContext)(null),YT=qT(),XT=e=>e,ZT=()=>{var e=(0,v.useContext)(JT);return e?e.store.dispatch:XT},QT=()=>{},$T=()=>QT,eE=(e,t)=>e===t;function Q(e){var t=(0,v.useContext)(JT),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:QT,[t,e]);return(0,YT.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:$T,t?t.store.getState:QT,t?t.store.getState:QT,n,eE)}function tE(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function nE(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var rE=e=>Array.isArray(e)?e:[e];function iE(e){let t=Array.isArray(e[0])?e[0]:e;return nE(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function aE(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var oE=class{constructor(e){this.value=e}deref(){return this.value}},sE=typeof WeakRef>`u`?oE:WeakRef,cE=0,lE=1;function uE(){return{s:cE,v:void 0,o:null,p:null}}function dE(e){return e instanceof sE?e.deref():e}function fE(e,t={}){let n=uE(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=uE(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=uE(),e.set(n,t)):t=r}}let s=t,c;if(t.s===lE)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=dE(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new sE(c):c}return s.s=lE,s.v=c,c}return o.clearCache=()=>{n=uE(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function pE(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),tE(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=fE,argsMemoizeOptions:u=[]}={...n,...a},d=rE(c),f=rE(u),p=iE(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=aE(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=pE(fE);function mE(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function hE(e,t,n){return xT(n)&&(typeof t==`number`&&zT(n)&&NT(t)&&t<n.length||typeof t==`string`&&t in n)?bT(n[t],e):!1}function gE(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var _E=(e,t,n)=>{if(e!==t){let r=gE(e),i=gE(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0};function vE(e){return typeof e==`symbol`||e instanceof Symbol}var yE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bE=/^\w*$/;function xE(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||vE(e)?!0:typeof e==`string`&&(bE.test(e)||!yE.test(e))||t!=null&&Object.hasOwn(t,e)}function SE(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||xE(e)?e:{key:e,path:lw(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=_E(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function CE(e,...t){let n=t.length;return n>1&&hE(e,t[0],t[1])?t=[]:n>2&&hE(t[0],t[1],t[2])&&(t=[t[0]]),SE(e,mE(t),[`asc`])}var wE=e=>e.legend.settings,TE=e=>e.legend.size;$([e=>e.legend.payload,wE],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?CE(r,n):r});function EE(e,t){return jE(e)||AE(e,t)||OE(e,t)||DE()}function DE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
81
81
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OE(e,t){if(e){if(typeof e==`string`)return kE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kE(e,t):void 0}}function kE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function jE(e){if(Array.isArray(e))return e}var ME=1;function NE(e,t){return Math.abs(e.height-t.height)>ME||Math.abs(e.left-t.left)>ME||Math.abs(e.top-t.top)>ME||Math.abs(e.width-t.width)>ME}function PE(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function FE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=EE((0,v.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,v.useRef)(null),a=(0,v.useRef)(n);a.current=n;var o=(0,v.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=PE(e);if(NE(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=PE(e);NE(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,v.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function IE(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var LE=typeof Symbol==`function`&&Symbol.observable||`@@observable`,RE=()=>Math.random().toString(36).substring(7).split(``).join(`.`),zE={INIT:`@@redux/INIT${RE()}`,REPLACE:`@@redux/REPLACE${RE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${RE()}`};function BE(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function VE(e,t,n){if(typeof e!=`function`)throw Error(IE(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(IE(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(IE(1));return n(VE)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(IE(3));return i}function d(e){if(typeof e!=`function`)throw Error(IE(4));if(c)throw Error(IE(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(IE(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!BE(e))throw Error(IE(7));if(e.type===void 0)throw Error(IE(8));if(typeof e.type!=`string`)throw Error(IE(17));if(c)throw Error(IE(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(IE(10));r=e,f({type:zE.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(IE(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[LE](){return this}}}return f({type:zE.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[LE]:m}}function HE(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:zE.INIT})===void 0)throw Error(IE(12));if(n(void 0,{type:zE.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(IE(13))})}function UE(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{HE(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(IE(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function WE(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function GE(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(IE(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=WE(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function KE(e){return BE(e)&&`type`in e&&typeof e.type==`string`}var qE=Symbol.for(`immer-nothing`),JE=Symbol.for(`immer-draftable`),YE=Symbol.for(`immer-state`);function XE(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ZE=Object,QE=ZE.getPrototypeOf,$E=`constructor`,eD=`prototype`,tD=`configurable`,nD=`enumerable`,rD=`writable`,iD=`value`,aD=e=>!!e&&!!e[YE];function oD(e){return e?lD(e)||gD(e)||!!e[JE]||!!e[$E]?.[JE]||_D(e)||vD(e):!1}var sD=ZE[eD][$E].toString(),cD=new WeakMap;function lD(e){if(!e||!yD(e))return!1;let t=QE(e);if(t===null||t===ZE[eD])return!0;let n=ZE.hasOwnProperty.call(t,$E)&&t[$E];if(n===Object)return!0;if(!bD(n))return!1;let r=cD.get(n);return r===void 0&&(r=Function.toString.call(n),cD.set(n,r)),r===sD}function uD(e,t,n=!0){dD(e)===0?(n?Reflect.ownKeys(e):ZE.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function dD(e){let t=e[YE];return t?t.type_:gD(e)?1:_D(e)?2:vD(e)?3:0}var fD=(e,t,n=dD(e))=>n===2?e.has(t):ZE[eD].hasOwnProperty.call(e,t),pD=(e,t,n=dD(e))=>n===2?e.get(t):e[t],mD=(e,t,n,r=dD(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function hD(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var gD=Array.isArray,_D=e=>e instanceof Map,vD=e=>e instanceof Set,yD=e=>typeof e==`object`,bD=e=>typeof e==`function`,xD=e=>typeof e==`boolean`;function SD(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var CD=e=>e.copy_||e.base_,wD=e=>e.modified_?e.copy_:e.base_;function TD(e,t){if(_D(e))return new Map(e);if(vD(e))return new Set(e);if(gD(e))return Array[eD].slice.call(e);let n=lD(e);if(t===!0||t===`class_only`&&!n){let t=ZE.getOwnPropertyDescriptors(e);delete t[YE];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[rD]===!1&&(a[rD]=!0,a[tD]=!0),(a.get||a.set)&&(t[i]={[tD]:!0,[rD]:!0,[nD]:a[nD],[iD]:e[i]})}return ZE.create(QE(e),t)}else{let t=QE(e);if(t!==null&&n)return{...e};let r=ZE.create(t);return ZE.assign(r,e)}}function ED(e,t=!1){return kD(e)||aD(e)||!oD(e)?e:(dD(e)>1&&ZE.defineProperties(e,{set:OD,add:OD,clear:OD,delete:OD}),ZE.freeze(e),t&&uD(e,(e,t)=>{ED(t,!0)},!1),e)}function DD(){XE(2)}var OD={[iD]:DD};function kD(e){return e===null||!yD(e)?!0:ZE.isFrozen(e)}var AD=`MapSet`,jD=`Patches`,MD=`ArrayMethods`,ND={};function PD(e){let t=ND[e];return t||XE(0,e),t}var FD=e=>!!ND[e],ID,LD=()=>ID,RD=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:FD(AD)?PD(AD):void 0,arrayMethodsPlugin_:FD(MD)?PD(MD):void 0});function zD(e,t){t&&(e.patchPlugin_=PD(jD),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function BD(e){VD(e),e.drafts_.forEach(UD),e.drafts_=null}function VD(e){e===ID&&(ID=e.parent_)}var HD=e=>ID=RD(ID,e);function UD(e){let t=e[YE];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function WD(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[YE].modified_&&(BD(t),XE(4)),oD(e)&&(e=GD(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[YE].base_,e,t)}else e=GD(t,n);return KD(t,e,!0),BD(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===qE?void 0:e}function GD(e,t){if(kD(t))return t;let n=t[YE];if(!n)return eO(t,e.handledSet_,e);if(!JD(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);QD(n,e)}return n.copy_}function KD(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ED(t,n)}function qD(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var JD=(e,t)=>e.scope_===t,YD=[];function XD(e,t,n,r){let i=CD(e),a=e.type_;if(r!==void 0&&pD(i,r,a)===t){mD(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;uD(i,(e,n)=>{if(aD(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??YD;for(let e of o)mD(i,e,n,a)}function ZD(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!JD(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=wD(i);XD(e,i.draft_??i,a,n),QD(i,r)})}function QD(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}qD(e)}}function $D(e,t,n){let{scope_:r}=e;if(aD(n)){let i=n[YE];JD(i,r)&&i.callbacks_.push(function(){cO(e),XD(e,n,wD(i),t)})}else oD(n)&&e.callbacks_.push(function(){let i=CD(e);e.type_===3?i.has(n)&&eO(n,r.handledSet_,r):pD(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&eO(pD(e.copy_,t,e.type_),r.handledSet_,r)})}function eO(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||aD(e)||t.has(e)||!oD(e)||kD(e)?e:(t.add(e),uD(e,(r,i)=>{if(aD(i)){let t=i[YE];JD(t,n)&&(mD(e,r,wD(t),e.type_),qD(t))}else oD(i)&&eO(i,t,n)}),e)}function tO(e,t){let n=gD(e),r={type_:+!!n,scope_:t?t.scope_:LD(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=nO;n&&(i=[r],a=rO);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var nO={get(e,t){if(t===YE)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=CD(e);if(!fD(i,t,e.type_))return aO(e,i,t);let a=i[t];if(e.finalized_||!oD(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&SD(t))return a;if(a===iO(e.base_,t)){cO(e);let n=e.type_===1?+t:t,r=uO(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in CD(e)},ownKeys(e){return Reflect.ownKeys(CD(e))},set(e,t,n){let r=oO(CD(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=iO(CD(e),t),i=r?.[YE];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(hD(n,r)&&(n!==void 0||fD(e.base_,t,e.type_)))return!0;cO(e),sO(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),$D(e,t,n),!0)},deleteProperty(e,t){return cO(e),iO(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),sO(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=CD(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[rD]:!0,[tD]:e.type_!==1||t!==`length`,[nD]:r[nD],[iD]:n[t]}},defineProperty(){XE(11)},getPrototypeOf(e){return QE(e.base_)},setPrototypeOf(){XE(12)}},rO={};for(let e in nO){let t=nO[e];rO[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}rO.deleteProperty=function(e,t){return rO.set.call(this,e,t,void 0)},rO.set=function(e,t,n){return nO.set.call(this,e[0],t,n,e[0])};function iO(e,t){let n=e[YE];return(n?CD(n):e)[t]}function aO(e,t,n){let r=oO(t,n);return r?iD in r?r[iD]:r.get?.call(e.draft_):void 0}function oO(e,t){if(!(t in e))return;let n=QE(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=QE(n)}}function sO(e){e.modified_||(e.modified_=!0,e.parent_&&sO(e.parent_))}function cO(e){e.copy_||=(e.assigned_=new Map,TD(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var lO=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(bD(e)&&!bD(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}bD(t)||XE(6),n!==void 0&&!bD(n)&&XE(7);let r;if(oD(e)){let i=HD(this),a=uO(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?BD(i):VD(i)}return zD(i,n),WD(r,i)}else if(!e||!yD(e)){if(r=t(e),r===void 0&&(r=e),r===qE&&(r=void 0),this.autoFreeze_&&ED(r,!0),n){let t=[],i=[];PD(jD).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else XE(1,e)},this.produceWithPatches=(e,t)=>{if(bD(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},xD(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),xD(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),xD(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){oD(e)||XE(8),aD(e)&&(e=dO(e));let t=HD(this),n=uO(t,e,void 0);return n[YE].isManual_=!0,VD(t),n}finishDraft(e,t){let n=e&&e[YE];(!n||!n.isManual_)&&XE(9);let{scope_:r}=n;return zD(r,t),WD(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=PD(jD).applyPatches_;return aD(e)?r(e,t):this.produce(e,e=>r(e,t))}};function uO(e,t,n,r){let[i,a]=_D(t)?PD(AD).proxyMap_(t,n):vD(t)?PD(AD).proxySet_(t,n):tO(t,n);return(n?.scope_??LD()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?ZD(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function dO(e){return aD(e)||XE(10,e),fO(e)}function fO(e){if(!oD(e)||kD(e))return e;let t=e[YE],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=TD(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=TD(e,!0);return uD(n,(e,t)=>{mD(n,e,fO(t))},r),t&&(t.finalized_=!1),n}var pO=new lO().produce;function mO(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var Fee=mO(),Iee=mO,Lee=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?WE:WE.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function hO(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(gk(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>KE(t)&&t.type===e,n}var gO=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function _O(e){return oD(e)?pO(e,()=>{}):e}function vO(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ree(e){return typeof e==`boolean`}var zee=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new gO;return t&&(Ree(t)?a.push(Fee):a.push(Iee(t.extraArgument))),a},yO=`RTK_autoBatch`,bO=()=>e=>({payload:e,meta:{[yO]:!0}}),xO=e=>t=>{setTimeout(t,e)},Bee=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},SO=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Bee(window.requestAnimationFrame,100):xO(10):e.type===`callback`?e.queueNotification:xO(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[yO],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Vee=e=>function(t){let{autoBatch:n=!0}=t??{},r=new gO(e);return n&&r.push(SO(typeof n==`object`?n:void 0)),r};function Hee(e){let t=zee(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(BE(n))c=UE(n);else throw Error(gk(1));let l;l=typeof r==`function`?r(t):t();let u=WE;i&&(u=Lee({trace:!1,...typeof i==`object`&&i}));let d=Vee(GE(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return VE(c,o,p)}function CO(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(gk(28));if(r in t)throw Error(gk(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Uee(e){return typeof e==`function`}function Wee(e,t){let[n,r,i]=CO(t),a;if(Uee(e))a=()=>_O(e());else{let t=_O(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(aD(e)){let r=n(e,t);return r===void 0?e:r}else if(oD(e))return pO(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var Gee=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,wO=(e=21)=>{let t=``,n=e;for(;n--;)t+=Gee[Math.random()*64|0];return t},TO=Symbol.for(`rtk-slice-createasyncthunk`);function EO(e,t){return`${e}/${t}`}function DO({creators:e}={}){let t=e?.asyncThunk?.[TO];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(gk(11));let i=(typeof e.reducers==`function`?e.reducers(AO()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(gk(12));if(n in o.sliceCaseReducersByType)throw Error(gk(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:EO(n,r),createNotation:typeof e.reducers==`function`};MO(a)?PO(o,a,s,t):jO(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?CO(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Wee(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=vO(d,r,m)),i}function i(t=l){return vO(vO(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=OO(a,t,()=>vO(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function OO(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var kO=DO();function AO(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function jO({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!NO(r))throw Error(gk(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?hO(e,o):hO(e))}function MO(e){return e._reducerDefinitionType===`asyncThunk`}function NO(e){return e._reducerDefinitionType===`reducerWithPrepare`}function PO({type:e,reducerName:t},n,r,i){if(!i)throw Error(gk(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||FO,pending:s||FO,rejected:c||FO,settled:l||FO})}function FO(){}var IO=`task`,LO=`listener`,RO=`completed`,zO=`cancelled`,BO=`task-${zO}`,VO=`task-${RO}`,HO=`${LO}-${zO}`,UO=`${LO}-${RO}`,WO=class{constructor(e){this.code=e,this.message=`${IO} ${zO} (reason: ${e})`}code;name=`TaskAbortError`;message},GO=(e,t)=>{if(typeof e!=`function`)throw TypeError(gk(32))},KO=()=>{},qO=(e,t=KO)=>(e.catch(t),e),JO=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),YO=e=>{if(e.aborted)throw new WO(e.reason)};function XO(e,t){let n=KO;return new Promise((r,i)=>{let a=()=>i(new WO(e.reason));if(e.aborted){a();return}n=JO(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=KO})}var ZO=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof WO?`cancelled`:`rejected`,error:e}}finally{t?.()}},QO=e=>t=>qO(XO(e,t).then(t=>(YO(e),t))),$O=e=>{let t=QO(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:ek}=Object,tk={},nk=`listenerMiddleware`,rk=(e,t)=>{let n=t=>JO(e,()=>t.abort(e.reason));return(r,i)=>{GO(r,`taskExecutor`);let a=new AbortController;n(a);let o=ZO(async()=>{YO(e),YO(a.signal);let t=await r({pause:QO(a.signal),delay:$O(a.signal),signal:a.signal});return YO(a.signal),t},()=>a.abort(VO));return i?.autoJoin&&t.push(o.catch(KO)),{result:QO(e)(o),cancel(){a.abort(BO)}}}},ik=(e,t)=>{let n=async(n,r)=>{YO(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await XO(t,Promise.race(a));return YO(t),e}finally{i()}};return((e,t)=>qO(n(e,t)))},ak=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=hO(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(gk(21));return GO(a,`options.listener`),{predicate:i,type:t,effect:a}},ok=ek(e=>{let{type:t,predicate:n,effect:r}=ak(e);return{id:wO(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(gk(22))}}},{withTypes:()=>ok}),sk=(e,t)=>{let{type:n,effect:r,predicate:i}=ak(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},ck=e=>{e.pending.forEach(e=>{e.abort(HO)})},lk=(e,t)=>()=>{for(let e of t.keys())ck(e);e.clear()},uk=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},dk=ek(hO(`${nk}/add`),{withTypes:()=>dk}),fk=hO(`${nk}/removeAll`),pk=ek(hO(`${nk}/remove`),{withTypes:()=>pk}),mk=(...e)=>{console.error(`${nk}/error`,...e)},hk=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=mk}=e;GO(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&ck(e)}),c=(e=>{let n=sk(t,e)??ok(e);return s(n)});ek(c,{withTypes:()=>c});let l=e=>{let n=sk(t,e);return n&&(n.unsubscribe(),e.cancelActive&&ck(n)),!!n};ek(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=ik(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,ek({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:$O(u.signal),pause:QO(u.signal),extra:a,signal:u.signal,fork:rk(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(HO),n.delete(e))})},cancel:()=>{u.abort(HO),e.pending.delete(u)},throwIfCancelled:()=>{YO(u.signal)}})))}catch(e){e instanceof WO||uk(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(UO),i(e),e.pending.delete(u)}},d=lk(t,n);return{middleware:e=>n=>r=>{if(!KE(r))return n(r);if(dk.match(r))return c(r.payload);if(fk.match(r)){d();return}if(pk.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===tk)throw Error(gk(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,uk(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=tk}return s},startListening:c,stopListening:l,clearListeners:d}};function gk(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _k=kO({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),vk=_k.actions,yk=vk.setMargin,bk=vk.setLayout,xk=vk.setChartSize,Sk=vk.setScale,Ck=_k.reducer;function wk(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Tk(e){return Number.isFinite(e)}function Ek(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ok(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Dk(Object(n),!0).forEach(function(t){kk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kk(e,t,n){return(t=Ak(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ak(e){var t=jk(e,`string`);return typeof t==`symbol`?t:t+``}function jk(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Mk(e,t,n){return Cw(e)||Cw(t)?n:gw(t)?uw(e,t,n):typeof t==`function`?t(e):n}var Nk=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&Z(e[a]))return Ok(Ok({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&Z(e[o]))return Ok(Ok({},e),{},{[o]:e[o]+(i||0)})}return e},Pk=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Fk=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},Ik=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?pw(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return Tk(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(Tw):c&&l?l.map((e,t)=>{var n=o.map(e);return Tk(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Tw):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return Tk(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Tw):o.domain().map((e,t)=>{var n=o.map(e);return Tk(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(Tw)},Lk=(e,t)=>{if(!t||t.length!==2||!Z(t[0])||!Z(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Z(e[0])||e[0]<n)&&(i[0]=n),(!Z(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Rk={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=mw(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:nw,none:ZC,silhouette:rw,wiggle:iw,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=mw(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},zk=(e,t,n)=>{var r=Rk[n]??ZC,i=tw().keys(t).value((e,t)=>Number(Mk(e,t,0))).order(QC).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=Mk(e[i],t[r],0);Array.isArray(a)&&a.length===2&&Z(a[0])&&Z(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function Bk(e){return e==null?void 0:String(e)}function Vk(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!Cw(i[t.dataKey])){var s=Sw(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Mk(i,Cw(o)?t.dataKey:o),l=t.scale.map(c);return Z(l)?l:null}var Hk=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=Mk(a,t.dataKey,t.scale.domain()[o]);if(Cw(s))return null;var c=t.scale.map(s);return Z(c)?c-i/2+r:null},Uk=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Wk=e=>{var t=e.flat(2).filter(Z);return[Math.min(...t),Math.max(...t)]},Gk=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Kk=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Gk(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=Wk(wk(r,t,n));return!Tk(i[0])||!Tk(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},qk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Jk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Yk=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=CE(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function Xk(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Ok(Ok({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Zk(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var Qk=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},$k=(e,t)=>t===`centric`?e.angle:e.radius,eA=e=>e.layout.width,tA=e=>e.layout.height,nA=e=>e.layout.scale,rA=e=>e.layout.margin,iA=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),aA=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),oA=`data-recharts-item-index`,sA=`data-recharts-item-id`;function cA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cA(Object(n),!0).forEach(function(t){uA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uA(e,t,n){return(t=dA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dA(e){var t=fA(e,`string`);return typeof t==`symbol`?t:t+``}function fA(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pA=e=>e.brush.height;function mA(e){return aA(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function hA(e){return aA(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function gA(e){return iA(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function _A(e){return iA(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var vA=$([eA,tA,rA,pA,mA,hA,gA,_A,wE,TE],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=lA(lA({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=Nk(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return lA(lA({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),yA=$(vA,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),bA=$(eA,tA,(e,t)=>({x:0,y:0,width:e,height:t})),xA=(0,v.createContext)(null),SA=()=>(0,v.useContext)(xA)!=null,CA=e=>e.brush,wA=$([CA,vA,rA],(e,t,n)=>({height:e.height,x:Z(e.x)?e.x:t.left,y:Z(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Z(e.width)?e.width:t.width}));function TA(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function EA(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=TA(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function DA(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return EA(e,t,{leading:r,maxWait:t,trailing:i})}var OA=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},kA={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},AA=(e,t,n)=>{var r=n.width,i=r===void 0?kA.width:r,a=n.height,o=a===void 0?kA.height:a,s=n.aspect,c=n.maxHeight,l=hw(i)?e:Number(i),u=hw(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},jA={width:0,height:0,overflow:`visible`},MA={width:0,overflowX:`visible`},NA={height:0,overflowY:`visible`},PA={},FA=e=>{var t=e.width,n=e.height,r=hw(t),i=hw(n);return r&&i?jA:r?MA:i?NA:PA};function IA(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=kA.width,a=kA.height):i===void 0?i=r&&r>0?void 0:kA.width:a===void 0&&(a=r&&r>0?void 0:kA.height),{width:i,height:a}}var LA=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function RA(){return RA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RA.apply(null,arguments)}function zA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zA(Object(n),!0).forEach(function(t){VA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VA(e,t,n){return(t=HA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HA(e){var t=UA(e,`string`);return typeof t==`symbol`?t:t+``}function UA(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function WA(e,t){return YA(e)||JA(e,t)||KA(e,t)||GA()}function GA(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
82
82
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KA(e,t){if(e){if(typeof e==`string`)return qA(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qA(e,t):void 0}}function qA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JA(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function YA(e){if(Array.isArray(e))return e}function XA(e,t){if(e==null)return{};var n,r,i=ZA(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZA(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var QA=(0,v.createContext)(kA.initialDimension);function $A(e){return Ek(e.width)&&Ek(e.height)}function ej(e){var t=e.children,n=e.width,r=e.height,i=(0,v.useMemo)(()=>({width:n,height:r}),[n,r]);return $A(i)?v.createElement(QA.Provider,{value:i},t):null}var tj=()=>(0,v.useContext)(QA),nj=(0,v.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?kA.initialDimension:r,a=e.width,o=e.height,s=e.minWidth,c=s===void 0?kA.minWidth:s,l=e.minHeight,u=e.maxHeight,d=e.children,f=e.debounce,p=f===void 0?kA.debounce:f,m=e.id,h=e.className,g=e.onResize,_=e.style,y=_===void 0?{}:_,b=XA(e,LA),x=(0,v.useRef)(null),S=(0,v.useRef)();S.current=g,(0,v.useImperativeHandle)(t,()=>x.current);var C=WA((0,v.useState)({containerWidth:i.width,containerHeight:i.height}),2),w=C[0],T=C[1],E=(0,v.useCallback)((e,t)=>{T(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,v.useEffect)(()=>{if(x.current==null||typeof ResizeObserver>`u`)return Ew;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;E(i,a),(t=S.current)==null||t.call(S,i,a)}};p>0&&(e=DA(e,p,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=x.current.getBoundingClientRect(),r=n.width,i=n.height;return E(r,i),t.observe(x.current),()=>{t.disconnect()}},[E,p]);var D=w.containerWidth,O=w.containerHeight;OA(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var k=AA(D,O,{width:a,height:o,aspect:n,maxHeight:u}),A=k.calculatedWidth,j=k.calculatedHeight;return OA(D<0||O<0||A!=null&&A>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
83
83
|
please check the style of container, or the props width(%s) and height(%s),
|
|
84
84
|
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
85
|
-
height and width.`,A,j,a,o,c,l,n),v.createElement(`div`,RA({id:m?`${m}`:void 0,className:Hv(`recharts-responsive-container`,h),style:BA(BA({},y),{},{width:a,height:o,minWidth:c,minHeight:l,maxHeight:u}),ref:x},b),v.createElement(`div`,{style:FA({width:a,height:o})},v.createElement(ej,{width:A,height:j},d)))}),rj=(0,v.forwardRef)((e,t)=>{var n=tj();if(Ek(n.width)&&Ek(n.height))return e.children;var r=IA({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=AA(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return Z(s)&&Z(c)?v.createElement(ej,{width:s,height:c},e.children):v.createElement(nj,RA({},e,{width:i,height:a,ref:t}))});function ij(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var aj=()=>{var e=SA(),t=Q(yA),n=Q(wA),r=Q(CA)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},oj={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},sj=()=>Q(vA)??oj,cj=()=>Q(eA),lj=()=>Q(tA),uj=e=>e.layout.layoutType,dj=()=>Q(uj),fj=()=>{var e=dj();if(e===`horizontal`||e===`vertical`)return e},pj=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},mj=()=>Q(pj),hj=()=>dj()!==void 0,gj=e=>{var t=ZT(),n=SA(),r=e.width,i=e.height,a=tj(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&Ek(o)&&Ek(s)&&t(xk({width:o,height:s}))},[t,n,o,s]),null},_j=Symbol.for(`immer-nothing`),vj=Symbol.for(`immer-draftable`),yj=Symbol.for(`immer-state`);function bj(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xj=Object,Sj=xj.getPrototypeOf,Cj=`constructor`,wj=`prototype`,Tj=`configurable`,Ej=`enumerable`,Dj=`writable`,Oj=`value`,kj=e=>!!e&&!!e[yj];function Aj(e){return e?Nj(e)||Bj(e)||!!e[vj]||!!e[Cj]?.[vj]||Vj(e)||Hj(e):!1}var jj=xj[wj][Cj].toString(),Mj=new WeakMap;function Nj(e){if(!e||!Uj(e))return!1;let t=Sj(e);if(t===null||t===xj[wj])return!0;let n=xj.hasOwnProperty.call(t,Cj)&&t[Cj];if(n===Object)return!0;if(!Wj(n))return!1;let r=Mj.get(n);return r===void 0&&(r=Function.toString.call(n),Mj.set(n,r)),r===jj}function Pj(e,t,n=!0){Fj(e)===0?(n?Reflect.ownKeys(e):xj.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Fj(e){let t=e[yj];return t?t.type_:Bj(e)?1:Vj(e)?2:Hj(e)?3:0}var Ij=(e,t,n=Fj(e))=>n===2?e.has(t):xj[wj].hasOwnProperty.call(e,t),Lj=(e,t,n=Fj(e))=>n===2?e.get(t):e[t],Rj=(e,t,n,r=Fj(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function zj(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Bj=Array.isArray,Vj=e=>e instanceof Map,Hj=e=>e instanceof Set,Uj=e=>typeof e==`object`,Wj=e=>typeof e==`function`,Gj=e=>typeof e==`boolean`;function Kj(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var qj=e=>e.copy_||e.base_,Jj=e=>e.modified_?e.copy_:e.base_;function Yj(e,t){if(Vj(e))return new Map(e);if(Hj(e))return new Set(e);if(Bj(e))return Array[wj].slice.call(e);let n=Nj(e);if(t===!0||t===`class_only`&&!n){let t=xj.getOwnPropertyDescriptors(e);delete t[yj];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Dj]===!1&&(a[Dj]=!0,a[Tj]=!0),(a.get||a.set)&&(t[i]={[Tj]:!0,[Dj]:!0,[Ej]:a[Ej],[Oj]:e[i]})}return xj.create(Sj(e),t)}else{let t=Sj(e);if(t!==null&&n)return{...e};let r=xj.create(t);return xj.assign(r,e)}}function Xj(e,t=!1){return $j(e)||kj(e)||!Aj(e)?e:(Fj(e)>1&&xj.defineProperties(e,{set:Qj,add:Qj,clear:Qj,delete:Qj}),xj.freeze(e),t&&Pj(e,(e,t)=>{Xj(t,!0)},!1),e)}function Zj(){bj(2)}var Qj={[Oj]:Zj};function $j(e){return e===null||!Uj(e)?!0:xj.isFrozen(e)}var eM=`MapSet`,tM=`Patches`,nM=`ArrayMethods`,rM={};function iM(e){let t=rM[e];return t||bj(0,e),t}var aM=e=>!!rM[e],oM,sM=()=>oM,cM=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:aM(eM)?iM(eM):void 0,arrayMethodsPlugin_:aM(nM)?iM(nM):void 0});function lM(e,t){t&&(e.patchPlugin_=iM(tM),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function uM(e){dM(e),e.drafts_.forEach(pM),e.drafts_=null}function dM(e){e===oM&&(oM=e.parent_)}var fM=e=>oM=cM(oM,e);function pM(e){let t=e[yj];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function mM(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[yj].modified_&&(uM(t),bj(4)),Aj(e)&&(e=hM(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[yj].base_,e,t)}else e=hM(t,n);return gM(t,e,!0),uM(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===_j?void 0:e}function hM(e,t){if($j(t))return t;let n=t[yj];if(!n)return wM(t,e.handledSet_,e);if(!vM(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);SM(n,e)}return n.copy_}function gM(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xj(t,n)}function _M(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var vM=(e,t)=>e.scope_===t,yM=[];function bM(e,t,n,r){let i=qj(e),a=e.type_;if(r!==void 0&&Lj(i,r,a)===t){Rj(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Pj(i,(e,n)=>{if(kj(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??yM;for(let e of o)Rj(i,e,n,a)}function xM(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!vM(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Jj(i);bM(e,i.draft_??i,a,n),SM(i,r)})}function SM(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}_M(e)}}function CM(e,t,n){let{scope_:r}=e;if(kj(n)){let i=n[yj];vM(i,r)&&i.callbacks_.push(function(){MM(e),bM(e,n,Jj(i),t)})}else Aj(n)&&e.callbacks_.push(function(){let i=qj(e);e.type_===3?i.has(n)&&wM(n,r.handledSet_,r):Lj(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&wM(Lj(e.copy_,t,e.type_),r.handledSet_,r)})}function wM(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||kj(e)||t.has(e)||!Aj(e)||$j(e)?e:(t.add(e),Pj(e,(r,i)=>{if(kj(i)){let t=i[yj];vM(t,n)&&(Rj(e,r,Jj(t),e.type_),_M(t))}else Aj(i)&&wM(i,t,n)}),e)}function TM(e,t){let n=Bj(e),r={type_:+!!n,scope_:t?t.scope_:sM(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=EM;n&&(i=[r],a=DM);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var EM={get(e,t){if(t===yj)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=qj(e);if(!Ij(i,t,e.type_))return kM(e,i,t);let a=i[t];if(e.finalized_||!Aj(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Kj(t))return a;if(a===OM(e.base_,t)){MM(e);let n=e.type_===1?+t:t,r=PM(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in qj(e)},ownKeys(e){return Reflect.ownKeys(qj(e))},set(e,t,n){let r=AM(qj(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=OM(qj(e),t),i=r?.[yj];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(zj(n,r)&&(n!==void 0||Ij(e.base_,t,e.type_)))return!0;MM(e),jM(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),CM(e,t,n),!0)},deleteProperty(e,t){return MM(e),OM(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),jM(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=qj(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Dj]:!0,[Tj]:e.type_!==1||t!==`length`,[Ej]:r[Ej],[Oj]:n[t]}},defineProperty(){bj(11)},getPrototypeOf(e){return Sj(e.base_)},setPrototypeOf(){bj(12)}},DM={};for(let e in EM){let t=EM[e];DM[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}DM.deleteProperty=function(e,t){return DM.set.call(this,e,t,void 0)},DM.set=function(e,t,n){return EM.set.call(this,e[0],t,n,e[0])};function OM(e,t){let n=e[yj];return(n?qj(n):e)[t]}function kM(e,t,n){let r=AM(t,n);return r?Oj in r?r[Oj]:r.get?.call(e.draft_):void 0}function AM(e,t){if(!(t in e))return;let n=Sj(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Sj(n)}}function jM(e){e.modified_||(e.modified_=!0,e.parent_&&jM(e.parent_))}function MM(e){e.copy_||=(e.assigned_=new Map,Yj(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var NM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Wj(e)&&!Wj(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Wj(t)||bj(6),n!==void 0&&!Wj(n)&&bj(7);let r;if(Aj(e)){let i=fM(this),a=PM(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?uM(i):dM(i)}return lM(i,n),mM(r,i)}else if(!e||!Uj(e)){if(r=t(e),r===void 0&&(r=e),r===_j&&(r=void 0),this.autoFreeze_&&Xj(r,!0),n){let t=[],i=[];iM(tM).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else bj(1,e)},this.produceWithPatches=(e,t)=>{if(Wj(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Gj(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Gj(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Gj(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Aj(e)||bj(8),kj(e)&&(e=FM(e));let t=fM(this),n=PM(t,e,void 0);return n[yj].isManual_=!0,dM(t),n}finishDraft(e,t){let n=e&&e[yj];(!n||!n.isManual_)&&bj(9);let{scope_:r}=n;return lM(r,t),mM(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=iM(tM).applyPatches_;return kj(e)?r(e,t):this.produce(e,e=>r(e,t))}};function PM(e,t,n,r){let[i,a]=Vj(t)?iM(eM).proxyMap_(t,n):Hj(t)?iM(eM).proxySet_(t,n):TM(t,n);return(n?.scope_??sM()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?xM(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function FM(e){return kj(e)||bj(10,e),IM(e)}function IM(e){if(!Aj(e)||$j(e))return e;let t=e[yj],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Yj(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Yj(e,!0);return Pj(n,(e,t)=>{Rj(n,e,IM(t))},r),t&&(t.finalized_=!1),n}new NM().produce;var LM=e=>e,RM=kO({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(LM(t.payload))},prepare:bO()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).payload.indexOf(LM(r));a>-1&&(e.payload[a]=LM(i))},prepare:bO()},removeLegendPayload:{reducer(e,t){var n=dO(e).payload.indexOf(LM(t.payload));n>-1&&e.payload.splice(n,1)},prepare:bO()}}}),zM=RM.actions;zM.setLegendSize,zM.setLegendSettings;var BM=zM.addLegendPayload,VM=zM.replaceLegendPayload,HM=zM.removeLegendPayload,UM=RM.reducer,WM=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=WM()}))();function GM(e){e()}function KM(){let e=null,t=null;return{clear(){e=null,t=null},notify(){GM(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var qM={notify(){},get:()=>[]};function JM(e,t){let n,r=qM,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=KM())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=qM)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var YM=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,XM=typeof navigator<`u`&&navigator.product===`ReactNative`,ZM=YM||XM?v.useLayoutEffect:v.useEffect;function QM(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function $M(e,t){if(QM(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!QM(e[n[r]],t[n[r]]))return!1;return!0}var eN=Symbol.for(`react-redux-context`),tN=typeof globalThis<`u`?globalThis:{};function nN(){if(!v.createContext)return{};let e=tN[eN]??=new Map,t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var rN=nN();function iN(e){let{children:t,context:n,serverState:r,store:i}=e,a=v.useMemo(()=>{let e=JM(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=v.useMemo(()=>i.getState(),[i]);ZM(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||rN;return v.createElement(s.Provider,{value:a},t)}var aN=iN,oN=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function sN(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function cN(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(oN.has(n)){if(e[n]==null&&t[n]==null)continue;if(!$M(e[n],t[n]))return!1}else if(!sN(e[n],t[n]))return!1;return!0}function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lN.apply(null,arguments)}function uN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uN(Object(n),!0).forEach(function(t){fN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fN(e,t,n){return(t=pN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pN(e){var t=mN(e,`string`);return typeof t==`symbol`?t:t+``}function mN(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hN(e,t){return bN(e)||yN(e,t)||_N(e,t)||gN()}function gN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _N(e,t){if(e){if(typeof e==`string`)return vN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vN(e,t):void 0}}function vN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bN(e){if(Array.isArray(e))return e}function xN(e){return Array.isArray(e)&&gw(e[0])&&gw(e[1])?e.join(` ~ `):e}var SN={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function CN(e,t){return t==null?e:CE(e,t)}var wN=e=>{var t=e.separator,n=t===void 0?SN.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?SN.labelStyle:a,s=e.payload,c=e.formatter,l=e.itemSorter,u=e.wrapperClassName,d=e.labelClassName,f=e.label,p=e.labelFormatter,m=e.accessibilityLayer,h=m===void 0?SN.accessibilityLayer:m,g=()=>{if(s&&s.length){var e={padding:0,margin:0},t=CN(s,l).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||xN,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var f=hN(d,2);l=f[0],u=f[1]}else if(d!=null)l=d;else return null}var p=dN(dN({},SN.itemStyle),{},{color:e.color||SN.itemStyle.color},i);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},gw(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,gw(u)?v.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,v.createElement(`span`,{className:`recharts-tooltip-item-value`},l),v.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return v.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},_=dN(dN({},SN.contentStyle),r),y=dN({margin:0},o),b=!Cw(f),x=b?f:``,S=
|
|
85
|
+
height and width.`,A,j,a,o,c,l,n),v.createElement(`div`,RA({id:m?`${m}`:void 0,className:Uv(`recharts-responsive-container`,h),style:BA(BA({},y),{},{width:a,height:o,minWidth:c,minHeight:l,maxHeight:u}),ref:x},b),v.createElement(`div`,{style:FA({width:a,height:o})},v.createElement(ej,{width:A,height:j},d)))}),rj=(0,v.forwardRef)((e,t)=>{var n=tj();if(Ek(n.width)&&Ek(n.height))return e.children;var r=IA({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,o=AA(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=o.calculatedWidth,c=o.calculatedHeight;return Z(s)&&Z(c)?v.createElement(ej,{width:s,height:c},e.children):v.createElement(nj,RA({},e,{width:i,height:a,ref:t}))});function ij(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var aj=()=>{var e=SA(),t=Q(yA),n=Q(wA),r=Q(CA)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},oj={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},sj=()=>Q(vA)??oj,cj=()=>Q(eA),lj=()=>Q(tA),uj=e=>e.layout.layoutType,dj=()=>Q(uj),fj=()=>{var e=dj();if(e===`horizontal`||e===`vertical`)return e},pj=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},mj=()=>Q(pj),hj=()=>dj()!==void 0,gj=e=>{var t=ZT(),n=SA(),r=e.width,i=e.height,a=tj(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&Ek(o)&&Ek(s)&&t(xk({width:o,height:s}))},[t,n,o,s]),null},_j=Symbol.for(`immer-nothing`),vj=Symbol.for(`immer-draftable`),yj=Symbol.for(`immer-state`);function bj(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xj=Object,Sj=xj.getPrototypeOf,Cj=`constructor`,wj=`prototype`,Tj=`configurable`,Ej=`enumerable`,Dj=`writable`,Oj=`value`,kj=e=>!!e&&!!e[yj];function Aj(e){return e?Nj(e)||Bj(e)||!!e[vj]||!!e[Cj]?.[vj]||Vj(e)||Hj(e):!1}var jj=xj[wj][Cj].toString(),Mj=new WeakMap;function Nj(e){if(!e||!Uj(e))return!1;let t=Sj(e);if(t===null||t===xj[wj])return!0;let n=xj.hasOwnProperty.call(t,Cj)&&t[Cj];if(n===Object)return!0;if(!Wj(n))return!1;let r=Mj.get(n);return r===void 0&&(r=Function.toString.call(n),Mj.set(n,r)),r===jj}function Pj(e,t,n=!0){Fj(e)===0?(n?Reflect.ownKeys(e):xj.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Fj(e){let t=e[yj];return t?t.type_:Bj(e)?1:Vj(e)?2:Hj(e)?3:0}var Ij=(e,t,n=Fj(e))=>n===2?e.has(t):xj[wj].hasOwnProperty.call(e,t),Lj=(e,t,n=Fj(e))=>n===2?e.get(t):e[t],Rj=(e,t,n,r=Fj(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function zj(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Bj=Array.isArray,Vj=e=>e instanceof Map,Hj=e=>e instanceof Set,Uj=e=>typeof e==`object`,Wj=e=>typeof e==`function`,Gj=e=>typeof e==`boolean`;function Kj(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var qj=e=>e.copy_||e.base_,Jj=e=>e.modified_?e.copy_:e.base_;function Yj(e,t){if(Vj(e))return new Map(e);if(Hj(e))return new Set(e);if(Bj(e))return Array[wj].slice.call(e);let n=Nj(e);if(t===!0||t===`class_only`&&!n){let t=xj.getOwnPropertyDescriptors(e);delete t[yj];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Dj]===!1&&(a[Dj]=!0,a[Tj]=!0),(a.get||a.set)&&(t[i]={[Tj]:!0,[Dj]:!0,[Ej]:a[Ej],[Oj]:e[i]})}return xj.create(Sj(e),t)}else{let t=Sj(e);if(t!==null&&n)return{...e};let r=xj.create(t);return xj.assign(r,e)}}function Xj(e,t=!1){return $j(e)||kj(e)||!Aj(e)?e:(Fj(e)>1&&xj.defineProperties(e,{set:Qj,add:Qj,clear:Qj,delete:Qj}),xj.freeze(e),t&&Pj(e,(e,t)=>{Xj(t,!0)},!1),e)}function Zj(){bj(2)}var Qj={[Oj]:Zj};function $j(e){return e===null||!Uj(e)?!0:xj.isFrozen(e)}var eM=`MapSet`,tM=`Patches`,nM=`ArrayMethods`,rM={};function iM(e){let t=rM[e];return t||bj(0,e),t}var aM=e=>!!rM[e],oM,sM=()=>oM,cM=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:aM(eM)?iM(eM):void 0,arrayMethodsPlugin_:aM(nM)?iM(nM):void 0});function lM(e,t){t&&(e.patchPlugin_=iM(tM),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function uM(e){dM(e),e.drafts_.forEach(pM),e.drafts_=null}function dM(e){e===oM&&(oM=e.parent_)}var fM=e=>oM=cM(oM,e);function pM(e){let t=e[yj];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function mM(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[yj].modified_&&(uM(t),bj(4)),Aj(e)&&(e=hM(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[yj].base_,e,t)}else e=hM(t,n);return gM(t,e,!0),uM(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===_j?void 0:e}function hM(e,t){if($j(t))return t;let n=t[yj];if(!n)return wM(t,e.handledSet_,e);if(!vM(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);SM(n,e)}return n.copy_}function gM(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xj(t,n)}function _M(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var vM=(e,t)=>e.scope_===t,yM=[];function bM(e,t,n,r){let i=qj(e),a=e.type_;if(r!==void 0&&Lj(i,r,a)===t){Rj(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Pj(i,(e,n)=>{if(kj(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??yM;for(let e of o)Rj(i,e,n,a)}function xM(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!vM(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Jj(i);bM(e,i.draft_??i,a,n),SM(i,r)})}function SM(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}_M(e)}}function CM(e,t,n){let{scope_:r}=e;if(kj(n)){let i=n[yj];vM(i,r)&&i.callbacks_.push(function(){MM(e),bM(e,n,Jj(i),t)})}else Aj(n)&&e.callbacks_.push(function(){let i=qj(e);e.type_===3?i.has(n)&&wM(n,r.handledSet_,r):Lj(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&wM(Lj(e.copy_,t,e.type_),r.handledSet_,r)})}function wM(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||kj(e)||t.has(e)||!Aj(e)||$j(e)?e:(t.add(e),Pj(e,(r,i)=>{if(kj(i)){let t=i[yj];vM(t,n)&&(Rj(e,r,Jj(t),e.type_),_M(t))}else Aj(i)&&wM(i,t,n)}),e)}function TM(e,t){let n=Bj(e),r={type_:+!!n,scope_:t?t.scope_:sM(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=EM;n&&(i=[r],a=DM);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var EM={get(e,t){if(t===yj)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=qj(e);if(!Ij(i,t,e.type_))return kM(e,i,t);let a=i[t];if(e.finalized_||!Aj(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Kj(t))return a;if(a===OM(e.base_,t)){MM(e);let n=e.type_===1?+t:t,r=PM(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in qj(e)},ownKeys(e){return Reflect.ownKeys(qj(e))},set(e,t,n){let r=AM(qj(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=OM(qj(e),t),i=r?.[yj];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(zj(n,r)&&(n!==void 0||Ij(e.base_,t,e.type_)))return!0;MM(e),jM(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),CM(e,t,n),!0)},deleteProperty(e,t){return MM(e),OM(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),jM(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=qj(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Dj]:!0,[Tj]:e.type_!==1||t!==`length`,[Ej]:r[Ej],[Oj]:n[t]}},defineProperty(){bj(11)},getPrototypeOf(e){return Sj(e.base_)},setPrototypeOf(){bj(12)}},DM={};for(let e in EM){let t=EM[e];DM[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}DM.deleteProperty=function(e,t){return DM.set.call(this,e,t,void 0)},DM.set=function(e,t,n){return EM.set.call(this,e[0],t,n,e[0])};function OM(e,t){let n=e[yj];return(n?qj(n):e)[t]}function kM(e,t,n){let r=AM(t,n);return r?Oj in r?r[Oj]:r.get?.call(e.draft_):void 0}function AM(e,t){if(!(t in e))return;let n=Sj(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Sj(n)}}function jM(e){e.modified_||(e.modified_=!0,e.parent_&&jM(e.parent_))}function MM(e){e.copy_||=(e.assigned_=new Map,Yj(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var NM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Wj(e)&&!Wj(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Wj(t)||bj(6),n!==void 0&&!Wj(n)&&bj(7);let r;if(Aj(e)){let i=fM(this),a=PM(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?uM(i):dM(i)}return lM(i,n),mM(r,i)}else if(!e||!Uj(e)){if(r=t(e),r===void 0&&(r=e),r===_j&&(r=void 0),this.autoFreeze_&&Xj(r,!0),n){let t=[],i=[];iM(tM).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else bj(1,e)},this.produceWithPatches=(e,t)=>{if(Wj(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Gj(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Gj(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Gj(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Aj(e)||bj(8),kj(e)&&(e=FM(e));let t=fM(this),n=PM(t,e,void 0);return n[yj].isManual_=!0,dM(t),n}finishDraft(e,t){let n=e&&e[yj];(!n||!n.isManual_)&&bj(9);let{scope_:r}=n;return lM(r,t),mM(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=iM(tM).applyPatches_;return kj(e)?r(e,t):this.produce(e,e=>r(e,t))}};function PM(e,t,n,r){let[i,a]=Vj(t)?iM(eM).proxyMap_(t,n):Hj(t)?iM(eM).proxySet_(t,n):TM(t,n);return(n?.scope_??sM()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?xM(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function FM(e){return kj(e)||bj(10,e),IM(e)}function IM(e){if(!Aj(e)||$j(e))return e;let t=e[yj],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Yj(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Yj(e,!0);return Pj(n,(e,t)=>{Rj(n,e,IM(t))},r),t&&(t.finalized_=!1),n}new NM().produce;var LM=e=>e,RM=kO({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`bottom`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(LM(t.payload))},prepare:bO()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).payload.indexOf(LM(r));a>-1&&(e.payload[a]=LM(i))},prepare:bO()},removeLegendPayload:{reducer(e,t){var n=dO(e).payload.indexOf(LM(t.payload));n>-1&&e.payload.splice(n,1)},prepare:bO()}}}),zM=RM.actions;zM.setLegendSize,zM.setLegendSettings;var BM=zM.addLegendPayload,VM=zM.replaceLegendPayload,HM=zM.removeLegendPayload,UM=RM.reducer,WM=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=WM()}))();function GM(e){e()}function KM(){let e=null,t=null;return{clear(){e=null,t=null},notify(){GM(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var qM={notify(){},get:()=>[]};function JM(e,t){let n,r=qM,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=KM())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=qM)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var YM=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,XM=typeof navigator<`u`&&navigator.product===`ReactNative`,ZM=YM||XM?v.useLayoutEffect:v.useEffect;function QM(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function $M(e,t){if(QM(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!QM(e[n[r]],t[n[r]]))return!1;return!0}var eN=Symbol.for(`react-redux-context`),tN=typeof globalThis<`u`?globalThis:{};function nN(){if(!v.createContext)return{};let e=tN[eN]??=new Map,t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var rN=nN();function iN(e){let{children:t,context:n,serverState:r,store:i}=e,a=v.useMemo(()=>{let e=JM(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=v.useMemo(()=>i.getState(),[i]);ZM(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||rN;return v.createElement(s.Provider,{value:a},t)}var aN=iN,oN=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function sN(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function cN(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(oN.has(n)){if(e[n]==null&&t[n]==null)continue;if(!$M(e[n],t[n]))return!1}else if(!sN(e[n],t[n]))return!1;return!0}function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lN.apply(null,arguments)}function uN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uN(Object(n),!0).forEach(function(t){fN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fN(e,t,n){return(t=pN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pN(e){var t=mN(e,`string`);return typeof t==`symbol`?t:t+``}function mN(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hN(e,t){return bN(e)||yN(e,t)||_N(e,t)||gN()}function gN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _N(e,t){if(e){if(typeof e==`string`)return vN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vN(e,t):void 0}}function vN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bN(e){if(Array.isArray(e))return e}function xN(e){return Array.isArray(e)&&gw(e[0])&&gw(e[1])?e.join(` ~ `):e}var SN={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function CN(e,t){return t==null?e:CE(e,t)}var wN=e=>{var t=e.separator,n=t===void 0?SN.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?SN.labelStyle:a,s=e.payload,c=e.formatter,l=e.itemSorter,u=e.wrapperClassName,d=e.labelClassName,f=e.label,p=e.labelFormatter,m=e.accessibilityLayer,h=m===void 0?SN.accessibilityLayer:m,g=()=>{if(s&&s.length){var e={padding:0,margin:0},t=CN(s,l).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||c||xN,a=e.value,o=e.name,l=a,u=o;if(r){var d=r(a,o,e,t,s);if(Array.isArray(d)){var f=hN(d,2);l=f[0],u=f[1]}else if(d!=null)l=d;else return null}var p=dN(dN({},SN.itemStyle),{},{color:e.color||SN.itemStyle.color},i);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},gw(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,gw(u)?v.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,v.createElement(`span`,{className:`recharts-tooltip-item-value`},l),v.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return v.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},_=dN(dN({},SN.contentStyle),r),y=dN({margin:0},o),b=!Cw(f),x=b?f:``,S=Uv(`recharts-default-tooltip`,u),C=Uv(`recharts-tooltip-label`,d);b&&p&&s!=null&&(x=p(f,s));var w=h?{role:`status`,"aria-live":`assertive`}:{};return v.createElement(`div`,lN({className:S,style:_},w),v.createElement(`p`,{className:C,style:y},v.isValidElement(x)?x:`${x}`),g())},TN=`recharts-tooltip-wrapper`,EN={visibility:`hidden`};function DN(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Uv(TN,{[`${TN}-right`]:Z(n)&&t&&Z(t.x)&&n>=t.x,[`${TN}-left`]:Z(n)&&t&&Z(t.x)&&n<t.x,[`${TN}-bottom`]:Z(r)&&t&&Z(t.y)&&r>=t.y,[`${TN}-top`]:Z(r)&&t&&Z(t.y)&&r<t.y})}function ON(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&Z(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function kN(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function AN(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s.height>0&&s.width>0&&n?(d=ON({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=ON({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=kN({translateX:d,translateY:f,useTranslate3d:c})):u=EN,{cssProperties:u,cssClasses:DN({translateX:d,translateY:f,coordinate:n})}}var jN={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function MN(e,t){return LN(e)||IN(e,t)||PN(e,t)||NN()}function NN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
87
87
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PN(e,t){if(e){if(typeof e==`string`)return FN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FN(e,t):void 0}}function FN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function IN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function LN(e){if(Array.isArray(e))return e}function RN(){var e=MN((0,v.useState)(()=>jN.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),2),t=e[0],n=e[1];return(0,v.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{n(e.matches)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}},[]),t}function zN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zN(Object(n),!0).forEach(function(t){VN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VN(e,t,n){return(t=HN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HN(e){var t=UN(e,`string`);return typeof t==`symbol`?t:t+``}function UN(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function WN(e,t){return YN(e)||JN(e,t)||KN(e,t)||GN()}function GN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
88
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KN(e,t){if(e){if(typeof e==`string`)return qN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qN(e,t):void 0}}function qN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function YN(e){if(Array.isArray(e))return e}function XN(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing==`string`?e.animationEasing:`ease`;return`transform ${e.animationDuration}ms ${t}`}}function ZN(e){var t=RN(),n=WN(v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];v.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(BN(BN({},r),{},{dismissed:!1}));var a=AN({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=BN(BN({},e.hasPortalFromProps?{}:BN(BN({transition:XN({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return v.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var QN=v.memo(ZN),$N=()=>Q(e=>e.rootProps.accessibilityLayer)??!0;function eP(){return eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eP.apply(null,arguments)}function tP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tP(Object(n),!0).forEach(function(t){rP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rP(e,t,n){return(t=iP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iP(e){var t=aP(e,`string`);return typeof t==`symbol`?t:t+``}function aP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oP={curveBasisClosed:AC,curveBasisOpen:MC,curveBasis:OC,curveBumpX:CC,curveBumpY:wC,curveLinearClosed:PC,curveLinear:_C,curveMonotoneX:HC,curveMonotoneY:UC,curveNatural:KC,curveStep:JC,curveStepAfter:XC,curveStepBefore:YC},sP=e=>Tk(e.x)&&Tk(e.y),cP=e=>e.base!=null&&sP(e.base)&&sP(e),lP=e=>e.x,uP=e=>e.y,dP=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${ww(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=oP[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return oP[n]||_C},fP={connectNulls:!1,type:`linear`},pP=e=>{var t=e.type,n=t===void 0?fP.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?fP.connectNulls:s,l=dP(n,o),u=c?i.filter(sP):i;if(Array.isArray(a)){var d,f=i.map((e,t)=>nP(nP({},e),{},{base:a[t]}));return d=o===`vertical`?xC().y(uP).x1(lP).x0(e=>e.base.x):xC().x(lP).y1(uP).y0(e=>e.base.y),d.defined(cP).curve(l)(c?f.filter(cP):f)}return(o===`vertical`&&Z(a)?xC().y(uP).x1(lP).x0(a):Z(a)?xC().x(lP).y1(uP).y0(a):bC().x(lP).y(uP)).defined(sP).curve(l)(u)},mP=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=dj();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?pP(o):r;return v.createElement(`path`,eP({},WS(e),Ow(e),{className:Hv(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},hP=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function gP(){return gP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gP.apply(null,arguments)}function _P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_P(Object(n),!0).forEach(function(t){yP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yP(e,t,n){return(t=bP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bP(e){var t=xP(e,`string`);return typeof t==`symbol`?t:t+``}function xP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function SP(e,t){if(e==null)return{};var n,r,i=CP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function CP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wP=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,TP=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=SP(e,hP),h=vP({x:n,y:i,top:o,left:c,width:u,height:f},m);return!Z(n)||!Z(i)||!Z(u)||!Z(f)||!Z(o)||!Z(c)?null:v.createElement(`path`,gP({},KS(h),{className:Hv(`recharts-cross`,p),d:wP(n,i,u,f,o,c)}))};function EP(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}var DP=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],OP=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),kP=(e,t)=>n=>OP(DP(e,t),n),AP=(e,t)=>n=>OP([...DP(e,t).map((e,t)=>e*t).slice(1),0],n),jP=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},MP=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=jP(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},NP=(e,t,n,r)=>{var i=kP(e,n),a=kP(t,r),o=AP(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},PP=function(){return NP(...MP(...arguments))},FP=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?16.67:a,s=1,c=[0],l=0,u=0,d=1e4,f=0;f<d;){var p=-(l-s)*n,m=u*i;if(u+=(p-m)*o/1e3,l+=u*o/1e3,c.push(l),Math.abs(l-s)<1e-4&&Math.abs(u)<1e-4)break;f++}c[c.length-1]=s;var h=c.length-1;return e=>{if(e<=0)return 0;if(e>=1)return s;var t=e*h,n=Math.floor(t),r=t-n;return(c[n]??0)+((c[n+1]??0)-(c[n]??0))*r}},IP=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return PP(e);case`spring`:return FP();default:if(e.split(`(`)[0]===`cubic-bezier`)return PP(e)}return typeof e==`function`?e:null},LP=(0,v.createContext)((e,t,n)=>{var r,i=a=>{var o=t.tick(a);if(t.getState()===`active`){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,o);return}r=e.setTimeout(i,o)};return r=e.setTimeout(i,0),()=>r?.()});LP.Provider;function RP(e){var t=(0,v.useContext)(LP);return(0,v.useMemo)(()=>e??t,[e,t])}function zP(e,t,n){return(t=BP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BP(e){var t=VP(e,`string`);return typeof t==`symbol`?t:t+``}function VP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var HP=`init`,UP=`pending`,WP=`active`,GP=`completed`;function KP(e){return Math.max(0,e)}var qP=class{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;zP(this,`state`,HP),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=KP(e.animationDuration),this.animationBegin=KP(e.animationBegin),this.progress=0,this.from=e.from,this.to=e.to,this.easing=e.easing,(t=e.onAnimationStart)==null||t.call(e)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(e){if(this.getState()===HP)return this.state=UP,this.beginStartedTime=e,this.animationBegin;if(this.getState()===UP){if(this.beginStartedTime==null)throw Error();var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=WP,this.animationStartedTime=e,this.nextAnimationUpdate(0)):KP(this.animationBegin-t)}if(this.getState()===WP){if(this.animationStartedTime==null)throw Error();var n=e-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state===`active`){var e;(e=this.onAnimationEnd)==null||e.call(this)}this.state=GP}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}},JP=class extends qP{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(xw(this.getFrom(),this.getTo(),this.getProgress()))}},YP=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):r=requestAnimationFrame(i)};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function XP(e,t){return tF(e)||eF(e,t)||QP(e,t)||ZP()}function ZP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
88
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KN(e,t){if(e){if(typeof e==`string`)return qN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qN(e,t):void 0}}function qN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function YN(e){if(Array.isArray(e))return e}function XN(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing==`string`?e.animationEasing:`ease`;return`transform ${e.animationDuration}ms ${t}`}}function ZN(e){var t=RN(),n=WN(v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];v.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(BN(BN({},r),{},{dismissed:!1}));var a=AN({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=BN(BN({},e.hasPortalFromProps?{}:BN(BN({transition:XN({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return v.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var QN=v.memo(ZN),$N=()=>Q(e=>e.rootProps.accessibilityLayer)??!0;function eP(){return eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eP.apply(null,arguments)}function tP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tP(Object(n),!0).forEach(function(t){rP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rP(e,t,n){return(t=iP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iP(e){var t=aP(e,`string`);return typeof t==`symbol`?t:t+``}function aP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oP={curveBasisClosed:AC,curveBasisOpen:MC,curveBasis:OC,curveBumpX:CC,curveBumpY:wC,curveLinearClosed:PC,curveLinear:_C,curveMonotoneX:HC,curveMonotoneY:UC,curveNatural:KC,curveStep:JC,curveStepAfter:XC,curveStepBefore:YC},sP=e=>Tk(e.x)&&Tk(e.y),cP=e=>e.base!=null&&sP(e.base)&&sP(e),lP=e=>e.x,uP=e=>e.y,dP=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${ww(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=oP[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return oP[n]||_C},fP={connectNulls:!1,type:`linear`},pP=e=>{var t=e.type,n=t===void 0?fP.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?fP.connectNulls:s,l=dP(n,o),u=c?i.filter(sP):i;if(Array.isArray(a)){var d,f=i.map((e,t)=>nP(nP({},e),{},{base:a[t]}));return d=o===`vertical`?xC().y(uP).x1(lP).x0(e=>e.base.x):xC().x(lP).y1(uP).y0(e=>e.base.y),d.defined(cP).curve(l)(c?f.filter(cP):f)}return(o===`vertical`&&Z(a)?xC().y(uP).x1(lP).x0(a):Z(a)?xC().x(lP).y1(uP).y0(a):bC().x(lP).y(uP)).defined(sP).curve(l)(u)},mP=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=dj();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?pP(o):r;return v.createElement(`path`,eP({},WS(e),Ow(e),{className:Uv(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},hP=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function gP(){return gP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gP.apply(null,arguments)}function _P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_P(Object(n),!0).forEach(function(t){yP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yP(e,t,n){return(t=bP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bP(e){var t=xP(e,`string`);return typeof t==`symbol`?t:t+``}function xP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function SP(e,t){if(e==null)return{};var n,r,i=CP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function CP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wP=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,TP=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=SP(e,hP),h=vP({x:n,y:i,top:o,left:c,width:u,height:f},m);return!Z(n)||!Z(i)||!Z(u)||!Z(f)||!Z(o)||!Z(c)?null:v.createElement(`path`,gP({},KS(h),{className:Uv(`recharts-cross`,p),d:wP(n,i,u,f,o,c)}))};function EP(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}var DP=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],OP=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),kP=(e,t)=>n=>OP(DP(e,t),n),AP=(e,t)=>n=>OP([...DP(e,t).map((e,t)=>e*t).slice(1),0],n),jP=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},MP=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=jP(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},NP=(e,t,n,r)=>{var i=kP(e,n),a=kP(t,r),o=AP(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},PP=function(){return NP(...MP(...arguments))},FP=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?16.67:a,s=1,c=[0],l=0,u=0,d=1e4,f=0;f<d;){var p=-(l-s)*n,m=u*i;if(u+=(p-m)*o/1e3,l+=u*o/1e3,c.push(l),Math.abs(l-s)<1e-4&&Math.abs(u)<1e-4)break;f++}c[c.length-1]=s;var h=c.length-1;return e=>{if(e<=0)return 0;if(e>=1)return s;var t=e*h,n=Math.floor(t),r=t-n;return(c[n]??0)+((c[n+1]??0)-(c[n]??0))*r}},IP=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return PP(e);case`spring`:return FP();default:if(e.split(`(`)[0]===`cubic-bezier`)return PP(e)}return typeof e==`function`?e:null},LP=(0,v.createContext)((e,t,n)=>{var r,i=a=>{var o=t.tick(a);if(t.getState()===`active`){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,o);return}r=e.setTimeout(i,o)};return r=e.setTimeout(i,0),()=>r?.()});LP.Provider;function RP(e){var t=(0,v.useContext)(LP);return(0,v.useMemo)(()=>e??t,[e,t])}function zP(e,t,n){return(t=BP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BP(e){var t=VP(e,`string`);return typeof t==`symbol`?t:t+``}function VP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var HP=`init`,UP=`pending`,WP=`active`,GP=`completed`;function KP(e){return Math.max(0,e)}var qP=class{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;zP(this,`state`,HP),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=KP(e.animationDuration),this.animationBegin=KP(e.animationBegin),this.progress=0,this.from=e.from,this.to=e.to,this.easing=e.easing,(t=e.onAnimationStart)==null||t.call(e)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(e){if(this.getState()===HP)return this.state=UP,this.beginStartedTime=e,this.animationBegin;if(this.getState()===UP){if(this.beginStartedTime==null)throw Error();var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=WP,this.animationStartedTime=e,this.nextAnimationUpdate(0)):KP(this.animationBegin-t)}if(this.getState()===WP){if(this.animationStartedTime==null)throw Error();var n=e-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state===`active`){var e;(e=this.onAnimationEnd)==null||e.call(this)}this.state=GP}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}},JP=class extends qP{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(xw(this.getFrom(),this.getTo(),this.getProgress()))}},YP=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):r=requestAnimationFrame(i)};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function XP(e,t){return tF(e)||eF(e,t)||QP(e,t)||ZP()}function ZP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
89
89
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QP(e,t){if(e){if(typeof e==`string`)return $P(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$P(e,t):void 0}}function $P(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eF(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function tF(e){if(Array.isArray(e))return e}var nF={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},rF=0,iF=1;function aF(e){var t=Iw(e,nF),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,s=t.begin,c=t.onAnimationEnd,l=t.onAnimationStart,u=t.children,d=RN(),f=r===`auto`?!jN.isSsr&&!d:r,p=RP(t.animationController),m=XP((0,v.useState)(f?rF:iF),2),h=m[0],g=m[1];return(0,v.useEffect)(()=>{f||g(iF)},[f]),(0,v.useEffect)(()=>{var e=IP(o);return!f||!i||e==null?Ew:p(new YP,new JP({animationId:n,easing:e,animationDuration:a,animationBegin:s,onAnimationStart:l,onAnimationEnd:c,from:rF,to:iF}),g)},[p,n,f,i,a,o,s,l,c]),u(Number(h))}function oF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,v.useRef)(vw(t)),r=(0,v.useRef)(e);return r.current!==e&&(n.current=vw(t),r.current=e),n.current}var sF=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),cF=(e,t,n)=>e.map(e=>`${sF(e)} ${t}ms ${n}`).join(`,`),lF=[`radius`],uF=[`radius`],dF,fF,pF,mF,hF,gF,_F,vF,yF,bF;function xF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xF(Object(n),!0).forEach(function(t){CF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CF(e,t,n){return(t=wF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wF(e){var t=TF(e,`string`);return typeof t==`symbol`?t:t+``}function TF(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function EF(){return EF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EF.apply(null,arguments)}function DF(e,t){if(e==null)return{};var n,r,i=OF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function OF(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kF(e,t){return PF(e)||NF(e,t)||jF(e,t)||AF()}function AF(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
90
90
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jF(e,t){if(e){if(typeof e==`string`)return MF(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MF(e,t):void 0}}function MF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function NF(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function PF(e){if(Array.isArray(e))return e}function FF(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var IF=(e,t,n,r,i)=>{var a=dw(n),o=dw(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=fw(dF||=FF([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=fw(fF||=FF([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=fw(pF||=FF([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=fw(mF||=FF([`A `,`,`,`,0,0,`,`,
|
|
91
91
|
`,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=fw(hF||=FF([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=fw(gF||=FF([`A `,`,`,`,0,0,`,`,
|
|
@@ -97,7 +97,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
97
97
|
L .,.
|
|
98
98
|
A .,.,0,0,.,.,.
|
|
99
99
|
L .,.
|
|
100
|
-
A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=fw(bF||=FF([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},LF={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},RF=e=>{var t=Iw(e,LF),n=(0,v.useRef)(null),r=kF((0,v.useState)(-1),2),i=r[0],a=r[1];(0,v.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive,_=(0,v.useRef)(c),y=(0,v.useRef)(l),b=(0,v.useRef)(o),x=(0,v.useRef)(s),S=oF((0,v.useMemo)(()=>({x:o,y:s,width:c,height:l,radius:u}),[o,s,c,l,u]),`rectangle-`);if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var C=
|
|
100
|
+
A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=fw(bF||=FF([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},LF={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},RF=e=>{var t=Iw(e,LF),n=(0,v.useRef)(null),r=kF((0,v.useState)(-1),2),i=r[0],a=r[1];(0,v.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive,_=(0,v.useRef)(c),y=(0,v.useRef)(l),b=(0,v.useRef)(o),x=(0,v.useRef)(s),S=oF((0,v.useMemo)(()=>({x:o,y:s,width:c,height:l,radius:u}),[o,s,c,l,u]),`rectangle-`);if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var C=Uv(`recharts-rectangle`,d);if(!g){var w=KS(t);w.radius;var T=DF(w,lF);return v.createElement(`path`,EF({},T,{x:dw(o),y:dw(s),width:dw(c),height:dw(l),radius:typeof u==`number`?u:void 0,className:C,d:IF(o,s,c,l,u)}))}var E=_.current,D=y.current,O=b.current,k=x.current,A=`0px ${i===-1?1:i}px`,j=`${i}px ${i}px`,M=cF([`strokeDasharray`],p,typeof f==`string`?f:LF.animationEasing);return v.createElement(aF,{animationId:S,key:S,canBegin:i>0,duration:p,easing:f,isActive:g,begin:m},e=>{var r=xw(E,c,e),i=xw(D,l,e),a=xw(O,o,e),d=xw(k,s,e);n.current&&(_.current=r,y.current=i,b.current=a,x.current=d);var f=h?e>0?{transition:M,strokeDasharray:j}:{strokeDasharray:A}:{strokeDasharray:j},p=KS(t);p.radius;var m=DF(p,uF);return v.createElement(`path`,EF({},m,{radius:typeof u==`number`?u:void 0,className:C,d:IF(a,d,r,i,u),ref:n,style:SF(SF({},f),t.style)}))})};function zF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zF(Object(n),!0).forEach(function(t){VF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VF(e,t,n){return(t=HF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HF(e){var t=UF(e,`string`);return typeof t==`symbol`?t:t+``}function UF(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var WF=Math.PI/180,GF=e=>e*Math.PI/180,KF=e=>e*180/Math.PI,qF=(e,t,n,r)=>({x:e+Math.cos(-WF*r)*n,y:t+Math.sin(-WF*r)*n}),JF=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},YF=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},XF=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,o=YF({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:KF(c),angleInRadian:c}},ZF=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},QF=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},$F=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=XF({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c||a===0)return null;var l=ZF(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?BF(BF({},t),{},{radius:a,angle:QF(f,t)}):null};function eI(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[qF(t,n,r,i),qF(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var tI,nI,rI,iI,aI,oI,sI;function cI(){return cI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cI.apply(null,arguments)}function lI(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var uI=(e,t)=>pw(t-e)*Math.min(Math.abs(t-e),359.999),dI=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/WF,d=c?i:i+a*u,f=qF(t,n,l,d),p=qF(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:qF(t,n,l*Math.cos(u*WF),m),theta:u}},fI=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=uI(a,o),c=a+s,l=qF(t,n,i,a),u=qF(t,n,i,c),d=fw(tI||=lI([`M `,`,`,`
|
|
101
101
|
A `,`,`,`,0,
|
|
102
102
|
`,`,`,`,
|
|
103
103
|
`,`,`,`
|
|
@@ -114,45 +114,45 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
114
114
|
`]),p.x,p.y,a,a,+(u<0),f.x,f.y,i,i,+(y>180),+(u<0),g.x,g.y,a,a,+(u<0),_.x,_.y);if(r>0){var x=dI({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=dI({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=fw(oI||=lI([`L`,`,`,`
|
|
115
115
|
A`,`,`,`,0,0,`,`,`,`,`,`
|
|
116
116
|
A`,`,`,`,0,`,`,`,`,`,`,`,`
|
|
117
|
-
A`,`,`,`,0,0,`,`,`,`,`,`Z`]),D.x,D.y,a,a,+(u<0),E.x,E.y,r,r,+(k>180),+(u>0),S.x,S.y,a,a,+(u<0),C.x,C.y)}else b+=fw(sI||=lI([`L`,`,`,`Z`]),t,n);return b},mI={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hI=e=>{var t=Iw(e,mI),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=
|
|
117
|
+
A`,`,`,`,0,0,`,`,`,`,`,`Z`]),D.x,D.y,a,a,+(u<0),E.x,E.y,r,r,+(k>180),+(u>0),S.x,S.y,a,a,+(u<0),C.x,C.y)}else b+=fw(sI||=lI([`L`,`,`,`Z`]),t,n);return b},mI={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},hI=e=>{var t=Iw(e,mI),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=Uv(`recharts-sector`,d),p=a-i,m=yw(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?pI({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):fI({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return v.createElement(`path`,cI({},KS(t),{className:f,d:h}))};function gI(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Dw(t)){if(e===`centric`){var r=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,s=t.angle,c=qF(r,i,a,s),l=qF(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return eI(t)}}function _I(e){return vE(e)?NaN:Number(e)}function vI(e){return e?(e=_I(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function yI(e,t,n){n&&typeof n!=`number`&&hE(e,t,n)&&(t=n=void 0),e=vI(e),t===void 0?(t=e,e=0):t=vI(t),n=n===void 0?e<t?1:-1:vI(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}var bI=e=>e.chartData,xI=$([bI],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),SI=(e,t,n,r)=>r?xI(e):bI(e),CI=(e,t,n)=>n?xI(e):bI(e),wI=$([SI],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)}),TI=$([xI],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)}),EI=$([bI],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t==null?[]:t.slice(n,r+1)});function DI(e,t){return MI(e)||jI(e,t)||kI(e,t)||OI()}function OI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
118
118
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kI(e,t){if(e){if(typeof e==`string`)return AI(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?AI(e,t):void 0}}function AI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function MI(e){if(Array.isArray(e))return e}function NI(e){if(Array.isArray(e)&&e.length===2){var t=DI(e,2),n=t[0],r=t[1];if(Tk(n)&&Tk(r))return!0}return!1}function PI(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function FI(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var n=DI(e,2),r=n[0],i=n[1],a,o;if(Tk(r))a=r;else if(typeof r==`function`)return;if(Tk(i))o=i;else if(typeof i==`function`)return;var s=[a,o];if(NI(s))return s}}function II(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(NI(r))return PI(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=DI(e,2),a=i[0],o=i[1],s,c;if(a===`auto`)t!=null&&(s=Math.min(...t));else if(Z(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[0]))}catch{}else if(typeof a==`string`&&qk.test(a)){var l=qk.exec(a);if(l==null||l[1]==null||t==null)s=void 0;else{var u=+l[1];s=t[0]-u}}else s=t?.[0];if(o===`auto`)t!=null&&(c=Math.max(...t));else if(Z(o))c=o;else if(typeof o==`function`)try{t!=null&&(c=o(t?.[1]))}catch{}else if(typeof o==`string`&&Jk.test(o)){var d=Jk.exec(o);if(d==null||d[1]==null||t==null)c=void 0;else{var f=+d[1];c=t[1]+f}}else c=t?.[1];var p=[s,c];if(NI(p))return t==null?p:PI(p,t,n)}}}var LI=l(o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,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=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function RI(e){return e===0?1:Math.floor(new LI.default(e).abs().log(10).toNumber())+1}function zI(e,t,n){for(var r=new LI.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function BI(e,t){return GI(e)||WI(e,t)||HI(e,t)||VI()}function VI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
119
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HI(e,t){if(e){if(typeof e==`string`)return UI(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?UI(e,t):void 0}}function UI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function WI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function GI(e){if(Array.isArray(e))return e}var KI=e=>{var t=BI(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},qI=(e,t,n)=>{if(e.lte(0))return new LI.default(0);var r=RI(e.toNumber()),i=new LI.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new LI.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new LI.default(s.toNumber()):new LI.default(Math.ceil(s.toNumber()))},JI=(e,t,n)=>{if(e.lte(0))return new LI.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new LI.default(i).abs().log(10).toNumber()),o=new LI.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new LI.default(10).pow(l))}var u=new LI.default(r[c]??1).mul(o);return t?u:new LI.default(Math.ceil(u.toNumber()))},YI=(e,t,n)=>{var r=new LI.default(1),i=new LI.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new LI.default(10).pow(RI(e)-1),i=new LI.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new LI.default(Math.floor(e)))}else e===0?i=new LI.default(Math.floor((t-1)/2)):n||(i=new LI.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new LI.default(c-o).mul(r)).toNumber());return s},XI=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:qI;if(!Number.isFinite((t-e)/(n-1)))return{step:new LI.default(0),tickMin:new LI.default(0),tickMax:new LI.default(0)};var o=a(new LI.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new LI.default(0):(s=new LI.default(e).add(t).div(2),s=s.sub(new LI.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new LI.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?XI(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new LI.default(c).mul(o)),tickMax:s.add(new LI.default(l).mul(o))})},ZI=function(e){var t=BI(e,2),n=t[0],r=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=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=Math.max(i,2),c=BI(KI([n,r]),2),l=c[0],u=c[1];if(l===-1/0||u===1/0){var d=u===1/0?[l,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?d.reverse():d}if(l===u)return YI(l,i,a);var f=XI(l,u,s,a,0,o===`snap125`?JI:qI),p=f.step,m=f.tickMin,h=f.tickMax,g=zI(m,h.add(new LI.default(.1).mul(p)),p);return n>r?g.reverse():g},QI=function(e,t){var n=BI(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,s=BI(KI([r,i]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0)return[r,i];if(c===l)return[c];var u=o===`snap125`?JI:qI,d=Math.max(t,2),f=u(new LI.default(l).sub(c).div(d-1),a,0),p=[...zI(new LI.default(c),new LI.default(l),f),l];if(a===!1){p=p.map(e=>Math.round(e));var m=p.length-1;m>0&&p[m]===p[m-1]&&(p=p.slice(0,m))}return r>i?p.reverse():p},$I=e=>e.rootProps.maxBarSize,eL=e=>e.rootProps.barGap,tL=e=>e.rootProps.barCategoryGap,nL=e=>e.rootProps.barSize,rL=e=>e.rootProps.stackOffset,iL=e=>e.rootProps.reverseStackOrder,aL=e=>e.options.chartName,oL=e=>e.rootProps.syncId,sL=e=>e.rootProps.syncMethod,cL=e=>e.options.eventEmitter,lL=e=>e.rootProps.baseValue,uL={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},dL={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:uL.axis},fL={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:uL.axis},pL=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function mL(e,t,n){if(n!==`auto`)return n;if(e!=null)return Pk(e,t)?`category`:`number`}function hL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hL(Object(n),!0).forEach(function(t){_L(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _L(e,t,n){return(t=vL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vL(e){var t=yL(e,`string`);return typeof t==`symbol`?t:t+``}function yL(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bL={allowDataOverflow:dL.allowDataOverflow,allowDecimals:dL.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:dL.angleAxisId,includeHidden:!1,name:void 0,reversed:dL.reversed,scale:dL.scale,tick:dL.tick,tickCount:void 0,ticks:void 0,type:dL.type,unit:void 0,niceTicks:`auto`},xL={allowDataOverflow:fL.allowDataOverflow,allowDecimals:fL.allowDecimals,allowDuplicatedCategory:fL.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:fL.radiusAxisId,includeHidden:fL.includeHidden,name:void 0,reversed:fL.reversed,scale:fL.scale,tick:fL.tick,tickCount:fL.tickCount,ticks:void 0,type:fL.type,unit:void 0,niceTicks:`auto`},SL=$([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},pj],(e,t)=>{if(e!=null)return e;var n=mL(t,`angleAxis`,bL.type)??`category`;return gL(gL({},bL),{},{type:n})}),CL=$([(e,t)=>e.polarAxis.radiusAxis[t],pj],(e,t)=>{if(e!=null)return e;var n=mL(t,`radiusAxis`,xL.type)??`category`;return gL(gL({},xL),{},{type:n})}),wL=e=>e.polarOptions,TL=$([eA,tA,vA],JF),EL=$([wL,TL],(e,t)=>{if(e!=null)return yw(e.innerRadius,t,0)}),DL=$([wL,TL],(e,t)=>{if(e!=null)return yw(e.outerRadius,t,t*.8)}),OL=$([wL],e=>e==null?[0,0]:[e.startAngle,e.endAngle]),kL=$([SL,OL],pL),AL=$([TL,EL,DL],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]}),jL=$([CL,AL],pL),ML=$([uj,wL,EL,DL,eA,tA],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var o=t.cx,s=t.cy,c=t.startAngle,l=t.endAngle;return{cx:yw(o,i,i/2),cy:yw(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),NL=(e,t)=>t,PL=(e,t,n)=>n;function FL(e){return e?.id}function IL(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,o=n.dataKey,s=new Map;return e.forEach(e=>{var t=e.data??i;if(!(t==null||t.length===0)){var n=FL(e);t.forEach((t,r)=>{var i=o==null||a?r:String(Mk(t,o,null)),c=Mk(t,e.dataKey,0),l=s.has(i)?s.get(i):{};Object.assign(l,{[n]:c}),s.set(i,l)})}}),Array.from(s.values())}function LL(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var RL=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function zL(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function BL(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var VL=e=>{var t=uj(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},HL=e=>e.tooltip.settings.axisId;function UL(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var WL=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!NI(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Tk(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function GL(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function KL(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qL(e){let t,n,r;e.length===2?(t=e===GL||e===KL?e:JL,n=e,r=e):(t=GL,n=(t,n)=>GL(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function JL(){return 0}function YL(e){return e===null?NaN:+e}function*XL(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var ZL=qL(GL),QL=ZL.right;ZL.left,qL(YL).center;var $L=class extends Map{constructor(e,t=Jee){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(eR(this,e))}has(e){return super.has(eR(this,e))}set(e,t){return super.set(Kee(this,e),t)}delete(e){return super.delete(qee(this,e))}};function eR({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function Kee({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function qee({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Jee(e){return typeof e==`object`&&e?e.valueOf():e}function Yee(e=GL){if(e===GL)return tR;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function tR(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var Xee=Math.sqrt(50),Zee=Math.sqrt(10),Qee=Math.sqrt(2);function nR(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Xee?10:a>=Zee?5:a>=Qee?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?nR(e,t,n*2):[s,c,l]}function rR(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?nR(t,e,n):nR(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function iR(e,t,n){return t=+t,e=+e,n=+n,nR(e,t,n)[2]}function aR(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?iR(t,e,n):iR(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function oR(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function sR(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cR(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?tR:Yee(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));cR(e,t,u,d,i)}let a=e[t],o=n,s=r;for(lR(e,n,t),i(e[r],a)>0&&lR(e,n,r);o<s;){for(lR(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?lR(e,n,s):(++s,lR(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function lR(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function $ee(e,t,n){if(e=Float64Array.from(XL(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return sR(e);if(t>=1)return oR(e);var r,i=(r-1)*t,a=Math.floor(i),o=oR(cR(e,a).subarray(0,a+1));return o+(sR(e.subarray(a+1))-o)*(i-a)}}function ete(e,t,n=YL){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function tte(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function uR(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function dR(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var fR=Symbol(`implicit`);function pR(){var e=new $L,t=[],n=[],r=fR;function i(i){let a=e.get(i);if(a===void 0){if(r!==fR)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new $L;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return pR(t,n).unknown(r)},uR.apply(i,arguments),i}function mR(){var e=pR().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=tte(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return mR(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},uR.apply(d(),arguments)}function hR(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return hR(t())},e}function nte(){return hR(mR.apply(null,arguments).paddingInner(1))}function gR(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _R(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vR(){}var yR=.7,bR=1/yR,xR=`\\s*([+-]?\\d+)\\s*`,SR=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,CR=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,rte=/^#([0-9a-f]{3,8})$/,ite=RegExp(`^rgb\\(${xR},${xR},${xR}\\)$`),ate=RegExp(`^rgb\\(${CR},${CR},${CR}\\)$`),ote=RegExp(`^rgba\\(${xR},${xR},${xR},${SR}\\)$`),ste=RegExp(`^rgba\\(${CR},${CR},${CR},${SR}\\)$`),cte=RegExp(`^hsl\\(${SR},${CR},${CR}\\)$`),lte=RegExp(`^hsla\\(${SR},${CR},${CR},${SR}\\)$`),wR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};gR(vR,DR,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:TR,formatHex:TR,formatHex8:ute,formatHsl:dte,formatRgb:ER,toString:ER});function TR(){return this.rgb().formatHex()}function ute(){return this.rgb().formatHex8()}function dte(){return BR(this).formatHsl()}function ER(){return this.rgb().formatRgb()}function DR(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=rte.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?OR(t):n===3?new MR(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kR(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kR(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=ite.exec(e))?new MR(t[1],t[2],t[3],1):(t=ate.exec(e))?new MR(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ote.exec(e))?kR(t[1],t[2],t[3],t[4]):(t=ste.exec(e))?kR(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cte.exec(e))?zR(t[1],t[2]/100,t[3]/100,1):(t=lte.exec(e))?zR(t[1],t[2]/100,t[3]/100,t[4]):wR.hasOwnProperty(e)?OR(wR[e]):e===`transparent`?new MR(NaN,NaN,NaN,0):null}function OR(e){return new MR(e>>16&255,e>>8&255,e&255,1)}function kR(e,t,n,r){return r<=0&&(e=t=n=NaN),new MR(e,t,n,r)}function AR(e){return e instanceof vR||(e=DR(e)),e?(e=e.rgb(),new MR(e.r,e.g,e.b,e.opacity)):new MR}function jR(e,t,n,r){return arguments.length===1?AR(e):new MR(e,t,n,r??1)}function MR(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}gR(MR,jR,_R(vR,{brighter(e){return e=e==null?bR:bR**+e,new MR(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yR:yR**+e,new MR(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new MR(LR(this.r),LR(this.g),LR(this.b),IR(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:NR,formatHex:NR,formatHex8:PR,formatRgb:FR,toString:FR}));function NR(){return`#${RR(this.r)}${RR(this.g)}${RR(this.b)}`}function PR(){return`#${RR(this.r)}${RR(this.g)}${RR(this.b)}${RR((isNaN(this.opacity)?1:this.opacity)*255)}`}function FR(){let e=IR(this.opacity);return`${e===1?`rgb(`:`rgba(`}${LR(this.r)}, ${LR(this.g)}, ${LR(this.b)}${e===1?`)`:`, ${e})`}`}function IR(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function LR(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function RR(e){return e=LR(e),(e<16?`0`:``)+e.toString(16)}function zR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new HR(e,t,n,r)}function BR(e){if(e instanceof HR)return new HR(e.h,e.s,e.l,e.opacity);if(e instanceof vR||(e=DR(e)),!e)return new HR;if(e instanceof HR)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new HR(o,s,c,e.opacity)}function VR(e,t,n,r){return arguments.length===1?BR(e):new HR(e,t,n,r??1)}function HR(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}gR(HR,VR,_R(vR,{brighter(e){return e=e==null?bR:bR**+e,new HR(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yR:yR**+e,new HR(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,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new MR(GR(e>=240?e-240:e+120,i,r),GR(e,i,r),GR(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new HR(UR(this.h),WR(this.s),WR(this.l),IR(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(){let e=IR(this.opacity);return`${e===1?`hsl(`:`hsla(`}${UR(this.h)}, ${WR(this.s)*100}%, ${WR(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function UR(e){return e=(e||0)%360,e<0?e+360:e}function WR(e){return Math.max(0,Math.min(1,e||0))}function GR(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var KR=e=>()=>e;function qR(e,t){return function(n){return e+n*t}}function JR(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function YR(e){return(e=+e)==1?XR:function(t,n){return n-t?JR(t,n,e):KR(isNaN(t)?n:t)}}function XR(e,t){var n=t-e;return n?qR(e,n):KR(isNaN(e)?t:e)}var ZR=(function e(t){var n=YR(t);function r(e,t){var r=n((e=jR(e)).r,(t=jR(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=XR(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function QR(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function $R(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ez(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=lz(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function tz(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nz(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function rz(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=lz(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var iz=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,az=new RegExp(iz.source,`g`);function oz(e){return function(){return e}}function sz(e){return function(t){return e(t)+``}}function cz(e,t){var n=iz.lastIndex=az.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=iz.exec(e))&&(i=az.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:nz(r,i)})),n=az.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?sz(c[0].x):oz(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function lz(e,t){var n=typeof t,r;return t==null||n===`boolean`?KR(t):(n===`number`?nz:n===`string`?(r=DR(t))?(t=r,ZR):cz:t instanceof DR?ZR:t instanceof Date?tz:$R(t)?QR:Array.isArray(t)?ez:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?rz:nz)(e,t)}function uz(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function dz(e,t){t===void 0&&(t=e,e=lz);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function fz(e){return function(){return e}}function pz(e){return+e}var mz=[0,1];function hz(e){return e}function gz(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:fz(isNaN(t)?NaN:.5)}function _z(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function vz(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=gz(i,r),a=n(o,a)):(r=gz(r,i),a=n(a,o)),function(e){return a(r(e))}}function yz(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=gz(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=QL(e,t,1,r)-1;return a[n](i[n](t))}}function bz(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xz(){var e=mz,t=mz,n=lz,r,i,a,o=hz,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==hz&&(o=_z(e[0],e[n-1])),s=n>2?yz:vz,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),nz))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,pz),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=uz,u()},d.clamp=function(e){return arguments.length?(o=e?!0:hz,u()):o!==hz},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Sz(){return xz()(hz,hz)}function Cz(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function wz(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Tz(e){return e=wz(Math.abs(e)),e?e[1]:NaN}function Ez(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Dz(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Oz=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kz(e){if(!(t=Oz.exec(e)))throw Error(`invalid format: `+e);var t;return new Az({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]})}kz.prototype=Az.prototype;function Az(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+``}Az.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 jz(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Mz;function Nz(e,t){var n=wz(e,t);if(!n)return Mz=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Mz=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+wz(e,Math.max(0,t+a-1))[0]}function Pz(e,t){var n=wz(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Fz={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Cz,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)=>Pz(e*100,t),r:Pz,s:Nz,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Iz(e){return e}var Lz=Array.prototype.map,Rz=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function zz(e){var t=e.grouping===void 0||e.thousands===void 0?Iz:Ez(Lz.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?Iz:Dz(Lz.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=kz(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Fz[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Fz[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=jz(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Mz!==void 0?Rz[8+Mz/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(Tz(t)/3)))*3,r=10**-n,i=l((e=kz(e),e.type=`f`,e),{suffix:Rz[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Bz,Vz,Hz;Uz({thousands:`,`,grouping:[3],currency:[`$`,``]});function Uz(e){return Bz=zz(e),Vz=Bz.format,Hz=Bz.formatPrefix,Bz}function Wz(e){return Math.max(0,-Tz(Math.abs(e)))}function Gz(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tz(t)/3)))*3-Tz(Math.abs(e)))}function Kz(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tz(t)-Tz(e))+1}function qz(e,t,n,r){var i=aR(e,t,n),a;switch(r=kz(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Gz(i,o))&&(r.precision=a),Hz(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Kz(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Wz(i))&&(r.precision=a-(r.type===`%`)*2);break}return Vz(r)}function Jz(e){var t=e.domain;return e.ticks=function(e){var n=t();return rR(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return qz(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=iR(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Yz(){var e=Sz();return e.copy=function(){return bz(e,Yz())},uR.apply(e,arguments),Jz(e)}function Xz(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,pz),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Xz(e).unknown(t)},e=arguments.length?Array.from(e,pz):[0,1],Jz(n)}function Zz(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function Qz(e){return Math.log(e)}function $z(e){return Math.exp(e)}function eB(e){return-Math.log(-e)}function tB(e){return-Math.exp(-e)}function nB(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function rB(e){return e===10?nB:e===Math.E?Math.exp:t=>e**+t}function iB(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 aB(e){return(t,n)=>-e(-t,n)}function oB(e){let t=e(Qz,$z),n=t.domain,r=10,i,a;function o(){return i=iB(r),a=rB(r),n()[0]<0?(i=aB(i),a=aB(a),e(eB,tB)):e(Qz,$z),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=rR(o,s,p))}else m=rR(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=kz(n)).precision==null&&(n.trim=!0),n=Vz(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(Zz(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function sB(){let e=oB(xz()).domain([1,10]);return e.copy=()=>bz(e,sB()).base(e.base()),uR.apply(e,arguments),e}function cB(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function lB(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function uB(e){var t=1,n=e(cB(t),lB(t));return n.constant=function(n){return arguments.length?e(cB(t=+n),lB(t)):t},Jz(n)}function dB(){var e=uB(xz());return e.copy=function(){return bz(e,dB()).constant(e.constant())},uR.apply(e,arguments)}function fB(e){return function(t){return t<0?-((-t)**+e):t**+e}}function pB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mB(e){return e<0?-e*e:e*e}function hB(e){var t=e(hz,hz),n=1;function r(){return n===1?e(hz,hz):n===.5?e(pB,mB):e(fB(n),fB(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},Jz(t)}function gB(){var e=hB(xz());return e.copy=function(){return bz(e,gB()).exponent(e.exponent())},uR.apply(e,arguments),e}function _B(){return gB.apply(null,arguments).exponent(.5)}function vB(e){return Math.sign(e)*e*e}function yB(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function bB(){var e=Sz(),t=[0,1],n=!1,r;function i(t){var i=yB(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(vB(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,pz)).map(vB)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return bB(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},uR.apply(i,arguments),Jz(i)}function xB(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=ete(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[QL(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(GL),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return xB().domain(e).range(t).unknown(r)},uR.apply(a,arguments)}function SB(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[QL(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return SB().domain([e,t]).range(i).unknown(a)},uR.apply(Jz(o),arguments)}function CB(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[QL(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return CB().domain(e).range(t).unknown(n)},uR.apply(i,arguments)}var wB=new Date,TB=new Date;function EB(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>EB(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(wB.setTime(+t),TB.setTime(+r),e(wB),e(TB),Math.floor(n(wB,TB))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var DB=EB(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);DB.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?EB(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):DB),DB.range;var OB=1e3,kB=OB*60,AB=kB*60,jB=AB*24,MB=jB*7,NB=jB*30,PB=jB*365,FB=EB(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*OB)},(e,t)=>(t-e)/OB,e=>e.getUTCSeconds());FB.range;var IB=EB(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*OB)},(e,t)=>{e.setTime(+e+t*kB)},(e,t)=>(t-e)/kB,e=>e.getMinutes());IB.range;var LB=EB(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*kB)},(e,t)=>(t-e)/kB,e=>e.getUTCMinutes());LB.range;var RB=EB(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*OB-e.getMinutes()*kB)},(e,t)=>{e.setTime(+e+t*AB)},(e,t)=>(t-e)/AB,e=>e.getHours());RB.range;var zB=EB(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*AB)},(e,t)=>(t-e)/AB,e=>e.getUTCHours());zB.range;var BB=EB(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*kB)/jB,e=>e.getDate()-1);BB.range;var VB=EB(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jB,e=>e.getUTCDate()-1);VB.range;var HB=EB(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jB,e=>Math.floor(e/jB));HB.range;function UB(e){return EB(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*kB)/MB)}var WB=UB(0),GB=UB(1),KB=UB(2),qB=UB(3),JB=UB(4),YB=UB(5),XB=UB(6);WB.range,GB.range,KB.range,qB.range,JB.range,YB.range,XB.range;function ZB(e){return EB(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/MB)}var QB=ZB(0),$B=ZB(1),eV=ZB(2),tV=ZB(3),nV=ZB(4),rV=ZB(5),iV=ZB(6);QB.range,$B.range,eV.range,tV.range,nV.range,rV.range,iV.range;var aV=EB(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());aV.range;var oV=EB(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());oV.range;var sV=EB(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());sV.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:EB(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),sV.range;var cV=EB(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());cV.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:EB(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),cV.range;function lV(e,t,n,r,i,a){let o=[[FB,1,OB],[FB,5,5*OB],[FB,15,15*OB],[FB,30,30*OB],[a,1,kB],[a,5,5*kB],[a,15,15*kB],[a,30,30*kB],[i,1,AB],[i,3,3*AB],[i,6,6*AB],[i,12,12*AB],[r,1,jB],[r,2,2*jB],[n,1,MB],[t,1,NB],[t,3,3*NB],[e,1,PB]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=qL(([,,e])=>e).right(o,i);if(a===o.length)return e.every(aR(t/PB,n/PB,r));if(a===0)return DB.every(Math.max(aR(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[uV,dV]=lV(cV,oV,QB,HB,zB,LB),[fV,pV]=lV(sV,aV,WB,BB,RB,IB);function mV(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function hV(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gV(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function _V(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=wV(i),u=TV(i),d=wV(a),f=TV(a),p=wV(o),m=TV(o),h=wV(s),g=TV(s),_=wV(c),v=TV(c),y={a:N,A:P,b:F,B:I,c:null,d:KV,e:KV,f:ZV,g:cH,G:uH,H:qV,I:JV,j:YV,L:XV,m:QV,M:$V,p:L,q:R,Q:NH,s:PH,S:eH,u:tH,U:nH,V:iH,w:aH,W:oH,x:null,X:null,y:sH,Y:lH,Z:dH,"%":MH},b={a:ee,A:te,b:z,B,c:null,d:fH,e:fH,f:_H,g:OH,G:AH,H:pH,I:mH,j:hH,L:gH,m:vH,M:yH,p:V,q:ne,Q:NH,s:PH,S:bH,u:xH,U:SH,V:wH,w:TH,W:EH,x:null,X:null,y:DH,Y:kH,Z:jH,"%":MH},x={a:E,A:D,b:O,B:k,c:A,d:IV,e:IV,f:HV,g:MV,G:jV,H:RV,I:RV,j:LV,L:VV,m:FV,M:zV,p:T,q:PV,Q:WV,s:GV,S:BV,u:DV,U:OV,V:kV,w:EV,W:AV,x:j,X:M,y:MV,Y:jV,Z:NV,"%":UV};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=vV[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=gV(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=hV(gV(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?$B.ceil(a):$B(a),a=VB.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=mV(gV(r.y,0,1)),o=a.getDay(),a=o>4||o===0?GB.ceil(a):GB(a),a=BB.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.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)),o=`Z`in r?hV(gV(r.y,0,1)).getUTCDay():mV(gV(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,hV(r)):mV(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in vV?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function R(e){return 1+~~(e.getMonth()/3)}function ee(e){return o[e.getUTCDay()]}function te(e){return a[e.getUTCDay()]}function z(e){return c[e.getUTCMonth()]}function B(e){return s[e.getUTCMonth()]}function V(e){return i[+(e.getUTCHours()>=12)]}function ne(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var vV={"-":``,_:` `,0:`0`},yV=/^\s*\d+/,bV=/^%/,xV=/[\\^$*+?|[\]().{}]/g;function SV(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function CV(e){return e.replace(xV,`\\$&`)}function wV(e){return RegExp(`^(?:`+e.map(CV).join(`|`)+`)`,`i`)}function TV(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function EV(e,t,n){var r=yV.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function DV(e,t,n){var r=yV.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function OV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function AV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function jV(e,t,n){var r=yV.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function MV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function NV(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function PV(e,t,n){var r=yV.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function FV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function IV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function LV(e,t,n){var r=yV.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function RV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function zV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function BV(e,t,n){var r=yV.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function VV(e,t,n){var r=yV.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function HV(e,t,n){var r=yV.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function UV(e,t,n){var r=bV.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function WV(e,t,n){var r=yV.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function GV(e,t,n){var r=yV.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function KV(e,t){return SV(e.getDate(),t,2)}function qV(e,t){return SV(e.getHours(),t,2)}function JV(e,t){return SV(e.getHours()%12||12,t,2)}function YV(e,t){return SV(1+BB.count(sV(e),e),t,3)}function XV(e,t){return SV(e.getMilliseconds(),t,3)}function ZV(e,t){return XV(e,t)+`000`}function QV(e,t){return SV(e.getMonth()+1,t,2)}function $V(e,t){return SV(e.getMinutes(),t,2)}function eH(e,t){return SV(e.getSeconds(),t,2)}function tH(e){var t=e.getDay();return t===0?7:t}function nH(e,t){return SV(WB.count(sV(e)-1,e),t,2)}function rH(e){var t=e.getDay();return t>=4||t===0?JB(e):JB.ceil(e)}function iH(e,t){return e=rH(e),SV(JB.count(sV(e),e)+(sV(e).getDay()===4),t,2)}function aH(e){return e.getDay()}function oH(e,t){return SV(GB.count(sV(e)-1,e),t,2)}function sH(e,t){return SV(e.getFullYear()%100,t,2)}function cH(e,t){return e=rH(e),SV(e.getFullYear()%100,t,2)}function lH(e,t){return SV(e.getFullYear()%1e4,t,4)}function uH(e,t){var n=e.getDay();return e=n>=4||n===0?JB(e):JB.ceil(e),SV(e.getFullYear()%1e4,t,4)}function dH(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+SV(t/60|0,`0`,2)+SV(t%60,`0`,2)}function fH(e,t){return SV(e.getUTCDate(),t,2)}function pH(e,t){return SV(e.getUTCHours(),t,2)}function mH(e,t){return SV(e.getUTCHours()%12||12,t,2)}function hH(e,t){return SV(1+VB.count(cV(e),e),t,3)}function gH(e,t){return SV(e.getUTCMilliseconds(),t,3)}function _H(e,t){return gH(e,t)+`000`}function vH(e,t){return SV(e.getUTCMonth()+1,t,2)}function yH(e,t){return SV(e.getUTCMinutes(),t,2)}function bH(e,t){return SV(e.getUTCSeconds(),t,2)}function xH(e){var t=e.getUTCDay();return t===0?7:t}function SH(e,t){return SV(QB.count(cV(e)-1,e),t,2)}function CH(e){var t=e.getUTCDay();return t>=4||t===0?nV(e):nV.ceil(e)}function wH(e,t){return e=CH(e),SV(nV.count(cV(e),e)+(cV(e).getUTCDay()===4),t,2)}function TH(e){return e.getUTCDay()}function EH(e,t){return SV($B.count(cV(e)-1,e),t,2)}function DH(e,t){return SV(e.getUTCFullYear()%100,t,2)}function OH(e,t){return e=CH(e),SV(e.getUTCFullYear()%100,t,2)}function kH(e,t){return SV(e.getUTCFullYear()%1e4,t,4)}function AH(e,t){var n=e.getUTCDay();return e=n>=4||n===0?nV(e):nV.ceil(e),SV(e.getUTCFullYear()%1e4,t,4)}function jH(){return`+0000`}function MH(){return`%`}function NH(e){return+e}function PH(e){return Math.floor(e/1e3)}var FH,IH,LH;RH({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 RH(e){return FH=_V(e),IH=FH.format,FH.parse,LH=FH.utcFormat,FH.utcParse,FH}function zH(e){return new Date(e)}function BH(e){return e instanceof Date?+e:+new Date(+e)}function VH(e,t,n,r,i,a,o,s,c,l){var u=Sz(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,BH)):f().map(zH)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(Zz(n,e)):u},u.copy=function(){return bz(u,VH(e,t,n,r,i,a,o,s,c,l))},u}function HH(){return uR.apply(VH(fV,pV,sV,aV,WB,BB,RB,IB,FB,IH).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function UH(){return uR.apply(VH(uV,dV,cV,oV,QB,VB,zB,LB,FB,LH).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function WH(){var e=0,t=1,n,r,i,a,o=hz,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(lz),l.rangeRound=u(uz),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function GH(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function KH(){var e=Jz(WH()(hz));return e.copy=function(){return GH(e,KH())},dR.apply(e,arguments)}function qH(){var e=oB(WH()).domain([1,10]);return e.copy=function(){return GH(e,qH()).base(e.base())},dR.apply(e,arguments)}function JH(){var e=uB(WH());return e.copy=function(){return GH(e,JH()).constant(e.constant())},dR.apply(e,arguments)}function YH(){var e=hB(WH());return e.copy=function(){return GH(e,YH()).exponent(e.exponent())},dR.apply(e,arguments)}function XH(){return YH.apply(null,arguments).exponent(.5)}function ZH(){var e=[],t=hz;function n(n){if(n!=null&&!isNaN(n=+n))return t((QL(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(GL),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>$ee(e,r/t))},n.copy=function(){return ZH(t).domain(e)},dR.apply(n,arguments)}function QH(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=hz,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=dz(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(lz),p.rangeRound=m(uz),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function $H(){var e=Jz(QH()(hz));return e.copy=function(){return GH(e,$H())},dR.apply(e,arguments)}function eU(){var e=oB(QH()).domain([.1,1,10]);return e.copy=function(){return GH(e,eU()).base(e.base())},dR.apply(e,arguments)}function tU(){var e=uB(QH());return e.copy=function(){return GH(e,tU()).constant(e.constant())},dR.apply(e,arguments)}function nU(){var e=hB(QH());return e.copy=function(){return GH(e,nU()).exponent(e.exponent())},dR.apply(e,arguments)}function rU(){return nU.apply(null,arguments).exponent(.5)}var iU=s({scaleBand:()=>mR,scaleDiverging:()=>$H,scaleDivergingLog:()=>eU,scaleDivergingPow:()=>nU,scaleDivergingSqrt:()=>rU,scaleDivergingSymlog:()=>tU,scaleIdentity:()=>Xz,scaleImplicit:()=>fR,scaleLinear:()=>Yz,scaleLog:()=>sB,scaleOrdinal:()=>pR,scalePoint:()=>nte,scalePow:()=>gB,scaleQuantile:()=>xB,scaleQuantize:()=>SB,scaleRadial:()=>bB,scaleSequential:()=>KH,scaleSequentialLog:()=>qH,scaleSequentialPow:()=>YH,scaleSequentialQuantile:()=>ZH,scaleSequentialSqrt:()=>XH,scaleSequentialSymlog:()=>JH,scaleSqrt:()=>_B,scaleSymlog:()=>dB,scaleThreshold:()=>CB,scaleTime:()=>HH,scaleUtc:()=>UH,tickFormat:()=>qz});function aU(e){var t=iU;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${ww(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function oU(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=aU(e);if(r!=null)return r.domain(t).range(n),r}}function sU(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?oU(e.scale,n,r):oU(t,n,r)}function cU(e){return`scale${ww(e)}`}function lU(e){return cU(e)in iU}var uU=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return lU(r)?r:`point`}};function dU(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function fU(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=dU(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function pU(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):fU(e,void 0)}function mU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mU(Object(n),!0).forEach(function(t){gU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gU(e,t,n){return(t=_U(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _U(e){var t=vU(e,`string`);return typeof t==`symbol`?t:t+``}function vU(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yU(e,t){return wU(e)||CU(e,t)||xU(e,t)||bU()}function bU(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
120
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xU(e,t){if(e){if(typeof e==`string`)return SU(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SU(e,t):void 0}}function SU(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function CU(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function wU(e){if(Array.isArray(e))return e}var TU=[0,`auto`],EU={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},DU=(e,t)=>e.cartesianAxis.xAxis[t],OU=(e,t)=>DU(e,t)??EU,kU={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:TU,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},AU=(e,t)=>e.cartesianAxis.yAxis[t],jU=(e,t)=>AU(e,t)??kU,MU={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},NU=(e,t)=>e.cartesianAxis.zAxis[t]??MU,PU=(e,t,n)=>{switch(t){case`xAxis`:return OU(e,n);case`yAxis`:return jU(e,n);case`zAxis`:return NU(e,n);case`angleAxis`:return SL(e,n);case`radiusAxis`:return CL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},FU=(e,t,n)=>{switch(t){case`xAxis`:return OU(e,n);case`yAxis`:return jU(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},IU=(e,t,n)=>{switch(t){case`xAxis`:return OU(e,n);case`yAxis`:return jU(e,n);case`angleAxis`:return SL(e,n);case`radiusAxis`:return CL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},LU=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function RU(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var zU=e=>e.graphicalItems.cartesianItems,BU=$([NL,PL],RU),VU=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),HU=$([zU,PU,BU],VU,{memoizeOptions:{resultEqualityCheck:zL}}),UU=$([HU],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(LL)),WU=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),GU=$([HU],WU),KU=e=>e.map(e=>e.data).filter(Boolean).flat(1),qU=$([HU],e=>e.some(e=>!e.data)),JU=$([HU],KU,{memoizeOptions:{resultEqualityCheck:zL}}),YU=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},XU=$([JU,SI],YU),ZU=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:Mk(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:Mk(e,t.dataKey)})),QU=(e,t,n,r,i,a)=>{var o=r.chartData,s=o===void 0?[]:o,c=r.dataStartIndex,l=r.dataEndIndex,u=ZU(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...s.slice(c,l+1).map(e=>({value:Mk(e,t.dataKey)})).filter(e=>e.value!=null),...u]:u},$U=$([XU,PU,HU,SI,qU,JU],QU);function eW(e){if(gw(e)||e instanceof Date){var t=Number(e);if(Tk(t))return t}}function tW(e){if(Array.isArray(e)){var t=[eW(e[0]),eW(e[1])];return NI(t)?t:void 0}var n=eW(e);if(n!=null)return[n,n]}function nW(e){return e.map(eW).filter(Tw)}function rW(e,t){var n=eW(e),r=eW(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var iW=$([$U],e=>e?.map(e=>e.value).sort(rW));function aW(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function oW(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!mw(t))r=t;else if(Array.isArray(t)){var i=nW(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:nW(n.flatMap(t=>{var n=Mk(e,t.dataKey),i,a;if(Array.isArray(n)){var o=yU(n,2);i=o[0],a=o[1]}else i=a=n;if(!(!Tk(i)||!Tk(a)))return[r-i,r+a]}))}var sW=e=>IU(e,VL(e),HL(e)),cW=$([sW],e=>e?.dataKey),lW=$([UU,SI,sW],IL),uW=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var i=yU(t,2),a=i[0],o=i[1],s=r?[...o].reverse():o;return[a,{stackedData:zk(e,s.map(FL),n),graphicalItems:s}]}))},dW=$([lW,UU,rL,iL],uW),fW=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!==`zAxis`)return Kk(e,i,a)},pW=$([PU],e=>e.allowDataOverflow),mW=e=>{if(e==null||!(`domain`in e))return TU;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=nW(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??TU},hW=$([PU],mW),gW=$([hW,pW],FI),_W=$([dW,bI,NL,gW],fW,{memoizeOptions:{resultEqualityCheck:RL}}),vW=e=>e.errorBars,yW=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>aW(n,e)),bW=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},xW=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>aW(i,e));n.forEach(n=>{var r=Mk(n,t.dataKey??e.dataKey),i=oW(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||a<o)&&(o=a),(s==null||l>s)&&(s=l)}var u=tW(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=tW(Mk(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),Tk(o)&&Tk(s))return[o,s]},SW=$([XU,PU,GU,vW,NL,wI],xW,{memoizeOptions:{resultEqualityCheck:RL}});function CW(e){var t=e.value;if(gw(t)||t instanceof Date)return t}var wW=(e,t,n)=>{var r=e.map(CW).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&bw(r))?yI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},TW=e=>e.referenceElements.dots,EW=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),DW=$([TW,NL,PL],EW),OW=e=>e.referenceElements.areas,kW=$([OW,NL,PL],EW),AW=e=>e.referenceElements.lines,jW=$([AW,NL,PL],EW),MW=(e,t)=>{if(e!=null){var n=nW(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},NW=$(DW,NL,MW),PW=(e,t)=>{if(e!=null){var n=nW(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},FW=$([kW,NL],PW);function IW(e){if(e.x!=null)return nW([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:nW(t)}function LW(e){if(e.y!=null)return nW([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:nW(t)}var RW=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?IW(e):LW(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},zW=$(NW,$([jW,NL],RW),FW,(e,t,n)=>bW(e,n,t)),BW=(e,t,n,r,i,a,o,s,c)=>{if(n!=null)return n;var l=o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?bW(r,a,i):bW(a,i),u=II(t,l,e.allowDataOverflow);return u==null&&e.allowDataOverflow&&l==null&&c!=null?c:u},VW=$([PU,hW,gW,_W,SW,zW,uj,NL,$([PU],e=>{if(!(e==null||e.type!==`number`||!(`ticks`in e)||e.ticks==null)){var t=nW(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},{memoizeOptions:{resultEqualityCheck:RL}})],BW,{memoizeOptions:{resultEqualityCheck:RL}}),HW=[0,1],UW=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var s=e.dataKey,c=e.type,l=Pk(t,a);return l&&s==null?yI(0,n?.length??0):c===`category`?wW(r,e,l):i===`expand`&&!l?HW:o}},WW=$([PU,uj,XU,$U,rL,NL,VW],UW),GW=$([PU,LU,aL],uU),KW=(e,t,n)=>{var r=t.niceTicks;if(r!==`none`){var i=mW(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&NI(e)){if(a)return ZI(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return QI(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&NI(e))return ZI(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&NI(e))return QI(e,t.tickCount,t.allowDecimals,`adaptive`)}}},qW=$([WW,IU,GW],KW),JW=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&NI(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},YW=$([PU,WW,qW,NL],JW),XW=$($($U,PU,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(nW(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(!(c==null||l==null)){var u=l-c;n=Math.min(n,u)}}return n/o}}),uj,tL,vA,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Tk(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=yw(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),ZW=(e,t,n)=>{var r=OU(e,t);return r==null||typeof r.padding!=`string`?0:XW(e,`xAxis`,t,n,r.padding)},QW=(e,t,n)=>{var r=jU(e,t);return r==null||typeof r.padding!=`string`?0:XW(e,`yAxis`,t,n,r.padding)},$W=$(OU,ZW,(e,t)=>{if(e==null)return{left:0,right:0};var n=e.padding;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),eG=$(jU,QW,(e,t)=>{if(e==null)return{top:0,bottom:0};var n=e.padding;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),tG=$([vA,$W,wA,CA,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),nG=$([vA,uj,eG,wA,CA,(e,t,n)=>n],(e,t,n,r,i,a)=>{var o=i.padding;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),rG=(e,t,n,r)=>{switch(t){case`xAxis`:return tG(e,n,r);case`yAxis`:return nG(e,n,r);case`zAxis`:return NU(e,n)?.range;case`angleAxis`:return OL(e);case`radiusAxis`:return AL(e,n);default:return}},iG=$([PU,rG],pL),aG=$([PU,GW,$([GW,YW],WL),iG],sU),oG=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale;if(Pk(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},sG=$([uj,$U,IU,NL],oG),cG=$([aG],UL);$([aG],pU),$([aG,iW],fU),$([HU,vW,NL],yW);function lG(e,t){return e.id<t.id?-1:+(e.id>t.id)}var uG=(e,t)=>t,dG=(e,t,n)=>n,fG=$(iA,uG,dG,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(lG)),pG=$(aA,uG,dG,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(lG)),mG=(e,t)=>({width:e.width,height:t.height}),hG=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),gG=$(vA,OU,mG),_G=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},vG=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},yG=$(tA,vA,fG,uG,dG,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=mG(t,n);o??=_G(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),bG=$(eA,vA,pG,uG,dG,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=hG(t,n);o??=vG(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),xG=$([vA,OU,(e,t)=>{var n=OU(e,t);if(n!=null)return yG(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),SG=$([vA,jU,(e,t)=>{var n=jU(e,t);if(n!=null)return bG(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),CG=$(vA,jU,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),wG=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,o=n.dataKey,s=Pk(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&bw(l))return c}},TG=$([uj,$U,PU,NL],wG),EG=$([uj,FU,GW,cG,TG,sG,rG,qW,NL],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=Pk(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),DG=(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=Pk(e,c),u=t.type,d=t.ticks,f=t.tickCount,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?pw(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return Tk(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(Tw):l&&s?s.map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Tw):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Tw):r.domain().map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(Tw)}},OG=$([uj,IU,GW,cG,qW,rG,TG,sG,NL],DG),kG=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=Pk(e,o),c=t.tickCount,l=0;return l=o===`angleAxis`&&r?.length>=2?pw(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return Tk(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Tw):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return Tk(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Tw):n.domain().map((e,t)=>{var r=n.map(e);return Tk(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(Tw)}},AG=$([uj,IU,cG,rG,TG,sG,NL],kG),jG=$(PU,cG,(e,t)=>{if(!(e==null||t==null))return hU(hU({},e),{},{scale:t})});$((e,t,n)=>NU(e,n),$([$([PU,GW,WW,iG],sU)],UL),(e,t)=>{if(!(e==null||t==null))return hU(hU({},e),{},{scale:t})});var MG=$([uj,iA,aA],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var NG=e=>e.options.defaultTooltipEventType,PG=e=>e.options.validateTooltipEventTypes;function FG(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function IG(e,t){return FG(t,NG(e),PG(e))}function LG(e){return Q(t=>IG(t,e))}var RG=(e,t)=>{var n,r=Number(t);if(!(mw(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},zG=e=>e.tooltip.settings,BG={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},VG=kO({name:`tooltip`,initialState:{itemInteraction:{click:BG,hover:BG},axisInteraction:{click:BG,hover:BG},keyboardInteraction:BG,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(LM(t.payload))},prepare:bO()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).tooltipItemPayloads.indexOf(LM(r));a>-1&&(e.tooltipItemPayloads[a]=LM(i))},prepare:bO()},removeTooltipEntrySettings:{reducer(e,t){var n=dO(e).tooltipItemPayloads.indexOf(LM(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:bO()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),HG=VG.actions,UG=HG.addTooltipEntrySettings,WG=HG.replaceTooltipEntrySettings,GG=HG.removeTooltipEntrySettings,KG=HG.setTooltipSettingsState,qG=HG.setActiveMouseOverItemIndex,JG=HG.mouseLeaveItem,YG=HG.mouseLeaveChart,XG=HG.setActiveClickItemIndex,ZG=HG.setMouseOverAxisIndex,QG=HG.setMouseClickAxisIndex,$G=HG.setSyncInteraction,eK=HG.setKeyboardInteraction,tK=VG.reducer;function nK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nK(Object(n),!0).forEach(function(t){iK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iK(e,t,n){return(t=aK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aK(e){var t=oK(e,`string`);return typeof t==`symbol`?t:t+``}function oK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function sK(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function cK(e){return e.index!=null}var lK=(e,t,n,r)=>{if(t==null)return BG;var i=sK(e,t,n);if(i==null)return BG;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(cK(i)){if(a)return rK(rK({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return rK(rK({},BG),{},{coordinate:i.coordinate})};function uK(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function dK(e,t){var n=uK(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function fK(e,t,n){if(n==null||t==null)return!0;var r=Mk(e,t);return r==null||!NI(n)?!0:dK(r,n)}var pK=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Tk(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||fK(l,n,r)?String(c):null},mK=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},hK=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},gK=e=>e.options.tooltipPayloadSearcher,_K=e=>e.tooltip;function vK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vK(Object(n),!0).forEach(function(t){bK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bK(e,t,n){return(t=xK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xK(e){var t=SK(e,`string`);return typeof t==`symbol`?t:t+``}function SK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CK(e){if(typeof e==`string`||typeof e==`number`)return e}function wK(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function TK(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function EK(e){if(typeof e==`string`)return e}function DK(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?CK(e.name):void 0,unit:`unit`in e?wK(e.unit):void 0,dataKey:`dataKey`in e?TK(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?EK(e.color):void 0,fill:`fill`in e?EK(e.fill):void 0}}function OK(e,t){return e??t}var kK=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var s=n.chartData,c=n.computedData,l=n.dataStartIndex,u=n.dataEndIndex;return e.reduce((e,n)=>{var d=n.dataDefinedOnItem,f=n.settings,p=OK(d,s),m=Array.isArray(p)?wk(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?Sw(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=DK(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=yK(yK({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(Xk({tooltipEntrySettings:o,dataKey:i,payload:a,value:Mk(a,i),name:r==null?void 0:String(r)}))}):e.push(Xk({tooltipEntrySettings:f,dataKey:h,payload:_,value:Mk(_,h),name:Mk(_,g)??f?.name})),e},[])}},AK=$([sW,LU,aL],uU),jK=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),sW,$([VL,HL],RU)],VU,{memoizeOptions:{resultEqualityCheck:zL}}),MK=$([jK],e=>e.filter(LL)),NK=$([jK],KU,{memoizeOptions:{resultEqualityCheck:zL}}),PK=$([jK],e=>e.some(e=>!e.data)),FK=$([NK,bI],YU),IK=$([MK,bI,sW],IL),LK=$([FK,sW,jK,bI,PK,NK],QU),RK=$([sW],mW),zK=$([RK,$([sW],e=>e.allowDataOverflow)],FI),BK=$([$([IK,$([jK],e=>e.filter(LL)),rL,iL],uW),bI,VL,zK],fW),VK=$([FK,sW,$([jK],WU),vW,VL,EI],xW,{memoizeOptions:{resultEqualityCheck:RL}}),HK=$([$([TW,VL,HL],EW),VL],MW),UK=$([$([OW,VL,HL],EW),VL],PW),WK=$([sW,uj,FK,LK,rL,VL,$([sW,RK,zK,BK,VK,$([HK,$([$([AW,VL,HL],EW),VL],RW),UK],bW),uj,VL],BW)],UW),GK=$([sW,WK,$([WK,sW,AK],KW),VL],JW),KK=e=>rG(e,VL(e),HL(e),!1),qK=$([sW,KK],pL),JK=$([$([sW,AK,GK,qK],sU)],UL),YK=$([uj,sW,AK,JK,KK,$([uj,LK,sW,VL],wG),$([uj,LK,sW,VL],oG),VL],(e,t,n,r,i,a,o,s)=>{if(t){var c=t.type,l=Pk(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?pw(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(Tw):r.domain().map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(Tw)}}}),XK=$([NG,PG,zG],(e,t,n)=>FG(n.shared,e,t)),ZK=e=>e.tooltip.settings.trigger,QK=e=>e.tooltip.settings.defaultIndex,$K=$([_K,XK,ZK,QK],lK),eq=$([$K,FK,cW,WK],pK),tq=$([YK,eq],RG),nq=$([$K],e=>{if(e)return e.dataKey}),rq=$([$K],e=>{if(e)return e.graphicalItemId}),iq=$([_K,XK,ZK,QK],hK),aq=$([$K,$([eA,tA,uj,vA,YK,QK,iq],mK)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),oq=$([$K],e=>e?.active??!1),sq=$([$([iq,eq,bI,cW,tq,gK,XK],kK)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function cq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cq(Object(n),!0).forEach(function(t){uq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uq(e,t,n){return(t=dq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dq(e){var t=fq(e,`string`);return typeof t==`symbol`?t:t+``}function fq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pq=()=>Q(sW),mq=()=>{var e=pq(),t=Q(YK),n=Q(JK);return Yk(!e||!n?void 0:lq(lq({},e),{},{scale:n}),t)};function hq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hq(Object(n),!0).forEach(function(t){_q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _q(e,t,n){return(t=vq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vq(e){var t=yq(e,`string`);return typeof t==`symbol`?t:t+``}function yq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bq=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},xq=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,o=r.radius;return gq(gq(gq({},r),qF(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return gq(gq(gq({},r),qF(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Sq(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var Cq=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(pw(c-s)!==pw(l-c)){var d=[];if(pw(l-c)===pw(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},wq=()=>Q(aL),Tq=(e,t)=>t,Eq=(e,t,n)=>n,Dq=(e,t,n,r)=>r,Oq=$(YK,e=>CE(e,e=>e.coordinate)),kq=$([_K,Tq,Eq,Dq],lK),Aq=$([kq,FK,cW,WK],pK),jq=(e,t,n)=>{if(t!=null){var r=_K(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},Mq=$([_K,Tq,Eq,Dq],hK),Nq=$([eA,tA,uj,vA,YK,Dq,Mq],mK),Pq=$([kq,Nq],(e,t)=>e.coordinate??t),Fq=$([YK,Aq],RG),Iq=$([Mq,Aq,bI,cW,Fq,gK,Tq],kK),Lq=$([kq,Aq],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Rq=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&Sq(e,o)){var s=Cq(Qk(e,t),a,i,n,r),c=bq(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},zq=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=$F(e,n);if(s){var c=Cq($k(s,t),o,a,r,i),l=xq(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},Bq=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?Rq(e,t,r,i,a,o,s):zq(e,t,n,r,i,a,o)},Vq=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Hq=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(uL));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:BL}});function Uq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Uq(Object(n),!0).forEach(function(t){Gq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Gq(e,t,n){return(t=Kq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kq(e){var t=qq(e,`string`);return typeof t==`symbol`?t:t+``}function qq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Jq={zIndexMap:Object.values(uL).reduce((e,t)=>Wq(Wq({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},Yq=new Set(Object.values(uL));function Xq(e){return Yq.has(e)}var Zq=kO({name:`zIndex`,initialState:Jq,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:bO()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!Xq(n)&&delete e.zIndexMap[n])},prepare:bO()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=LM(i):e.zIndexMap[r].element=LM(i):e.zIndexMap[r]={consumers:0,element:a?void 0:LM(i),panoramaElement:a?LM(i):void 0}},prepare:bO()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:bO()}}}),Qq=Zq.actions,$q=Qq.registerZIndexPortal,eJ=Qq.unregisterZIndexPortal,tJ=Qq.registerZIndexPortalElement,nJ=Qq.unregisterZIndexPortalElement,rJ=Zq.reducer;function iJ(e){var t=e.zIndex,n=e.children,r=hj()&&t!==void 0&&t!==0,i=SA(),a=(0,v.useRef)(void 0),o=(0,v.useRef)(new Set),s=ZT(),c=Q(e=>Vq(e,t,i));if((0,v.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(eJ({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s($q({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(eJ({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,v.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(eJ({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,Fl.createPortal)(n,l):null}function aJ(){return aJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aJ.apply(null,arguments)}function oJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oJ(Object(n),!0).forEach(function(t){cJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cJ(e,t,n){return(t=lJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lJ(e){var t=uJ(e,`string`);return typeof t==`symbol`?t:t+``}function uJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dJ(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return(0,v.isValidElement)(t)?(0,v.cloneElement)(t,r):(0,v.createElement)(n,r)}function fJ(e){var t=e.coordinate,n=e.payload,r=e.index,i=e.offset,a=e.tooltipAxisBandSize,o=e.layout,s=e.cursor,c=e.tooltipEventType,l=e.chartName,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=TP,h=uL.cursorLine;else if(l===`BarChart`)p=EP(o,u,i,a),m=RF,h=uL.cursorRectangle;else if(o===`radial`&&Dw(u)){var g=eI(u),_=g.cx,y=g.cy,b=g.radius;p={cx:_,cy:y,startAngle:g.startAngle,endAngle:g.endAngle,innerRadius:b,outerRadius:b},m=hI,h=uL.cursorLine}else p={points:gI(o,u,i)},m=mP,h=uL.cursorLine;var x=typeof s==`object`&&`className`in s?s.className:void 0,S=sJ(sJ(sJ(sJ({stroke:`#ccc`,pointerEvents:`none`},i),p),GS(s)),{},{payload:d,payloadIndex:f,className:Hv(`recharts-tooltip-cursor`,x)});return v.createElement(iJ,{zIndex:e.zIndex??h},v.createElement(dJ,{cursor:s,cursorComp:m,cursorProps:S}))}function pJ(e){var t=mq(),n=sj(),r=dj(),i=wq();return t==null||n==null||r==null||i==null?null:v.createElement(fJ,aJ({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var mJ=(0,v.createContext)(null),hJ=()=>(0,v.useContext)(mJ),gJ=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,_J=new gJ,vJ=`recharts.syncEvent.tooltip`,yJ=`recharts.syncEvent.brush`,bJ=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!mw(n))return e[n]}},xJ=kO({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),SJ=xJ.reducer,CJ=xJ.actions.createEventEmitter;function wJ(e){return e.tooltip.syncInteraction}var TJ=kO({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=LM(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),EJ=TJ.actions,DJ=EJ.setChartData,OJ=EJ.setDataStartEndIndexes;EJ.setComputedData;var kJ=TJ.reducer,AJ=[`x`,`y`];function jJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jJ(Object(n),!0).forEach(function(t){NJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NJ(e,t,n){return(t=PJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=FJ(e,`string`);return typeof t==`symbol`?t:t+``}function FJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IJ(e,t){if(e==null)return{};var n,r,i=LJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function LJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function RJ(){var e=Q(oL),t=Q(cL),n=ZT(),r=Q(sL),i=Q(YK),a=dj(),o=aj();(0,v.useEffect)(()=>{if(e==null)return Ew;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n($G({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,f=d.x,p=d.y,m=IJ(d,AJ),h=c.payload.sourceViewBox,g=h.x,_=h.y,v=h.width,y=h.height,b=MJ(MJ({},m),{},{x:o.x+(v?(f-g)/v:0)*o.width,y:o.y+(y?(p-_)/y:0)*o.height});n(MJ(MJ({},c),{},{payload:MJ(MJ({},c.payload),{},{coordinate:b})}))}else n(c);return}if(i!=null){var x;typeof r==`function`?x=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(x=i.find(e=>String(e.value)===c.payload.label));var S=c.payload.coordinate;if(S==null||o==null){n($G({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(x==null){n($G({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var C=S.x,w=S.y,T=Math.min(C,o.x+o.width),E=Math.min(w,o.y+o.height),D={x:a===`horizontal`?x.coordinate:T,y:a===`horizontal`?E:x.coordinate};n($G({active:c.payload.active,coordinate:D,dataKey:c.payload.dataKey,index:String(x.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return _J.on(vJ,s),()=>{_J.off(vJ,s)}},[Q(e=>e.rootProps.className),n,t,e,r,i,a,o])}function zJ(){var e=Q(oL),t=Q(cL),n=ZT();(0,v.useEffect)(()=>{if(e==null)return Ew;var r=(r,i,a)=>{t!==a&&e===r&&n(OJ(i))};return _J.on(yJ,r),()=>{_J.off(yJ,r)}},[n,t,e])}function BJ(){var e=ZT();(0,v.useEffect)(()=>{e(CJ())},[e]),RJ(),zJ()}function VJ(e,t,n,r,i,a){var o=Q(n=>jq(n,e,t)),s=Q(rq),c=Q(cL),l=Q(oL),u=Q(sL),d=Q(wJ)?.sourceViewBox!=null,f=aj();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=$G({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});_J.emit(vJ,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function HJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HJ(Object(n),!0).forEach(function(t){WJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WJ(e,t,n){return(t=GJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GJ(e){var t=KJ(e,`string`);return typeof t==`symbol`?t:t+``}function KJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qJ(e,t){return QJ(e)||ZJ(e,t)||YJ(e,t)||JJ()}function JJ(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
120
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xU(e,t){if(e){if(typeof e==`string`)return SU(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SU(e,t):void 0}}function SU(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function CU(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function wU(e){if(Array.isArray(e))return e}var TU=[0,`auto`],EU={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},DU=(e,t)=>e.cartesianAxis.xAxis[t],OU=(e,t)=>DU(e,t)??EU,kU={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:TU,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},AU=(e,t)=>e.cartesianAxis.yAxis[t],jU=(e,t)=>AU(e,t)??kU,MU={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},NU=(e,t)=>e.cartesianAxis.zAxis[t]??MU,PU=(e,t,n)=>{switch(t){case`xAxis`:return OU(e,n);case`yAxis`:return jU(e,n);case`zAxis`:return NU(e,n);case`angleAxis`:return SL(e,n);case`radiusAxis`:return CL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},FU=(e,t,n)=>{switch(t){case`xAxis`:return OU(e,n);case`yAxis`:return jU(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},IU=(e,t,n)=>{switch(t){case`xAxis`:return OU(e,n);case`yAxis`:return jU(e,n);case`angleAxis`:return SL(e,n);case`radiusAxis`:return CL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},LU=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function RU(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var zU=e=>e.graphicalItems.cartesianItems,BU=$([NL,PL],RU),VU=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),HU=$([zU,PU,BU],VU,{memoizeOptions:{resultEqualityCheck:zL}}),UU=$([HU],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(LL)),WU=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),GU=$([HU],WU),KU=e=>e.map(e=>e.data).filter(Boolean).flat(1),qU=$([HU],e=>e.some(e=>!e.data)),JU=$([HU],KU,{memoizeOptions:{resultEqualityCheck:zL}}),YU=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},XU=$([JU,SI],YU),ZU=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:Mk(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:Mk(e,t.dataKey)})),QU=(e,t,n,r,i,a)=>{var o=r.chartData,s=o===void 0?[]:o,c=r.dataStartIndex,l=r.dataEndIndex,u=ZU(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...s.slice(c,l+1).map(e=>({value:Mk(e,t.dataKey)})).filter(e=>e.value!=null),...u]:u},$U=$([XU,PU,HU,SI,qU,JU],QU);function eW(e){if(gw(e)||e instanceof Date){var t=Number(e);if(Tk(t))return t}}function tW(e){if(Array.isArray(e)){var t=[eW(e[0]),eW(e[1])];return NI(t)?t:void 0}var n=eW(e);if(n!=null)return[n,n]}function nW(e){return e.map(eW).filter(Tw)}function rW(e,t){var n=eW(e),r=eW(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var iW=$([$U],e=>e?.map(e=>e.value).sort(rW));function aW(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function oW(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!mw(t))r=t;else if(Array.isArray(t)){var i=nW(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:nW(n.flatMap(t=>{var n=Mk(e,t.dataKey),i,a;if(Array.isArray(n)){var o=yU(n,2);i=o[0],a=o[1]}else i=a=n;if(!(!Tk(i)||!Tk(a)))return[r-i,r+a]}))}var sW=e=>IU(e,VL(e),HL(e)),cW=$([sW],e=>e?.dataKey),lW=$([UU,SI,sW],IL),uW=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var i=yU(t,2),a=i[0],o=i[1],s=r?[...o].reverse():o;return[a,{stackedData:zk(e,s.map(FL),n),graphicalItems:s}]}))},dW=$([lW,UU,rL,iL],uW),fW=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!==`zAxis`)return Kk(e,i,a)},pW=$([PU],e=>e.allowDataOverflow),mW=e=>{if(e==null||!(`domain`in e))return TU;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=nW(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??TU},hW=$([PU],mW),gW=$([hW,pW],FI),_W=$([dW,bI,NL,gW],fW,{memoizeOptions:{resultEqualityCheck:RL}}),vW=e=>e.errorBars,yW=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>aW(n,e)),bW=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},xW=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>aW(i,e));n.forEach(n=>{var r=Mk(n,t.dataKey??e.dataKey),i=oW(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||a<o)&&(o=a),(s==null||l>s)&&(s=l)}var u=tW(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=tW(Mk(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),Tk(o)&&Tk(s))return[o,s]},SW=$([XU,PU,GU,vW,NL,wI],xW,{memoizeOptions:{resultEqualityCheck:RL}});function CW(e){var t=e.value;if(gw(t)||t instanceof Date)return t}var wW=(e,t,n)=>{var r=e.map(CW).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&bw(r))?yI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},TW=e=>e.referenceElements.dots,EW=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),DW=$([TW,NL,PL],EW),OW=e=>e.referenceElements.areas,kW=$([OW,NL,PL],EW),AW=e=>e.referenceElements.lines,jW=$([AW,NL,PL],EW),MW=(e,t)=>{if(e!=null){var n=nW(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},NW=$(DW,NL,MW),PW=(e,t)=>{if(e!=null){var n=nW(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},FW=$([kW,NL],PW);function IW(e){if(e.x!=null)return nW([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:nW(t)}function LW(e){if(e.y!=null)return nW([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:nW(t)}var RW=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?IW(e):LW(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},zW=$(NW,$([jW,NL],RW),FW,(e,t,n)=>bW(e,n,t)),BW=(e,t,n,r,i,a,o,s,c)=>{if(n!=null)return n;var l=o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?bW(r,a,i):bW(a,i),u=II(t,l,e.allowDataOverflow);return u==null&&e.allowDataOverflow&&l==null&&c!=null?c:u},VW=$([PU,hW,gW,_W,SW,zW,uj,NL,$([PU],e=>{if(!(e==null||e.type!==`number`||!(`ticks`in e)||e.ticks==null)){var t=nW(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},{memoizeOptions:{resultEqualityCheck:RL}})],BW,{memoizeOptions:{resultEqualityCheck:RL}}),HW=[0,1],UW=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var s=e.dataKey,c=e.type,l=Pk(t,a);return l&&s==null?yI(0,n?.length??0):c===`category`?wW(r,e,l):i===`expand`&&!l?HW:o}},WW=$([PU,uj,XU,$U,rL,NL,VW],UW),GW=$([PU,LU,aL],uU),KW=(e,t,n)=>{var r=t.niceTicks;if(r!==`none`){var i=mW(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&NI(e)){if(a)return ZI(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return QI(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&NI(e))return ZI(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&NI(e))return QI(e,t.tickCount,t.allowDecimals,`adaptive`)}}},qW=$([WW,IU,GW],KW),JW=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&NI(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},YW=$([PU,WW,qW,NL],JW),XW=$($($U,PU,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(nW(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(!(c==null||l==null)){var u=l-c;n=Math.min(n,u)}}return n/o}}),uj,tL,vA,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Tk(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=yw(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),ZW=(e,t,n)=>{var r=OU(e,t);return r==null||typeof r.padding!=`string`?0:XW(e,`xAxis`,t,n,r.padding)},QW=(e,t,n)=>{var r=jU(e,t);return r==null||typeof r.padding!=`string`?0:XW(e,`yAxis`,t,n,r.padding)},$W=$(OU,ZW,(e,t)=>{if(e==null)return{left:0,right:0};var n=e.padding;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),eG=$(jU,QW,(e,t)=>{if(e==null)return{top:0,bottom:0};var n=e.padding;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),tG=$([vA,$W,wA,CA,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),nG=$([vA,uj,eG,wA,CA,(e,t,n)=>n],(e,t,n,r,i,a)=>{var o=i.padding;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),rG=(e,t,n,r)=>{switch(t){case`xAxis`:return tG(e,n,r);case`yAxis`:return nG(e,n,r);case`zAxis`:return NU(e,n)?.range;case`angleAxis`:return OL(e);case`radiusAxis`:return AL(e,n);default:return}},iG=$([PU,rG],pL),aG=$([PU,GW,$([GW,YW],WL),iG],sU),oG=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale;if(Pk(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},sG=$([uj,$U,IU,NL],oG),cG=$([aG],UL);$([aG],pU),$([aG,iW],fU),$([HU,vW,NL],yW);function lG(e,t){return e.id<t.id?-1:+(e.id>t.id)}var uG=(e,t)=>t,dG=(e,t,n)=>n,fG=$(iA,uG,dG,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(lG)),pG=$(aA,uG,dG,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(lG)),mG=(e,t)=>({width:e.width,height:t.height}),hG=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),gG=$(vA,OU,mG),_G=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},vG=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},yG=$(tA,vA,fG,uG,dG,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=mG(t,n);o??=_G(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),bG=$(eA,vA,pG,uG,dG,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=hG(t,n);o??=vG(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),xG=$([vA,OU,(e,t)=>{var n=OU(e,t);if(n!=null)return yG(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),SG=$([vA,jU,(e,t)=>{var n=jU(e,t);if(n!=null)return bG(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),CG=$(vA,jU,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),wG=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,o=n.dataKey,s=Pk(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&bw(l))return c}},TG=$([uj,$U,PU,NL],wG),EG=$([uj,FU,GW,cG,TG,sG,rG,qW,NL],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=Pk(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),DG=(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=Pk(e,c),u=t.type,d=t.ticks,f=t.tickCount,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?pw(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return Tk(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(Tw):l&&s?s.map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Tw):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(Tw):r.domain().map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(Tw)}},OG=$([uj,IU,GW,cG,qW,rG,TG,sG,NL],DG),kG=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=Pk(e,o),c=t.tickCount,l=0;return l=o===`angleAxis`&&r?.length>=2?pw(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return Tk(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Tw):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return Tk(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(Tw):n.domain().map((e,t)=>{var r=n.map(e);return Tk(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(Tw)}},AG=$([uj,IU,cG,rG,TG,sG,NL],kG),jG=$(PU,cG,(e,t)=>{if(!(e==null||t==null))return hU(hU({},e),{},{scale:t})});$((e,t,n)=>NU(e,n),$([$([PU,GW,WW,iG],sU)],UL),(e,t)=>{if(!(e==null||t==null))return hU(hU({},e),{},{scale:t})});var MG=$([uj,iA,aA],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var NG=e=>e.options.defaultTooltipEventType,PG=e=>e.options.validateTooltipEventTypes;function FG(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function IG(e,t){return FG(t,NG(e),PG(e))}function LG(e){return Q(t=>IG(t,e))}var RG=(e,t)=>{var n,r=Number(t);if(!(mw(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},zG=e=>e.tooltip.settings,BG={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},VG=kO({name:`tooltip`,initialState:{itemInteraction:{click:BG,hover:BG},axisInteraction:{click:BG,hover:BG},keyboardInteraction:BG,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(LM(t.payload))},prepare:bO()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).tooltipItemPayloads.indexOf(LM(r));a>-1&&(e.tooltipItemPayloads[a]=LM(i))},prepare:bO()},removeTooltipEntrySettings:{reducer(e,t){var n=dO(e).tooltipItemPayloads.indexOf(LM(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:bO()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),HG=VG.actions,UG=HG.addTooltipEntrySettings,WG=HG.replaceTooltipEntrySettings,GG=HG.removeTooltipEntrySettings,KG=HG.setTooltipSettingsState,qG=HG.setActiveMouseOverItemIndex,JG=HG.mouseLeaveItem,YG=HG.mouseLeaveChart,XG=HG.setActiveClickItemIndex,ZG=HG.setMouseOverAxisIndex,QG=HG.setMouseClickAxisIndex,$G=HG.setSyncInteraction,eK=HG.setKeyboardInteraction,tK=VG.reducer;function nK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nK(Object(n),!0).forEach(function(t){iK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iK(e,t,n){return(t=aK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aK(e){var t=oK(e,`string`);return typeof t==`symbol`?t:t+``}function oK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function sK(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function cK(e){return e.index!=null}var lK=(e,t,n,r)=>{if(t==null)return BG;var i=sK(e,t,n);if(i==null)return BG;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(cK(i)){if(a)return rK(rK({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return rK(rK({},BG),{},{coordinate:i.coordinate})};function uK(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function dK(e,t){var n=uK(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function fK(e,t,n){if(n==null||t==null)return!0;var r=Mk(e,t);return r==null||!NI(n)?!0:dK(r,n)}var pK=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Tk(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||fK(l,n,r)?String(c):null},mK=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},hK=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},gK=e=>e.options.tooltipPayloadSearcher,_K=e=>e.tooltip;function vK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vK(Object(n),!0).forEach(function(t){bK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bK(e,t,n){return(t=xK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xK(e){var t=SK(e,`string`);return typeof t==`symbol`?t:t+``}function SK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CK(e){if(typeof e==`string`||typeof e==`number`)return e}function wK(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function TK(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function EK(e){if(typeof e==`string`)return e}function DK(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?CK(e.name):void 0,unit:`unit`in e?wK(e.unit):void 0,dataKey:`dataKey`in e?TK(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?EK(e.color):void 0,fill:`fill`in e?EK(e.fill):void 0}}function OK(e,t){return e??t}var kK=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var s=n.chartData,c=n.computedData,l=n.dataStartIndex,u=n.dataEndIndex;return e.reduce((e,n)=>{var d=n.dataDefinedOnItem,f=n.settings,p=OK(d,s),m=Array.isArray(p)?wk(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?Sw(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=DK(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=yK(yK({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(Xk({tooltipEntrySettings:o,dataKey:i,payload:a,value:Mk(a,i),name:r==null?void 0:String(r)}))}):e.push(Xk({tooltipEntrySettings:f,dataKey:h,payload:_,value:Mk(_,h),name:Mk(_,g)??f?.name})),e},[])}},AK=$([sW,LU,aL],uU),jK=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),sW,$([VL,HL],RU)],VU,{memoizeOptions:{resultEqualityCheck:zL}}),MK=$([jK],e=>e.filter(LL)),NK=$([jK],KU,{memoizeOptions:{resultEqualityCheck:zL}}),PK=$([jK],e=>e.some(e=>!e.data)),FK=$([NK,bI],YU),IK=$([MK,bI,sW],IL),LK=$([FK,sW,jK,bI,PK,NK],QU),RK=$([sW],mW),zK=$([RK,$([sW],e=>e.allowDataOverflow)],FI),BK=$([$([IK,$([jK],e=>e.filter(LL)),rL,iL],uW),bI,VL,zK],fW),VK=$([FK,sW,$([jK],WU),vW,VL,EI],xW,{memoizeOptions:{resultEqualityCheck:RL}}),HK=$([$([TW,VL,HL],EW),VL],MW),UK=$([$([OW,VL,HL],EW),VL],PW),WK=$([sW,uj,FK,LK,rL,VL,$([sW,RK,zK,BK,VK,$([HK,$([$([AW,VL,HL],EW),VL],RW),UK],bW),uj,VL],BW)],UW),GK=$([sW,WK,$([WK,sW,AK],KW),VL],JW),KK=e=>rG(e,VL(e),HL(e),!1),qK=$([sW,KK],pL),JK=$([$([sW,AK,GK,qK],sU)],UL),YK=$([uj,sW,AK,JK,KK,$([uj,LK,sW,VL],wG),$([uj,LK,sW,VL],oG),VL],(e,t,n,r,i,a,o,s)=>{if(t){var c=t.type,l=Pk(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?pw(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(Tw):r.domain().map((e,t)=>{var n=r.map(e);return Tk(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(Tw)}}}),XK=$([NG,PG,zG],(e,t,n)=>FG(n.shared,e,t)),ZK=e=>e.tooltip.settings.trigger,QK=e=>e.tooltip.settings.defaultIndex,$K=$([_K,XK,ZK,QK],lK),eq=$([$K,FK,cW,WK],pK),tq=$([YK,eq],RG),nq=$([$K],e=>{if(e)return e.dataKey}),rq=$([$K],e=>{if(e)return e.graphicalItemId}),iq=$([_K,XK,ZK,QK],hK),aq=$([$K,$([eA,tA,uj,vA,YK,QK,iq],mK)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),oq=$([$K],e=>e?.active??!1),sq=$([$([iq,eq,bI,cW,tq,gK,XK],kK)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function cq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cq(Object(n),!0).forEach(function(t){uq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uq(e,t,n){return(t=dq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dq(e){var t=fq(e,`string`);return typeof t==`symbol`?t:t+``}function fq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pq=()=>Q(sW),mq=()=>{var e=pq(),t=Q(YK),n=Q(JK);return Yk(!e||!n?void 0:lq(lq({},e),{},{scale:n}),t)};function hq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hq(Object(n),!0).forEach(function(t){_q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _q(e,t,n){return(t=vq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vq(e){var t=yq(e,`string`);return typeof t==`symbol`?t:t+``}function yq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bq=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},xq=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,o=r.radius;return gq(gq(gq({},r),qF(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return gq(gq(gq({},r),qF(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Sq(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var Cq=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(pw(c-s)!==pw(l-c)){var d=[];if(pw(l-c)===pw(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},wq=()=>Q(aL),Tq=(e,t)=>t,Eq=(e,t,n)=>n,Dq=(e,t,n,r)=>r,Oq=$(YK,e=>CE(e,e=>e.coordinate)),kq=$([_K,Tq,Eq,Dq],lK),Aq=$([kq,FK,cW,WK],pK),jq=(e,t,n)=>{if(t!=null){var r=_K(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},Mq=$([_K,Tq,Eq,Dq],hK),Nq=$([eA,tA,uj,vA,YK,Dq,Mq],mK),Pq=$([kq,Nq],(e,t)=>e.coordinate??t),Fq=$([YK,Aq],RG),Iq=$([Mq,Aq,bI,cW,Fq,gK,Tq],kK),Lq=$([kq,Aq],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Rq=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&Sq(e,o)){var s=Cq(Qk(e,t),a,i,n,r),c=bq(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},zq=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=$F(e,n);if(s){var c=Cq($k(s,t),o,a,r,i),l=xq(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},Bq=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?Rq(e,t,r,i,a,o,s):zq(e,t,n,r,i,a,o)},Vq=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Hq=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(uL));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:BL}});function Uq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Uq(Object(n),!0).forEach(function(t){Gq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Gq(e,t,n){return(t=Kq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kq(e){var t=qq(e,`string`);return typeof t==`symbol`?t:t+``}function qq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Jq={zIndexMap:Object.values(uL).reduce((e,t)=>Wq(Wq({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},Yq=new Set(Object.values(uL));function Xq(e){return Yq.has(e)}var Zq=kO({name:`zIndex`,initialState:Jq,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:bO()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!Xq(n)&&delete e.zIndexMap[n])},prepare:bO()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=LM(i):e.zIndexMap[r].element=LM(i):e.zIndexMap[r]={consumers:0,element:a?void 0:LM(i),panoramaElement:a?LM(i):void 0}},prepare:bO()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:bO()}}}),Qq=Zq.actions,$q=Qq.registerZIndexPortal,eJ=Qq.unregisterZIndexPortal,tJ=Qq.registerZIndexPortalElement,nJ=Qq.unregisterZIndexPortalElement,rJ=Zq.reducer;function iJ(e){var t=e.zIndex,n=e.children,r=hj()&&t!==void 0&&t!==0,i=SA(),a=(0,v.useRef)(void 0),o=(0,v.useRef)(new Set),s=ZT(),c=Q(e=>Vq(e,t,i));if((0,v.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(eJ({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s($q({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(eJ({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,v.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(eJ({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,Fl.createPortal)(n,l):null}function aJ(){return aJ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aJ.apply(null,arguments)}function oJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oJ(Object(n),!0).forEach(function(t){cJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cJ(e,t,n){return(t=lJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lJ(e){var t=uJ(e,`string`);return typeof t==`symbol`?t:t+``}function uJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dJ(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return(0,v.isValidElement)(t)?(0,v.cloneElement)(t,r):(0,v.createElement)(n,r)}function fJ(e){var t=e.coordinate,n=e.payload,r=e.index,i=e.offset,a=e.tooltipAxisBandSize,o=e.layout,s=e.cursor,c=e.tooltipEventType,l=e.chartName,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=TP,h=uL.cursorLine;else if(l===`BarChart`)p=EP(o,u,i,a),m=RF,h=uL.cursorRectangle;else if(o===`radial`&&Dw(u)){var g=eI(u),_=g.cx,y=g.cy,b=g.radius;p={cx:_,cy:y,startAngle:g.startAngle,endAngle:g.endAngle,innerRadius:b,outerRadius:b},m=hI,h=uL.cursorLine}else p={points:gI(o,u,i)},m=mP,h=uL.cursorLine;var x=typeof s==`object`&&`className`in s?s.className:void 0,S=sJ(sJ(sJ(sJ({stroke:`#ccc`,pointerEvents:`none`},i),p),GS(s)),{},{payload:d,payloadIndex:f,className:Uv(`recharts-tooltip-cursor`,x)});return v.createElement(iJ,{zIndex:e.zIndex??h},v.createElement(dJ,{cursor:s,cursorComp:m,cursorProps:S}))}function pJ(e){var t=mq(),n=sj(),r=dj(),i=wq();return t==null||n==null||r==null||i==null?null:v.createElement(fJ,aJ({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var mJ=(0,v.createContext)(null),hJ=()=>(0,v.useContext)(mJ),gJ=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,_J=new gJ,vJ=`recharts.syncEvent.tooltip`,yJ=`recharts.syncEvent.brush`,bJ=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!mw(n))return e[n]}},xJ=kO({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),SJ=xJ.reducer,CJ=xJ.actions.createEventEmitter;function wJ(e){return e.tooltip.syncInteraction}var TJ=kO({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=LM(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),EJ=TJ.actions,DJ=EJ.setChartData,OJ=EJ.setDataStartEndIndexes;EJ.setComputedData;var kJ=TJ.reducer,AJ=[`x`,`y`];function jJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jJ(Object(n),!0).forEach(function(t){NJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NJ(e,t,n){return(t=PJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=FJ(e,`string`);return typeof t==`symbol`?t:t+``}function FJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IJ(e,t){if(e==null)return{};var n,r,i=LJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function LJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function RJ(){var e=Q(oL),t=Q(cL),n=ZT(),r=Q(sL),i=Q(YK),a=dj(),o=aj();(0,v.useEffect)(()=>{if(e==null)return Ew;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n($G({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,f=d.x,p=d.y,m=IJ(d,AJ),h=c.payload.sourceViewBox,g=h.x,_=h.y,v=h.width,y=h.height,b=MJ(MJ({},m),{},{x:o.x+(v?(f-g)/v:0)*o.width,y:o.y+(y?(p-_)/y:0)*o.height});n(MJ(MJ({},c),{},{payload:MJ(MJ({},c.payload),{},{coordinate:b})}))}else n(c);return}if(i!=null){var x;typeof r==`function`?x=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(x=i.find(e=>String(e.value)===c.payload.label));var S=c.payload.coordinate;if(S==null||o==null){n($G({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(x==null){n($G({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var C=S.x,w=S.y,T=Math.min(C,o.x+o.width),E=Math.min(w,o.y+o.height),D={x:a===`horizontal`?x.coordinate:T,y:a===`horizontal`?E:x.coordinate};n($G({active:c.payload.active,coordinate:D,dataKey:c.payload.dataKey,index:String(x.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return _J.on(vJ,s),()=>{_J.off(vJ,s)}},[Q(e=>e.rootProps.className),n,t,e,r,i,a,o])}function zJ(){var e=Q(oL),t=Q(cL),n=ZT();(0,v.useEffect)(()=>{if(e==null)return Ew;var r=(r,i,a)=>{t!==a&&e===r&&n(OJ(i))};return _J.on(yJ,r),()=>{_J.off(yJ,r)}},[n,t,e])}function BJ(){var e=ZT();(0,v.useEffect)(()=>{e(CJ())},[e]),RJ(),zJ()}function VJ(e,t,n,r,i,a){var o=Q(n=>jq(n,e,t)),s=Q(rq),c=Q(cL),l=Q(oL),u=Q(sL),d=Q(wJ)?.sourceViewBox!=null,f=aj();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=$G({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});_J.emit(vJ,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function HJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HJ(Object(n),!0).forEach(function(t){WJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WJ(e,t,n){return(t=GJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GJ(e){var t=KJ(e,`string`);return typeof t==`symbol`?t:t+``}function KJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qJ(e,t){return QJ(e)||ZJ(e,t)||YJ(e,t)||JJ()}function JJ(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
121
121
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YJ(e,t){if(e){if(typeof e==`string`)return XJ(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XJ(e,t):void 0}}function XJ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZJ(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function QJ(e){if(Array.isArray(e))return e}function $J(e){return e.dataKey}function eY(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e==`function`?v.createElement(e,t):v.createElement(wN,t)}var tY=[],nY={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function rY(e){var t=Iw(e,nY),n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.filterNull,c=t.isAnimationActive,l=t.offset,u=t.payloadUniqBy,d=t.position,f=t.reverseDirection,p=t.useTranslate3d,m=t.wrapperStyle,h=t.cursor,g=t.shared,_=t.trigger,y=t.defaultIndex,b=t.portal,x=t.axisId,S=ZT(),C=typeof y==`number`?String(y):y;(0,v.useEffect)(()=>{S(KG({shared:g,trigger:_,axisId:x,active:n,defaultIndex:C}))},[S,g,_,x,n,C]);var w=aj(),T=$N(),E=LG(g),D=Q(e=>Lq(e,E,_,C))??{},O=D.activeIndex,k=D.isActive,A=Q(e=>Iq(e,E,_,C)),j=Q(e=>Fq(e,E,_,C)),M=Q(e=>Pq(e,E,_,C)),N=A,P=hJ(),F=n??k??!1,I=qJ(FE([N,F]),2),L=I[0],R=I[1],ee=E===`axis`?j:void 0;VJ(E,_,M,ee,O,F);var te=b??P;if(te==null||w==null||E==null)return null;var z=N??tY;F||(z=tY),s&&z.length&&(z=UT(z.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,$J));var B=z.length>0,V=UJ(UJ({},t),{},{payload:z,label:ee,active:F,activeIndex:O,coordinate:M,accessibilityLayer:T}),ne=v.createElement(QN,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:F,coordinate:M,hasPayload:B,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:w,wrapperStyle:m,lastBoundingBox:L,innerRef:R,hasPortalFromProps:!!b},eY(o,V));return v.createElement(v.Fragment,null,(0,Fl.createPortal)(ne,te),F&&v.createElement(pJ,{cursor:h,tooltipEventType:E,coordinate:M,payload:z,index:O}))}var iY=e=>null;iY.displayName=`Cell`;function aY(e,t,n){return(t=oY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oY(e){var t=sY(e,`string`);return typeof t==`symbol`?t:t+``}function sY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var cY=class{constructor(e){aY(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function lY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lY(Object(n),!0).forEach(function(t){dY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dY(e,t,n){return(t=fY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fY(e){var t=pY(e,`string`);return typeof t==`symbol`?t:t+``}function pY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var mY=uY({},{cacheSize:2e3,enableCache:!0}),hY=new cY(mY.cacheSize),gY={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},_Y=`recharts_measurement_span`;function vY(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var yY=(e,t)=>{try{var n=document.getElementById(_Y);n||(n=document.createElement(`span`),n.setAttribute(`id`,_Y),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,gY,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},bY=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||jN.isSsr)return{width:0,height:0};if(!mY.enableCache)return yY(e,t);var n=vY(e,t),r=hY.get(n);if(r)return r;var i=yY(e,t);return hY.set(n,i),i},xY;function SY(e,t){return DY(e)||EY(e,t)||wY(e,t)||CY()}function CY(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
122
122
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wY(e,t){if(e){if(typeof e==`string`)return TY(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TY(e,t):void 0}}function TY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function EY(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function DY(e){if(Array.isArray(e))return e}function OY(e,t,n){return(t=kY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kY(e){var t=AY(e,`string`);return typeof t==`symbol`?t:t+``}function AY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jY=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,MY=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,NY=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,PY=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,FY={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},IY=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function LY(e){return IY.includes(e)}var RY=`NaN`;function zY(e,t){return e*FY[t]}var BY=class e{static parse(t){var n=SY(PY.exec(t)??[],3),r=n[1],i=n[2];return r==null?e.NaN:new e(parseFloat(r),i??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,mw(e)&&(this.unit=``),t!==``&&!NY.test(t)&&(this.num=NaN,this.unit=``),LY(t)&&(this.num=zY(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return mw(this.num)}};xY=BY,OY(BY,`NaN`,new xY(NaN,``));function VY(e){if(e==null||e.includes(RY))return RY;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=SY(jY.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=BY.parse(r??``),s=BY.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return RY;t=t.replace(jY,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=SY(MY.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=BY.parse(u??``),m=BY.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return RY;t=t.replace(MY,h.toString())}return t}var HY=/\(([^()]*)\)/;function UY(e){for(var t=e,n;(n=HY.exec(t))!=null;){var r=SY(n,2)[1];t=t.replace(HY,VY(r))}return t}function WY(e){var t=e.replace(/\s+/g,``);return t=UY(t),t=VY(t),t}function GY(e){try{return WY(e)}catch{return RY}}function KY(e){var t=GY(e.slice(5,-1));return t===RY?``:t}var qY=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],JY=[`dx`,`dy`,`angle`,`className`,`breakAll`];function YY(){return YY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YY.apply(null,arguments)}function XY(e,t){if(e==null)return{};var n,r,i=ZY(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function QY(e,t){return rX(e)||nX(e,t)||eX(e,t)||$Y()}function $Y(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
123
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eX(e,t){if(e){if(typeof e==`string`)return tX(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tX(e,t):void 0}}function tX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nX(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function rX(e){if(Array.isArray(e))return e}var iX=/[ \f\n\r\t\v\u2028\u2029]+/,aX=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return Cw(t)||(i=n?t.toString().split(``):t.toString().split(iX)),{wordsWithComputedWidth:i.map(e=>({word:e,width:bY(e,r).width})),spaceWidth:n?0:bY(`\xA0`,r).width}}catch{return null}};function oX(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function sX(e){return Cw(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var cX=(e,t,n,r)=>e.reduce((e,i)=>{var a=i.word,o=i.width,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),lX=e=>e.reduce((e,t)=>e.width>t.width?e:t),uX=`…`,dX=(e,t,n,r,i,a,o,s)=>{var c=aX({breakAll:n,style:r,children:e.slice(0,t)+uX});if(!c)return[!1,[]];var l=cX(c.wordsWithComputedWidth,a,o,s);return[l.length>i||lX(l).width>Number(a),l]},fX=(e,t,n,r,i)=>{var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=Z(a),u=String(o),d=cX(t,r,n,i);if(!l||i||!(d.length>a||lX(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),_=QY(dX(u,g-1,c,s,a,r,n,i),2),v=_[0],y=_[1],b=QY(dX(u,g,c,s,a,r,n,i),1)[0];if(!v&&!b&&(f=g+1),v&&b&&(p=g-1),!v&&b){h=y;break}m++}return h||d},pX=e=>[{words:Cw(e)?[]:e.toString().split(iX),width:void 0}],mX=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!jN.isSsr){var s,c,l=aX({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return pX(r);return fX({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return pX(r)},hX=`#808080`,gX={angle:0,breakAll:!1,capHeight:`0.71em`,fill:hX,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},_X=(0,v.forwardRef)((e,t)=>{var n=Iw(e,gX),r=n.x,i=n.y,a=n.lineHeight,o=n.capHeight,s=n.fill,c=n.scaleToFit,l=n.textAnchor,u=n.verticalAnchor,d=XY(n,qY),f=(0,v.useMemo)(()=>mX({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),p=d.dx,m=d.dy,h=d.angle,g=d.className,_=d.breakAll,y=XY(d,JY);if(!gw(r)||!gw(i)||f.length===0)return null;var b=Number(r)+(Z(p)?p:0),x=Number(i)+(Z(m)?m:0);if(!Tk(b)||!Tk(x))return null;var S;switch(u){case`start`:S=KY(`calc(${o})`);break;case`middle`:S=KY(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=KY(`calc(${f.length-1} * -${a})`);break}var C=[],w=f[0];if(c&&w!=null){var T=w.width,E=d.width;C.push(`scale(${Z(E)&&Z(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,YY({},KS(y),{ref:t,x:b,y:x,className:
|
|
123
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eX(e,t){if(e){if(typeof e==`string`)return tX(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tX(e,t):void 0}}function tX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nX(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function rX(e){if(Array.isArray(e))return e}var iX=/[ \f\n\r\t\v\u2028\u2029]+/,aX=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return Cw(t)||(i=n?t.toString().split(``):t.toString().split(iX)),{wordsWithComputedWidth:i.map(e=>({word:e,width:bY(e,r).width})),spaceWidth:n?0:bY(`\xA0`,r).width}}catch{return null}};function oX(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function sX(e){return Cw(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var cX=(e,t,n,r)=>e.reduce((e,i)=>{var a=i.word,o=i.width,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),lX=e=>e.reduce((e,t)=>e.width>t.width?e:t),uX=`…`,dX=(e,t,n,r,i,a,o,s)=>{var c=aX({breakAll:n,style:r,children:e.slice(0,t)+uX});if(!c)return[!1,[]];var l=cX(c.wordsWithComputedWidth,a,o,s);return[l.length>i||lX(l).width>Number(a),l]},fX=(e,t,n,r,i)=>{var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=Z(a),u=String(o),d=cX(t,r,n,i);if(!l||i||!(d.length>a||lX(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),_=QY(dX(u,g-1,c,s,a,r,n,i),2),v=_[0],y=_[1],b=QY(dX(u,g,c,s,a,r,n,i),1)[0];if(!v&&!b&&(f=g+1),v&&b&&(p=g-1),!v&&b){h=y;break}m++}return h||d},pX=e=>[{words:Cw(e)?[]:e.toString().split(iX),width:void 0}],mX=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!jN.isSsr){var s,c,l=aX({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return pX(r);return fX({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return pX(r)},hX=`#808080`,gX={angle:0,breakAll:!1,capHeight:`0.71em`,fill:hX,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},_X=(0,v.forwardRef)((e,t)=>{var n=Iw(e,gX),r=n.x,i=n.y,a=n.lineHeight,o=n.capHeight,s=n.fill,c=n.scaleToFit,l=n.textAnchor,u=n.verticalAnchor,d=XY(n,qY),f=(0,v.useMemo)(()=>mX({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),p=d.dx,m=d.dy,h=d.angle,g=d.className,_=d.breakAll,y=XY(d,JY);if(!gw(r)||!gw(i)||f.length===0)return null;var b=Number(r)+(Z(p)?p:0),x=Number(i)+(Z(m)?m:0);if(!Tk(b)||!Tk(x))return null;var S;switch(u){case`start`:S=KY(`calc(${o})`);break;case`middle`:S=KY(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=KY(`calc(${f.length-1} * -${a})`);break}var C=[],w=f[0];if(c&&w!=null){var T=w.width,E=d.width;C.push(`scale(${Z(E)&&Z(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,YY({},KS(y),{ref:t,x:b,y:x,className:Uv(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?hX:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return v.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});_X.displayName=`Text`;function vX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vX(Object(n),!0).forEach(function(t){bX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bX(e,t,n){return(t=xX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xX(e){var t=SX(e,`string`);return typeof t==`symbol`?t:t+``}function SX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var CX=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=ij(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?yX({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?yX({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?yX({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?yX({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?yX({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?yX({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?yX({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?yX({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(Z(n.x)||hw(n.x))&&(Z(n.y)||hw(n.y))?yX({x:c+yw(n.x,g),y:l+yw(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):yX({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},wX=[`labelRef`],TX=[`content`];function EX(e,t){if(e==null)return{};var n,r,i=DX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function OX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OX(Object(n),!0).forEach(function(t){AX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AX(e,t,n){return(t=jX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jX(e){var t=MX(e,`string`);return typeof t==`symbol`?t:t+``}function MX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function NX(){return NX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NX.apply(null,arguments)}var PX=(0,v.createContext)(null),FX=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,s=e.children,c=(0,v.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return v.createElement(PX.Provider,{value:c},s)},IX=()=>{var e=(0,v.useContext)(PX),t=aj();return e||(t?ij(t):void 0)},LX=(0,v.createContext)(null),RX=()=>{var e=(0,v.useContext)(LX),t=Q(ML);return e||t},zX=e=>{var t=e.value,n=e.formatter,r=Cw(e.children)?t:e.children;return typeof n==`function`?n(r):r},BX=e=>e!=null&&typeof e==`function`,VX=(e,t)=>pw(t-e)*Math.min(Math.abs(t-e),360),HX=(e,t,n,r,i)=>{var a=e.offset,o=e.className,s=i.cx,c=i.cy,l=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,p=i.clockWise,m=(l+u)/2,h=VX(d,f),g=h>=0?1:-1,_,y;switch(t){case`insideStart`:_=d+g*a,y=p;break;case`insideEnd`:_=f-g*a,y=!p;break;case`end`:_=f+g*a,y=p;break;default:throw Error(`Unsupported position ${t}`)}y=h<=0?y:!y;var b=qF(s,c,m,_),x=qF(s,c,m,_+(y?1:-1)*359),S=`M${b.x},${b.y}
|
|
124
124
|
A${m},${m},0,1,${+!y},
|
|
125
|
-
${x.x},${x.y}`,C=Cw(e.id)?vw(`recharts-radial-line-`):e.id;return v.createElement(`text`,NX({},r,{dominantBaseline:`central`,className:Hv(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},UX=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,s=(e.startAngle+e.endAngle)/2;if(n===`outside`){var c=qF(r,i,o+t,s),l=c.x;return{x:l,y:c.y,textAnchor:l>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var u=qF(r,i,(a+o)/2,s);return{x:u.x,y:u.y,textAnchor:`middle`,verticalAnchor:`middle`}},WX=e=>e!=null&&`cx`in e&&Z(e.cx),GX={angle:0,offset:5,zIndex:uL.label,position:`middle`,textBreakAll:!1};function KX(e){if(!WX(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function qX(e){var t=Iw(e,GX),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,o=t.children,s=t.content,c=t.className,l=c===void 0?``:c,u=t.textBreakAll,d=t.labelRef,f=RX(),p=IX(),m=n==null?i===`center`?p:f??p:WX(n)?n:ij(n),h,g,_=KX(m);if(!m||Cw(a)&&Cw(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var y=kX(kX({},t),{},{viewBox:m});if((0,v.isValidElement)(s))return y.labelRef,(0,v.cloneElement)(s,EX(y,wX));if(typeof s==`function`){if(y.content,h=(0,v.createElement)(s,EX(y,TX)),(0,v.isValidElement)(h))return h}else h=zX(t);var b=KS(t);if(WX(m)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return HX(t,i,h,b,m);g=UX(m,t.offset,t.position)}else{if(!_)return null;var x=CX({viewBox:_,position:i,offset:t.offset,parentViewBox:WX(r)?void 0:r,clamp:!0});g=kX(kX({x:x.x,y:x.y,textAnchor:x.horizontalAnchor,verticalAnchor:x.verticalAnchor},x.width===void 0?{}:{width:x.width}),x.height===void 0?{}:{height:x.height})}return v.createElement(iJ,{zIndex:t.zIndex},v.createElement(_X,NX({ref:d,className:Hv(`recharts-label`,l)},b,g,{textAnchor:oX(b.textAnchor)?b.textAnchor:g.textAnchor,breakAll:u}),h))}qX.displayName=`Label`;var JX=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(qX,NX({key:`label-implicit`},r)):gw(e)?v.createElement(qX,NX({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===qX?(0,v.cloneElement)(e,kX({key:`label-implicit`},r)):v.createElement(qX,NX({key:`label-implicit`,content:e},r)):BX(e)?v.createElement(qX,NX({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(qX,NX({},e,{key:`label-implicit`},r)):null};function YX(e){var t=e.label,n=e.labelRef;return JX(t,IX(),n)||null}var XX=[`valueAccessor`],ZX=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function QX(){return QX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QX.apply(null,arguments)}function $X(e,t){if(e==null)return{};var n,r,i=eZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tZ=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(sX(t))return t},nZ=(0,v.createContext)(void 0),rZ=nZ.Provider,iZ=(0,v.createContext)(void 0),aZ=iZ.Provider;function oZ(){return(0,v.useContext)(nZ)}function sZ(){return(0,v.useContext)(iZ)}function cZ(e){var t=e.valueAccessor,n=t===void 0?tZ:t,r=$X(e,XX),i=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,s=r.zIndex,c=$X(r,ZX),l=oZ(),u=sZ(),d=l||u;return!d||!d.length?null:v.createElement(iJ,{zIndex:s??uL.label},v.createElement(rC,{className:`recharts-label-list`},d.map((e,t)=>{var s=Cw(i)?n(e,t):Mk(e.payload,i),l=Cw(a)?{}:{id:`${a}-${t}`};return v.createElement(qX,QX({key:`label-${t}`},KS(e),c,l,{fill:r.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:t,zIndex:0}))})))}cZ.displayName=`LabelList`;function lZ(e){var t=e.label;return t?t===!0?v.createElement(cZ,{key:`labelList-implicit`}):v.isValidElement(t)||BX(t)?v.createElement(cZ,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(cZ,QX({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}var uZ=[`points`,`className`,`baseLinePoints`,`connectNulls`],dZ;function fZ(){return fZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fZ.apply(null,arguments)}function pZ(e,t){if(e==null)return{};var n,r,i=mZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hZ(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var gZ=e=>e!=null&&e.x===+e.x&&e.y===+e.y,_Z=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];e.forEach(e=>{var n=t[t.length-1];gZ(e)?n&&n.push(e):n&&n.length>0&&t.push([])});var n=e[0],r=t[t.length-1];gZ(n)&&r&&r.push(n);var i=t[t.length-1];return i&&i.length<=0&&(t=t.slice(0,-1)),t},vZ=(e,t)=>{var n=_Z(e);t&&(n=[n.reduce((e,t)=>[...e,...t],[])]);var r=n.map(e=>e.reduce((e,t,n)=>fw(dZ||=hZ([``,``,``,`,`,``]),e,n===0?`M`:`L`,t.x,t.y),``)).join(``);return n.length===1?`${r}Z`:r},yZ=(e,t,n)=>{var r=vZ(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${vZ(Array.from(t).reverse(),n).slice(1)}`},bZ=e=>{var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=pZ(e,uZ);if(!t||!t.length)return null;var o=Hv(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=yZ(t,r,i);return v.createElement(`g`,{className:o},v.createElement(`path`,fZ({},KS(a),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?v.createElement(`path`,fZ({},KS(a),{fill:`none`,d:vZ(t,i)})):null,s?v.createElement(`path`,fZ({},KS(a),{fill:`none`,d:vZ(r,i)})):null)}var l=vZ(t,i);return v.createElement(`path`,fZ({},KS(a),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function xZ(){return xZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xZ.apply(null,arguments)}var SZ=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Hv(`recharts-dot`,i);return Z(t)&&Z(n)&&Z(r)?v.createElement(`circle`,xZ({},WS(e),Ow(e),{className:a,cx:t,cy:n,r})):null},CZ=e=>e.graphicalItems.polarItems,wZ=$([CZ,PU,$([NL,PL],RU)],VU),TZ=$([$([wZ],KU),xI],YU),EZ=$([TZ,PU,wZ],ZU);$([TZ,PU,wZ],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:Mk(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:Mk(e,t.dataKey),errorDomain:[]})));var DZ=()=>void 0,OZ=$([PU,uj,TZ,EZ,rL,NL,$([PU,hW,gW,DZ,$([TZ,PU,wZ,vW,NL,TI],xW),DZ,uj,NL],BW)],UW),kZ=$([OZ,IU,GW],KW),AZ=$([GW,$([PU,OZ,kZ,NL],JW)],WL),jZ=(e,t,n)=>{switch(t){case`angleAxis`:return SL(e,n);case`radiusAxis`:return CL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},MZ=(e,t,n)=>{switch(t){case`angleAxis`:return kL(e,n);case`radiusAxis`:return jL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},NZ=$([$([jZ,GW,AZ,MZ],sU)],UL),PZ=$([uj,EZ,IU,NL],oG),FZ=$([uj,jZ,GW,NZ,kZ,MZ,TG,PZ,NL],DG),IZ=$([FZ],e=>{if(e){var t=new Map;return e.forEach(e=>{var n=(e.coordinate+360)%360;t.has(n)||t.set(n,e)}),Array.from(t.values())}}),LZ=$([uj,jZ,NZ,MZ,TG,PZ,NL],kG),RZ=kO({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=LM(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=LM(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),zZ=RZ.actions;zZ.addRadiusAxis,zZ.removeRadiusAxis;var BZ=zZ.addAngleAxis,VZ=zZ.removeAngleAxis,HZ=RZ.reducer;function UZ(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var WZ=[`children`,`type`],GZ=[`ref`];function KZ(){return KZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KZ.apply(null,arguments)}function qZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qZ(Object(n),!0).forEach(function(t){YZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YZ(e,t,n){return(t=XZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XZ(e){var t=ZZ(e,`string`);return typeof t==`symbol`?t:t+``}function ZZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function QZ(e,t){if(e==null)return{};var n,r,i=$Z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $Z(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eQ=1e-5,tQ=Math.cos(GF(45)),nQ=`angleAxis`;function rQ(e){var t=ZT(),n=mj(),r=(0,v.useMemo)(()=>{e.children;var t=e.type,r=QZ(e,WZ),i=mL(n,`angleAxis`,t);if(i!=null)return JZ(JZ({},r),{},{type:i})},[e,n]),i=r===Q(e=>SL(e,r?.id));return(0,v.useEffect)(()=>r==null?Ew:(t(BZ(r)),()=>{t(VZ(r))}),[t,r]),i?e.children:null}var iQ=(e,t)=>{var n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=qF(n,r,i,e.coordinate),c=qF(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}},aQ=(e,t)=>{var n=Math.cos(GF(-e.coordinate));return n>eQ?t===`outer`?`start`:`end`:n<-eQ?t===`outer`?`end`:`start`:`middle`},oQ=e=>{var t=Math.cos(GF(-e.coordinate)),n=Math.sin(GF(-e.coordinate));return Math.abs(t)<=tQ?n>0?`start`:`end`:`middle`},sQ=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.axisLineType,a=e.axisLine,o=e.ticks;if(!a)return null;var s=JZ(JZ({},WS(e)),{},{fill:`none`},WS(a));if(i===`circle`)return v.createElement(SZ,KZ({className:`recharts-polar-angle-axis-line`},s,{cx:t,cy:n,r}));var c=o.map(e=>qF(t,n,r,e.coordinate));return v.createElement(bZ,KZ({className:`recharts-polar-angle-axis-line`},s,{points:c}))},cQ=e=>{var t=e.tick,n=e.tickProps,r=e.value;return t?v.isValidElement(t)?v.cloneElement(t,n):typeof t==`function`?t(n):v.createElement(_X,KZ({},n,{className:`recharts-polar-angle-axis-tick-value`}),r):null},lQ=e=>{var t=e.tick,n=e.tickLine,r=e.tickFormatter,i=e.stroke,a=e.ticks,o=WS(e);o.ref;var s=QZ(o,GZ),c=GS(t),l=JZ(JZ({},s),{},{fill:`none`},WS(n)),u=a.map((a,o)=>{var u=iQ(a,e),d=aQ(a,e.orientation),f=oQ(a),p=JZ(JZ(JZ({},s),{},{textAnchor:d,verticalAnchor:f,stroke:`none`,fill:i},c),{},{index:o,payload:a,x:u.x2,y:u.y2});return v.createElement(rC,KZ({className:Hv(`recharts-polar-angle-axis-tick`,UZ(t)),key:`tick-${a.coordinate}`},Aw(e,a,o)),n&&v.createElement(`line`,KZ({className:`recharts-polar-angle-axis-tick-line`},l,u)),v.createElement(cQ,{tick:t,tickProps:p,value:r?r(a.value,o):a.value}))});return v.createElement(rC,{className:`recharts-polar-angle-axis-ticks`},u)},uQ=e=>{var t=e.angleAxisId,n=Q(ML),r=Q(e=>NZ(e,`angleAxis`,t)),i=SA(),a=Q(e=>IZ(e,`angleAxis`,t,i));if(n==null||!a||!a.length||r==null)return null;var o=JZ(JZ(JZ({},e),{},{scale:r},n),{},{radius:n.outerRadius,ticks:a});return v.createElement(iJ,{zIndex:o.zIndex},v.createElement(rC,{className:Hv(`recharts-polar-angle-axis`,nQ,o.className)},v.createElement(sQ,o),v.createElement(lQ,o)))};function dQ(e){var t=Iw(e,dL);return v.createElement(rQ,{id:t.angleAxisId,scale:t.scale,type:t.type,dataKey:t.dataKey,unit:void 0,name:t.name,allowDuplicatedCategory:!1,allowDataOverflow:!1,reversed:t.reversed,includeHidden:!1,allowDecimals:t.allowDecimals,tickCount:t.tickCount,niceTicks:t.niceTicks??`auto`,ticks:t.ticks,tick:t.tick,domain:t.domain},v.createElement(uQ,t))}dQ.displayName=`PolarAngleAxis`;function fQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fQ(Object(n),!0).forEach(function(t){mQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mQ(e,t,n){return(t=hQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hQ(e){var t=gQ(e,`string`);return typeof t==`symbol`?t:t+``}function gQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _Q=$([CZ,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),vQ=[],yQ=(e,t,n)=>n?.length===0?vQ:n,bQ=$([xI,_Q,yQ],(e,t,n)=>{var r=e.chartData;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>pQ(pQ({},t.presentationProps),e.props))),i!=null)return i}}),xQ=$([bQ,_Q,yQ],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=Mk(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:Zk(a,t.dataKey),dataKey:t.dataKey,color:o,payload:e,type:t.legendType}})}),SQ=$([bQ,_Q,yQ,vA],(e,t,n,r)=>{if(!(t==null||e==null))return l1({offset:r,pieSettings:t,displayedData:e,cells:n})}),CQ=o((e=>{var t=60103,n=60106,r=60107,i=60108,a=60114,o=60109,s=60110,c=60112,l=60113,u=60120,d=60115,f=60116;if(typeof Symbol==`function`&&Symbol.for){var p=Symbol.for;t=p(`react.element`),n=p(`react.portal`),r=p(`react.fragment`),i=p(`react.strict_mode`),a=p(`react.profiler`),o=p(`react.provider`),s=p(`react.context`),c=p(`react.forward_ref`),l=p(`react.suspense`),u=p(`react.suspense_list`),d=p(`react.memo`),f=p(`react.lazy`),p(`react.block`),p(`react.server.block`),p(`react.fundamental`),p(`react.debug_trace_mode`),p(`react.legacy_hidden`)}function m(e){if(typeof e==`object`&&e){var p=e.$$typeof;switch(p){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:case o:return e;default:return p}}case n:return p}}}e.isFragment=function(e){return m(e)===r}})),wQ=o(((e,t)=>{t.exports=CQ()}))(),TQ=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,EQ=null,DQ=null,OQ=e=>{if(e===EQ&&Array.isArray(DQ))return DQ;var t=[];return v.Children.forEach(e,e=>{Cw(e)||((0,wQ.isFragment)(e)?t=t.concat(OQ(e.props.children)):t.push(e))}),DQ=t,EQ=e,t};function kQ(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>TQ(e)):[TQ(t)],OQ(e).forEach(e=>{var t=uw(e,`type.displayName`)||uw(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var AQ=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0;function jQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jQ(Object(n),!0).forEach(function(t){NQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NQ(e,t,n){return(t=PQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PQ(e){var t=FQ(e,`string`);return typeof t==`symbol`?t:t+``}function FQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IQ(e,t){return MQ(MQ({},t),e)}function LQ(e){return(0,v.isValidElement)(e)?e.props:e}function RQ(e,t){return(0,v.cloneElement)(e,IQ(LQ(e),t))}function zQ(e){if(`index`in e){var t=e.index;return typeof t==`number`||typeof t==`string`?t:void 0}}function BQ(e){return`isActive`in e&&e.isActive===!0}function VQ(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?`recharts-active-shape`:i,o=e.inActiveClassName,s=o===void 0?`recharts-shape`:o,c=zQ(r),l=(0,v.isValidElement)(t)?RQ(t,r):t===n?v.createElement(n,r):typeof t==`function`?t(r,c):typeof t==`object`?v.createElement(n,IQ(t,r)):v.createElement(n,r);return BQ(r)?v.createElement(rC,{className:a},l):v.createElement(rC,{className:s},l)}var HQ=(e,t,n)=>{var r=ZT();return(i,a)=>o=>{e?.(i,a,o),r(qG({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},UQ=e=>{var t=ZT();return(n,r)=>i=>{e?.(n,r,i),t(JG())}},WQ=(e,t,n)=>{var r=ZT();return(i,a)=>o=>{e?.(i,a,o),r(XG({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function GQ(e){var t=e.tooltipEntrySettings,n=ZT(),r=SA(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(UG(t)):i.current!==t&&n(WG({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(GG(i.current)),null)},[n]),null}function KQ(e){var t=e.legendPayload,n=ZT(),r=SA(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(BM(t)):i.current!==t&&n(VM({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(HM(i.current)),null)},[n]),null}function qQ(e){var t=e.legendPayload,n=ZT(),r=Q(uj),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r!==`centric`&&r!==`radial`||(i.current===null?n(BM(t)):i.current!==t&&n(VM({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(HM(i.current)),null)},[n]),null}function JQ(e,t){return $Q(e)||QQ(e,t)||XQ(e,t)||YQ()}function YQ(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
125
|
+
${x.x},${x.y}`,C=Cw(e.id)?vw(`recharts-radial-line-`):e.id;return v.createElement(`text`,NX({},r,{dominantBaseline:`central`,className:Uv(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},UX=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,s=(e.startAngle+e.endAngle)/2;if(n===`outside`){var c=qF(r,i,o+t,s),l=c.x;return{x:l,y:c.y,textAnchor:l>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var u=qF(r,i,(a+o)/2,s);return{x:u.x,y:u.y,textAnchor:`middle`,verticalAnchor:`middle`}},WX=e=>e!=null&&`cx`in e&&Z(e.cx),GX={angle:0,offset:5,zIndex:uL.label,position:`middle`,textBreakAll:!1};function KX(e){if(!WX(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function qX(e){var t=Iw(e,GX),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,o=t.children,s=t.content,c=t.className,l=c===void 0?``:c,u=t.textBreakAll,d=t.labelRef,f=RX(),p=IX(),m=n==null?i===`center`?p:f??p:WX(n)?n:ij(n),h,g,_=KX(m);if(!m||Cw(a)&&Cw(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var y=kX(kX({},t),{},{viewBox:m});if((0,v.isValidElement)(s))return y.labelRef,(0,v.cloneElement)(s,EX(y,wX));if(typeof s==`function`){if(y.content,h=(0,v.createElement)(s,EX(y,TX)),(0,v.isValidElement)(h))return h}else h=zX(t);var b=KS(t);if(WX(m)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return HX(t,i,h,b,m);g=UX(m,t.offset,t.position)}else{if(!_)return null;var x=CX({viewBox:_,position:i,offset:t.offset,parentViewBox:WX(r)?void 0:r,clamp:!0});g=kX(kX({x:x.x,y:x.y,textAnchor:x.horizontalAnchor,verticalAnchor:x.verticalAnchor},x.width===void 0?{}:{width:x.width}),x.height===void 0?{}:{height:x.height})}return v.createElement(iJ,{zIndex:t.zIndex},v.createElement(_X,NX({ref:d,className:Uv(`recharts-label`,l)},b,g,{textAnchor:oX(b.textAnchor)?b.textAnchor:g.textAnchor,breakAll:u}),h))}qX.displayName=`Label`;var JX=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(qX,NX({key:`label-implicit`},r)):gw(e)?v.createElement(qX,NX({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===qX?(0,v.cloneElement)(e,kX({key:`label-implicit`},r)):v.createElement(qX,NX({key:`label-implicit`,content:e},r)):BX(e)?v.createElement(qX,NX({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(qX,NX({},e,{key:`label-implicit`},r)):null};function YX(e){var t=e.label,n=e.labelRef;return JX(t,IX(),n)||null}var XX=[`valueAccessor`],ZX=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function QX(){return QX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QX.apply(null,arguments)}function $X(e,t){if(e==null)return{};var n,r,i=eZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tZ=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(sX(t))return t},nZ=(0,v.createContext)(void 0),rZ=nZ.Provider,iZ=(0,v.createContext)(void 0),aZ=iZ.Provider;function oZ(){return(0,v.useContext)(nZ)}function sZ(){return(0,v.useContext)(iZ)}function cZ(e){var t=e.valueAccessor,n=t===void 0?tZ:t,r=$X(e,XX),i=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,s=r.zIndex,c=$X(r,ZX),l=oZ(),u=sZ(),d=l||u;return!d||!d.length?null:v.createElement(iJ,{zIndex:s??uL.label},v.createElement(rC,{className:`recharts-label-list`},d.map((e,t)=>{var s=Cw(i)?n(e,t):Mk(e.payload,i),l=Cw(a)?{}:{id:`${a}-${t}`};return v.createElement(qX,QX({key:`label-${t}`},KS(e),c,l,{fill:r.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:t,zIndex:0}))})))}cZ.displayName=`LabelList`;function lZ(e){var t=e.label;return t?t===!0?v.createElement(cZ,{key:`labelList-implicit`}):v.isValidElement(t)||BX(t)?v.createElement(cZ,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(cZ,QX({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}var uZ=[`points`,`className`,`baseLinePoints`,`connectNulls`],dZ;function fZ(){return fZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fZ.apply(null,arguments)}function pZ(e,t){if(e==null)return{};var n,r,i=mZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hZ(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var gZ=e=>e!=null&&e.x===+e.x&&e.y===+e.y,_Z=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];e.forEach(e=>{var n=t[t.length-1];gZ(e)?n&&n.push(e):n&&n.length>0&&t.push([])});var n=e[0],r=t[t.length-1];gZ(n)&&r&&r.push(n);var i=t[t.length-1];return i&&i.length<=0&&(t=t.slice(0,-1)),t},vZ=(e,t)=>{var n=_Z(e);t&&(n=[n.reduce((e,t)=>[...e,...t],[])]);var r=n.map(e=>e.reduce((e,t,n)=>fw(dZ||=hZ([``,``,``,`,`,``]),e,n===0?`M`:`L`,t.x,t.y),``)).join(``);return n.length===1?`${r}Z`:r},yZ=(e,t,n)=>{var r=vZ(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${vZ(Array.from(t).reverse(),n).slice(1)}`},bZ=e=>{var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=pZ(e,uZ);if(!t||!t.length)return null;var o=Uv(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=yZ(t,r,i);return v.createElement(`g`,{className:o},v.createElement(`path`,fZ({},KS(a),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?v.createElement(`path`,fZ({},KS(a),{fill:`none`,d:vZ(t,i)})):null,s?v.createElement(`path`,fZ({},KS(a),{fill:`none`,d:vZ(r,i)})):null)}var l=vZ(t,i);return v.createElement(`path`,fZ({},KS(a),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function xZ(){return xZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xZ.apply(null,arguments)}var SZ=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Uv(`recharts-dot`,i);return Z(t)&&Z(n)&&Z(r)?v.createElement(`circle`,xZ({},WS(e),Ow(e),{className:a,cx:t,cy:n,r})):null},CZ=e=>e.graphicalItems.polarItems,wZ=$([CZ,PU,$([NL,PL],RU)],VU),TZ=$([$([wZ],KU),xI],YU),EZ=$([TZ,PU,wZ],ZU);$([TZ,PU,wZ],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:Mk(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:Mk(e,t.dataKey),errorDomain:[]})));var DZ=()=>void 0,OZ=$([PU,uj,TZ,EZ,rL,NL,$([PU,hW,gW,DZ,$([TZ,PU,wZ,vW,NL,TI],xW),DZ,uj,NL],BW)],UW),kZ=$([OZ,IU,GW],KW),AZ=$([GW,$([PU,OZ,kZ,NL],JW)],WL),jZ=(e,t,n)=>{switch(t){case`angleAxis`:return SL(e,n);case`radiusAxis`:return CL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},MZ=(e,t,n)=>{switch(t){case`angleAxis`:return kL(e,n);case`radiusAxis`:return jL(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},NZ=$([$([jZ,GW,AZ,MZ],sU)],UL),PZ=$([uj,EZ,IU,NL],oG),FZ=$([uj,jZ,GW,NZ,kZ,MZ,TG,PZ,NL],DG),IZ=$([FZ],e=>{if(e){var t=new Map;return e.forEach(e=>{var n=(e.coordinate+360)%360;t.has(n)||t.set(n,e)}),Array.from(t.values())}}),LZ=$([uj,jZ,NZ,MZ,TG,PZ,NL],kG),RZ=kO({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=LM(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=LM(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),zZ=RZ.actions;zZ.addRadiusAxis,zZ.removeRadiusAxis;var BZ=zZ.addAngleAxis,VZ=zZ.removeAngleAxis,HZ=RZ.reducer;function UZ(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var WZ=[`children`,`type`],GZ=[`ref`];function KZ(){return KZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KZ.apply(null,arguments)}function qZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JZ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qZ(Object(n),!0).forEach(function(t){YZ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YZ(e,t,n){return(t=XZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XZ(e){var t=ZZ(e,`string`);return typeof t==`symbol`?t:t+``}function ZZ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function QZ(e,t){if(e==null)return{};var n,r,i=$Z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $Z(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eQ=1e-5,tQ=Math.cos(GF(45)),nQ=`angleAxis`;function rQ(e){var t=ZT(),n=mj(),r=(0,v.useMemo)(()=>{e.children;var t=e.type,r=QZ(e,WZ),i=mL(n,`angleAxis`,t);if(i!=null)return JZ(JZ({},r),{},{type:i})},[e,n]),i=r===Q(e=>SL(e,r?.id));return(0,v.useEffect)(()=>r==null?Ew:(t(BZ(r)),()=>{t(VZ(r))}),[t,r]),i?e.children:null}var iQ=(e,t)=>{var n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=qF(n,r,i,e.coordinate),c=qF(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}},aQ=(e,t)=>{var n=Math.cos(GF(-e.coordinate));return n>eQ?t===`outer`?`start`:`end`:n<-eQ?t===`outer`?`end`:`start`:`middle`},oQ=e=>{var t=Math.cos(GF(-e.coordinate)),n=Math.sin(GF(-e.coordinate));return Math.abs(t)<=tQ?n>0?`start`:`end`:`middle`},sQ=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.axisLineType,a=e.axisLine,o=e.ticks;if(!a)return null;var s=JZ(JZ({},WS(e)),{},{fill:`none`},WS(a));if(i===`circle`)return v.createElement(SZ,KZ({className:`recharts-polar-angle-axis-line`},s,{cx:t,cy:n,r}));var c=o.map(e=>qF(t,n,r,e.coordinate));return v.createElement(bZ,KZ({className:`recharts-polar-angle-axis-line`},s,{points:c}))},cQ=e=>{var t=e.tick,n=e.tickProps,r=e.value;return t?v.isValidElement(t)?v.cloneElement(t,n):typeof t==`function`?t(n):v.createElement(_X,KZ({},n,{className:`recharts-polar-angle-axis-tick-value`}),r):null},lQ=e=>{var t=e.tick,n=e.tickLine,r=e.tickFormatter,i=e.stroke,a=e.ticks,o=WS(e);o.ref;var s=QZ(o,GZ),c=GS(t),l=JZ(JZ({},s),{},{fill:`none`},WS(n)),u=a.map((a,o)=>{var u=iQ(a,e),d=aQ(a,e.orientation),f=oQ(a),p=JZ(JZ(JZ({},s),{},{textAnchor:d,verticalAnchor:f,stroke:`none`,fill:i},c),{},{index:o,payload:a,x:u.x2,y:u.y2});return v.createElement(rC,KZ({className:Uv(`recharts-polar-angle-axis-tick`,UZ(t)),key:`tick-${a.coordinate}`},Aw(e,a,o)),n&&v.createElement(`line`,KZ({className:`recharts-polar-angle-axis-tick-line`},l,u)),v.createElement(cQ,{tick:t,tickProps:p,value:r?r(a.value,o):a.value}))});return v.createElement(rC,{className:`recharts-polar-angle-axis-ticks`},u)},uQ=e=>{var t=e.angleAxisId,n=Q(ML),r=Q(e=>NZ(e,`angleAxis`,t)),i=SA(),a=Q(e=>IZ(e,`angleAxis`,t,i));if(n==null||!a||!a.length||r==null)return null;var o=JZ(JZ(JZ({},e),{},{scale:r},n),{},{radius:n.outerRadius,ticks:a});return v.createElement(iJ,{zIndex:o.zIndex},v.createElement(rC,{className:Uv(`recharts-polar-angle-axis`,nQ,o.className)},v.createElement(sQ,o),v.createElement(lQ,o)))};function dQ(e){var t=Iw(e,dL);return v.createElement(rQ,{id:t.angleAxisId,scale:t.scale,type:t.type,dataKey:t.dataKey,unit:void 0,name:t.name,allowDuplicatedCategory:!1,allowDataOverflow:!1,reversed:t.reversed,includeHidden:!1,allowDecimals:t.allowDecimals,tickCount:t.tickCount,niceTicks:t.niceTicks??`auto`,ticks:t.ticks,tick:t.tick,domain:t.domain},v.createElement(uQ,t))}dQ.displayName=`PolarAngleAxis`;function fQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fQ(Object(n),!0).forEach(function(t){mQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mQ(e,t,n){return(t=hQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hQ(e){var t=gQ(e,`string`);return typeof t==`symbol`?t:t+``}function gQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _Q=$([CZ,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),vQ=[],yQ=(e,t,n)=>n?.length===0?vQ:n,bQ=$([xI,_Q,yQ],(e,t,n)=>{var r=e.chartData;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>pQ(pQ({},t.presentationProps),e.props))),i!=null)return i}}),xQ=$([bQ,_Q,yQ],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=Mk(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:Zk(a,t.dataKey),dataKey:t.dataKey,color:o,payload:e,type:t.legendType}})}),SQ=$([bQ,_Q,yQ,vA],(e,t,n,r)=>{if(!(t==null||e==null))return l1({offset:r,pieSettings:t,displayedData:e,cells:n})}),CQ=o((e=>{var t=60103,n=60106,r=60107,i=60108,a=60114,o=60109,s=60110,c=60112,l=60113,u=60120,d=60115,f=60116;if(typeof Symbol==`function`&&Symbol.for){var p=Symbol.for;t=p(`react.element`),n=p(`react.portal`),r=p(`react.fragment`),i=p(`react.strict_mode`),a=p(`react.profiler`),o=p(`react.provider`),s=p(`react.context`),c=p(`react.forward_ref`),l=p(`react.suspense`),u=p(`react.suspense_list`),d=p(`react.memo`),f=p(`react.lazy`),p(`react.block`),p(`react.server.block`),p(`react.fundamental`),p(`react.debug_trace_mode`),p(`react.legacy_hidden`)}function m(e){if(typeof e==`object`&&e){var p=e.$$typeof;switch(p){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:case o:return e;default:return p}}case n:return p}}}e.isFragment=function(e){return m(e)===r}})),wQ=o(((e,t)=>{t.exports=CQ()}))(),TQ=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,EQ=null,DQ=null,OQ=e=>{if(e===EQ&&Array.isArray(DQ))return DQ;var t=[];return v.Children.forEach(e,e=>{Cw(e)||((0,wQ.isFragment)(e)?t=t.concat(OQ(e.props.children)):t.push(e))}),DQ=t,EQ=e,t};function kQ(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>TQ(e)):[TQ(t)],OQ(e).forEach(e=>{var t=uw(e,`type.displayName`)||uw(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var AQ=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0;function jQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jQ(Object(n),!0).forEach(function(t){NQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NQ(e,t,n){return(t=PQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PQ(e){var t=FQ(e,`string`);return typeof t==`symbol`?t:t+``}function FQ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IQ(e,t){return MQ(MQ({},t),e)}function LQ(e){return(0,v.isValidElement)(e)?e.props:e}function RQ(e,t){return(0,v.cloneElement)(e,IQ(LQ(e),t))}function zQ(e){if(`index`in e){var t=e.index;return typeof t==`number`||typeof t==`string`?t:void 0}}function BQ(e){return`isActive`in e&&e.isActive===!0}function VQ(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?`recharts-active-shape`:i,o=e.inActiveClassName,s=o===void 0?`recharts-shape`:o,c=zQ(r),l=(0,v.isValidElement)(t)?RQ(t,r):t===n?v.createElement(n,r):typeof t==`function`?t(r,c):typeof t==`object`?v.createElement(n,IQ(t,r)):v.createElement(n,r);return BQ(r)?v.createElement(rC,{className:a},l):v.createElement(rC,{className:s},l)}var HQ=(e,t,n)=>{var r=ZT();return(i,a)=>o=>{e?.(i,a,o),r(qG({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},UQ=e=>{var t=ZT();return(n,r)=>i=>{e?.(n,r,i),t(JG())}},WQ=(e,t,n)=>{var r=ZT();return(i,a)=>o=>{e?.(i,a,o),r(XG({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function GQ(e){var t=e.tooltipEntrySettings,n=ZT(),r=SA(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(UG(t)):i.current!==t&&n(WG({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(GG(i.current)),null)},[n]),null}function KQ(e){var t=e.legendPayload,n=ZT(),r=SA(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(BM(t)):i.current!==t&&n(VM({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(HM(i.current)),null)},[n]),null}function qQ(e){var t=e.legendPayload,n=ZT(),r=Q(uj),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r!==`centric`&&r!==`radial`||(i.current===null?n(BM(t)):i.current!==t&&n(VM({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(HM(i.current)),null)},[n]),null}function JQ(e,t){return $Q(e)||QQ(e,t)||XQ(e,t)||YQ()}function YQ(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
126
126
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XQ(e,t){if(e){if(typeof e==`string`)return ZQ(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ZQ(e,t):void 0}}function ZQ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function QQ(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $Q(e){if(Array.isArray(e))return e}var e$=`index`,t$=`append`;function n$(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:`removed`,prev:i});for(var a=0;a<t.length;a++){var o=e[a],s=t[a];o==null?r.push({status:`added`,next:s}):r.push({status:`matched`,prev:o,next:s})}return r}function r$(e,t){var n=e.length/t.length;return n$(t.map((t,r)=>e[Math.floor(r*n)]),t)}function i$(e,t){return n$(t.map((t,n)=>e[n]),t)}function a$(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function o$(e,t,n){var r=a$(e,n),i=new Set,a=t.map((e,t)=>{var a=n(e,t);if(a!=null){var o=r.get(a);if(o!==void 0)return i.add(a),o}}),o=[];for(var s of r){var c=JQ(s,2),l=c[0],u=c[1];i.has(l)||o.push(u)}return n$(a,t,o)}function s$(e,t,n){return t==null?null:e==null?t.map(e=>({status:`added`,next:e})):n===`index`?r$(e,t):n===`append`?i$(e,t):o$(e,t,n)}function c$(e,t){var n=(0,v.useRef)(e),r=(0,v.useRef)(t.current),i=(0,v.useRef)(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=(0,v.useCallback)(function(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(n===0){i.current=!0;return}n===1&&(r.current=e),n>0&&i.current&&a&&(t.current=e)},[t]);return{startValue:r.current,syncStepValue:a}}function l$(e,t){return m$(e)||p$(e,t)||d$(e,t)||u$()}function u$(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
127
127
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d$(e,t){if(e){if(typeof e==`string`)return f$(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f$(e,t):void 0}}function f$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p$(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function m$(e){if(Array.isArray(e))return e}function h$(e,t){var n=l$((0,v.useState)(!1),2),r=n[0],i=n[1];return{isAnimating:r,handleAnimationStart:(0,v.useCallback)(()=>{typeof e==`function`&&e(),i(!0)},[e]),handleAnimationEnd:(0,v.useCallback)(()=>{typeof t==`function`&&t(),i(!1)},[t])}}function g$(e){var t=e.animationInput,n=e.animationIdPrefix,r=e.items,i=e.previousItemsRef,a=e.isAnimationActive,o=e.animationBegin,s=e.animationDuration,c=e.animationEasing,l=e.onAnimationStart,u=e.onAnimationEnd,d=e.animationInterpolateFn,f=e.animationMatchBy,p=e.shouldUpdatePreviousRef,m=e.children,h=e.layout,g=oF(t,n),_=c$(g,i),y=_.startValue??null,b=s$(y,r,f??e$);return v.createElement(aF,{animationId:g,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:u,onAnimationStart:l,key:g},e=>{var t=y==null,n=r==null?r:d(b,e,h),i=p?p(e):e>0;return _.syncStepValue(n,e,i),n==null?null:m(n,e,t)})}function _$(e,t){return S$(e)||x$(e,t)||y$(e,t)||v$()}function v$(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
128
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y$(e,t){if(e){if(typeof e==`string`)return b$(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b$(e,t):void 0}}function b$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x$(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function S$(e){if(Array.isArray(e))return e}var C$=v.useId??(()=>_$(v.useState(()=>vw(`uid-`)),1)[0]);function w$(e,t){var n=C$();return t||(e?`${e}-${n}`:n)}var T$=(0,v.createContext)(void 0),E$=e=>{var t=e.id,n=e.type,r=e.children,i=w$(`recharts-${n}`,t);return v.createElement(T$.Provider,{value:i},r(i))},D$=kO({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(LM(t.payload))},prepare:bO()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).cartesianItems.indexOf(LM(r));a>-1&&(e.cartesianItems[a]=LM(i))},prepare:bO()},removeCartesianGraphicalItem:{reducer(e,t){var n=dO(e).cartesianItems.indexOf(LM(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:bO()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(LM(t.payload))},prepare:bO()},removePolarGraphicalItem:{reducer(e,t){var n=dO(e).polarItems.indexOf(LM(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:bO()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).polarItems.indexOf(LM(r));a>-1&&(e.polarItems[a]=LM(i))},prepare:bO()}}}),O$=D$.actions,k$=O$.addCartesianGraphicalItem,A$=O$.replaceCartesianGraphicalItem,j$=O$.removeCartesianGraphicalItem,M$=O$.addPolarGraphicalItem,N$=O$.removePolarGraphicalItem,P$=O$.replacePolarGraphicalItem,F$=D$.reducer,I$=(0,v.memo)(e=>{var t=ZT(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(k$(e)):n.current!==e&&t(A$({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(j$(n.current)),null)},[t]),null}),L$=(0,v.memo)(e=>{var t=ZT(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(M$(e)):n.current!==e&&t(P$({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(N$(n.current)),null)},[t]),null}),R$=[`key`],z$=[`onMouseEnter`,`onClick`,`onMouseLeave`],B$=[`id`],V$=[`id`];function H$(){return H$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H$.apply(null,arguments)}function U$(e,t){if(e==null)return{};var n,r,i=W$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function W$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function G$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?G$(Object(n),!0).forEach(function(t){q$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q$(e,t,n){return(t=J$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J$(e){var t=Y$(e,`string`);return typeof t==`symbol`?t:t+``}function Y$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var X$=hI;function Z$(e){var t=(0,v.useMemo)(()=>kQ(e.children,iY),[e.children]),n=Q(n=>xQ(n,e.id,t));return n==null?null:v.createElement(qQ,{legendPayload:n})}function Q$(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(v.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var n=e.fill;return typeof n==`string`?n:void 0}}var $$=v.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,i=e.stroke,a=e.strokeWidth,o=e.fill,s=e.name,c=e.hide,l=e.tooltipType,u=e.formatter,d=e.id,f=e.activeShape,p=Q$(f),m={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return p==null||t==null?t:t.map(e=>K$(K$({},e),{},{color:p,fill:p}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Zk(s,t),hide:c,type:l,color:o,unit:``,formatter:u,graphicalItemId:d}};return v.createElement(GQ,{tooltipEntrySettings:m})}),e1=(e,t)=>e>t?`start`:e<t?`end`:`middle`,t1=(e,t,n)=>yw(typeof t==`function`?t(e):t,n,n*.8),n1=(e,t,n)=>{var r=t.top,i=t.left,a=t.width,o=t.height,s=JF(a,o);return{cx:i+yw(e.cx,a,a/2),cy:r+yw(e.cy,o,o/2),innerRadius:yw(e.innerRadius,s,0),outerRadius:t1(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},r1=(e,t)=>pw(t-e)*Math.min(Math.abs(t-e),360),i1=(e,t)=>{if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=Hv(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);t.key;var r=U$(t,R$);return v.createElement(mP,H$({},r,{type:`linear`,className:n}))},a1=(e,t,n)=>{if(v.isValidElement(e))return v.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),v.isValidElement(r)))return r;var i=Hv(`recharts-pie-label-text`,UZ(e));return v.createElement(_X,H$({},t,{alignmentBaseline:`middle`,className:i}),r)};function o1(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label,a=n.labelLine,o=n.dataKey;if(!r||!i||!t)return null;var s=WS(n),c=GS(i),l=GS(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=qF(e.cx,e.cy,e.outerRadius+u,n),d=K$(K$(K$(K$({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:e1(r.x,e.cx)},r),f=K$(K$(K$(K$({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[qF(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return v.createElement(iJ,{zIndex:uL.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},v.createElement(rC,null,a&&i1(a,f),a1(i,d,Mk(e,o))))});return v.createElement(rC,{className:`recharts-pie-labels`},d)}function s1(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label;return typeof i==`object`&&i&&`position`in i?v.createElement(lZ,{label:i}):v.createElement(o1,{sectors:t,props:n,showLabels:r})}function c1(e){var t=e.sectors,n=e.activeShape,r=e.inactiveShape,i=e.allOtherPieProps,a=e.shape,o=e.id,s=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=Q(eq),d=Q(nq),f=Q(rq),p=i.onMouseEnter,m=i.onClick,h=i.onMouseLeave,g=U$(i,z$),_=HQ(p,i.dataKey,o),y=UQ(h),b=WQ(m,i.dataKey,o);return t==null||t.length===0?null:v.createElement(v.Fragment,null,t.map((e,p)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var m=f==null||f===o,h=String(p)===u&&(d==null||i.dataKey===d)&&m,x=n&&h?n:u?r:null,S=K$(K$({},e),{},{stroke:e.stroke,tabIndex:-1,index:p,isActive:h,animationElapsedTime:s,isAnimating:c,isEntrance:l,[oA]:p,[sA]:o});return v.createElement(rC,H$({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${p}`,tabIndex:-1,className:`recharts-pie-sector`},Aw(g,e,p),{onMouseEnter:_(e,p),onMouseLeave:y(e,p),onClick:b(e,p)}),v.createElement(VQ,{option:x??a,DefaultShape:X$,shapeProps:S}))}))}function l1(e){var t=e.pieSettings,n=e.displayedData,r=e.cells,i=e.offset,a=t.cornerRadius,o=t.startAngle,s=t.endAngle,c=t.dataKey,l=t.nameKey,u=t.tooltipType,d=Math.abs(t.minAngle),f=r1(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>Mk(e,c,0)!==0).length,g=(p>=360?h:h-1)*m,_=n.reduce((e,t)=>{var n=Mk(t,c,0);return e+(Z(n)?n:0)},0),v=d>0&&_>0&&n.some(e=>{var t=Mk(e,c,0),n=(Z(t)?t:0)/_;return t!==0&&n*p<d})?d:0,y=p-h*v-g,b;if(_>0){var x;b=n.map((e,n)=>{var s=Mk(e,c,0),d=Mk(e,l,n),p=n1(t,i,e),h=(Z(s)?s:0)/_,g,b=K$(K$({},e),r&&r[n]&&r[n].props),S=b!=null&&`fill`in b&&typeof b.fill==`string`?b.fill:t.fill;g=n?x.endAngle+pw(f)*m*(s===0?0:1):o;var C=g+pw(f)*((s===0?0:v)+h*y),w=(g+C)/2,T=(p.innerRadius+p.outerRadius)/2,E=[{name:d,value:s,payload:b,dataKey:c,type:u,color:S,fill:S,graphicalItemId:t.id}],D=qF(p.cx,p.cy,T,w);return x=K$(K$(K$(K$({},t.presentationProps),{},{percent:h,cornerRadius:typeof a==`string`?parseFloat(a):a,name:d,tooltipPayload:E,midAngle:w,middleRadius:T,tooltipPosition:D},b),p),{},{value:s,dataKey:c,startAngle:g,endAngle:C,payload:b,paddingAngle:s===0?0:pw(f)*m}),x})}return b}function u1(e){var t=e.showLabels,n=e.sectors,r=e.children,i=(0,v.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return v.createElement(aZ,{value:t?i:void 0},r)}var d1=(e,t)=>{if(e==null)return[];var n=[],r=e.find(e=>e.status!==`removed`),i=r?r.next.startAngle:0;return e.forEach((e,r)=>{if(e.status!==`removed`){var a=r>0?uw(e.next,`paddingAngle`,0):0;if(e.status===`matched`){var o=xw(e.prev.endAngle-e.prev.startAngle,e.next.endAngle-e.next.startAngle,t),s=K$(K$({},e.next),{},{startAngle:i+a,endAngle:i+o+a});n.push(s),i=s.endAngle}else{var c=xw(0,e.next.endAngle-e.next.startAngle,t),l=K$(K$({},e.next),{},{startAngle:i+a,endAngle:i+c+a});n.push(l),i=l.endAngle}}}),n};function f1(e){var t=e.props,n=e.previousSectorsRef,r=e.id,i=t.sectors,a=t.activeShape,o=t.inactiveShape,s=t.animationInterpolateFn,c=h$(t.onAnimationStart,t.onAnimationEnd),l=c.isAnimating,u=c.handleAnimationStart,d=c.handleAnimationEnd,f=mj();return f==null?null:v.createElement(u1,{showLabels:!l,sectors:i},v.createElement(g$,{animationInput:t,animationIdPrefix:`recharts-pie-`,items:i,previousItemsRef:n,isAnimationActive:t.isAnimationActive,animationBegin:t.animationBegin,animationDuration:t.animationDuration,animationEasing:t.animationEasing,onAnimationStart:u,onAnimationEnd:d,animationInterpolateFn:s,animationMatchBy:t.animationMatchBy,layout:f},(e,n,i)=>v.createElement(rC,null,v.createElement(c1,{sectors:e,activeShape:a,inactiveShape:o,allOtherPieProps:t,shape:t.shape,id:r,animationElapsedTime:n,isAnimating:l||n<1,isEntrance:i}))),v.createElement(s1,{showLabels:!l,sectors:i,props:t}),t.children)}var p1={animationBegin:400,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:d1,animationMatchBy:t$,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,shape:X$,startAngle:0,stroke:`#fff`,zIndex:uL.area};function m1(e){var t=e.id,n=U$(e,B$),r=e.hide,i=e.className,a=e.rootTabIndex,o=(0,v.useMemo)(()=>kQ(e.children,iY),[e.children]),s=Q(e=>SQ(e,t,o)),c=(0,v.useRef)(null),l=Hv(`recharts-pie`,i);return r||s==null?(c.current=null,v.createElement(rC,{tabIndex:a,className:l})):v.createElement(iJ,{zIndex:e.zIndex},v.createElement($$,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,formatter:e.formatter,id:t,activeShape:e.activeShape}),v.createElement(rC,{tabIndex:a,className:l},v.createElement(f1,{props:K$(K$({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function h1(e){var t=Iw(e,p1),n=t.id,r=U$(t,V$),i=WS(r);return v.createElement(E$,{id:n,type:`pie`},e=>v.createElement(v.Fragment,null,v.createElement(L$,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),v.createElement(Z$,H$({},r,{id:e})),v.createElement(m1,H$({},r,{id:e}))))}var g1=h1;g1.displayName=`Pie`;var _1=[`points`];function v1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?v1(Object(n),!0).forEach(function(t){b1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b1(e,t,n){return(t=x1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x1(e){var t=S1(e,`string`);return typeof t==`symbol`?t:t+``}function S1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C1(){return C1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C1.apply(null,arguments)}function w1(e,t){if(e==null)return{};var n,r,i=T1(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function T1(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function E1(e){var t=e.option,n=e.dotProps,r=e.className;if((0,v.isValidElement)(t))return(0,v.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=Hv(r,typeof t==`boolean`?``:t.className),a=n??{};a.points;var o=w1(a,_1);return v.createElement(SZ,C1({},o,{className:i}))}function D1(e,t){return e==null?!1:t?!0:e.length===1}function O1(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,o=e.baseProps,s=e.needClip,c=e.clipPathId,l=e.zIndex,u=l===void 0?uL.scatter:l;if(!D1(t,n))return null;var d=AQ(n),f=qS(n),p=t.map((e,r)=>{var s=y1(y1(y1({r:3},o),f),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return v.createElement(E1,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),m={};return s&&c!=null&&(m.clipPath=`url(#clipPath-${d?``:`dots-`}${c})`),v.createElement(iJ,{zIndex:u},v.createElement(rC,C1({className:r},m),p))}function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?k1(Object(n),!0).forEach(function(t){j1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j1(e,t,n){return(t=M1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M1(e){var t=N1(e,`string`);return typeof t==`symbol`?t:t+``}function N1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var P1=kO({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=LM(t.payload)},prepare:bO()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=LM(i))},prepare:bO()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:bO()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=LM(t.payload)},prepare:bO()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=LM(i))},prepare:bO()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:bO()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=LM(t.payload)},prepare:bO()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=LM(i))},prepare:bO()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:bO()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var o=a.widthHistory||[];if(o.length===3&&o[0]===o[2]&&i===o[1]&&i!==a.width&&Math.abs(i-(o[0]??0))<=1)return;var s=[...o,i].slice(-3);e.yAxis[r]=A1(A1({},a),{},{width:i,widthHistory:s})}}}}),F1=P1.actions,I1=F1.addXAxis,L1=F1.replaceXAxis,R1=F1.removeXAxis,z1=F1.addYAxis,B1=F1.replaceYAxis,V1=F1.removeYAxis;F1.addZAxis,F1.replaceZAxis,F1.removeZAxis;var H1=F1.updateYAxisWidth,U1=P1.reducer,W1=$([$([vA],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),eA,tA],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),G1=()=>Q(W1),K1=()=>Q(sq);function q1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?q1(Object(n),!0).forEach(function(t){Y1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Y1(e,t,n){return(t=X1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X1(e){var t=Z1(e,`string`);return typeof t==`symbol`?t:t+``}function Z1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Q1=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s=J1(J1(J1({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),GS(i)),Ow(i)),c=(0,v.isValidElement)(i)?(0,v.cloneElement)(i,s):typeof i==`function`?i(s):v.createElement(SZ,s);return v.createElement(rC,{className:`recharts-active-dot`,clipPath:o},c)};function $1(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,s=o===void 0?uL.activeDot:o,c=Q(eq),l=K1();if(t==null||l==null)return null;var u=t.find(e=>l.includes(e.payload));return Cw(u)?null:v.createElement(iJ,{zIndex:s},v.createElement(Q1,{point:u,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var e0=[`option`];function t0(e,t){if(e==null)return{};var n,r,i=n0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function n0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var r0=hI;function i0(e){return typeof e==`string`?parseInt(e,10):e}function a0(e){var t=e.option,n=t0(e,e0);return v.createElement(VQ,{option:t,DefaultShape:r0,shapeProps:n})}function o0(e,t){return d0(e)||u0(e,t)||c0(e,t)||s0()}function s0(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c0(e,t){if(e){if(typeof e==`string`)return l0(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l0(e,t):void 0}}function l0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u0(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d0(e){if(Array.isArray(e))return e}var f0=(e,t,n)=>{var r=n??e;if(!Cw(r))return yw(r,t,0)},p0=(e,t,n)=>{var r={},i=e.filter(LL),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var r=o0(e,2),i=r[0],a=r[1];return{stackId:i,dataKeys:a.map(e=>e.dataKey),barSize:f0(t,n,a[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:f0(t,n,e.barSize)}));return[...s,...c]};function m0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m0(Object(n),!0).forEach(function(t){g0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g0(e,t,n){return(t=_0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _0(e){var t=v0(e,`string`);return typeof t==`symbol`?t:t+``}function v0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function y0(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=yw(e,n,0,!0),s,c=[];if(Tk(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:Math.round((n-d)/2)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=yw(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m=Math.round(m));var h=Tk(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var b0=(e,t,n,r,i,a,o)=>{var s=Cw(o)?t:o,c=y0(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>h0(h0({},e),{},{position:h0(h0({},e.position),{},{offset:e.position.offset-i/2})}))),c},x0=(e,t)=>{var n=FL(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(e=>e.key===n)}}}},S0=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function C0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?C0(Object(n),!0).forEach(function(t){T0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T0(e,t,n){return(t=E0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E0(e){var t=D0(e,`string`);return typeof t==`symbol`?t:t+``}function D0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var O0=$([(e,t)=>CL(e,t),(e,t)=>NZ(e,`radiusAxis`,t)],(e,t)=>{if(!(e==null||t==null))return w0(w0({},e),{},{scale:t})}),k0=(e,t)=>LZ(e,`radiusAxis`,t,!1),A0=$([(e,t,n)=>SL(e,n),(e,t,n)=>NZ(e,`angleAxis`,n)],(e,t)=>{if(!(e==null||t==null))return w0(w0({},e),{},{scale:t})}),j0=(e,t,n)=>FZ(e,`angleAxis`,n,!1),M0=$([CZ,(e,t,n,r)=>r],(e,t)=>{if(e.some(e=>e.type===`radialBar`&&t.dataKey===e.dataKey&&t.stackId===e.stackId))return t}),N0=$([uj,O0,k0,A0,j0],(e,t,n,r,i)=>Pk(e,`radiusAxis`)?Yk(t,n,!1):Yk(r,i,!1)),P0=$([A0,O0,uj],(e,t,n)=>{var r=n===`radial`?e:t;if(!(r==null||r.scale==null))return Uk({numericAxis:r})}),F0=(e,t,n,r,i)=>i,I0=(e,t,n,r,i)=>n,L0=(e,t,n,r,i)=>t,R0=(e,t,n,r,i)=>r.maxBarSize,z0=e=>e.type===`radialBar`,B0=$([$([$([$([uj,CZ,I0,L0],(e,t,n,r)=>t.filter(t=>e===`centric`?t.angleAxisId===n:t.radiusAxisId===r).filter(e=>e.hide===!1).filter(z0)),nL,()=>void 0],p0),$I,eL,tL,$([uj,$I,A0,j0,O0,k0,R0],(e,t,n,r,i,a,o)=>{var s=Cw(o)?t:o;return e===`centric`?Yk(n,r,!0)??s??0:Yk(i,a,!0)??s??0}),N0,R0],b0),M0],S0),V0=$([wZ],e=>e.filter(z0).filter(LL)),H0=$([$([V0,xI,sW],IL),V0,rL,iL],uW),U0=$([A0,j0,O0,k0,bI,M0,N0,uj,P0,ML,F0,B0,$([(e,t,n)=>uj(e)===`centric`?H0(e,`radiusAxis`,t):H0(e,`angleAxis`,n),M0],x0)],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var p=i.chartData,m=i.dataStartIndex,h=i.dataEndIndex;if(a==null||n==null||e==null||p==null||o==null||d==null||s!==`centric`&&s!==`radial`||r==null||l==null)return[];var g=a.dataKey,_=a.minPointSize,v=l.cx,y=l.cy,b=l.startAngle,x=l.endAngle;return m2({angleAxis:e,angleAxisTicks:t,bandSize:o,baseValue:c,cells:u,cx:v,cy:y,dataKey:g,dataStartIndex:m,displayedData:p.slice(m,h+1),endAngle:x,layout:s,minPointSize:_,pos:d,radiusAxis:n,radiusAxisTicks:r,stackedData:f,stackedDomain:f?(s===`centric`?n:e).scale.domain():null,startAngle:b})}),W0=$([xI,(e,t)=>t],(e,t)=>{var n=e.chartData,r=e.dataStartIndex,i=e.dataEndIndex;if(n==null)return[];var a=n.slice(r,i+1);return a.length===0?[]:a.map(e=>({type:t,value:e.name,color:e.fill,payload:e}))});function G0(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&Tk(e.zIndex)?e.zIndex:t}var K0=[`shape`,`activeShape`,`cornerRadius`,`id`],q0=[`onMouseEnter`,`onClick`,`onMouseLeave`],J0=[`value`,`background`];function Y0(){return Y0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y0.apply(null,arguments)}function X0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X0(Object(n),!0).forEach(function(t){Q0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q0(e,t,n){return(t=$0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $0(e){var t=e2(e,`string`);return typeof t==`symbol`?t:t+``}function e2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function t2(e,t){if(e==null)return{};var n,r,i=n2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function n2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var r2=[];function i2(e){var t=e.showLabels,n=e.sectors,r=e.children,i=n.map(e=>({value:e.value,payload:e.payload,parentViewBox:void 0,clockWise:!1,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill}));return v.createElement(aZ,{value:t?i:void 0},r)}function a2(e){var t=e.sectors,n=e.allOtherRadialBarProps,r=e.showLabels,i=e.animationElapsedTime,a=e.isAnimating,o=e.isEntrance,s=n.shape,c=n.activeShape,l=n.cornerRadius,u=n.id,d=t2(n,K0),f=WS(d),p=Q(eq),m=n.onMouseEnter,h=n.onClick,g=n.onMouseLeave,_=t2(n,q0),y=HQ(m,n.dataKey,u),b=UQ(g),x=WQ(h,n.dataKey,u);return t==null?null:v.createElement(i2,{showLabels:r,sectors:t},t.map((e,t)=>{var n=!!(c&&p===String(t)),r=y(e,t),u=b(e,t),m=x(e,t),h=Z0(Z0(Z0(Z0({},f),{},{cornerRadius:i0(l)},e),Aw(_,e,t)),{},{onMouseEnter:r,onMouseLeave:u,onClick:m,className:`recharts-radial-bar-sector ${e.className}`,forceCornerRadius:d.forceCornerRadius,cornerIsExternal:d.cornerIsExternal,animationElapsedTime:i,isAnimating:a,isEntrance:o,isActive:n,option:n&&c!=null?c:s,index:t});return n?v.createElement(iJ,{zIndex:uL.activeBar,key:`sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}`},v.createElement(a0,h)):v.createElement(a0,Y0({key:`sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}`},h))}),v.createElement(lZ,{label:n.label}),n.children)}var o2=(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`removed`?[]:e.status===`matched`?[Z0(Z0({},e.next),{},{startAngle:xw(e.prev.startAngle,e.next.startAngle,t),endAngle:xw(e.prev.endAngle,e.next.endAngle,t)})]:[Z0(Z0({},e.next),{},{endAngle:xw(e.next.startAngle,e.next.endAngle,t)})]);function s2(e){var t=e.props,n=e.previousSectorsRef,r=t.sectors,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.onAnimationStart,l=t.onAnimationEnd,u=h$(c,l),d=u.isAnimating,f=u.handleAnimationStart,p=u.handleAnimationEnd,m=mj();return m==null?null:v.createElement(g$,{animationInput:t,animationIdPrefix:`recharts-radialbar-`,items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:o,animationEasing:s,onAnimationStart:f,onAnimationEnd:p,animationInterpolateFn:t.animationInterpolateFn,animationMatchBy:t.animationMatchBy,layout:m},(e,n,r)=>v.createElement(a2,{sectors:e,allOtherRadialBarProps:t,showLabels:!d,animationElapsedTime:n,isAnimating:d||n<1,isEntrance:r}))}function c2(e){var t=(0,v.useRef)(null);return v.createElement(s2,{props:e,previousSectorsRef:t})}function l2(e){var t=Q(t=>W0(t,e.legendType));return v.createElement(qQ,{legendPayload:t??[]})}var u2=v.memo(e=>{var t=e.dataKey,n=e.sectors,r=e.stroke,i=e.strokeWidth,a=e.name,o=e.hide,s=e.fill,c=e.tooltipType,l=e.formatter,u={dataDefinedOnItem:n,getPosition:Ew,settings:{graphicalItemId:e.id,stroke:r,strokeWidth:i,fill:s,nameKey:void 0,dataKey:t,name:Zk(a,t),hide:o,type:c,color:s,unit:``,formatter:l}};return v.createElement(GQ,{tooltipEntrySettings:u})}),d2=class extends v.PureComponent{renderBackground(e){if(e==null)return null;var t=this.props.cornerRadius,n=GS(this.props.background);return v.createElement(iJ,{zIndex:G0(this.props.background,uL.barBackground)},e.map((e,r)=>{e.value;var i=e.background,a=t2(e,J0);if(!i)return null;var o=Z0(Z0(Z0(Z0(Z0({cornerRadius:i0(t)},a),{},{fill:`#eee`},i),n),Aw(this.props,e,r)),{},{index:r,className:Hv(`recharts-radial-bar-background-sector`,String(n?.className)),option:i,isActive:!1});return v.createElement(a0,Y0({key:`background-${a.cx}-${a.cy}-${a.innerRadius}-${a.outerRadius}-${a.startAngle}-${a.endAngle}-${r}`},o))}))}render(){var e=this.props,t=e.hide,n=e.sectors,r=e.className,i=e.background;if(t)return null;var a=Hv(`recharts-area`,r);return v.createElement(iJ,{zIndex:this.props.zIndex},v.createElement(rC,{className:a},i&&v.createElement(rC,{className:`recharts-radial-bar-background`},this.renderBackground(n)),v.createElement(rC,{className:`recharts-radial-bar-sectors`},v.createElement(c2,this.props))))}};function f2(e){var t=v.useMemo(()=>kQ(e.children,iY),[e.children]),n=v.useMemo(()=>({data:void 0,hide:!1,id:e.id,dataKey:e.dataKey,minPointSize:e.minPointSize,stackId:Bk(e.stackId),maxBarSize:e.maxBarSize,barSize:e.barSize,type:`radialBar`,angleAxisId:e.angleAxisId,radiusAxisId:e.radiusAxisId}),[e.id,e.dataKey,e.minPointSize,e.stackId,e.maxBarSize,e.barSize,e.angleAxisId,e.radiusAxisId]),r=Q(r=>U0(r,e.radiusAxisId,e.angleAxisId,n,t))??r2;return v.createElement(v.Fragment,null,v.createElement(u2,{dataKey:e.dataKey,sectors:r,stroke:e.stroke,strokeWidth:e.strokeWidth,name:e.name,hide:e.hide,fill:e.fill,tooltipType:e.tooltipType,formatter:e.formatter,id:e.id}),v.createElement(d2,Y0({},e,{sectors:r})))}var p2={angleAxisId:0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:t$,animationInterpolateFn:o2,background:!1,cornerIsExternal:!1,cornerRadius:0,forceCornerRadius:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:0,radiusAxisId:0,shape:r0,zIndex:uL.bar};function m2(e){var t=e.displayedData,n=e.stackedData,r=e.dataStartIndex,i=e.stackedDomain,a=e.dataKey,o=e.baseValue,s=e.layout,c=e.radiusAxis,l=e.radiusAxisTicks,u=e.bandSize,d=e.pos,f=e.angleAxis,p=e.minPointSize,m=e.cx,h=e.cy,g=e.angleAxisTicks,_=e.cells,v=e.startAngle,y=e.endAngle;return g==null||l==null?r2:(t??[]).map((e,t)=>{var b,x,S,C,w,T;if(n?b=Lk(n[r+t],i):(b=Mk(e,a),Array.isArray(b)||(b=[o,b])),s===`radial`){if(C=f.scale.map(b[0])??v,w=f.scale.map(b[1])??y,x=Hk({axis:c,ticks:l,bandSize:u,offset:d.offset,entry:e,index:t}),x!=null&&w!=null&&C!=null){S=x+d.size;var E=w-C;if(Math.abs(p)>0&&Math.abs(E)<Math.abs(p)){var D=pw(E||p)*(Math.abs(p)-Math.abs(E));w+=D}T={background:{cx:m,cy:h,innerRadius:x,outerRadius:S,startAngle:v,endAngle:y}}}}else if(x=c.scale.map(b[0]),S=c.scale.map(b[1]),C=Hk({axis:f,ticks:g,bandSize:u,offset:d.offset,entry:e,index:t}),x!=null&&S!=null&&C!=null){w=C+d.size;var O=S-x;if(Math.abs(p)>0&&Math.abs(O)<Math.abs(p)){var k=pw(O||p)*(Math.abs(p)-Math.abs(O));S+=k}}return Z0(Z0(Z0({},e),T),{},{payload:e,value:n?b:b[1],cx:m,cy:h,innerRadius:x,outerRadius:S,startAngle:C,endAngle:w},_&&_[t]&&_[t].props)})}function h2(e){var t=Iw(e,p2);return v.createElement(E$,{id:t.id,type:`radialBar`},e=>v.createElement(v.Fragment,null,v.createElement(L$,{type:`radialBar`,id:e,data:void 0,dataKey:t.dataKey,hide:t.hide??p2.hide,angleAxisId:t.angleAxisId??p2.angleAxisId,radiusAxisId:t.radiusAxisId??p2.radiusAxisId,stackId:Bk(t.stackId),barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize}),v.createElement(l2,t),v.createElement(f2,Y0({},t,{id:e}))))}h2.displayName=`RadialBar`;var g2=e=>{var t=e.chartData,n=ZT(),r=SA();return(0,v.useEffect)(()=>r?()=>{}:(n(DJ(t)),()=>{n(DJ(void 0))}),[t,n,r]),null},_2={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},v2=kO({name:`brush`,initialState:_2,reducers:{setBrushSettings(e,t){return t.payload==null?_2:t.payload}}});v2.actions.setBrushSettings;var y2=v2.reducer;function b2(e){return(e%180+180)%180}var x2=function(e){var t=e.width,n=e.height,r=b2(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},S2=kO({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=dO(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=dO(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(LM(t.payload))},removeLine:(e,t)=>{var n=dO(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),C2=S2.actions;C2.addDot,C2.removeDot,C2.addArea,C2.removeArea,C2.addLine,C2.removeLine;var w2=S2.reducer;function T2(e,t){return A2(e)||k2(e,t)||D2(e,t)||E2()}function E2(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y$(e,t){if(e){if(typeof e==`string`)return b$(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b$(e,t):void 0}}function b$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x$(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function S$(e){if(Array.isArray(e))return e}var C$=v.useId??(()=>_$(v.useState(()=>vw(`uid-`)),1)[0]);function w$(e,t){var n=C$();return t||(e?`${e}-${n}`:n)}var T$=(0,v.createContext)(void 0),E$=e=>{var t=e.id,n=e.type,r=e.children,i=w$(`recharts-${n}`,t);return v.createElement(T$.Provider,{value:i},r(i))},D$=kO({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(LM(t.payload))},prepare:bO()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).cartesianItems.indexOf(LM(r));a>-1&&(e.cartesianItems[a]=LM(i))},prepare:bO()},removeCartesianGraphicalItem:{reducer(e,t){var n=dO(e).cartesianItems.indexOf(LM(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:bO()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(LM(t.payload))},prepare:bO()},removePolarGraphicalItem:{reducer(e,t){var n=dO(e).polarItems.indexOf(LM(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:bO()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=dO(e).polarItems.indexOf(LM(r));a>-1&&(e.polarItems[a]=LM(i))},prepare:bO()}}}),O$=D$.actions,k$=O$.addCartesianGraphicalItem,A$=O$.replaceCartesianGraphicalItem,j$=O$.removeCartesianGraphicalItem,M$=O$.addPolarGraphicalItem,N$=O$.removePolarGraphicalItem,P$=O$.replacePolarGraphicalItem,F$=D$.reducer,I$=(0,v.memo)(e=>{var t=ZT(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(k$(e)):n.current!==e&&t(A$({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(j$(n.current)),null)},[t]),null}),L$=(0,v.memo)(e=>{var t=ZT(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(M$(e)):n.current!==e&&t(P$({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(N$(n.current)),null)},[t]),null}),R$=[`key`],z$=[`onMouseEnter`,`onClick`,`onMouseLeave`],B$=[`id`],V$=[`id`];function H$(){return H$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H$.apply(null,arguments)}function U$(e,t){if(e==null)return{};var n,r,i=W$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function W$(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function G$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?G$(Object(n),!0).forEach(function(t){q$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q$(e,t,n){return(t=J$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J$(e){var t=Y$(e,`string`);return typeof t==`symbol`?t:t+``}function Y$(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var X$=hI;function Z$(e){var t=(0,v.useMemo)(()=>kQ(e.children,iY),[e.children]),n=Q(n=>xQ(n,e.id,t));return n==null?null:v.createElement(qQ,{legendPayload:n})}function Q$(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(v.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var n=e.fill;return typeof n==`string`?n:void 0}}var $$=v.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,i=e.stroke,a=e.strokeWidth,o=e.fill,s=e.name,c=e.hide,l=e.tooltipType,u=e.formatter,d=e.id,f=e.activeShape,p=Q$(f),m={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return p==null||t==null?t:t.map(e=>K$(K$({},e),{},{color:p,fill:p}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Zk(s,t),hide:c,type:l,color:o,unit:``,formatter:u,graphicalItemId:d}};return v.createElement(GQ,{tooltipEntrySettings:m})}),e1=(e,t)=>e>t?`start`:e<t?`end`:`middle`,t1=(e,t,n)=>yw(typeof t==`function`?t(e):t,n,n*.8),n1=(e,t,n)=>{var r=t.top,i=t.left,a=t.width,o=t.height,s=JF(a,o);return{cx:i+yw(e.cx,a,a/2),cy:r+yw(e.cy,o,o/2),innerRadius:yw(e.innerRadius,s,0),outerRadius:t1(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},r1=(e,t)=>pw(t-e)*Math.min(Math.abs(t-e),360),i1=(e,t)=>{if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=Uv(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);t.key;var r=U$(t,R$);return v.createElement(mP,H$({},r,{type:`linear`,className:n}))},a1=(e,t,n)=>{if(v.isValidElement(e))return v.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),v.isValidElement(r)))return r;var i=Uv(`recharts-pie-label-text`,UZ(e));return v.createElement(_X,H$({},t,{alignmentBaseline:`middle`,className:i}),r)};function o1(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label,a=n.labelLine,o=n.dataKey;if(!r||!i||!t)return null;var s=WS(n),c=GS(i),l=GS(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=qF(e.cx,e.cy,e.outerRadius+u,n),d=K$(K$(K$(K$({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:e1(r.x,e.cx)},r),f=K$(K$(K$(K$({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[qF(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return v.createElement(iJ,{zIndex:uL.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},v.createElement(rC,null,a&&i1(a,f),a1(i,d,Mk(e,o))))});return v.createElement(rC,{className:`recharts-pie-labels`},d)}function s1(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label;return typeof i==`object`&&i&&`position`in i?v.createElement(lZ,{label:i}):v.createElement(o1,{sectors:t,props:n,showLabels:r})}function c1(e){var t=e.sectors,n=e.activeShape,r=e.inactiveShape,i=e.allOtherPieProps,a=e.shape,o=e.id,s=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=Q(eq),d=Q(nq),f=Q(rq),p=i.onMouseEnter,m=i.onClick,h=i.onMouseLeave,g=U$(i,z$),_=HQ(p,i.dataKey,o),y=UQ(h),b=WQ(m,i.dataKey,o);return t==null||t.length===0?null:v.createElement(v.Fragment,null,t.map((e,p)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var m=f==null||f===o,h=String(p)===u&&(d==null||i.dataKey===d)&&m,x=n&&h?n:u?r:null,S=K$(K$({},e),{},{stroke:e.stroke,tabIndex:-1,index:p,isActive:h,animationElapsedTime:s,isAnimating:c,isEntrance:l,[oA]:p,[sA]:o});return v.createElement(rC,H$({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${p}`,tabIndex:-1,className:`recharts-pie-sector`},Aw(g,e,p),{onMouseEnter:_(e,p),onMouseLeave:y(e,p),onClick:b(e,p)}),v.createElement(VQ,{option:x??a,DefaultShape:X$,shapeProps:S}))}))}function l1(e){var t=e.pieSettings,n=e.displayedData,r=e.cells,i=e.offset,a=t.cornerRadius,o=t.startAngle,s=t.endAngle,c=t.dataKey,l=t.nameKey,u=t.tooltipType,d=Math.abs(t.minAngle),f=r1(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>Mk(e,c,0)!==0).length,g=(p>=360?h:h-1)*m,_=n.reduce((e,t)=>{var n=Mk(t,c,0);return e+(Z(n)?n:0)},0),v=d>0&&_>0&&n.some(e=>{var t=Mk(e,c,0),n=(Z(t)?t:0)/_;return t!==0&&n*p<d})?d:0,y=p-h*v-g,b;if(_>0){var x;b=n.map((e,n)=>{var s=Mk(e,c,0),d=Mk(e,l,n),p=n1(t,i,e),h=(Z(s)?s:0)/_,g,b=K$(K$({},e),r&&r[n]&&r[n].props),S=b!=null&&`fill`in b&&typeof b.fill==`string`?b.fill:t.fill;g=n?x.endAngle+pw(f)*m*(s===0?0:1):o;var C=g+pw(f)*((s===0?0:v)+h*y),w=(g+C)/2,T=(p.innerRadius+p.outerRadius)/2,E=[{name:d,value:s,payload:b,dataKey:c,type:u,color:S,fill:S,graphicalItemId:t.id}],D=qF(p.cx,p.cy,T,w);return x=K$(K$(K$(K$({},t.presentationProps),{},{percent:h,cornerRadius:typeof a==`string`?parseFloat(a):a,name:d,tooltipPayload:E,midAngle:w,middleRadius:T,tooltipPosition:D},b),p),{},{value:s,dataKey:c,startAngle:g,endAngle:C,payload:b,paddingAngle:s===0?0:pw(f)*m}),x})}return b}function u1(e){var t=e.showLabels,n=e.sectors,r=e.children,i=(0,v.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return v.createElement(aZ,{value:t?i:void 0},r)}var d1=(e,t)=>{if(e==null)return[];var n=[],r=e.find(e=>e.status!==`removed`),i=r?r.next.startAngle:0;return e.forEach((e,r)=>{if(e.status!==`removed`){var a=r>0?uw(e.next,`paddingAngle`,0):0;if(e.status===`matched`){var o=xw(e.prev.endAngle-e.prev.startAngle,e.next.endAngle-e.next.startAngle,t),s=K$(K$({},e.next),{},{startAngle:i+a,endAngle:i+o+a});n.push(s),i=s.endAngle}else{var c=xw(0,e.next.endAngle-e.next.startAngle,t),l=K$(K$({},e.next),{},{startAngle:i+a,endAngle:i+c+a});n.push(l),i=l.endAngle}}}),n};function f1(e){var t=e.props,n=e.previousSectorsRef,r=e.id,i=t.sectors,a=t.activeShape,o=t.inactiveShape,s=t.animationInterpolateFn,c=h$(t.onAnimationStart,t.onAnimationEnd),l=c.isAnimating,u=c.handleAnimationStart,d=c.handleAnimationEnd,f=mj();return f==null?null:v.createElement(u1,{showLabels:!l,sectors:i},v.createElement(g$,{animationInput:t,animationIdPrefix:`recharts-pie-`,items:i,previousItemsRef:n,isAnimationActive:t.isAnimationActive,animationBegin:t.animationBegin,animationDuration:t.animationDuration,animationEasing:t.animationEasing,onAnimationStart:u,onAnimationEnd:d,animationInterpolateFn:s,animationMatchBy:t.animationMatchBy,layout:f},(e,n,i)=>v.createElement(rC,null,v.createElement(c1,{sectors:e,activeShape:a,inactiveShape:o,allOtherPieProps:t,shape:t.shape,id:r,animationElapsedTime:n,isAnimating:l||n<1,isEntrance:i}))),v.createElement(s1,{showLabels:!l,sectors:i,props:t}),t.children)}var p1={animationBegin:400,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:d1,animationMatchBy:t$,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,shape:X$,startAngle:0,stroke:`#fff`,zIndex:uL.area};function m1(e){var t=e.id,n=U$(e,B$),r=e.hide,i=e.className,a=e.rootTabIndex,o=(0,v.useMemo)(()=>kQ(e.children,iY),[e.children]),s=Q(e=>SQ(e,t,o)),c=(0,v.useRef)(null),l=Uv(`recharts-pie`,i);return r||s==null?(c.current=null,v.createElement(rC,{tabIndex:a,className:l})):v.createElement(iJ,{zIndex:e.zIndex},v.createElement($$,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,formatter:e.formatter,id:t,activeShape:e.activeShape}),v.createElement(rC,{tabIndex:a,className:l},v.createElement(f1,{props:K$(K$({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function h1(e){var t=Iw(e,p1),n=t.id,r=U$(t,V$),i=WS(r);return v.createElement(E$,{id:n,type:`pie`},e=>v.createElement(v.Fragment,null,v.createElement(L$,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),v.createElement(Z$,H$({},r,{id:e})),v.createElement(m1,H$({},r,{id:e}))))}var g1=h1;g1.displayName=`Pie`;var _1=[`points`];function v1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?v1(Object(n),!0).forEach(function(t){b1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b1(e,t,n){return(t=x1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x1(e){var t=S1(e,`string`);return typeof t==`symbol`?t:t+``}function S1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function C1(){return C1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C1.apply(null,arguments)}function w1(e,t){if(e==null)return{};var n,r,i=T1(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function T1(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function E1(e){var t=e.option,n=e.dotProps,r=e.className;if((0,v.isValidElement)(t))return(0,v.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=Uv(r,typeof t==`boolean`?``:t.className),a=n??{};a.points;var o=w1(a,_1);return v.createElement(SZ,C1({},o,{className:i}))}function D1(e,t){return e==null?!1:t?!0:e.length===1}function O1(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,o=e.baseProps,s=e.needClip,c=e.clipPathId,l=e.zIndex,u=l===void 0?uL.scatter:l;if(!D1(t,n))return null;var d=AQ(n),f=qS(n),p=t.map((e,r)=>{var s=y1(y1(y1({r:3},o),f),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return v.createElement(E1,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),m={};return s&&c!=null&&(m.clipPath=`url(#clipPath-${d?``:`dots-`}${c})`),v.createElement(iJ,{zIndex:u},v.createElement(rC,C1({className:r},m),p))}function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?k1(Object(n),!0).forEach(function(t){j1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j1(e,t,n){return(t=M1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M1(e){var t=N1(e,`string`);return typeof t==`symbol`?t:t+``}function N1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var P1=kO({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=LM(t.payload)},prepare:bO()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=LM(i))},prepare:bO()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:bO()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=LM(t.payload)},prepare:bO()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=LM(i))},prepare:bO()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:bO()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=LM(t.payload)},prepare:bO()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=LM(i))},prepare:bO()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:bO()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var o=a.widthHistory||[];if(o.length===3&&o[0]===o[2]&&i===o[1]&&i!==a.width&&Math.abs(i-(o[0]??0))<=1)return;var s=[...o,i].slice(-3);e.yAxis[r]=A1(A1({},a),{},{width:i,widthHistory:s})}}}}),F1=P1.actions,I1=F1.addXAxis,L1=F1.replaceXAxis,R1=F1.removeXAxis,z1=F1.addYAxis,B1=F1.replaceYAxis,V1=F1.removeYAxis;F1.addZAxis,F1.replaceZAxis,F1.removeZAxis;var H1=F1.updateYAxisWidth,U1=P1.reducer,W1=$([$([vA],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),eA,tA],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),G1=()=>Q(W1),K1=()=>Q(sq);function q1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?q1(Object(n),!0).forEach(function(t){Y1(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q1(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Y1(e,t,n){return(t=X1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X1(e){var t=Z1(e,`string`);return typeof t==`symbol`?t:t+``}function Z1(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Q1=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s=J1(J1(J1({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),GS(i)),Ow(i)),c=(0,v.isValidElement)(i)?(0,v.cloneElement)(i,s):typeof i==`function`?i(s):v.createElement(SZ,s);return v.createElement(rC,{className:`recharts-active-dot`,clipPath:o},c)};function $1(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,s=o===void 0?uL.activeDot:o,c=Q(eq),l=K1();if(t==null||l==null)return null;var u=t.find(e=>l.includes(e.payload));return Cw(u)?null:v.createElement(iJ,{zIndex:s},v.createElement(Q1,{point:u,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var e0=[`option`];function t0(e,t){if(e==null)return{};var n,r,i=n0(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function n0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var r0=hI;function i0(e){return typeof e==`string`?parseInt(e,10):e}function a0(e){var t=e.option,n=t0(e,e0);return v.createElement(VQ,{option:t,DefaultShape:r0,shapeProps:n})}function o0(e,t){return d0(e)||u0(e,t)||c0(e,t)||s0()}function s0(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c0(e,t){if(e){if(typeof e==`string`)return l0(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l0(e,t):void 0}}function l0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u0(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d0(e){if(Array.isArray(e))return e}var f0=(e,t,n)=>{var r=n??e;if(!Cw(r))return yw(r,t,0)},p0=(e,t,n)=>{var r={},i=e.filter(LL),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var r=o0(e,2),i=r[0],a=r[1];return{stackId:i,dataKeys:a.map(e=>e.dataKey),barSize:f0(t,n,a[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:f0(t,n,e.barSize)}));return[...s,...c]};function m0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m0(Object(n),!0).forEach(function(t){g0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g0(e,t,n){return(t=_0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _0(e){var t=v0(e,`string`);return typeof t==`symbol`?t:t+``}function v0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function y0(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=yw(e,n,0,!0),s,c=[];if(Tk(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:Math.round((n-d)/2)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=yw(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m=Math.round(m));var h=Tk(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var b0=(e,t,n,r,i,a,o)=>{var s=Cw(o)?t:o,c=y0(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>h0(h0({},e),{},{position:h0(h0({},e.position),{},{offset:e.position.offset-i/2})}))),c},x0=(e,t)=>{var n=FL(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(e=>e.key===n)}}}},S0=(e,t)=>{if(!(e==null||t==null)){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function C0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?C0(Object(n),!0).forEach(function(t){T0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T0(e,t,n){return(t=E0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E0(e){var t=D0(e,`string`);return typeof t==`symbol`?t:t+``}function D0(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var O0=$([(e,t)=>CL(e,t),(e,t)=>NZ(e,`radiusAxis`,t)],(e,t)=>{if(!(e==null||t==null))return w0(w0({},e),{},{scale:t})}),k0=(e,t)=>LZ(e,`radiusAxis`,t,!1),A0=$([(e,t,n)=>SL(e,n),(e,t,n)=>NZ(e,`angleAxis`,n)],(e,t)=>{if(!(e==null||t==null))return w0(w0({},e),{},{scale:t})}),j0=(e,t,n)=>FZ(e,`angleAxis`,n,!1),M0=$([CZ,(e,t,n,r)=>r],(e,t)=>{if(e.some(e=>e.type===`radialBar`&&t.dataKey===e.dataKey&&t.stackId===e.stackId))return t}),N0=$([uj,O0,k0,A0,j0],(e,t,n,r,i)=>Pk(e,`radiusAxis`)?Yk(t,n,!1):Yk(r,i,!1)),P0=$([A0,O0,uj],(e,t,n)=>{var r=n===`radial`?e:t;if(!(r==null||r.scale==null))return Uk({numericAxis:r})}),F0=(e,t,n,r,i)=>i,I0=(e,t,n,r,i)=>n,L0=(e,t,n,r,i)=>t,R0=(e,t,n,r,i)=>r.maxBarSize,z0=e=>e.type===`radialBar`,B0=$([$([$([$([uj,CZ,I0,L0],(e,t,n,r)=>t.filter(t=>e===`centric`?t.angleAxisId===n:t.radiusAxisId===r).filter(e=>e.hide===!1).filter(z0)),nL,()=>void 0],p0),$I,eL,tL,$([uj,$I,A0,j0,O0,k0,R0],(e,t,n,r,i,a,o)=>{var s=Cw(o)?t:o;return e===`centric`?Yk(n,r,!0)??s??0:Yk(i,a,!0)??s??0}),N0,R0],b0),M0],S0),V0=$([wZ],e=>e.filter(z0).filter(LL)),H0=$([$([V0,xI,sW],IL),V0,rL,iL],uW),U0=$([A0,j0,O0,k0,bI,M0,N0,uj,P0,ML,F0,B0,$([(e,t,n)=>uj(e)===`centric`?H0(e,`radiusAxis`,t):H0(e,`angleAxis`,n),M0],x0)],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var p=i.chartData,m=i.dataStartIndex,h=i.dataEndIndex;if(a==null||n==null||e==null||p==null||o==null||d==null||s!==`centric`&&s!==`radial`||r==null||l==null)return[];var g=a.dataKey,_=a.minPointSize,v=l.cx,y=l.cy,b=l.startAngle,x=l.endAngle;return m2({angleAxis:e,angleAxisTicks:t,bandSize:o,baseValue:c,cells:u,cx:v,cy:y,dataKey:g,dataStartIndex:m,displayedData:p.slice(m,h+1),endAngle:x,layout:s,minPointSize:_,pos:d,radiusAxis:n,radiusAxisTicks:r,stackedData:f,stackedDomain:f?(s===`centric`?n:e).scale.domain():null,startAngle:b})}),W0=$([xI,(e,t)=>t],(e,t)=>{var n=e.chartData,r=e.dataStartIndex,i=e.dataEndIndex;if(n==null)return[];var a=n.slice(r,i+1);return a.length===0?[]:a.map(e=>({type:t,value:e.name,color:e.fill,payload:e}))});function G0(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&Tk(e.zIndex)?e.zIndex:t}var K0=[`shape`,`activeShape`,`cornerRadius`,`id`],q0=[`onMouseEnter`,`onClick`,`onMouseLeave`],J0=[`value`,`background`];function Y0(){return Y0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y0.apply(null,arguments)}function X0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?X0(Object(n),!0).forEach(function(t){Q0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q0(e,t,n){return(t=$0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $0(e){var t=e2(e,`string`);return typeof t==`symbol`?t:t+``}function e2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function t2(e,t){if(e==null)return{};var n,r,i=n2(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function n2(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var r2=[];function i2(e){var t=e.showLabels,n=e.sectors,r=e.children,i=n.map(e=>({value:e.value,payload:e.payload,parentViewBox:void 0,clockWise:!1,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill}));return v.createElement(aZ,{value:t?i:void 0},r)}function a2(e){var t=e.sectors,n=e.allOtherRadialBarProps,r=e.showLabels,i=e.animationElapsedTime,a=e.isAnimating,o=e.isEntrance,s=n.shape,c=n.activeShape,l=n.cornerRadius,u=n.id,d=t2(n,K0),f=WS(d),p=Q(eq),m=n.onMouseEnter,h=n.onClick,g=n.onMouseLeave,_=t2(n,q0),y=HQ(m,n.dataKey,u),b=UQ(g),x=WQ(h,n.dataKey,u);return t==null?null:v.createElement(i2,{showLabels:r,sectors:t},t.map((e,t)=>{var n=!!(c&&p===String(t)),r=y(e,t),u=b(e,t),m=x(e,t),h=Z0(Z0(Z0(Z0({},f),{},{cornerRadius:i0(l)},e),Aw(_,e,t)),{},{onMouseEnter:r,onMouseLeave:u,onClick:m,className:`recharts-radial-bar-sector ${e.className}`,forceCornerRadius:d.forceCornerRadius,cornerIsExternal:d.cornerIsExternal,animationElapsedTime:i,isAnimating:a,isEntrance:o,isActive:n,option:n&&c!=null?c:s,index:t});return n?v.createElement(iJ,{zIndex:uL.activeBar,key:`sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}`},v.createElement(a0,h)):v.createElement(a0,Y0({key:`sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}`},h))}),v.createElement(lZ,{label:n.label}),n.children)}var o2=(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`removed`?[]:e.status===`matched`?[Z0(Z0({},e.next),{},{startAngle:xw(e.prev.startAngle,e.next.startAngle,t),endAngle:xw(e.prev.endAngle,e.next.endAngle,t)})]:[Z0(Z0({},e.next),{},{endAngle:xw(e.next.startAngle,e.next.endAngle,t)})]);function s2(e){var t=e.props,n=e.previousSectorsRef,r=t.sectors,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.onAnimationStart,l=t.onAnimationEnd,u=h$(c,l),d=u.isAnimating,f=u.handleAnimationStart,p=u.handleAnimationEnd,m=mj();return m==null?null:v.createElement(g$,{animationInput:t,animationIdPrefix:`recharts-radialbar-`,items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:o,animationEasing:s,onAnimationStart:f,onAnimationEnd:p,animationInterpolateFn:t.animationInterpolateFn,animationMatchBy:t.animationMatchBy,layout:m},(e,n,r)=>v.createElement(a2,{sectors:e,allOtherRadialBarProps:t,showLabels:!d,animationElapsedTime:n,isAnimating:d||n<1,isEntrance:r}))}function c2(e){var t=(0,v.useRef)(null);return v.createElement(s2,{props:e,previousSectorsRef:t})}function l2(e){var t=Q(t=>W0(t,e.legendType));return v.createElement(qQ,{legendPayload:t??[]})}var u2=v.memo(e=>{var t=e.dataKey,n=e.sectors,r=e.stroke,i=e.strokeWidth,a=e.name,o=e.hide,s=e.fill,c=e.tooltipType,l=e.formatter,u={dataDefinedOnItem:n,getPosition:Ew,settings:{graphicalItemId:e.id,stroke:r,strokeWidth:i,fill:s,nameKey:void 0,dataKey:t,name:Zk(a,t),hide:o,type:c,color:s,unit:``,formatter:l}};return v.createElement(GQ,{tooltipEntrySettings:u})}),d2=class extends v.PureComponent{renderBackground(e){if(e==null)return null;var t=this.props.cornerRadius,n=GS(this.props.background);return v.createElement(iJ,{zIndex:G0(this.props.background,uL.barBackground)},e.map((e,r)=>{e.value;var i=e.background,a=t2(e,J0);if(!i)return null;var o=Z0(Z0(Z0(Z0(Z0({cornerRadius:i0(t)},a),{},{fill:`#eee`},i),n),Aw(this.props,e,r)),{},{index:r,className:Uv(`recharts-radial-bar-background-sector`,String(n?.className)),option:i,isActive:!1});return v.createElement(a0,Y0({key:`background-${a.cx}-${a.cy}-${a.innerRadius}-${a.outerRadius}-${a.startAngle}-${a.endAngle}-${r}`},o))}))}render(){var e=this.props,t=e.hide,n=e.sectors,r=e.className,i=e.background;if(t)return null;var a=Uv(`recharts-area`,r);return v.createElement(iJ,{zIndex:this.props.zIndex},v.createElement(rC,{className:a},i&&v.createElement(rC,{className:`recharts-radial-bar-background`},this.renderBackground(n)),v.createElement(rC,{className:`recharts-radial-bar-sectors`},v.createElement(c2,this.props))))}};function f2(e){var t=v.useMemo(()=>kQ(e.children,iY),[e.children]),n=v.useMemo(()=>({data:void 0,hide:!1,id:e.id,dataKey:e.dataKey,minPointSize:e.minPointSize,stackId:Bk(e.stackId),maxBarSize:e.maxBarSize,barSize:e.barSize,type:`radialBar`,angleAxisId:e.angleAxisId,radiusAxisId:e.radiusAxisId}),[e.id,e.dataKey,e.minPointSize,e.stackId,e.maxBarSize,e.barSize,e.angleAxisId,e.radiusAxisId]),r=Q(r=>U0(r,e.radiusAxisId,e.angleAxisId,n,t))??r2;return v.createElement(v.Fragment,null,v.createElement(u2,{dataKey:e.dataKey,sectors:r,stroke:e.stroke,strokeWidth:e.strokeWidth,name:e.name,hide:e.hide,fill:e.fill,tooltipType:e.tooltipType,formatter:e.formatter,id:e.id}),v.createElement(d2,Y0({},e,{sectors:r})))}var p2={angleAxisId:0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:t$,animationInterpolateFn:o2,background:!1,cornerIsExternal:!1,cornerRadius:0,forceCornerRadius:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:0,radiusAxisId:0,shape:r0,zIndex:uL.bar};function m2(e){var t=e.displayedData,n=e.stackedData,r=e.dataStartIndex,i=e.stackedDomain,a=e.dataKey,o=e.baseValue,s=e.layout,c=e.radiusAxis,l=e.radiusAxisTicks,u=e.bandSize,d=e.pos,f=e.angleAxis,p=e.minPointSize,m=e.cx,h=e.cy,g=e.angleAxisTicks,_=e.cells,v=e.startAngle,y=e.endAngle;return g==null||l==null?r2:(t??[]).map((e,t)=>{var b,x,S,C,w,T;if(n?b=Lk(n[r+t],i):(b=Mk(e,a),Array.isArray(b)||(b=[o,b])),s===`radial`){if(C=f.scale.map(b[0])??v,w=f.scale.map(b[1])??y,x=Hk({axis:c,ticks:l,bandSize:u,offset:d.offset,entry:e,index:t}),x!=null&&w!=null&&C!=null){S=x+d.size;var E=w-C;if(Math.abs(p)>0&&Math.abs(E)<Math.abs(p)){var D=pw(E||p)*(Math.abs(p)-Math.abs(E));w+=D}T={background:{cx:m,cy:h,innerRadius:x,outerRadius:S,startAngle:v,endAngle:y}}}}else if(x=c.scale.map(b[0]),S=c.scale.map(b[1]),C=Hk({axis:f,ticks:g,bandSize:u,offset:d.offset,entry:e,index:t}),x!=null&&S!=null&&C!=null){w=C+d.size;var O=S-x;if(Math.abs(p)>0&&Math.abs(O)<Math.abs(p)){var k=pw(O||p)*(Math.abs(p)-Math.abs(O));S+=k}}return Z0(Z0(Z0({},e),T),{},{payload:e,value:n?b:b[1],cx:m,cy:h,innerRadius:x,outerRadius:S,startAngle:C,endAngle:w},_&&_[t]&&_[t].props)})}function h2(e){var t=Iw(e,p2);return v.createElement(E$,{id:t.id,type:`radialBar`},e=>v.createElement(v.Fragment,null,v.createElement(L$,{type:`radialBar`,id:e,data:void 0,dataKey:t.dataKey,hide:t.hide??p2.hide,angleAxisId:t.angleAxisId??p2.angleAxisId,radiusAxisId:t.radiusAxisId??p2.radiusAxisId,stackId:Bk(t.stackId),barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize}),v.createElement(l2,t),v.createElement(f2,Y0({},t,{id:e}))))}h2.displayName=`RadialBar`;var g2=e=>{var t=e.chartData,n=ZT(),r=SA();return(0,v.useEffect)(()=>r?()=>{}:(n(DJ(t)),()=>{n(DJ(void 0))}),[t,n,r]),null},_2={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},v2=kO({name:`brush`,initialState:_2,reducers:{setBrushSettings(e,t){return t.payload==null?_2:t.payload}}});v2.actions.setBrushSettings;var y2=v2.reducer;function b2(e){return(e%180+180)%180}var x2=function(e){var t=e.width,n=e.height,r=b2(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},S2=kO({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=dO(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=dO(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(LM(t.payload))},removeLine:(e,t)=>{var n=dO(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),C2=S2.actions;C2.addDot,C2.removeDot,C2.addArea,C2.removeArea,C2.addLine,C2.removeLine;var w2=S2.reducer;function T2(e,t){return A2(e)||k2(e,t)||D2(e,t)||E2()}function E2(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
130
130
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D2(e,t){if(e){if(typeof e==`string`)return O2(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O2(e,t):void 0}}function O2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k2(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function A2(e){if(Array.isArray(e))return e}var j2=(0,v.createContext)(void 0),M2=e=>{var t=e.children,n=T2((0,v.useState)(`${vw(`recharts`)}-clip`),1)[0],r=G1();if(r==null)return null;var i=r.x,a=r.y,o=r.width,s=r.height;return v.createElement(j2.Provider,{value:n},v.createElement(`defs`,null,v.createElement(`clipPath`,{id:n},v.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function N2(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function P2(e,t,n){return x2({width:e.width+t.width,height:e.height+t.height},n)}function F2(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function I2(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function L2(e,t){return N2(e,t+1)}function R2(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:N2(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||I2(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function z2(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var o=t.start,s=t.end,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||I2(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m<a&&(p=f(),!(p!==0&&p===1));m+=c);if(d){for(var h=[],g=l;g<a;g+=c){var _=r[g];_!=null&&h.push(_)}return h}}return[]}function B2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?B2(Object(n),!0).forEach(function(t){H2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function H2(e,t,n){return(t=U2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U2(e){var t=W2(e,`string`);return typeof t==`symbol`?t:t+``}function W2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function G2(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t];if(r==null)return 1;var l=r,u,d=()=>(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=V2(V2({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=V2(V2({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&I2(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=V2(V2({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function K2(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=V2(V2({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&I2(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=V2(V2({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=V2(V2({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=V2(V2({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&I2(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=V2(V2({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function q2(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(Z(c)||jN.isSsr)return L2(i,Z(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?bY(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=(e,r)=>{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?P2(bY(i,{fontSize:t,letterSpacing:n}),m,d):bY(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?pw(_.coordinate-g.coordinate):1,y=F2(a,v,p);return c===`equidistantPreserveStart`?R2(v,y,h,i,o):c===`equidistantPreserveEnd`?z2(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?K2(v,y,h,i,o,c===`preserveStartEnd`):G2(v,y,h,i,o),f.filter(e=>e.isShow))}var J2=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r===void 0?5:r,a=e.tickSize,o=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,l=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>l&&(l=t.width)}});var u=n?n.getBoundingClientRect().width:0,d=o+c,f=l+d+u+(n?i:0);return Math.round(f)}return 0},Y2=kO({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=LM(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),X2=Y2.actions,Z2=X2.setRenderedTicks,Q2=X2.removeRenderedTicks,$2=Y2.reducer,e4=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function t4(e,t){return o4(e)||a4(e,t)||r4(e,t)||n4()}function n4(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r4(e,t){if(e){if(typeof e==`string`)return i4(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i4(e,t):void 0}}function i4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a4(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function o4(e){if(Array.isArray(e))return e}function s4(e,t){if(e==null)return{};var n,r,i=c4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function l4(){return l4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l4.apply(null,arguments)}function u4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u4(Object(n),!0).forEach(function(t){f4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f4(e,t,n){return(t=p4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p4(e){var t=m4(e,`string`);return typeof t==`symbol`?t:t+``}function m4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var h4={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`,zIndex:uL.axis};function g4(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=e.otherSvgProps;if(!s)return null;var l=d4(d4(d4({},c),WS(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=d4(d4({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=d4(d4({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return v.createElement(`line`,l4({},l,{className:Hv(`recharts-cartesian-axis-line`,uw(s,`className`))}))}function _4(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=Z(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_;break}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function v4(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function y4(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function b4(e){var t=e.option,n=e.tickProps,r=e.value,i,a=Hv(n.className,`recharts-cartesian-axis-tick-value`);if(v.isValidElement(t))i=v.cloneElement(t,d4(d4({},n),{},{className:a}));else if(typeof t==`function`)i=t(d4(d4({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=Hv(o,UZ(t))),i=v.createElement(_X,l4({},n,{className:o}),r)}return i}function x4(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=ZT();return(0,v.useEffect)(()=>r==null||n==null?Ew:(i(Z2({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(Q2({axisId:r,axisType:n}))}),[i,t,r,n]),null}var S4=(0,v.forwardRef)((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,o=e.stroke,s=e.tickFormatter,c=e.unit,l=e.padding,u=e.tickTextProps,d=e.orientation,f=e.mirror,p=e.x,m=e.y,h=e.width,g=e.height,_=e.tickSize,y=e.tickMargin,b=e.fontSize,x=e.letterSpacing,S=e.getTicksConfig,C=e.events,w=e.axisType,T=e.axisId,E=q2(d4(d4({},S),{},{ticks:r}),b,x),D=WS(S),O=GS(i),k=oX(D.textAnchor)?D.textAnchor:v4(d,f),A=y4(d,f),j={};typeof a==`object`&&(j=a);var M=d4(d4({},D),{},{fill:`none`},j),N=E.map(e=>d4({entry:e},_4(e,p,m,h,g,d,_,f,y))),P=N.map(e=>{var t=e.entry,n=e.line;return v.createElement(rC,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},a&&v.createElement(`line`,l4({},M,n,{className:Hv(`recharts-cartesian-axis-tick-line`,uw(a,`className`))})))}),F=N.map((e,t)=>{var n=e.entry,r=e.tick,a=d4(d4({},d4(d4(d4(d4({verticalAnchor:A},D),{},{textAnchor:k,stroke:`none`,fill:o},r),{},{index:t,payload:n,visibleTicksCount:E.length,tickFormatter:s,padding:l},u),{},{angle:u?.angle??D.angle??0})),O);return v.createElement(rC,l4({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},Aw(C,n,t)),i&&v.createElement(b4,{option:i,tickProps:a,value:`${typeof s==`function`?s(n.value,t):n.value}${c||``}`}))});return v.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${w}-ticks`},v.createElement(x4,{ticks:E,axisId:T,axisType:w}),F.length>0&&v.createElement(iJ,{zIndex:uL.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${w}-tick-labels`,ref:t},F)),P.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${w}-tick-lines`},P))}),C4=(0,v.forwardRef)((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,o=e.hide,s=e.ticks,c=e.axisType,l=e.axisId,u=s4(e,e4),d=t4((0,v.useState)(``),2),f=d[0],p=d[1],m=t4((0,v.useState)(``),2),h=m[0],g=m[1],_=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>J2({ticks:_.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var y=(0,v.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);_.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==f||a!==h)&&(p(i),g(a))}}},[f,h]);return o||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(iJ,{zIndex:e.zIndex},v.createElement(rC,{className:Hv(`recharts-cartesian-axis`,a)},v.createElement(g4,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:WS(e)}),v.createElement(S4,{ref:y,axisType:c,events:u,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),v.createElement(FX,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(YX,{label:e.label,labelRef:e.labelRef}),e.children)))}),w4=v.forwardRef((e,t)=>{var n=Iw(e,h4);return v.createElement(C4,l4({},n,{ref:t}))});w4.displayName=`CartesianAxis`;var T4=[`x1`,`y1`,`x2`,`y2`,`key`],E4=[`offset`],D4=[`xAxisId`,`yAxisId`],O4=[`xAxisId`,`yAxisId`];function k4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?k4(Object(n),!0).forEach(function(t){j4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j4(e,t,n){return(t=M4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M4(e){var t=N4(e,`string`);return typeof t==`symbol`?t:t+``}function N4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function P4(){return P4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P4.apply(null,arguments)}function F4(e,t){if(e==null)return{};var n,r,i=I4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function I4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var L4=e=>{var t=e.fill;if(!t||t===`none`)return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.ry;return v.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function R4(e){var t=e.option,n=e.lineItemProps,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var i=n.x1,a=n.y1,o=n.x2,s=n.y2,c=n.key,l=WS(F4(n,T4))??{};l.offset;var u=F4(l,E4);r=v.createElement(`line`,P4({},u,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function z4(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=F4(e,D4),s=a.map((e,r)=>{var a=A4(A4({},o),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${r}`,index:r});return v.createElement(R4,{key:`line-${r}`,option:i,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},s)}function B4(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=F4(e,O4),s=a.map((e,r)=>{var a=A4(A4({},o),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${r}`,index:r});return v.createElement(R4,{option:i,lineItemProps:a,key:`line-${r}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},s)}function V4(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(c===void 0||c)||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return v.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function H4(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!n||!r||!r.length)return null;var u=l.map(e=>Math.round(e+a-a)).sort((e,t)=>e-t);a!==u[0]&&u.unshift(0);var d=u.map((e,t)=>{var n=u[t+1],l=n==null?a+s-e:n-e;if(l<=0)return null;var d=t%r.length;return v.createElement(`rect`,{key:`react-${t}`,x:e,y:o,width:l,height:c,stroke:`none`,fill:r[d],fillOpacity:i,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},d)}var U4=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return Fk(q2(A4(A4(A4({},h4),n),{},{ticks:Ik(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},W4=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return Fk(q2(A4(A4(A4({},h4),n),{},{ticks:Ik(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},G4={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:uL.grid};function K4(e){var t=cj(),n=lj(),r=sj(),i=A4(A4({},Iw(e,G4)),{},{x:Z(e.x)?e.x:r.left,y:Z(e.y)?e.y:r.top,width:Z(e.width)?e.width:r.width,height:Z(e.height)?e.height:r.height}),a=i.xAxisId,o=i.yAxisId,s=i.x,c=i.y,l=i.width,u=i.height,d=i.syncWithTicks,f=i.horizontalValues,p=i.verticalValues,m=SA(),h=Q(e=>EG(e,`xAxis`,a,m)),g=Q(e=>EG(e,`yAxis`,o,m));if(!Ek(l)||!Ek(u)||!Z(s)||!Z(c))return null;var _=i.verticalCoordinatesGenerator||U4,y=i.horizontalCoordinatesGenerator||W4,b=i.horizontalPoints,x=i.verticalPoints;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?A4(A4({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);OA(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof _==`function`){var w=p&&p.length,T=_({xAxis:h?A4(A4({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);OA(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(iJ,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(L4,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(V4,P4({},i,{horizontalPoints:b})),v.createElement(H4,P4({},i,{verticalPoints:x})),v.createElement(z4,P4({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(B4,P4({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}K4.displayName=`CartesianGrid`;var q4=kO({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(e=>e.dataKey===i.dataKey&&e.direction===i.direction?a:e))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==i.dataKey||e.direction!==i.direction))}}}),J4=q4.actions;J4.addErrorBar,J4.replaceErrorBar,J4.removeErrorBar;var Y4=q4.reducer;function X4(e,t){var n=Q(t=>OU(t,e)),r=Q(e=>jU(e,t)),i=n?.allowDataOverflow??EU.allowDataOverflow,a=r?.allowDataOverflow??kU.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function Z4(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=G1(),a=X4(t,n),o=a.needClipX,s=a.needClipY,c=a.needClip,l=Q(e=>tG(e,t,!1)),u=Q(e=>nG(e,n,!1));if(!c||!i)return null;var d=i.x,f=i.y,p=i.width,m=i.height,h=o&&l?Math.min(l[0],l[1]):d-p/2,g=s&&u?Math.min(u[0],u[1]):f-m/2,_=o&&l?Math.abs(l[1]-l[0]):p*2,y=s&&u?Math.abs(u[1]-u[0]):m*2;return v.createElement(`clipPath`,{id:`clipPath-${r}`},v.createElement(`rect`,{x:h,y:g,width:_,height:y}))}function Q4(e){var t=GS(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}function $4(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function e3(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var t3=(e,t,n)=>jG(e,`xAxis`,$4(e,t),n),n3=(e,t,n)=>AG(e,`xAxis`,$4(e,t),n),r3=(e,t,n)=>jG(e,`yAxis`,e3(e,t),n),i3=(e,t,n)=>AG(e,`yAxis`,e3(e,t),n),a3=$([uj,t3,r3,n3,i3],(e,t,n,r,i)=>Pk(e,`xAxis`)?Yk(t,r,!1):Yk(n,i,!1)),o3=$([zU,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),s3=e=>Pk(uj(e),`xAxis`)?`yAxis`:`xAxis`,c3=(e,t)=>s3(e)===`yAxis`?e3(e,t):$4(e,t),l3=$([uj,t3,r3,n3,i3,$([o3,(e,t,n)=>dW(e,s3(e),c3(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var n=e.stackId,r=FL(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),CI,a3,o3,lL],(e,t,n,r,i,a,o,s,c,l)=>{var u=o.chartData,d=o.dataStartIndex,f=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var p=c.data,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return H3({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),u3=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],d3=[`id`,`baseLine`];function f3(){return f3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f3.apply(null,arguments)}function p3(e,t){if(e==null)return{};var n,r,i=m3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function m3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function h3(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!Tk(a)||!Tk(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return Z(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),Z(c)?v.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function g3(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!Tk(a)||!Tk(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return Z(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),Z(c)?v.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function _3(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?v.createElement(g3,{alpha:t,points:r,baseLine:i,strokeWidth:a}):v.createElement(h3,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function v3(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r===void 0?!1:r,a=e.isEntrance,o=a===void 0?!1:a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=p3(e,u3),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=C$(),h=d.id,g=d.baseLine,_=WS(p3(d,d3)),y=v.createElement(mP,f3({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&v.createElement(mP,f3({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:d.points})),x=l!==`none`&&c&&Array.isArray(g)&&v.createElement(mP,f3({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?v.createElement(rC,null,v.createElement(`defs`,null,v.createElement(`clipPath`,{id:m},v.createElement(_3,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),v.createElement(rC,{clipPath:`url(#${m})`},y,b,x)):v.createElement(v.Fragment,null,y,b,x)}var y3=[`id`],b3=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function x3(){return x3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x3.apply(null,arguments)}function S3(e,t){if(e==null)return{};var n,r,i=C3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function C3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function w3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?w3(Object(n),!0).forEach(function(t){E3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E3(e,t,n){return(t=D3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D3(e){var t=O3(e,`string`);return typeof t==`symbol`?t:t+``}function O3(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var k3={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:e$,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[T3(T3({},e.next),{},{x:xw(e.prev.x,e.next.x,t),y:xw(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:v3,xAxisId:0,yAxisId:0,zIndex:uL.area};function A3(e,t){return e&&e!==`none`?e:t}var j3=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:A3(r,i),value:Zk(n,t),payload:e}]},M3=v.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:Ew,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Zk(o,t),hide:s,type:u,color:A3(r,a),unit:c,formatter:l,graphicalItemId:d}};return v.createElement(GQ,{tooltipEntrySettings:f})});function N3(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=WS(r);return v.createElement(O1,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function P3(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return T3(T3({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return v.createElement(rZ,{value:t?r:void 0},n)}function F3(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,f=a.connectNulls,p=a.isRange,m=a.shape,h=a.id,g=S3(a,y3),_=T3(T3({},KS(g)),{},{id:h,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:d,isRange:p,animationElapsedTime:o,isAnimating:s,isEntrance:c});return v.createElement(v.Fragment,null,t?.length>1&&v.createElement(rC,{clipPath:r?`url(#clipPath-${i})`:void 0},v.createElement(VQ,{option:m,DefaultShape:k3.shape,shapeProps:_})),v.createElement(N3,{points:t,props:g,clipPathId:i}))}function I3(e,t,n){return Z(e)?xw(Z(t)?t:void 0,e,n):Cw(e)||mw(e)?xw(Z(t)?t:void 0,0,n):e}function L3(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,p=r.animationInterpolateFn,m=(0,v.useMemo)(()=>({points:o,baseLine:s}),[o,s]),h=c$(m,a),g=fj(),_=h$(r.onAnimationStart,r.onAnimationEnd),y=_.isAnimating,b=_.handleAnimationStart,x=_.handleAnimationEnd,S=h.startValue;if(g==null)return null;var C=Array.isArray(s)&&Array.isArray(S)?s$(S,s,f):Array.isArray(s)?s$(null,s,f):null;return v.createElement(g$,{animationInput:m,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:b,onAnimationEnd:x,animationInterpolateFn:p,animationMatchBy:f,layout:g},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?p(C,i,g):a?s:I3(s,S,i);return h.syncStepValue(c,i),v.createElement(P3,{showLabels:!y,points:o},r.children,v.createElement(F3,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:y||i<1,isEntrance:a}),v.createElement(lZ,{label:r.label}))})}function R3(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,v.useRef)(null),a=(0,v.useRef)();return v.createElement(L3,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var z3=class extends v.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,l=e.yAxisId,u=e.width,d=e.height,f=e.id,p=e.baseLine,m=e.zIndex;if(t)return null;var h=Hv(`recharts-area`,i),g=f,_=Q4(n),y=_.r,b=_.strokeWidth,x=AQ(n),S=y*2+b,C=s?`url(#clipPath-${x?``:`dots-`}${g})`:void 0;return v.createElement(iJ,{zIndex:m},v.createElement(rC,{className:h},s&&v.createElement(`defs`,null,v.createElement(Z4,{clipPathId:g,xAxisId:c,yAxisId:l}),!x&&v.createElement(`clipPath`,{id:`clipPath-dots-${g}`},v.createElement(`rect`,{x:o-S/2,y:a-S/2,width:u+S,height:d+S}))),v.createElement(R3,{needClip:s,clipPathId:g,props:this.props})),v.createElement($1,{points:r,mainColor:A3(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(p)&&v.createElement($1,{points:p,mainColor:A3(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}};function B3(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=S3(e,b3),g=dj(),_=wq(),y=X4(p,m).needClip,b=SA(),x=Q(t=>l3(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=G1();if(g!==`horizontal`&&g!==`vertical`||T==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var E=T.height,D=T.width,O=T.x,k=T.y;return!S||!S.length?null:v.createElement(z3,x3({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:f,width:D,left:O,top:k,xAxisId:p,yAxisId:m}))}var V3=(e,t,n,r,i)=>{var a=n??t;if(Z(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function H3(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=a&&a.length,g=V3(o,s,r,c,l),_=o===`horizontal`,v=!1,y=u.map((e,t)=>{var r;if(h)r=a[d+t];else{var o=Mk(e,i);Array.isArray(o)?(r=o,v=!0):r=[g,o]}var s=r?.[1]??null,u=s==null||h&&!n&&Mk(e,i)==null;return _?{x:Vk({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:u?null:l.scale.map(s)??null,value:r,payload:e}:{x:u?null:c.scale.map(s)??null,y:Vk({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:y,baseLine:(h||v?y.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return _?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):_?l.scale.map(g):c.scale.map(g))??0,isRange:v}}function U3(e){var t=Iw(e,k3),n=SA();return v.createElement(E$,{id:t.id,type:`area`},e=>v.createElement(v.Fragment,null,v.createElement(KQ,{legendPayload:j3(t)}),v.createElement(M3,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),v.createElement(I$,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Bk(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),v.createElement(B3,x3({},t,{id:e}))))}var W3=v.memo(U3,cN);W3.displayName=`Area`;var G3=[`domain`,`range`],K3=[`domain`,`range`];function q3(e,t){if(e==null)return{};var n,r,i=J3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function J3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Y3(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function X3(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=q3(e,G3),a=t.domain,o=t.range,s=q3(t,K3);return!Y3(n,a)||!Y3(r,o)?!1:cN(i,s)}var Z3=[`type`],Q3=[`dangerouslySetInnerHTML`,`ticks`,`scale`],$3=[`id`,`scale`];function e6(){return e6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e6.apply(null,arguments)}function t6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?t6(Object(n),!0).forEach(function(t){r6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r6(e,t,n){return(t=i6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i6(e){var t=a6(e,`string`);return typeof t==`symbol`?t:t+``}function a6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o6(e,t){if(e==null)return{};var n,r,i=s6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function s6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function c6(e){var t=ZT(),n=(0,v.useRef)(null),r=fj(),i=e.type,a=o6(e,Z3),o=mL(r,`xAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return n6(n6({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(I1(s)):n.current!==s&&t(L1({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(R1(n.current)),null)},[t]),null}var l6=e=>{var t=e.xAxisId,n=e.className,r=Q(bA),i=SA(),a=`xAxis`,o=Q(e=>OG(e,a,t,i)),s=Q(e=>gG(e,t)),c=Q(e=>xG(e,t)),l=Q(e=>DU(e,t));if(s==null||c==null||l==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var u=o6(e,Q3);l.id,l.scale;var d=o6(l,$3);return v.createElement(w4,e6({},u,d,{x:c.x,y:c.y,width:s.width,height:s.height,className:Hv(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},u6={allowDataOverflow:EU.allowDataOverflow,allowDecimals:EU.allowDecimals,allowDuplicatedCategory:EU.allowDuplicatedCategory,angle:EU.angle,axisLine:h4.axisLine,height:EU.height,hide:!1,includeHidden:EU.includeHidden,interval:EU.interval,label:!1,minTickGap:EU.minTickGap,mirror:EU.mirror,orientation:EU.orientation,padding:EU.padding,reversed:EU.reversed,scale:EU.scale,tick:EU.tick,tickCount:EU.tickCount,tickLine:h4.tickLine,tickSize:h4.tickSize,type:EU.type,niceTicks:EU.niceTicks,xAxisId:0},d6=v.memo(e=>{var t=Iw(e,u6);return v.createElement(v.Fragment,null,v.createElement(c6,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(l6,t))},X3);d6.displayName=`XAxis`;var f6=[`type`],p6=[`dangerouslySetInnerHTML`,`ticks`,`scale`],m6=[`id`,`scale`];function h6(){return h6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h6.apply(null,arguments)}function g6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g6(Object(n),!0).forEach(function(t){v6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v6(e,t,n){return(t=y6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y6(e){var t=b6(e,`string`);return typeof t==`symbol`?t:t+``}function b6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function x6(e,t){if(e==null)return{};var n,r,i=S6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function S6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function C6(e){var t=ZT(),n=(0,v.useRef)(null),r=fj(),i=e.type,a=x6(e,f6),o=mL(r,`yAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return _6(_6({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(z1(s)):n.current!==s&&t(B1({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(V1(n.current)),null)},[t]),null}function w6(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=Q(bA),c=SA(),l=ZT(),u=`yAxis`,d=Q(e=>CG(e,t)),f=Q(e=>SG(e,t)),p=Q(e=>OG(e,u,t,c)),m=Q(e=>AU(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||BX(i)||(0,v.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(H1({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var h=x6(e,p6);m.id,m.scale;var g=x6(m,m6);return v.createElement(w4,h6({},h,g,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:Hv(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var T6={allowDataOverflow:kU.allowDataOverflow,allowDecimals:kU.allowDecimals,allowDuplicatedCategory:kU.allowDuplicatedCategory,angle:kU.angle,axisLine:h4.axisLine,hide:!1,includeHidden:kU.includeHidden,interval:kU.interval,label:!1,minTickGap:kU.minTickGap,mirror:kU.mirror,orientation:kU.orientation,padding:kU.padding,reversed:kU.reversed,scale:kU.scale,tick:kU.tick,tickCount:kU.tickCount,tickLine:h4.tickLine,tickSize:h4.tickSize,type:kU.type,niceTicks:kU.niceTicks,width:kU.width,yAxisId:0},E6=v.memo(e=>{var t=Iw(e,T6);return v.createElement(v.Fragment,null,v.createElement(C6,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(w6,t))},X3);E6.displayName=`YAxis`;var D6=$([(e,t)=>t,uj,ML,VL,qK,YK,Oq,vA],Bq);function O6(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function k6(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(O6(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var A6=hO(`mouseClick`),j6=hk();j6.startListening({actionCreator:A6,effect:(e,t)=>{var n=e.payload,r=D6(t.getState(),k6(n));r?.activeIndex!=null&&t.dispatch(QG({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var M6=hO(`mouseMove`),N6=hk(),P6=null,F6=null,I6=null;N6.startListening({actionCreator:M6,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);P6!==null&&(cancelAnimationFrame(P6),P6=null),F6!==null&&(typeof i!=`number`||!o)&&(clearTimeout(F6),F6=null),I6=k6(n);var s=()=>{var e=t.getState(),n=IG(e,e.tooltip.settings.shared);if(!I6){P6=null,F6=null;return}if(n===`axis`){var r=D6(e,I6);r?.activeIndex==null?t.dispatch(YG()):t.dispatch(ZG({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}P6=null,F6=null};if(!o){s();return}i===`raf`?P6=requestAnimationFrame(s):typeof i==`number`&&F6===null&&(F6=setTimeout(s,i))}});function L6(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var R6={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},z6=kO({name:`rootProps`,initialState:R6,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??R6.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),B6=z6.reducer,V6=z6.actions.updateOptions,H6=kO({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),U6=H6.actions.updatePolarOptions,W6=H6.reducer,G6=hO(`keyDown`),K6=hO(`focus`),q6=hO(`blur`),J6=hk(),Y6=null,X6=null,Z6=null;J6.startListening({actionCreator:G6,effect:(e,t)=>{Z6=e.payload,Y6!==null&&(cancelAnimationFrame(Y6),Y6=null);var n=t.getState().eventSettings,r=n.throttleDelay,i=n.throttledEvents,a=i===`all`||i.includes(`keydown`);X6!==null&&(typeof r!=`number`||!a)&&(clearTimeout(X6),X6=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=Z6;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=pK(n,FK(e),cW(e),WK(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=YK(e),c=FK(e),l=IG(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=Nq(e,l,`hover`,String(n.index));t.dispatch(eK({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=MG(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=cW(e),h=WK(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(pK(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(pK(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=Nq(e,l,`hover`,String(p));t.dispatch(eK({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{Y6=null,X6=null}};if(!a){o();return}r===`raf`?Y6=requestAnimationFrame(o):typeof r==`number`&&X6===null&&(o(),Z6=null,X6=setTimeout(()=>{Z6?o():(X6=null,Y6=null)},r))}}),J6.startListening({actionCreator:K6,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;if(!r.active&&r.index==null){var i=`0`,a=Nq(n,IG(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(eK({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),J6.startListening({actionCreator:q6,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(eK({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function Q6(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var $6=hO(`externalEvent`),e8=hk(),t8=new Map,n8=new Map,r8=new Map;e8.startListening({actionCreator:$6,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=Q6(i);r8.set(a,{handler:r,reactEvent:o});var s=t8.get(a);s!==void 0&&(cancelAnimationFrame(s),t8.delete(a));var c=t.getState().eventSettings,l=c.throttleDelay,u=c.throttledEvents,d=u===`all`||u?.includes(a),f=n8.get(a);f!==void 0&&(typeof l!=`number`||!d)&&(clearTimeout(f),n8.delete(a));var p=()=>{var e=r8.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:aq(i),activeDataKey:nq(i),activeIndex:eq(i),activeLabel:tq(i),activeTooltipIndex:eq(i),isTooltipActive:oq(i)};n&&n(o,r)}finally{t8.delete(a),n8.delete(a),r8.delete(a)}};if(!d){p();return}if(l===`raf`){var m=requestAnimationFrame(p);t8.set(a,m)}else if(typeof l==`number`){if(!n8.has(a)){p();var h=setTimeout(p,l);n8.set(a,h)}}else p()}}});var i8=$([$([_K],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),a8=hO(`touchMove`),o8=hk(),s8=null,c8=null,l8=null,u8=null;o8.startListening({actionCreator:a8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){u8=Q6(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);s8!==null&&(cancelAnimationFrame(s8),s8=null),c8!==null&&(typeof i!=`number`||!o)&&(clearTimeout(c8),c8=null),l8=Array.from(n.touches).map(e=>k6({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(u8!=null){var e=t.getState(),n=IG(e,e.tooltip.settings.shared);if(n===`axis`){var r=l8?.[0];if(r==null){s8=null,c8=null;return}var i=D6(e,r);i?.activeIndex!=null&&t.dispatch(ZG({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=u8.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(oA),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=jK(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=i8(e,s,c);t.dispatch(qG({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}s8=null,c8=null}};if(!o){s();return}i===`raf`?s8=requestAnimationFrame(s):typeof i==`number`&&c8===null&&(s(),u8=null,c8=setTimeout(()=>{u8?s():(c8=null,s8=null)},i))}}});var d8={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},f8=kO({name:`eventSettings`,initialState:d8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=LM(t.payload.throttledEvents))}}}),p8=f8.actions.setEventSettings,m8=f8.reducer,h8=UE({brush:y2,cartesianAxis:U1,chartData:kJ,errorBars:Y4,eventSettings:m8,graphicalItems:F$,layout:Ck,legend:UM,options:SJ,polarAxis:HZ,polarOptions:W6,referenceElements:w2,renderedTicks:$2,rootProps:B6,tooltip:tK,zIndex:rJ}),g8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Hee({reducer:h8,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([j6.middleware,N6.middleware,J6.middleware,e8.middleware,o8.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(SO({type:`raf`}))},devTools:jN.devToolsEnabled&&{serialize:{replacer:L6},name:`recharts-${t}`}})};function _8(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=SA(),a=(0,v.useRef)(null);if(i)return n;a.current??=g8(t,r);var o=JT;return v.createElement(aN,{context:o,store:a.current},n)}function v8(e){var t=e.layout,n=e.margin,r=ZT(),i=SA();return(0,v.useEffect)(()=>{i||(r(bk(t)),r(yk(n)))},[r,i,t,n]),null}var y8=(0,v.memo)(v8,cN);function b8(e){var t=ZT();return(0,v.useEffect)(()=>{t(V6(e))},[t,e]),null}var x8=(0,v.memo)(e=>{var t=ZT();return(0,v.useEffect)(()=>{t(p8(e))},[t,e]),null},cN);function S8(e){var t=e.zIndex,n=e.isPanorama,r=(0,v.useRef)(null),i=ZT();return(0,v.useLayoutEffect)(()=>(r.current&&i(tJ({zIndex:t,element:r.current,isPanorama:n})),()=>{i(nJ({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function C8(e){var t=e.children,n=e.isPanorama,r=Q(Hq);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(S8,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(S8,{key:e,zIndex:e,isPanorama:n})))}var w8=[`children`];function T8(e,t){if(e==null)return{};var n,r,i=E8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function E8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function D8(){return D8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D8.apply(null,arguments)}var O8={width:`100%`,height:`100%`,display:`block`},k8=(0,v.forwardRef)((e,t)=>{var n=cj(),r=lj(),i=$N();if(!Ek(n)||!Ek(r))return null;var a=e.children,o=e.otherAttributes,s=e.title,c=e.desc,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),v.createElement(QS,D8({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:O8,ref:t}),a)}),A8=e=>{var t=e.children,n=Q(wA);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return v.createElement(QS,{width:r,height:i,x:o,y:a},t)},j8=(0,v.forwardRef)((e,t)=>{var n=e.children,r=T8(e,w8);return SA()?v.createElement(A8,null,v.createElement(C8,{isPanorama:!0},n)):v.createElement(k8,D8({ref:t},r),v.createElement(C8,{isPanorama:!1},n))});function M8(e,t){return L8(e)||I8(e,t)||P8(e,t)||N8()}function N8(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r4(e,t){if(e){if(typeof e==`string`)return i4(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i4(e,t):void 0}}function i4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a4(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function o4(e){if(Array.isArray(e))return e}function s4(e,t){if(e==null)return{};var n,r,i=c4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function l4(){return l4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l4.apply(null,arguments)}function u4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u4(Object(n),!0).forEach(function(t){f4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f4(e,t,n){return(t=p4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p4(e){var t=m4(e,`string`);return typeof t==`symbol`?t:t+``}function m4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var h4={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`,zIndex:uL.axis};function g4(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=e.otherSvgProps;if(!s)return null;var l=d4(d4(d4({},c),WS(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=d4(d4({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=d4(d4({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return v.createElement(`line`,l4({},l,{className:Uv(`recharts-cartesian-axis-line`,uw(s,`className`))}))}function _4(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=Z(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_;break}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function v4(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function y4(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function b4(e){var t=e.option,n=e.tickProps,r=e.value,i,a=Uv(n.className,`recharts-cartesian-axis-tick-value`);if(v.isValidElement(t))i=v.cloneElement(t,d4(d4({},n),{},{className:a}));else if(typeof t==`function`)i=t(d4(d4({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=Uv(o,UZ(t))),i=v.createElement(_X,l4({},n,{className:o}),r)}return i}function x4(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=ZT();return(0,v.useEffect)(()=>r==null||n==null?Ew:(i(Z2({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(Q2({axisId:r,axisType:n}))}),[i,t,r,n]),null}var S4=(0,v.forwardRef)((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,o=e.stroke,s=e.tickFormatter,c=e.unit,l=e.padding,u=e.tickTextProps,d=e.orientation,f=e.mirror,p=e.x,m=e.y,h=e.width,g=e.height,_=e.tickSize,y=e.tickMargin,b=e.fontSize,x=e.letterSpacing,S=e.getTicksConfig,C=e.events,w=e.axisType,T=e.axisId,E=q2(d4(d4({},S),{},{ticks:r}),b,x),D=WS(S),O=GS(i),k=oX(D.textAnchor)?D.textAnchor:v4(d,f),A=y4(d,f),j={};typeof a==`object`&&(j=a);var M=d4(d4({},D),{},{fill:`none`},j),N=E.map(e=>d4({entry:e},_4(e,p,m,h,g,d,_,f,y))),P=N.map(e=>{var t=e.entry,n=e.line;return v.createElement(rC,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},a&&v.createElement(`line`,l4({},M,n,{className:Uv(`recharts-cartesian-axis-tick-line`,uw(a,`className`))})))}),F=N.map((e,t)=>{var n=e.entry,r=e.tick,a=d4(d4({},d4(d4(d4(d4({verticalAnchor:A},D),{},{textAnchor:k,stroke:`none`,fill:o},r),{},{index:t,payload:n,visibleTicksCount:E.length,tickFormatter:s,padding:l},u),{},{angle:u?.angle??D.angle??0})),O);return v.createElement(rC,l4({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},Aw(C,n,t)),i&&v.createElement(b4,{option:i,tickProps:a,value:`${typeof s==`function`?s(n.value,t):n.value}${c||``}`}))});return v.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${w}-ticks`},v.createElement(x4,{ticks:E,axisId:T,axisType:w}),F.length>0&&v.createElement(iJ,{zIndex:uL.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${w}-tick-labels`,ref:t},F)),P.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${w}-tick-lines`},P))}),C4=(0,v.forwardRef)((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,o=e.hide,s=e.ticks,c=e.axisType,l=e.axisId,u=s4(e,e4),d=t4((0,v.useState)(``),2),f=d[0],p=d[1],m=t4((0,v.useState)(``),2),h=m[0],g=m[1],_=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>J2({ticks:_.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var y=(0,v.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);_.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==f||a!==h)&&(p(i),g(a))}}},[f,h]);return o||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(iJ,{zIndex:e.zIndex},v.createElement(rC,{className:Uv(`recharts-cartesian-axis`,a)},v.createElement(g4,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:WS(e)}),v.createElement(S4,{ref:y,axisType:c,events:u,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),v.createElement(FX,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(YX,{label:e.label,labelRef:e.labelRef}),e.children)))}),w4=v.forwardRef((e,t)=>{var n=Iw(e,h4);return v.createElement(C4,l4({},n,{ref:t}))});w4.displayName=`CartesianAxis`;var T4=[`x1`,`y1`,`x2`,`y2`,`key`],E4=[`offset`],D4=[`xAxisId`,`yAxisId`],O4=[`xAxisId`,`yAxisId`];function k4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?k4(Object(n),!0).forEach(function(t){j4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j4(e,t,n){return(t=M4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M4(e){var t=N4(e,`string`);return typeof t==`symbol`?t:t+``}function N4(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function P4(){return P4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P4.apply(null,arguments)}function F4(e,t){if(e==null)return{};var n,r,i=I4(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function I4(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var L4=e=>{var t=e.fill;if(!t||t===`none`)return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.ry;return v.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function R4(e){var t=e.option,n=e.lineItemProps,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var i=n.x1,a=n.y1,o=n.x2,s=n.y2,c=n.key,l=WS(F4(n,T4))??{};l.offset;var u=F4(l,E4);r=v.createElement(`line`,P4({},u,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function z4(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=F4(e,D4),s=a.map((e,r)=>{var a=A4(A4({},o),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${r}`,index:r});return v.createElement(R4,{key:`line-${r}`,option:i,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},s)}function B4(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=F4(e,O4),s=a.map((e,r)=>{var a=A4(A4({},o),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${r}`,index:r});return v.createElement(R4,{option:i,lineItemProps:a,key:`line-${r}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},s)}function V4(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(c===void 0||c)||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return v.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function H4(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!n||!r||!r.length)return null;var u=l.map(e=>Math.round(e+a-a)).sort((e,t)=>e-t);a!==u[0]&&u.unshift(0);var d=u.map((e,t)=>{var n=u[t+1],l=n==null?a+s-e:n-e;if(l<=0)return null;var d=t%r.length;return v.createElement(`rect`,{key:`react-${t}`,x:e,y:o,width:l,height:c,stroke:`none`,fill:r[d],fillOpacity:i,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},d)}var U4=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return Fk(q2(A4(A4(A4({},h4),n),{},{ticks:Ik(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},W4=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return Fk(q2(A4(A4(A4({},h4),n),{},{ticks:Ik(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},G4={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:uL.grid};function K4(e){var t=cj(),n=lj(),r=sj(),i=A4(A4({},Iw(e,G4)),{},{x:Z(e.x)?e.x:r.left,y:Z(e.y)?e.y:r.top,width:Z(e.width)?e.width:r.width,height:Z(e.height)?e.height:r.height}),a=i.xAxisId,o=i.yAxisId,s=i.x,c=i.y,l=i.width,u=i.height,d=i.syncWithTicks,f=i.horizontalValues,p=i.verticalValues,m=SA(),h=Q(e=>EG(e,`xAxis`,a,m)),g=Q(e=>EG(e,`yAxis`,o,m));if(!Ek(l)||!Ek(u)||!Z(s)||!Z(c))return null;var _=i.verticalCoordinatesGenerator||U4,y=i.horizontalCoordinatesGenerator||W4,b=i.horizontalPoints,x=i.verticalPoints;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?A4(A4({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);OA(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof _==`function`){var w=p&&p.length,T=_({xAxis:h?A4(A4({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);OA(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(iJ,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(L4,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(V4,P4({},i,{horizontalPoints:b})),v.createElement(H4,P4({},i,{verticalPoints:x})),v.createElement(z4,P4({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(B4,P4({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}K4.displayName=`CartesianGrid`;var q4=kO({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(e=>e.dataKey===i.dataKey&&e.direction===i.direction?a:e))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==i.dataKey||e.direction!==i.direction))}}}),J4=q4.actions;J4.addErrorBar,J4.replaceErrorBar,J4.removeErrorBar;var Y4=q4.reducer;function X4(e,t){var n=Q(t=>OU(t,e)),r=Q(e=>jU(e,t)),i=n?.allowDataOverflow??EU.allowDataOverflow,a=r?.allowDataOverflow??kU.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function Z4(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=G1(),a=X4(t,n),o=a.needClipX,s=a.needClipY,c=a.needClip,l=Q(e=>tG(e,t,!1)),u=Q(e=>nG(e,n,!1));if(!c||!i)return null;var d=i.x,f=i.y,p=i.width,m=i.height,h=o&&l?Math.min(l[0],l[1]):d-p/2,g=s&&u?Math.min(u[0],u[1]):f-m/2,_=o&&l?Math.abs(l[1]-l[0]):p*2,y=s&&u?Math.abs(u[1]-u[0]):m*2;return v.createElement(`clipPath`,{id:`clipPath-${r}`},v.createElement(`rect`,{x:h,y:g,width:_,height:y}))}function Q4(e){var t=GS(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}function $4(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function e3(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var t3=(e,t,n)=>jG(e,`xAxis`,$4(e,t),n),n3=(e,t,n)=>AG(e,`xAxis`,$4(e,t),n),r3=(e,t,n)=>jG(e,`yAxis`,e3(e,t),n),i3=(e,t,n)=>AG(e,`yAxis`,e3(e,t),n),a3=$([uj,t3,r3,n3,i3],(e,t,n,r,i)=>Pk(e,`xAxis`)?Yk(t,r,!1):Yk(n,i,!1)),o3=$([zU,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),s3=e=>Pk(uj(e),`xAxis`)?`yAxis`:`xAxis`,c3=(e,t)=>s3(e)===`yAxis`?e3(e,t):$4(e,t),l3=$([uj,t3,r3,n3,i3,$([o3,(e,t,n)=>dW(e,s3(e),c3(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var n=e.stackId,r=FL(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),CI,a3,o3,lL],(e,t,n,r,i,a,o,s,c,l)=>{var u=o.chartData,d=o.dataStartIndex,f=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var p=c.data,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return H3({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),u3=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],d3=[`id`,`baseLine`];function f3(){return f3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f3.apply(null,arguments)}function p3(e,t){if(e==null)return{};var n,r,i=m3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function m3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function h3(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!Tk(a)||!Tk(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return Z(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),Z(c)?v.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function g3(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!Tk(a)||!Tk(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return Z(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),Z(c)?v.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function _3(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?v.createElement(g3,{alpha:t,points:r,baseLine:i,strokeWidth:a}):v.createElement(h3,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function v3(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r===void 0?!1:r,a=e.isEntrance,o=a===void 0?!1:a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=p3(e,u3),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=C$(),h=d.id,g=d.baseLine,_=WS(p3(d,d3)),y=v.createElement(mP,f3({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&v.createElement(mP,f3({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:d.points})),x=l!==`none`&&c&&Array.isArray(g)&&v.createElement(mP,f3({},_,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?v.createElement(rC,null,v.createElement(`defs`,null,v.createElement(`clipPath`,{id:m},v.createElement(_3,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),v.createElement(rC,{clipPath:`url(#${m})`},y,b,x)):v.createElement(v.Fragment,null,y,b,x)}var y3=[`id`],b3=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function x3(){return x3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x3.apply(null,arguments)}function S3(e,t){if(e==null)return{};var n,r,i=C3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function C3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function w3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?w3(Object(n),!0).forEach(function(t){E3(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E3(e,t,n){return(t=D3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D3(e){var t=O3(e,`string`);return typeof t==`symbol`?t:t+``}function O3(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var k3={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:e$,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[T3(T3({},e.next),{},{x:xw(e.prev.x,e.next.x,t),y:xw(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:v3,xAxisId:0,yAxisId:0,zIndex:uL.area};function A3(e,t){return e&&e!==`none`?e:t}var j3=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:A3(r,i),value:Zk(n,t),payload:e}]},M3=v.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:Ew,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Zk(o,t),hide:s,type:u,color:A3(r,a),unit:c,formatter:l,graphicalItemId:d}};return v.createElement(GQ,{tooltipEntrySettings:f})});function N3(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=WS(r);return v.createElement(O1,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function P3(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return T3(T3({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return v.createElement(rZ,{value:t?r:void 0},n)}function F3(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,f=a.connectNulls,p=a.isRange,m=a.shape,h=a.id,g=S3(a,y3),_=T3(T3({},KS(g)),{},{id:h,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:d,isRange:p,animationElapsedTime:o,isAnimating:s,isEntrance:c});return v.createElement(v.Fragment,null,t?.length>1&&v.createElement(rC,{clipPath:r?`url(#clipPath-${i})`:void 0},v.createElement(VQ,{option:m,DefaultShape:k3.shape,shapeProps:_})),v.createElement(N3,{points:t,props:g,clipPathId:i}))}function I3(e,t,n){return Z(e)?xw(Z(t)?t:void 0,e,n):Cw(e)||mw(e)?xw(Z(t)?t:void 0,0,n):e}function L3(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,p=r.animationInterpolateFn,m=(0,v.useMemo)(()=>({points:o,baseLine:s}),[o,s]),h=c$(m,a),g=fj(),_=h$(r.onAnimationStart,r.onAnimationEnd),y=_.isAnimating,b=_.handleAnimationStart,x=_.handleAnimationEnd,S=h.startValue;if(g==null)return null;var C=Array.isArray(s)&&Array.isArray(S)?s$(S,s,f):Array.isArray(s)?s$(null,s,f):null;return v.createElement(g$,{animationInput:m,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:b,onAnimationEnd:x,animationInterpolateFn:p,animationMatchBy:f,layout:g},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?p(C,i,g):a?s:I3(s,S,i);return h.syncStepValue(c,i),v.createElement(P3,{showLabels:!y,points:o},r.children,v.createElement(F3,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:y||i<1,isEntrance:a}),v.createElement(lZ,{label:r.label}))})}function R3(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,v.useRef)(null),a=(0,v.useRef)();return v.createElement(L3,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var z3=class extends v.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,l=e.yAxisId,u=e.width,d=e.height,f=e.id,p=e.baseLine,m=e.zIndex;if(t)return null;var h=Uv(`recharts-area`,i),g=f,_=Q4(n),y=_.r,b=_.strokeWidth,x=AQ(n),S=y*2+b,C=s?`url(#clipPath-${x?``:`dots-`}${g})`:void 0;return v.createElement(iJ,{zIndex:m},v.createElement(rC,{className:h},s&&v.createElement(`defs`,null,v.createElement(Z4,{clipPathId:g,xAxisId:c,yAxisId:l}),!x&&v.createElement(`clipPath`,{id:`clipPath-dots-${g}`},v.createElement(`rect`,{x:o-S/2,y:a-S/2,width:u+S,height:d+S}))),v.createElement(R3,{needClip:s,clipPathId:g,props:this.props})),v.createElement($1,{points:r,mainColor:A3(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(p)&&v.createElement($1,{points:p,mainColor:A3(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}};function B3(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=S3(e,b3),g=dj(),_=wq(),y=X4(p,m).needClip,b=SA(),x=Q(t=>l3(t,e.id,b))??{},S=x.points,C=x.isRange,w=x.baseLine,T=G1();if(g!==`horizontal`&&g!==`vertical`||T==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var E=T.height,D=T.width,O=T.x,k=T.y;return!S||!S.length?null:v.createElement(z3,x3({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:w,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:E,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:f,width:D,left:O,top:k,xAxisId:p,yAxisId:m}))}var V3=(e,t,n,r,i)=>{var a=n??t;if(Z(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function H3(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=a&&a.length,g=V3(o,s,r,c,l),_=o===`horizontal`,v=!1,y=u.map((e,t)=>{var r;if(h)r=a[d+t];else{var o=Mk(e,i);Array.isArray(o)?(r=o,v=!0):r=[g,o]}var s=r?.[1]??null,u=s==null||h&&!n&&Mk(e,i)==null;return _?{x:Vk({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:u?null:l.scale.map(s)??null,value:r,payload:e}:{x:u?null:c.scale.map(s)??null,y:Vk({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:y,baseLine:(h||v?y.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return _?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):_?l.scale.map(g):c.scale.map(g))??0,isRange:v}}function U3(e){var t=Iw(e,k3),n=SA();return v.createElement(E$,{id:t.id,type:`area`},e=>v.createElement(v.Fragment,null,v.createElement(KQ,{legendPayload:j3(t)}),v.createElement(M3,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),v.createElement(I$,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Bk(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),v.createElement(B3,x3({},t,{id:e}))))}var W3=v.memo(U3,cN);W3.displayName=`Area`;var G3=[`domain`,`range`],K3=[`domain`,`range`];function q3(e,t){if(e==null)return{};var n,r,i=J3(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function J3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Y3(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function X3(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=q3(e,G3),a=t.domain,o=t.range,s=q3(t,K3);return!Y3(n,a)||!Y3(r,o)?!1:cN(i,s)}var Z3=[`type`],Q3=[`dangerouslySetInnerHTML`,`ticks`,`scale`],$3=[`id`,`scale`];function e6(){return e6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e6.apply(null,arguments)}function t6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?t6(Object(n),!0).forEach(function(t){r6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r6(e,t,n){return(t=i6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i6(e){var t=a6(e,`string`);return typeof t==`symbol`?t:t+``}function a6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o6(e,t){if(e==null)return{};var n,r,i=s6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function s6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function c6(e){var t=ZT(),n=(0,v.useRef)(null),r=fj(),i=e.type,a=o6(e,Z3),o=mL(r,`xAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return n6(n6({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(I1(s)):n.current!==s&&t(L1({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(R1(n.current)),null)},[t]),null}var l6=e=>{var t=e.xAxisId,n=e.className,r=Q(bA),i=SA(),a=`xAxis`,o=Q(e=>OG(e,a,t,i)),s=Q(e=>gG(e,t)),c=Q(e=>xG(e,t)),l=Q(e=>DU(e,t));if(s==null||c==null||l==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var u=o6(e,Q3);l.id,l.scale;var d=o6(l,$3);return v.createElement(w4,e6({},u,d,{x:c.x,y:c.y,width:s.width,height:s.height,className:Uv(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},u6={allowDataOverflow:EU.allowDataOverflow,allowDecimals:EU.allowDecimals,allowDuplicatedCategory:EU.allowDuplicatedCategory,angle:EU.angle,axisLine:h4.axisLine,height:EU.height,hide:!1,includeHidden:EU.includeHidden,interval:EU.interval,label:!1,minTickGap:EU.minTickGap,mirror:EU.mirror,orientation:EU.orientation,padding:EU.padding,reversed:EU.reversed,scale:EU.scale,tick:EU.tick,tickCount:EU.tickCount,tickLine:h4.tickLine,tickSize:h4.tickSize,type:EU.type,niceTicks:EU.niceTicks,xAxisId:0},d6=v.memo(e=>{var t=Iw(e,u6);return v.createElement(v.Fragment,null,v.createElement(c6,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(l6,t))},X3);d6.displayName=`XAxis`;var f6=[`type`],p6=[`dangerouslySetInnerHTML`,`ticks`,`scale`],m6=[`id`,`scale`];function h6(){return h6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h6.apply(null,arguments)}function g6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g6(Object(n),!0).forEach(function(t){v6(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v6(e,t,n){return(t=y6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y6(e){var t=b6(e,`string`);return typeof t==`symbol`?t:t+``}function b6(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function x6(e,t){if(e==null)return{};var n,r,i=S6(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function S6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function C6(e){var t=ZT(),n=(0,v.useRef)(null),r=fj(),i=e.type,a=x6(e,f6),o=mL(r,`yAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return _6(_6({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(z1(s)):n.current!==s&&t(B1({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(V1(n.current)),null)},[t]),null}function w6(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=Q(bA),c=SA(),l=ZT(),u=`yAxis`,d=Q(e=>CG(e,t)),f=Q(e=>SG(e,t)),p=Q(e=>OG(e,u,t,c)),m=Q(e=>AU(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||BX(i)||(0,v.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(H1({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var h=x6(e,p6);m.id,m.scale;var g=x6(m,m6);return v.createElement(w4,h6({},h,g,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:Uv(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var T6={allowDataOverflow:kU.allowDataOverflow,allowDecimals:kU.allowDecimals,allowDuplicatedCategory:kU.allowDuplicatedCategory,angle:kU.angle,axisLine:h4.axisLine,hide:!1,includeHidden:kU.includeHidden,interval:kU.interval,label:!1,minTickGap:kU.minTickGap,mirror:kU.mirror,orientation:kU.orientation,padding:kU.padding,reversed:kU.reversed,scale:kU.scale,tick:kU.tick,tickCount:kU.tickCount,tickLine:h4.tickLine,tickSize:h4.tickSize,type:kU.type,niceTicks:kU.niceTicks,width:kU.width,yAxisId:0},E6=v.memo(e=>{var t=Iw(e,T6);return v.createElement(v.Fragment,null,v.createElement(C6,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(w6,t))},X3);E6.displayName=`YAxis`;var D6=$([(e,t)=>t,uj,ML,VL,qK,YK,Oq,vA],Bq);function O6(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function k6(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(O6(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var A6=hO(`mouseClick`),j6=hk();j6.startListening({actionCreator:A6,effect:(e,t)=>{var n=e.payload,r=D6(t.getState(),k6(n));r?.activeIndex!=null&&t.dispatch(QG({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var M6=hO(`mouseMove`),N6=hk(),P6=null,F6=null,I6=null;N6.startListening({actionCreator:M6,effect:(e,t)=>{var n=e.payload,r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a?.includes(`mousemove`);P6!==null&&(cancelAnimationFrame(P6),P6=null),F6!==null&&(typeof i!=`number`||!o)&&(clearTimeout(F6),F6=null),I6=k6(n);var s=()=>{var e=t.getState(),n=IG(e,e.tooltip.settings.shared);if(!I6){P6=null,F6=null;return}if(n===`axis`){var r=D6(e,I6);r?.activeIndex==null?t.dispatch(YG()):t.dispatch(ZG({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}P6=null,F6=null};if(!o){s();return}i===`raf`?P6=requestAnimationFrame(s):typeof i==`number`&&F6===null&&(F6=setTimeout(s,i))}});function L6(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var R6={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},z6=kO({name:`rootProps`,initialState:R6,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??R6.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),B6=z6.reducer,V6=z6.actions.updateOptions,H6=kO({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),U6=H6.actions.updatePolarOptions,W6=H6.reducer,G6=hO(`keyDown`),K6=hO(`focus`),q6=hO(`blur`),J6=hk(),Y6=null,X6=null,Z6=null;J6.startListening({actionCreator:G6,effect:(e,t)=>{Z6=e.payload,Y6!==null&&(cancelAnimationFrame(Y6),Y6=null);var n=t.getState().eventSettings,r=n.throttleDelay,i=n.throttledEvents,a=i===`all`||i.includes(`keydown`);X6!==null&&(typeof r!=`number`||!a)&&(clearTimeout(X6),X6=null);var o=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var n=e.tooltip.keyboardInteraction,r=Z6;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=pK(n,FK(e),cW(e),WK(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=YK(e),c=FK(e),l=IG(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=Nq(e,l,`hover`,String(n.index));t.dispatch(eK({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=MG(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=cW(e),h=WK(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(pK(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(pK(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=Nq(e,l,`hover`,String(p));t.dispatch(eK({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{Y6=null,X6=null}};if(!a){o();return}r===`raf`?Y6=requestAnimationFrame(o):typeof r==`number`&&X6===null&&(o(),Z6=null,X6=setTimeout(()=>{Z6?o():(X6=null,Y6=null)},r))}}),J6.startListening({actionCreator:K6,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;if(!r.active&&r.index==null){var i=`0`,a=Nq(n,IG(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(eK({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),J6.startListening({actionCreator:q6,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var r=n.tooltip.keyboardInteraction;r.active&&t.dispatch(eK({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function Q6(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var $6=hO(`externalEvent`),e8=hk(),t8=new Map,n8=new Map,r8=new Map;e8.startListening({actionCreator:$6,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,o=Q6(i);r8.set(a,{handler:r,reactEvent:o});var s=t8.get(a);s!==void 0&&(cancelAnimationFrame(s),t8.delete(a));var c=t.getState().eventSettings,l=c.throttleDelay,u=c.throttledEvents,d=u===`all`||u?.includes(a),f=n8.get(a);f!==void 0&&(typeof l!=`number`||!d)&&(clearTimeout(f),n8.delete(a));var p=()=>{var e=r8.get(a);try{if(!e)return;var n=e.handler,r=e.reactEvent,i=t.getState(),o={activeCoordinate:aq(i),activeDataKey:nq(i),activeIndex:eq(i),activeLabel:tq(i),activeTooltipIndex:eq(i),isTooltipActive:oq(i)};n&&n(o,r)}finally{t8.delete(a),n8.delete(a),r8.delete(a)}};if(!d){p();return}if(l===`raf`){var m=requestAnimationFrame(p);t8.set(a,m)}else if(typeof l==`number`){if(!n8.has(a)){p();var h=setTimeout(p,l);n8.set(a,h)}}else p()}}});var i8=$([$([_K],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),a8=hO(`touchMove`),o8=hk(),s8=null,c8=null,l8=null,u8=null;o8.startListening({actionCreator:a8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){u8=Q6(n);var r=t.getState().eventSettings,i=r.throttleDelay,a=r.throttledEvents,o=a===`all`||a.includes(`touchmove`);s8!==null&&(cancelAnimationFrame(s8),s8=null),c8!==null&&(typeof i!=`number`||!o)&&(clearTimeout(c8),c8=null),l8=Array.from(n.touches).map(e=>k6({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var s=()=>{if(u8!=null){var e=t.getState(),n=IG(e,e.tooltip.settings.shared);if(n===`axis`){var r=l8?.[0];if(r==null){s8=null,c8=null;return}var i=D6(e,r);i?.activeIndex!=null&&t.dispatch(ZG({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=u8.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(oA),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=jK(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var u=l.dataKey,d=i8(e,s,c);t.dispatch(qG({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}s8=null,c8=null}};if(!o){s();return}i===`raf`?s8=requestAnimationFrame(s):typeof i==`number`&&c8===null&&(s(),u8=null,c8=setTimeout(()=>{u8?s():(c8=null,s8=null)},i))}}});var d8={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},f8=kO({name:`eventSettings`,initialState:d8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=LM(t.payload.throttledEvents))}}}),p8=f8.actions.setEventSettings,m8=f8.reducer,h8=UE({brush:y2,cartesianAxis:U1,chartData:kJ,errorBars:Y4,eventSettings:m8,graphicalItems:F$,layout:Ck,legend:UM,options:SJ,polarAxis:HZ,polarOptions:W6,referenceElements:w2,renderedTicks:$2,rootProps:B6,tooltip:tK,zIndex:rJ}),g8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Hee({reducer:h8,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([j6.middleware,N6.middleware,J6.middleware,e8.middleware,o8.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(SO({type:`raf`}))},devTools:jN.devToolsEnabled&&{serialize:{replacer:L6},name:`recharts-${t}`}})};function _8(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=SA(),a=(0,v.useRef)(null);if(i)return n;a.current??=g8(t,r);var o=JT;return v.createElement(aN,{context:o,store:a.current},n)}function v8(e){var t=e.layout,n=e.margin,r=ZT(),i=SA();return(0,v.useEffect)(()=>{i||(r(bk(t)),r(yk(n)))},[r,i,t,n]),null}var y8=(0,v.memo)(v8,cN);function b8(e){var t=ZT();return(0,v.useEffect)(()=>{t(V6(e))},[t,e]),null}var x8=(0,v.memo)(e=>{var t=ZT();return(0,v.useEffect)(()=>{t(p8(e))},[t,e]),null},cN);function S8(e){var t=e.zIndex,n=e.isPanorama,r=(0,v.useRef)(null),i=ZT();return(0,v.useLayoutEffect)(()=>(r.current&&i(tJ({zIndex:t,element:r.current,isPanorama:n})),()=>{i(nJ({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function C8(e){var t=e.children,n=e.isPanorama,r=Q(Hq);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(S8,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(S8,{key:e,zIndex:e,isPanorama:n})))}var w8=[`children`];function T8(e,t){if(e==null)return{};var n,r,i=E8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function E8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function D8(){return D8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D8.apply(null,arguments)}var O8={width:`100%`,height:`100%`,display:`block`},k8=(0,v.forwardRef)((e,t)=>{var n=cj(),r=lj(),i=$N();if(!Ek(n)||!Ek(r))return null;var a=e.children,o=e.otherAttributes,s=e.title,c=e.desc,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),v.createElement(QS,D8({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:O8,ref:t}),a)}),A8=e=>{var t=e.children,n=Q(wA);if(!n)return null;var r=n.width,i=n.height,a=n.y,o=n.x;return v.createElement(QS,{width:r,height:i,x:o,y:a},t)},j8=(0,v.forwardRef)((e,t)=>{var n=e.children,r=T8(e,w8);return SA()?v.createElement(A8,null,v.createElement(C8,{isPanorama:!0},n)):v.createElement(k8,D8({ref:t},r),v.createElement(C8,{isPanorama:!1},n))});function M8(e,t){return L8(e)||I8(e,t)||P8(e,t)||N8()}function N8(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
132
132
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P8(e,t){if(e){if(typeof e==`string`)return F8(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F8(e,t):void 0}}function F8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I8(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function L8(e){if(Array.isArray(e))return e}function R8(){var e=ZT(),t=M8((0,v.useState)(null),2),n=t[0],r=t[1],i=Q(nA);return(0,v.useEffect)(()=>{if(n!=null){var t=n.getBoundingClientRect().width/n.offsetWidth;Tk(t)&&t!==i&&e(Sk(t))}},[n,e,i]),r}function z8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z8(Object(n),!0).forEach(function(t){V8(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V8(e,t,n){return(t=H8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H8(e){var t=U8(e,`string`);return typeof t==`symbol`?t:t+``}function U8(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function W8(){return W8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W8.apply(null,arguments)}function G8(e,t){return X8(e)||Y8(e,t)||q8(e,t)||K8()}function K8(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
133
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q8(e,t){if(e){if(typeof e==`string`)return J8(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J8(e,t):void 0}}function J8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y8(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function X8(e){if(Array.isArray(e))return e}var Z8=()=>(BJ(),null);function Q8(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var $8=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),r=G8((0,v.useState)({containerWidth:Q8(e.style?.width),containerHeight:Q8(e.style?.height)}),2),i=r[0],a=r[1],o=(0,v.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var r=e.getBoundingClientRect(),i=r.width,a=r.height;o(i,a);var s=new ResizeObserver(e=>{var t=e[0];if(t!=null){var n=t.contentRect,r=n.width,i=n.height;o(r,i)}});s.observe(e),n.current=s}},[t,o]);return(0,v.useEffect)(()=>()=>{n.current?.disconnect()},[o]),v.createElement(v.Fragment,null,v.createElement(gj,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,W8({ref:s},e)))}),e5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=G8((0,v.useState)({containerWidth:Q8(n),containerHeight:Q8(r)}),2),a=i[0],o=i[1],s=(0,v.useCallback)((e,t)=>{o(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),c=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var n=e.getBoundingClientRect(),r=n.width,i=n.height;s(r,i)}},[t,s]);return v.createElement(v.Fragment,null,v.createElement(gj,{width:a.containerWidth,height:a.containerHeight}),v.createElement(`div`,W8({ref:c},e)))}),t5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return v.createElement(v.Fragment,null,v.createElement(gj,{width:n,height:r}),v.createElement(`div`,W8({ref:t},e)))}),n5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?v.createElement(e5,W8({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(t5,W8({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(gj,{width:n,height:r}),v.createElement(`div`,W8({ref:t},e)))});function r5(e){return e?$8:n5}var i5=(0,v.forwardRef)((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,l=e.onMouseEnter,u=e.onMouseLeave,d=e.onMouseMove,f=e.onMouseUp,p=e.onTouchEnd,m=e.onTouchMove,h=e.onTouchStart,g=e.style,_=e.width,y=e.responsive,b=e.dispatchTouchEvents,x=b===void 0?!0:b,S=(0,v.useRef)(null),C=ZT(),w=G8((0,v.useState)(null),2),T=w[0],E=w[1],D=G8((0,v.useState)(null),2),O=D[0],k=D[1],A=R8(),j=tj(),M=j?.width>0?j.width:_,N=j?.height>0?j.height:i,P=(0,v.useCallback)(e=>{A(e),typeof t==`function`&&t(e),E(e),k(e),e!=null&&(S.current=e)},[A,t,E,k]),F=(0,v.useCallback)(e=>{C(A6(e)),C($6({handler:a,reactEvent:e}))},[C,a]),I=(0,v.useCallback)(e=>{C(M6(e)),C($6({handler:l,reactEvent:e}))},[C,l]),L=(0,v.useCallback)(e=>{C(YG()),C($6({handler:u,reactEvent:e}))},[C,u]),R=(0,v.useCallback)(e=>{C(M6(e)),C($6({handler:d,reactEvent:e}))},[C,d]),ee=(0,v.useCallback)(()=>{C(K6())},[C]),te=(0,v.useCallback)(()=>{C(q6())},[C]),z=(0,v.useCallback)(e=>{C(G6(e.key))},[C]),B=(0,v.useCallback)(e=>{C($6({handler:o,reactEvent:e}))},[C,o]),V=(0,v.useCallback)(e=>{C($6({handler:s,reactEvent:e}))},[C,s]),ne=(0,v.useCallback)(e=>{C($6({handler:c,reactEvent:e}))},[C,c]),re=(0,v.useCallback)(e=>{C($6({handler:f,reactEvent:e}))},[C,f]),ie=(0,v.useCallback)(e=>{C($6({handler:h,reactEvent:e}))},[C,h]),ae=(0,v.useCallback)(e=>{x&&C(a8(e)),C($6({handler:m,reactEvent:e}))},[C,x,m]),oe=(0,v.useCallback)(e=>{C($6({handler:p,reactEvent:e}))},[C,p]),se=r5(y);return v.createElement(mJ.Provider,{value:T},v.createElement(iC.Provider,{value:O},v.createElement(se,{width:M??g?.width,height:N??g?.height,className:Hv(`recharts-wrapper`,r),style:B8({position:`relative`,cursor:`default`,width:M,height:N},g),onClick:F,onContextMenu:B,onDoubleClick:V,onFocus:ee,onBlur:te,onKeyDown:z,onMouseDown:ne,onMouseEnter:I,onMouseLeave:L,onMouseMove:R,onMouseUp:re,onTouchEnd:oe,onTouchMove:ae,onTouchStart:ie,ref:P},v.createElement(Z8,null),n)))}),a5=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function o5(e,t){if(e==null)return{};var n,r,i=s5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function s5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var c5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=WS(o5(e,a5));return c?v.createElement(v.Fragment,null,v.createElement(gj,{width:n,height:r}),v.createElement(j8,{otherAttributes:d,title:l,desc:u},a)):v.createElement(i5,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(j8,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(M2,null,a)))});function l5(){return l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l5.apply(null,arguments)}function u5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u5(Object(n),!0).forEach(function(t){f5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f5(e,t,n){return(t=p5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p5(e){var t=m5(e,`string`);return typeof t==`symbol`?t:t+``}function m5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var h5=d5({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},d8),g5=(0,v.forwardRef)(function(e,t){var n=Iw(e.categoricalChartProps,h5),r=e.chartName,i=e.defaultTooltipEventType,a=e.validateTooltipEventTypes,o=e.tooltipPayloadSearcher,s=e.categoricalChartProps,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return v.createElement(_8,{preloadedState:{options:c},reduxStoreName:s.id??r},v.createElement(g2,{chartData:s.data}),v.createElement(y8,{layout:n.layout,margin:n.margin}),v.createElement(x8,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(b8,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(c5,l5({},n,{ref:t})))});function _5(e){var t=ZT();return(0,v.useEffect)(()=>{t(U6(e))},[t,e]),null}var v5=[`layout`];function y5(){return y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y5.apply(null,arguments)}function b5(e,t){if(e==null)return{};var n,r,i=x5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function S5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?S5(Object(n),!0).forEach(function(t){w5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w5(e,t,n){return(t=T5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T5(e){var t=E5(e,`string`);return typeof t==`symbol`?t:t+``}function E5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var D5=C5({accessibilityLayer:!0,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`,layout:`radial`,responsive:!1,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`},d8),O5=(0,v.forwardRef)(function(e,t){var n=Iw(e.categoricalChartProps,D5),r=n.layout,i=b5(n,v5),a=e.chartName,o={chartName:a,defaultTooltipEventType:e.defaultTooltipEventType,validateTooltipEventTypes:e.validateTooltipEventTypes,tooltipPayloadSearcher:e.tooltipPayloadSearcher,eventEmitter:void 0};return v.createElement(_8,{preloadedState:{options:o},reduxStoreName:n.id??a},v.createElement(g2,{chartData:n.data}),v.createElement(y8,{layout:r,margin:n.margin}),v.createElement(x8,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(b8,{baseValue:void 0,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(_5,{cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius}),v.createElement(c5,y5({},i,{ref:t})))});function k5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?k5(Object(n),!0).forEach(function(t){j5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j5(e,t,n){return(t=M5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M5(e){var t=N5(e,`string`);return typeof t==`symbol`?t:t+``}function N5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var P5=[`item`],F5=A5(A5({},D5),{},{layout:`centric`,startAngle:0,endAngle:360}),I5=(0,v.forwardRef)((e,t)=>{var n=Iw(e,F5);return v.createElement(O5,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:P5,tooltipPayloadSearcher:bJ,categoricalChartProps:n,ref:t})}),L5=[`axis`],R5=(0,v.forwardRef)((e,t)=>v.createElement(g5,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:L5,tooltipPayloadSearcher:bJ,categoricalChartProps:e,ref:t}));function z5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z5(Object(n),!0).forEach(function(t){V5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V5(e,t,n){return(t=H5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H5(e){var t=U5(e,`string`);return typeof t==`symbol`?t:t+``}function U5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var W5=[`axis`,`item`],G5=B5(B5({},D5),{},{layout:`radial`,startAngle:0,endAngle:360}),K5=(0,v.forwardRef)((e,t)=>{var n=Iw(e,G5);return v.createElement(O5,{chartName:`RadialBarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:W5,tooltipPayloadSearcher:bJ,categoricalChartProps:n,ref:t})}),q5={light:``,dark:`.dark`},J5={width:320,height:200},Y5=v.createContext(null);function X5(){let e=v.useContext(Y5);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function Z5({id:e,className:t,children:n,config:r,initialDimension:i=J5,...a}){let o=v.useId(),s=`chart-${e??o.replace(/:/g,``)}`;return(0,W.jsx)(Y5.Provider,{value:{config:r},children:(0,W.jsxs)(`div`,{"data-slot":`chart`,"data-chart":s,className:J(`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-hidden [&_.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]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,t),...a,children:[(0,W.jsx)(Q5,{id:s,config:r}),(0,W.jsx)(rj,{initialDimension:i,children:n})]})})}function Q5({id:e,config:t}){let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(q5).map(([t,r])=>`
|
|
133
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q8(e,t){if(e){if(typeof e==`string`)return J8(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J8(e,t):void 0}}function J8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y8(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function X8(e){if(Array.isArray(e))return e}var Z8=()=>(BJ(),null);function Q8(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var $8=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),r=G8((0,v.useState)({containerWidth:Q8(e.style?.width),containerHeight:Q8(e.style?.height)}),2),i=r[0],a=r[1],o=(0,v.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var r=e.getBoundingClientRect(),i=r.width,a=r.height;o(i,a);var s=new ResizeObserver(e=>{var t=e[0];if(t!=null){var n=t.contentRect,r=n.width,i=n.height;o(r,i)}});s.observe(e),n.current=s}},[t,o]);return(0,v.useEffect)(()=>()=>{n.current?.disconnect()},[o]),v.createElement(v.Fragment,null,v.createElement(gj,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,W8({ref:s},e)))}),e5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=G8((0,v.useState)({containerWidth:Q8(n),containerHeight:Q8(r)}),2),a=i[0],o=i[1],s=(0,v.useCallback)((e,t)=>{o(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),c=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var n=e.getBoundingClientRect(),r=n.width,i=n.height;s(r,i)}},[t,s]);return v.createElement(v.Fragment,null,v.createElement(gj,{width:a.containerWidth,height:a.containerHeight}),v.createElement(`div`,W8({ref:c},e)))}),t5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return v.createElement(v.Fragment,null,v.createElement(gj,{width:n,height:r}),v.createElement(`div`,W8({ref:t},e)))}),n5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height;return typeof n==`string`||typeof r==`string`?v.createElement(e5,W8({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(t5,W8({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(gj,{width:n,height:r}),v.createElement(`div`,W8({ref:t},e)))});function r5(e){return e?$8:n5}var i5=(0,v.forwardRef)((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,l=e.onMouseEnter,u=e.onMouseLeave,d=e.onMouseMove,f=e.onMouseUp,p=e.onTouchEnd,m=e.onTouchMove,h=e.onTouchStart,g=e.style,_=e.width,y=e.responsive,b=e.dispatchTouchEvents,x=b===void 0?!0:b,S=(0,v.useRef)(null),C=ZT(),w=G8((0,v.useState)(null),2),T=w[0],E=w[1],D=G8((0,v.useState)(null),2),O=D[0],k=D[1],A=R8(),j=tj(),M=j?.width>0?j.width:_,N=j?.height>0?j.height:i,P=(0,v.useCallback)(e=>{A(e),typeof t==`function`&&t(e),E(e),k(e),e!=null&&(S.current=e)},[A,t,E,k]),F=(0,v.useCallback)(e=>{C(A6(e)),C($6({handler:a,reactEvent:e}))},[C,a]),I=(0,v.useCallback)(e=>{C(M6(e)),C($6({handler:l,reactEvent:e}))},[C,l]),L=(0,v.useCallback)(e=>{C(YG()),C($6({handler:u,reactEvent:e}))},[C,u]),R=(0,v.useCallback)(e=>{C(M6(e)),C($6({handler:d,reactEvent:e}))},[C,d]),ee=(0,v.useCallback)(()=>{C(K6())},[C]),te=(0,v.useCallback)(()=>{C(q6())},[C]),z=(0,v.useCallback)(e=>{C(G6(e.key))},[C]),B=(0,v.useCallback)(e=>{C($6({handler:o,reactEvent:e}))},[C,o]),V=(0,v.useCallback)(e=>{C($6({handler:s,reactEvent:e}))},[C,s]),ne=(0,v.useCallback)(e=>{C($6({handler:c,reactEvent:e}))},[C,c]),re=(0,v.useCallback)(e=>{C($6({handler:f,reactEvent:e}))},[C,f]),ie=(0,v.useCallback)(e=>{C($6({handler:h,reactEvent:e}))},[C,h]),ae=(0,v.useCallback)(e=>{x&&C(a8(e)),C($6({handler:m,reactEvent:e}))},[C,x,m]),oe=(0,v.useCallback)(e=>{C($6({handler:p,reactEvent:e}))},[C,p]),se=r5(y);return v.createElement(mJ.Provider,{value:T},v.createElement(iC.Provider,{value:O},v.createElement(se,{width:M??g?.width,height:N??g?.height,className:Uv(`recharts-wrapper`,r),style:B8({position:`relative`,cursor:`default`,width:M,height:N},g),onClick:F,onContextMenu:B,onDoubleClick:V,onFocus:ee,onBlur:te,onKeyDown:z,onMouseDown:ne,onMouseEnter:I,onMouseLeave:L,onMouseMove:R,onMouseUp:re,onTouchEnd:oe,onTouchMove:ae,onTouchStart:ie,ref:P},v.createElement(Z8,null),n)))}),a5=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function o5(e,t){if(e==null)return{};var n,r,i=s5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function s5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var c5=(0,v.forwardRef)((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,o=e.className,s=e.style,c=e.compact,l=e.title,u=e.desc,d=WS(o5(e,a5));return c?v.createElement(v.Fragment,null,v.createElement(gj,{width:n,height:r}),v.createElement(j8,{otherAttributes:d,title:l,desc:u},a)):v.createElement(i5,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(j8,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(M2,null,a)))});function l5(){return l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l5.apply(null,arguments)}function u5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u5(Object(n),!0).forEach(function(t){f5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f5(e,t,n){return(t=p5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p5(e){var t=m5(e,`string`);return typeof t==`symbol`?t:t+``}function m5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var h5=d5({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},d8),g5=(0,v.forwardRef)(function(e,t){var n=Iw(e.categoricalChartProps,h5),r=e.chartName,i=e.defaultTooltipEventType,a=e.validateTooltipEventTypes,o=e.tooltipPayloadSearcher,s=e.categoricalChartProps,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return v.createElement(_8,{preloadedState:{options:c},reduxStoreName:s.id??r},v.createElement(g2,{chartData:s.data}),v.createElement(y8,{layout:n.layout,margin:n.margin}),v.createElement(x8,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(b8,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(c5,l5({},n,{ref:t})))});function _5(e){var t=ZT();return(0,v.useEffect)(()=>{t(U6(e))},[t,e]),null}var v5=[`layout`];function y5(){return y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y5.apply(null,arguments)}function b5(e,t){if(e==null)return{};var n,r,i=x5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function S5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?S5(Object(n),!0).forEach(function(t){w5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w5(e,t,n){return(t=T5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T5(e){var t=E5(e,`string`);return typeof t==`symbol`?t:t+``}function E5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var D5=C5({accessibilityLayer:!0,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`,layout:`radial`,responsive:!1,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`},d8),O5=(0,v.forwardRef)(function(e,t){var n=Iw(e.categoricalChartProps,D5),r=n.layout,i=b5(n,v5),a=e.chartName,o={chartName:a,defaultTooltipEventType:e.defaultTooltipEventType,validateTooltipEventTypes:e.validateTooltipEventTypes,tooltipPayloadSearcher:e.tooltipPayloadSearcher,eventEmitter:void 0};return v.createElement(_8,{preloadedState:{options:o},reduxStoreName:n.id??a},v.createElement(g2,{chartData:n.data}),v.createElement(y8,{layout:r,margin:n.margin}),v.createElement(x8,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(b8,{baseValue:void 0,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(_5,{cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius}),v.createElement(c5,y5({},i,{ref:t})))});function k5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function A5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?k5(Object(n),!0).forEach(function(t){j5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j5(e,t,n){return(t=M5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M5(e){var t=N5(e,`string`);return typeof t==`symbol`?t:t+``}function N5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var P5=[`item`],F5=A5(A5({},D5),{},{layout:`centric`,startAngle:0,endAngle:360}),I5=(0,v.forwardRef)((e,t)=>{var n=Iw(e,F5);return v.createElement(O5,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:P5,tooltipPayloadSearcher:bJ,categoricalChartProps:n,ref:t})}),L5=[`axis`],R5=(0,v.forwardRef)((e,t)=>v.createElement(g5,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:L5,tooltipPayloadSearcher:bJ,categoricalChartProps:e,ref:t}));function z5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z5(Object(n),!0).forEach(function(t){V5(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V5(e,t,n){return(t=H5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H5(e){var t=U5(e,`string`);return typeof t==`symbol`?t:t+``}function U5(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var W5=[`axis`,`item`],G5=B5(B5({},D5),{},{layout:`radial`,startAngle:0,endAngle:360}),K5=(0,v.forwardRef)((e,t)=>{var n=Iw(e,G5);return v.createElement(O5,{chartName:`RadialBarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:W5,tooltipPayloadSearcher:bJ,categoricalChartProps:n,ref:t})}),q5={light:``,dark:`.dark`},J5={width:320,height:200},Y5=v.createContext(null);function X5(){let e=v.useContext(Y5);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function Z5({id:e,className:t,children:n,config:r,initialDimension:i=J5,...a}){let o=v.useId(),s=`chart-${e??o.replace(/:/g,``)}`;return(0,W.jsx)(Y5.Provider,{value:{config:r},children:(0,W.jsxs)(`div`,{"data-slot":`chart`,"data-chart":s,className:J(`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-hidden [&_.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]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,t),...a,children:[(0,W.jsx)(Q5,{id:s,config:r}),(0,W.jsx)(rj,{initialDimension:i,children:n})]})})}function Q5({id:e,config:t}){let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(q5).map(([t,r])=>`
|
|
134
134
|
${r} [data-chart=${e}] {
|
|
135
135
|
${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).join(`
|
|
136
136
|
`)}
|
|
137
137
|
}
|
|
138
138
|
`).join(`
|
|
139
139
|
`)}}):null}var $5=rY;function e7({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=X5(),m=v.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=`${f??e?.dataKey??e?.name??`value`}`,r=t7(p,e,n),a=!f&&typeof o==`string`?p[o]?.label??o:r?.label;return s?(0,W.jsx)(`div`,{className:J(`font-medium`,c),children:s(a,t)}):a?(0,W.jsx)(`div`,{className:J(`font-medium`,c),children:a}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,W.jsxs)(`div`,{className:J(`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`,n),children:[h?null:m,(0,W.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=`${d??e.name??e.dataKey??`value`}`,i=t7(p,e,n),o=u??e.payload?.fill??e.color;return(0,W.jsx)(`div`,{className:J(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,W.jsxs)(W.Fragment,{children:[i?.icon?(0,W.jsx)(i.icon,{}):!a&&(0,W.jsx)(`div`,{className:J(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":h&&r===`dashed`}),style:{"--color-bg":o,"--color-border":o}}),(0,W.jsxs)(`div`,{className:J(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:i?.label??e.name})]}),e.value!=null&&(0,W.jsx)(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}function t7(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var n7=e=>new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),r7={ok:{label:`ok`,color:`var(--chart-1)`},error:{label:`error`,color:`var(--destructive)`}};function i7({series:e}){return(0,W.jsx)(Z5,{config:r7,className:`h-[200px] w-full`,children:(0,W.jsxs)(R5,{data:e,margin:{top:8,right:8,left:-18,bottom:0},children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`linearGradient`,{id:`fillOk`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`var(--color-ok)`,stopOpacity:.5}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`var(--color-ok)`,stopOpacity:.04})]}),(0,W.jsxs)(`linearGradient`,{id:`fillErr`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`var(--color-error)`,stopOpacity:.55}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`var(--color-error)`,stopOpacity:.05})]})]}),(0,W.jsx)(K4,{vertical:!1,strokeDasharray:`3 3`}),(0,W.jsx)(d6,{dataKey:`t`,tickFormatter:n7,tick:{fontSize:10},tickLine:!1,axisLine:!1,minTickGap:48}),(0,W.jsx)(E6,{tick:{fontSize:10},tickLine:!1,axisLine:!1,width:34,allowDecimals:!1}),(0,W.jsx)($5,{content:(0,W.jsx)(e7,{labelFormatter:(e,t)=>{let n=t?.[0]?.payload?.t;return typeof n==`number`?n7(n):``}})}),(0,W.jsx)(W3,{type:`monotone`,dataKey:`ok`,name:`ok`,stackId:`1`,stroke:`var(--color-ok)`,fill:`url(#fillOk)`,strokeWidth:2,isAnimationActive:!1}),(0,W.jsx)(W3,{type:`monotone`,dataKey:`error`,name:`error`,stackId:`1`,stroke:`var(--color-error)`,fill:`url(#fillErr)`,strokeWidth:2,isAnimationActive:!1})]})})}function a7({segments:e,centerLabel:t=`calls`}){let n=e.filter(e=>e.value>0),r=e.reduce((e,t)=>e+t.value,0);return(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3`,children:[(0,W.jsx)(Z5,{config:Object.fromEntries(n.map(e=>[e.label,{label:e.label,color:e.color}])),className:`mx-auto aspect-square w-full max-w-[180px]`,children:(0,W.jsxs)(I5,{children:[(0,W.jsx)($5,{content:(0,W.jsx)(e7,{hideLabel:!0})}),(0,W.jsx)(g1,{data:n,dataKey:`value`,nameKey:`label`,innerRadius:58,outerRadius:80,paddingAngle:2,strokeWidth:0,isAnimationActive:!1,children:n.map(e=>(0,W.jsx)(iY,{fill:e.color},e.label))}),(0,W.jsx)(`text`,{x:`50%`,y:`47%`,textAnchor:`middle`,className:`fill-foreground`,fontSize:22,fontWeight:600,children:r.toLocaleString()}),(0,W.jsx)(`text`,{x:`50%`,y:`59%`,textAnchor:`middle`,className:`fill-muted-foreground`,fontSize:10,children:t})]})}),(0,W.jsx)(`div`,{className:`flex flex-wrap justify-center gap-x-3.5 gap-y-1.5 text-[11px] text-muted-foreground`,children:n.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`size-[9px] rounded-[3px]`,style:{background:e.color}}),e.label,` `,(0,W.jsx)(`b`,{className:`font-medium text-foreground`,children:e.value})]},e.label))})]})}function o7({values:e,color:t,unit:n,maxValue:r,id:i}){let a=e.filter(e=>e!=null);if(a.length===0)return(0,W.jsx)(`div`,{className:`px-1.5 py-3 text-center text-[11px] text-muted-foreground`,children:`no samples yet`});let o=e.map((e,t)=>({i:t,v:e})),s=a[a.length-1],c=`ma-${(i??t).replace(/[^a-z0-9]/gi,``)}`,l={v:{label:`value`,color:t}},u=Math.min(...a),d=Math.max(...a),f=Math.max(0,(n===`%`?10:0)-(d-u))/2,p=u-f,m=d+f,h=(m-p)*.15||1;return p=Math.max(0,p-h),m+=h,r!=null&&(m=Math.min(r,m)),m<=p&&(m=p+1),(0,W.jsxs)(`div`,{className:`relative w-full`,children:[(0,W.jsxs)(`span`,{className:`absolute right-0.5 top-0 z-10 text-[10px] font-semibold`,style:{color:t},children:[s.toFixed(n===`%`?0:1),n??``]}),(0,W.jsx)(Z5,{config:l,className:`h-[46px] w-full`,children:(0,W.jsxs)(R5,{data:o,margin:{top:4,right:2,left:2,bottom:0},children:[(0,W.jsx)(`defs`,{children:(0,W.jsxs)(`linearGradient`,{id:c,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`var(--color-v)`,stopOpacity:.35}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`var(--color-v)`,stopOpacity:0})]})}),(0,W.jsx)(E6,{hide:!0,domain:[p,m]}),(0,W.jsx)($5,{content:(0,W.jsx)(e7,{hideLabel:!0,formatter:e=>(0,W.jsxs)(`span`,{className:`font-mono tabular-nums text-foreground`,children:[typeof e==`number`?e.toLocaleString():String(e),n??``]})})}),(0,W.jsx)(W3,{type:`monotone`,dataKey:`v`,stroke:`var(--color-v)`,fill:`url(#${c})`,strokeWidth:1.7,connectNulls:!1,isAnimationActive:!1,dot:!1})]})})]})}function s7({value:e,label:t,color:n}){let r=e!=null,i=r?Math.max(0,Math.min(100,e)):0;return(0,W.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,children:[(0,W.jsxs)(`div`,{className:`relative grid size-[72px] place-items-center`,children:[(0,W.jsx)(Z5,{config:{value:{label:t,color:n}},className:`size-[72px]`,children:(0,W.jsxs)(K5,{data:[{name:t,value:i,fill:n}],innerRadius:`72%`,outerRadius:`100%`,startAngle:90,endAngle:-270,barSize:7,children:[(0,W.jsx)(dQ,{type:`number`,domain:[0,100],tick:!1,axisLine:!1}),(0,W.jsx)(h2,{dataKey:`value`,cornerRadius:4,background:{fill:`var(--muted)`},isAnimationActive:!1})]})}),(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-0 grid place-items-center text-[13px] font-bold`,style:{color:r?`var(--foreground)`:`var(--muted-foreground)`},children:r?`${Math.round(i)}%`:`n/a`})]}),(0,W.jsx)(`span`,{className:`text-[10px] tracking-[0.06em] text-muted-foreground`,children:t})]})}var c7=40,l7=30,u7=1e3,d7=`http://www.w3.org/2000/svg`,f7=e=>`${(e/1e6).toFixed(2)} Mbps`,p7=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:e>0?`${Math.round(e)}`:`0`;function m7({history:e}){let t=Math.max(1,...e.flatMap(e=>[e.rx,e.tx])),n=e=>8+e*504/Math.max(1,c7-1),r=e=>142-e/t*134,i=t=>e.map((e,i)=>`${n(i).toFixed(1)},${r(t(e)).toFixed(1)}`).join(` `),a=t=>{if(e.length<2)return``;let r=n(0).toFixed(1),a=n(e.length-1).toFixed(1);return`${r},${142 .toFixed(1)} ${i(t)} ${a},${142 .toFixed(1)}`};return(0,W.jsx)(`svg`,{className:`block h-[150px] w-full max-w-[520px] rounded-md border border-border bg-background`,viewBox:`0 0 520 150`,xmlns:d7,role:`img`,children:e.length>=2&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`polygon`,{className:`fill-success/20 stroke-none`,points:a(e=>e.rx)}),(0,W.jsx)(`polygon`,{className:`fill-warning/15 stroke-none`,points:a(e=>e.tx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-success stroke-2`,points:i(e=>e.rx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-warning stroke-2`,points:i(e=>e.tx)})]})})}function h7({history:e}){let t=`block h-[18px] w-20 shrink-0 rounded-[3px] bg-muted/40`;if(e.length<2)return(0,W.jsx)(`svg`,{className:t,viewBox:`0 0 80 18`});let n=Math.max(1,...e.flatMap(e=>[e.rx,e.tx])),r=e=>1+e*78/Math.max(1,l7-1),i=e=>17-e/n*16,a=t=>e.map((e,n)=>`${r(n).toFixed(1)},${i(t(e)).toFixed(1)}`).join(` `),o=t=>{let n=r(0).toFixed(1),i=r(e.length-1).toFixed(1),o=17 .toFixed(1);return`${n},${o} ${a(t)} ${i},${o}`};return(0,W.jsxs)(`svg`,{className:t,viewBox:`0 0 80 18`,xmlns:d7,children:[(0,W.jsx)(`polygon`,{className:`fill-success/20 stroke-none`,points:o(e=>e.rx)}),(0,W.jsx)(`polygon`,{className:`fill-warning/15 stroke-none`,points:o(e=>e.tx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-success stroke-1`,vectorEffect:`non-scaling-stroke`,points:a(e=>e.rx)}),(0,W.jsx)(`polyline`,{className:`fill-none stroke-warning stroke-1`,vectorEffect:`non-scaling-stroke`,points:a(e=>e.tx)})]})}function g7({ip:e,deviceName:t,current:n,onSaved:r}){let[i,a]=(0,v.useState)(n.download),[o,s]=(0,v.useState)(n.upload),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null);(0,v.useEffect)(()=>{c||(a(n.download),s(n.upload))},[n.download,n.upload,c]);let m=(0,v.useCallback)(async(n,i)=>{d(!0),p(null);try{let a=await _c(`/api/clients/limits`,{ip:e,device:t,download:n,upload:i});p(a.message),a.ok?(l(!1),r(),Y.success(n||i?`Rate limits applied`:`Rate limits removed`)):Y.error(a.message||`Rate limits failed`)}catch(e){p(e instanceof Error?e.message:String(e)),Y.error(e instanceof Error?e.message:`Rate limits failed`)}finally{d(!1)}},[e,t,r]),h=!!(n.download||n.upload);return(0,W.jsxs)(`div`,{className:`mt-3.5 max-w-[520px] border-t border-border pt-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-3`,children:[(0,W.jsx)(`span`,{className:`text-[13px] font-semibold`,children:`Rate limits`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`current: ↓ `,n.download||`unlimited`,` · ↑ `,n.upload||`unlimited`]})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-[3px] text-[11.5px]`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`↓ Download`}),(0,W.jsx)(Wx,{className:`w-[150px]`,placeholder:`10M · blank = unlimited`,value:i,onChange:e=>{l(!0),a(e.target.value)}})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-[3px] text-[11.5px]`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`↑ Upload`}),(0,W.jsx)(Wx,{className:`w-[150px]`,placeholder:`2M · blank = unlimited`,value:o,onChange:e=>{l(!0),s(e.target.value)}})]}),(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:u,onClick:()=>void m(i,o),children:`Apply`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:u||!h,onClick:()=>{a(``),s(``),m(``,``)},children:`Remove`})]}),f&&(0,W.jsx)(`div`,{className:`mt-1.5 text-muted-foreground text-xs`,children:f})]})}function _7({device:e,deviceName:t,traffic:n}){let r=n!==void 0;return(0,W.jsxs)(`div`,{className:`mt-3.5 border-t border-border pt-3.5`,children:[(0,W.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-baseline gap-3`,children:[(0,W.jsx)(`span`,{className:`text-sm font-semibold`,children:e.host||e.comment||e.ip}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.ip||`no IP`,` · `,e.mac,` · `,e.iface||`?`,` · `,e.status]})]}),r?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`mb-2 flex gap-[18px] tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`font-semibold text-success`,children:[`↓ `,f7(n.rxRate)]}),(0,W.jsxs)(`span`,{className:`font-semibold text-warning`,children:[`↑ `,f7(n.txRate)]})]}),(0,W.jsx)(m7,{history:n.history}),(0,W.jsxs)(`div`,{className:`mt-2 text-muted-foreground text-xs tabular-nums`,children:[`total ↓ `,dx(n.rxBytes),` · ↑ `,dx(n.txBytes)]})]}):(0,W.jsxs)(Lx,{type:`secondary`,label:`No traffic yet`,children:[`No traffic seen for `,(0,W.jsx)(`code`,{children:e.ip}),` yet. Rates appear here as soon as the device sends or receives.`]}),e.ip&&(0,W.jsx)(g7,{ip:e.ip,deviceName:t,current:{download:n?.downloadLimit??``,upload:n?.uploadLimit??``},onSaved:()=>{}}),e.ip&&(0,W.jsxs)(`div`,{className:`mt-4`,children:[(0,W.jsx)(`div`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:`Usage history · last 3 months`}),(0,W.jsx)(iS,{endpoint:`/api/usage/client?ip=${encodeURIComponent(e.ip)}${t?`&device=${encodeURIComponent(t)}`:``}&days=90`,days:90})]})]})}var v7={map:new Map,source:`accounting`};function y7(e,t){let n=new Set([...e.map.keys(),...Object.keys(t.hosts),...Object.keys(t.limits)]),r=new Map;for(let i of n){let n=t.hosts[i],a=n?.rxRate??0,o=n?.txRate??0,s=e.map.get(i),c=[...s?.history??[],{rx:a,tx:o}].slice(-30),l=t.limits[i];!l&&!c.some(e=>e.rx>0||e.tx>0)||r.set(i,{rxRate:a,txRate:o,rxBytes:n?.rxBytes??s?.rxBytes??0,txBytes:n?.txBytes??s?.txBytes??0,downloadLimit:l?.download??``,uploadLimit:l?.upload??``,history:c})}return{map:r,source:t.source,note:t.note}}function b7(e){let[t,n]=(0,v.useState)(v7);return(0,v.useEffect)(()=>{n(v7)},[e]),(0,v.useEffect)(()=>{if(!e)return;let t=!1,r=null,i=null,a=null,o=`traffic=${encodeURIComponent(e)}`,s=e=>{t||n(t=>y7(t,e))},c=()=>{if(t||a)return;let n=async()=>{try{s(await gc(`/api/clients/traffic-bulk?device=${encodeURIComponent(e)}`))}catch{}};n(),a=setInterval(()=>void n(),u7)},l=()=>{if(t)return;i=new EventSource(hc(`/api/sse?${o}`));let e=!1;i.onopen=()=>{e=!0},i.addEventListener(`traffic`,e=>{try{s(JSON.parse(e.data))}catch{}}),i.onerror=()=>{!e&&i&&(i.close(),i=null,c())}},u=()=>{if(t)return;let e=location.protocol===`https:`?`wss`:`ws`;r=new WebSocket(hc(`${e}://${location.host}/api/stream?${o}`));let n=!1;r.onopen=()=>{n=!0},r.onerror=()=>r?.close(),r.onmessage=e=>{try{let t=JSON.parse(e.data);t.type===`traffic`&&t.sample&&s(t.sample)}catch{}},r.onclose=()=>{t||(n?setTimeout(u,2e3):l())}};return u(),()=>{t=!0,r?.close(),i?.close(),a&&clearInterval(a)}},[e]),t}function x7(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(null),{map:g,source:_,note:y}=b7(n);(0,v.useEffect)(()=>{gc(`/api/devices`).then(e=>{t(e),r(t=>t||e.defaultDevice||e.devices[0]?.name||``)}).catch(()=>t({server:``,defaultDevice:``,devices:[]}))},[]);let b=(0,v.useCallback)(async()=>{try{let e=n?`?device=${encodeURIComponent(n)}`:``;a(await gc(`/api/clients${e}`)),d(null)}catch(e){d(e instanceof Error?e.message:String(e))}},[n]);(0,v.useEffect)(()=>{a(null),s(null),b();let e=setInterval(()=>void b(),15e3);return()=>clearInterval(e)},[b]);let x=(0,v.useCallback)(async(e,t,r)=>{l(t),d(null);try{let i=await _c(`/api/clients/${e}`,{mac:t,device:n,...r});i.view?a(i.view):await b();let o=e===`block`?`Client blocked`:e===`allow`?`Client allowed`:e===`pin`?`IP pinned`:e===`set-ip`?`IP set`:e===`label`?`Client labeled`:`Done`;i.ok?Y.success(o):(d(i.message),Y.error(i.message||`${o} failed`))}catch(e){d(e instanceof Error?e.message:String(e)),Y.error(e instanceof Error?e.message:`Action failed`)}finally{l(null)}},[n,b]),S=(0,v.useCallback)((e,t)=>{s(e.mac),h({mac:e.mac,field:t,value:t===`ip`?e.ip:e.comment||e.host})},[]),C=(0,v.useCallback)(async()=>{if(!m)return;let e=m.value.trim();m.field===`ip`?e&&await x(`set-ip`,m.mac,{ip:e}):await x(`label`,m.mac,{label:e}),h(null)},[m,x]),w=(0,v.useMemo)(()=>{let e=i?.devices??[],t=f.trim().toLowerCase();return t?e.filter(e=>e.ip.toLowerCase().includes(t)||e.mac.toLowerCase().includes(t)||e.host.toLowerCase().includes(t)||e.comment.toLowerCase().includes(t)):e},[i,f]),T=(0,v.useMemo)(()=>i?.devices.find(e=>e.mac===o)??null,[i,o]),E=e?.devices??[],D=i?.counts;return(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsxs)(ax,{title:`Connected clients`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[E.length>1&&(0,W.jsx)(Jx,{value:n,onValueChange:r,"aria-label":`Router`,options:E.map(e=>({value:e.name,label:`${e.name}${e.isDefault?` (default)`:``}`}))}),(0,W.jsx)(Wx,{className:`w-[200px]`,placeholder:`Filter IP / MAC / name…`,value:f,onChange:e=>p(e.target.value)}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:()=>void b(),children:`Refresh`})]}),children:[D&&(0,W.jsxs)(`div`,{className:`mb-2.5 text-muted-foreground text-xs`,children:[D.total,` total · `,D.static,` static · `,D.blocked,` blocked`]}),u&&(0,W.jsx)(Lx,{type:`error`,className:`mb-2.5`,children:u}),_===`none`&&y&&(0,W.jsxs)(Lx,{type:`warning`,label:`Traffic unavailable`,className:`mb-2.5`,children:[y,` The Traffic column needs per-host counters — `,(0,W.jsx)(`code`,{children:`/ip accounting`}),` `,`on RouterOS v6, or Kid Control on v7.`]}),i?w.length===0?(0,W.jsxs)(`div`,{className:`grid justify-items-center gap-2 rounded-lg border border-dashed border-border px-4 py-[54px] text-center`,children:[(0,W.jsx)(hl,{className:`size-7 text-muted-foreground opacity-80`}),(0,W.jsx)(`p`,{className:`m-0 font-semibold text-foreground`,children:`No connected devices`}),(0,W.jsxs)(`p`,{className:`m-0 max-w-[460px] text-muted-foreground text-xs`,children:[`Nothing in this router's DHCP-lease or ARP table`,f?` matches the filter`:``,`.`]})]}):(0,W.jsxs)(Yb,{className:`text-[13px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`IP`}),(0,W.jsx)($b,{children:`Name`}),(0,W.jsx)($b,{children:`MAC`}),(0,W.jsx)($b,{children:`Iface`}),(0,W.jsx)($b,{children:`Status`}),(0,W.jsx)($b,{children:`Traffic`}),(0,W.jsx)($b,{className:`text-right`,children:`Actions`})]})}),(0,W.jsx)(Zb,{children:w.map(e=>{let t=e.mac===o,n=c===e.mac,r=e.ip?g.get(e.ip):void 0,i=e.blocked&&`text-muted-foreground line-through`;return(0,W.jsxs)(Qb,{"data-state":t?`selected`:void 0,className:`cursor-pointer`,onClick:()=>s(t?null:e.mac),children:[(0,W.jsx)(ex,{className:J(`max-w-[120px] truncate`,i),children:e.ip||`—`}),(0,W.jsx)(ex,{className:J(`max-w-[200px] truncate`,i),children:e.host||e.comment||`(unknown)`}),(0,W.jsx)(ex,{className:`font-mono text-[11.5px] text-muted-foreground`,children:e.mac}),(0,W.jsx)(ex,{className:`text-muted-foreground text-[11px]`,children:e.iface||``}),(0,W.jsx)(ex,{children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.static&&(0,W.jsx)(Bx,{type:`secondary`,children:`static`}),e.blocked?(0,W.jsx)(Bx,{type:`error`,children:`blocked`}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:e.status})]})}),(0,W.jsx)(ex,{children:r?(0,W.jsxs)(`span`,{className:`flex items-center gap-1 overflow-hidden tabular-nums`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-[48px] flex-col whitespace-nowrap leading-tight`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`↓`,p7(r.rxRate)]}),(0,W.jsxs)(`span`,{className:`text-warning`,children:[`↑`,p7(r.txRate)]})]}),(0,W.jsx)(h7,{history:r.history})]}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:e.ip?`—`:``})}),(0,W.jsx)(ex,{onClick:e=>e.stopPropagation(),children:(0,W.jsxs)(`span`,{className:`flex justify-end gap-1.5`,children:[e.blocked?(0,W.jsx)(X,{size:`sm`,type:`success`,ghost:!0,loading:n,onClick:()=>void x(`allow`,e.mac),children:`Allow`}):(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,loading:n,onClick:()=>void x(`block`,e.mac),children:`Block`}),!e.static&&(0,W.jsx)(X,{size:`sm`,ghost:!0,loading:n,onClick:()=>void x(`pin`,e.mac),children:`Pin IP`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:n,onClick:()=>S(e,`ip`),children:`Set IP`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,disabled:n,onClick:()=>S(e,`label`),children:`Label`})]})})]},e.mac)})})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading connected devices…`}),m&&T?.mac===m.mac&&(0,W.jsxs)(`div`,{className:`mt-3.5 flex flex-wrap items-center gap-2 rounded-md border border-border bg-card px-3 py-2.5`,children:[(0,W.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[m.field===`ip`?`Reserve IP for`:`Label for`,` `,(0,W.jsx)(`b`,{children:T.host||T.mac}),`:`]}),(0,W.jsx)(Wx,{className:`w-[220px]`,autoFocus:!0,value:m.value,placeholder:m.field===`ip`?`e.g. 192.168.88.50`:`e.g. Ali phone`,onChange:e=>h({...m,value:e.target.value}),onKeyDown:e=>{e.key===`Enter`&&C(),e.key===`Escape`&&h(null)}}),(0,W.jsx)(X,{size:`sm`,type:`accent`,loading:c===m.mac,onClick:()=>void C(),children:`Save`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>h(null),children:`Cancel`})]}),T&&(0,W.jsx)(_7,{device:T,deviceName:n,traffic:T.ip?g.get(T.ip):void 0})]})})}var S7=/("(?:\\.|[^"\\])*"(?:\s*:)?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;function C7(e){let t=[],n=0,r=0;for(let i of e.matchAll(S7)){let a=i.index??0;a>n&&t.push(e.slice(n,a));let o=i[0],s;s=i[1]===void 0?i[2]===void 0?`text-chart-1`:`text-warning`:/:\s*$/.test(o)?`text-foreground`:`text-success`,t.push((0,W.jsx)(`span`,{className:s,children:o},r++)),n=a+o.length}return n<e.length&&t.push(e.slice(n)),t}var w7=new RegExp([/(;;;[^\n]*)/,/("(?:\\.|[^"\\])*")/,/([0-9A-Fa-f]{2}(?::[0-9A-Fa-f]{2}){5})/,/(\d{1,3}(?:\.\d{1,3}){3}(?:\/\d{1,2})?)/,/([A-Za-z.][\w.-]*)(?==)/,/\b(running|enabled|active|connected|established|reachable|bound|authorized|ok|up)\b/,/\b(disabled|invalid|inactive|stopped|unreachable|timeout|failure|failed|error|rejected|expired|down)\b/,/\b(yes|no|true|false)\b/,/\b(dynamic|slave|builtin|default|passthrough|complete)\b/,/(-?\d+(?:\.\d+)?)/].map(e=>e.source).join(`|`),`gi`);function T7(e){let t=[],n=0,r=0;for(let i of e.matchAll(w7)){let a=i.index??0;a>n&&t.push(e.slice(n,a));let o=i[0],s=`text-chart-1`;i[1]===void 0?i[2]===void 0?i[3]===void 0?i[4]===void 0?i[5]===void 0?i[6]===void 0?i[7]===void 0?i[8]===void 0?i[9]!==void 0&&(s=`text-muted-foreground`):s=`text-warning`:s=`text-destructive font-medium`:s=`text-success font-medium`:s=`text-foreground`:s=`text-chart-2`:s=`text-chart-5`:s=`text-success`:s=`text-muted-foreground italic`,t.push((0,W.jsx)(`span`,{className:s,children:o},r++)),n=a+o.length}return n<e.length&&t.push(e.slice(n)),t}var E7=`mt-pretty-input`;function D7(){try{return localStorage.getItem(E7)!==`0`}catch{return!0}}function O7(e){try{localStorage.setItem(E7,e?`1`:`0`)}catch{}}function k7(e,t){if(!t)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function A7({value:e,maxHeight:t}){let n=typeof e==`string`?e:JSON.stringify(e,null,2);return(0,W.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap text-muted-foreground`,style:t?{maxHeight:t}:void 0,children:C7(n)})}function j7(e){return e.startsWith(`+++`)||e.startsWith(`---`)?`file`:e.startsWith(`@@`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var M7={add:`bg-success/10`,del:`bg-destructive/10`,hunk:`bg-muted/50`,file:``,ctx:``},N7={add:`text-success`,del:`text-destructive`,hunk:`text-brand`,file:`text-muted-foreground`,ctx:`text-muted-foreground/50`},P7={add:`+`,del:`−`,ctx:``,hunk:``,file:``};function F7({unified:e,maxHeight:t}){let n=e.replace(/\n+$/,``).split(`
|
|
140
|
-
`);return(0,W.jsx)(`pre`,{className:`text-muted-foreground m-0 overflow-auto rounded border border-border bg-background py-2 font-mono text-[11px] leading-[1.6] break-words whitespace-pre-wrap`,style:t?{maxHeight:t}:void 0,children:n.map((e,t)=>{let n=j7(e),r=n===`hunk`||n===`file`,i=n===`add`||n===`del`||n===`ctx`?e.slice(1):e;return(0,W.jsxs)(`div`,{className:J(`flex px-2`,M7[n]),children:[(0,W.jsx)(`span`,{className:J(`w-3 shrink-0 select-none text-center`,N7[n]),children:P7[n]}),(0,W.jsx)(`span`,{className:J(`min-w-0 flex-1 break-words whitespace-pre-wrap`,r&&`text-muted-foreground/80`),children:r?e:C7(i)})]},t)})})}function I7(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function L7(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function R7({onRestored:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),h=(0,v.useCallback)(()=>{gc(`/api/config/history`).then(n).catch(()=>n({versions:[],bytes:0,retention:50}))},[]);(0,v.useEffect)(()=>h(),[h]);let g=(e,t)=>_c(e,t).catch(()=>({error:`request failed`})),_=async()=>{let e=(p??``).trim();m(null);let t=await g(`/api/config/history/checkpoint`,{label:e||void 0});i(t.ok?`Checkpoint saved${e?` · “${e}”`:``}`:`Failed: ${t.error}`),t.ok?(Y.success(`Checkpoint saved`),h()):Y.error(t.error??`Checkpoint failed`)},y=async e=>{if(s===e){c(null),u(null);return}c(e),u(null);let t=await gc(`/api/config/history/diff?id=${encodeURIComponent(e)}`).catch(()=>null);u(t)},b=async t=>{f(null),o(!0);let n=await g(`/api/config/history/restore`,{id:t});o(!1),i(n.ok?`Restored ${t}${n.persisted===!1?` (applied live, not persisted)`:``}`:`Restore failed: ${n.error}`),n.ok?(Y.success(`Version restored`),h(),e()):Y.error(n.error??`Restore failed`)},x=async e=>{let t=await g(`/api/config/history/delete`,{id:e});i(t.ok?`Version deleted`:`Failed: ${t.error}`),t.ok?(Y.success(`Version deleted`),h()):Y.error(t.error??`Delete failed`)};return t?(0,W.jsxs)(W.Fragment,{children:[r&&(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-xs`,children:r}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,style:{marginBottom:14},children:[p===null?(0,W.jsx)(X,{size:`sm`,type:`accent`,icon:(0,W.jsx)(ul,{className:`size-4`}),onClick:()=>m(``),children:`Save checkpoint`}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`w-[min(48vw,380px)]`,autoFocus:!0,placeholder:`checkpoint name (e.g. pre-upgrade)`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&_(),e.key===`Escape`&&m(null)}}),(0,W.jsx)(X,{size:`sm`,type:`accent`,onClick:()=>void _(),children:`Save`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>m(null),children:`Cancel`})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[t.versions.length,` versions · `,I7(t.bytes),` · auto-keep `,t.retention]})]}),t.versions.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`No versions yet — they appear here after each config change.`}):(0,W.jsx)(`ol`,{className:`m-0 grid list-none p-0 pl-1.5`,children:t.versions.map((e,t)=>{let n=e.drift.added+e.drift.removed;return(0,W.jsxs)(`li`,{className:`hover:bg-foreground/5 relative grid grid-cols-[24px_minmax(0,1fr)_auto] items-start gap-3 rounded-md px-2.5 py-3.5 transition-colors before:absolute before:top-[25px] before:bottom-0 before:left-[22px] before:w-px before:bg-border last:before:hidden`,children:[(0,W.jsx)(`span`,{className:J(`relative z-[1] mt-1 justify-self-center rounded-full border-[2.5px]`,t===0?`border-brand bg-brand ring-brand/25 size-[14px] ring-4`:`border-border bg-card size-[13px]`),"aria-hidden":`true`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[9px] text-[12.5px]`,children:[(0,W.jsx)(`span`,{className:J(`rounded-full border px-2 py-0.5 font-mono text-[10px] tracking-[0.05em] uppercase`,e.kind===`checkpoint`?`border-warning/45 bg-warning/10 text-warning`:`border-border text-muted-foreground`),children:e.kind===`checkpoint`?`★ checkpoint`:`auto`}),e.label&&(0,W.jsx)(`span`,{className:`text-foreground font-semibold`,children:e.label}),(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[11.5px]`,children:L7(e.ts)}),t===0?(0,W.jsx)(`span`,{className:`text-brand font-mono text-[10px] font-semibold tracking-[0.05em] uppercase`,children:`latest`}):n===0?(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11.5px]`,children:`identical to current`}):(0,W.jsxs)(`span`,{className:`inline-flex items-baseline gap-[7px] font-mono text-[11.5px]`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,e.drift.added]}),(0,W.jsxs)(`span`,{className:`text-destructive`,children:[`−`,e.drift.removed]}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:` vs current`})]})]}),s===e.id&&(0,W.jsx)(`div`,{className:`mt-2`,children:l?l.unified.trim()?(0,W.jsx)(F7,{unified:l.unified,maxHeight:280}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No differences from the current config.`}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`computing diff…`})})]}),(0,W.jsxs)(`div`,{className:`mt-px inline-flex flex-none items-center gap-1.5`,children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>void y(e.id),children:s===e.id?`Hide`:`Diff`}),d===e.id?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,disabled:a,onClick:()=>void b(e.id),children:`Confirm restore`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>f(null),children:`Cancel`})]}):(0,W.jsx)(X,{size:`sm`,disabled:t===0,title:t===0?`This is the current config`:`Restore this version`,onClick:()=>f(e.id),children:`Restore`}),e.kind===`checkpoint`&&(0,W.jsx)(X,{size:`sm`,ghost:!0,type:`error`,icon:(0,W.jsx)(gl,{className:`size-4`}),title:`Delete`,onClick:()=>void x(e.id)})]})]},e.id)})})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading history…`})}function z7(e){if(!e)return[];let t=[],n=e=>e?Array.isArray(e.enum)?`enum`:e.type===`array`?`array<${n(e.items)}>`:Array.isArray(e.type)?e.type.join(` | `):e.type??(e.properties?`object`:`any`):`any`,r=(e,i,a,o)=>{let s=e.properties??{};for(let[e,c]of Object.entries(s)){let s=i?`${i}.${e}`:e,l=a||e;t.push({path:s,section:l,type:n(c),def:c.default===void 0?void 0:JSON.stringify(c.default),desc:c.description,enumv:Array.isArray(c.enum)?c.enum:void 0,required:o.has(e)}),c.properties&&r(c,s,l,new Set(c.required??[]));let u=c.additionalProperties;u?.properties&&r(u,`${s}.<name>`,l,new Set(u.required??[]));let d=c.items;d?.properties&&r(d,`${s}[]`,l,new Set(d.required??[]))}};return r(e,``,``,new Set(e.required??[])),t}function B7(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/config-schema`).then(t).catch(()=>{})},[]);let i=(0,v.useMemo)(()=>z7(e),[e]),a=n.trim().toLowerCase(),o=a?i.filter(e=>e.path.toLowerCase().includes(a)||(e.desc??``).toLowerCase().includes(a)):i,s=(0,v.useMemo)(()=>{let e=new Map;for(let t of o){let n=e.get(t.section)??[];n.push(t),e.set(t.section,n)}return[...e.entries()]},[o]);return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,style:{marginBottom:12},children:[(0,W.jsx)(Wx,{className:`w-[min(360px,60vw)]`,placeholder:`Search fields & descriptions…`,value:n,onChange:e=>r(e.target.value)}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[o.length,` options`]})]}),s.length===0?(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[11px]`,children:[`No fields match “`,n,`”.`]}):(0,W.jsx)(`div`,{className:`grid gap-[18px]`,children:s.map(([e,t])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{className:`text-brand m-0 mb-2 font-mono text-[11px] tracking-[0.09em] uppercase`,children:e}),(0,W.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>(0,W.jsxs)(`div`,{className:`border-border bg-muted/45 hover:border-brand/40 rounded-md border px-[13px] py-[11px] transition-colors`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2.5`,children:[(0,W.jsx)(`code`,{className:`text-foreground font-mono text-[12.5px] font-medium`,children:e.path}),(0,W.jsx)(`span`,{className:`text-brand bg-brand/[0.13] rounded-full px-[7px] py-px font-mono text-[10.5px]`,children:e.type}),e.required&&(0,W.jsx)(`span`,{className:`text-destructive font-mono text-[10px] tracking-[0.05em] uppercase`,children:`required`}),e.def!==void 0&&(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`default `,(0,W.jsx)(`code`,{className:`text-muted-foreground`,children:e.def})]})]}),e.desc&&(0,W.jsx)(`p`,{className:`text-muted-foreground mt-1.5 mb-0 text-[12.5px] leading-[1.5]`,children:e.desc}),e.enumv&&(0,W.jsx)(`div`,{className:`mt-[7px] flex flex-wrap gap-1.5`,children:e.enumv.map(e=>(0,W.jsx)(`code`,{className:`border-border text-muted-foreground rounded-md border px-[7px] py-px font-mono text-[11px]`,children:e},e))})]},e.path))})]},e))})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading schema…`})}function V7({...e}){return(0,W.jsx)(hf,{"data-slot":`sheet`,...e})}function H7({...e}){return(0,W.jsx)(xf,{"data-slot":`sheet-portal`,...e})}function U7({className:e,...t}){return(0,W.jsx)(Cf,{"data-slot":`sheet-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function W7({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,W.jsxs)(H7,{children:[(0,W.jsx)(U7,{}),(0,W.jsxs)(Df,{"data-slot":`sheet-content`,className:J(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`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`,n===`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`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,W.jsxs)(If,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,W.jsx)(gl,{className:`size-4`}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function G7({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-header`,className:J(`flex flex-col gap-1.5 p-4`,e),...t})}function fte({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-footer`,className:J(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function K7({className:e,...t}){return(0,W.jsx)(Mf,{"data-slot":`sheet-title`,className:J(`font-semibold text-foreground`,e),...t})}function pte({className:e,...t}){return(0,W.jsx)(Pf,{"data-slot":`sheet-description`,className:J(`text-sm text-muted-foreground`,e),...t})}var mte=500;function q7({title:e,subtitle:t,onClose:n,footer:r,children:i}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(n);return c.current=n,(0,v.useEffect)(()=>{let e=requestAnimationFrame(()=>o(!0));return()=>{cancelAnimationFrame(e),s.current&&clearTimeout(s.current)}},[]),(0,W.jsx)(V7,{open:a,onOpenChange:(0,v.useCallback)(e=>{e||s.current||(o(!1),s.current=setTimeout(()=>c.current(),mte))},[]),children:(0,W.jsxs)(W7,{side:`right`,className:`w-full gap-0 sm:max-w-2xl`,children:[(0,W.jsxs)(G7,{className:`border-b`,children:[(0,W.jsx)(K7,{children:e}),t!=null&&(0,W.jsx)(pte,{children:t})]}),(0,W.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:i}),r!=null&&(0,W.jsx)(fte,{className:`border-t`,children:r})]})})}var J7=[{key:`host`,label:`Host / IP`,type:`text`,placeholder:`192.168.88.1`,help:`SSH host. Ignored when a MAC address is set (MAC-Telnet).`},{key:`port`,label:`SSH port`,type:`number`,placeholder:`22`},{key:`username`,label:`Username`,type:`text`,placeholder:`admin`},{key:`password`,label:`Password`,type:`password`,secret:!0},{key:`timeoutMs`,label:`Timeout (ms)`,type:`number`,placeholder:`10000`},{key:`description`,label:`Description`,type:`text`,placeholder:`Core router`,help:`Free-text label.`},{key:`keyFilename`,label:`SSH key file`,type:`text`,advanced:!0,help:`Path to a private-key file.`},{key:`privateKey`,label:`Private key (PEM)`,type:`password`,secret:!0,advanced:!0},{key:`keyPassphrase`,label:`Key passphrase`,type:`password`,secret:!0,advanced:!0},{key:`jumpVia`,label:`Jump via device`,type:`text`,advanced:!0,help:`Name of another device to use as an SSH bastion.`},{key:`mac`,label:`MAC address`,type:`text`,advanced:!0,help:`Set to reach the device over Layer-2 MAC-Telnet (no IP).`},{key:`sourceMac`,label:`Source MAC`,type:`text`,advanced:!0},{key:`macHost`,label:`MAC-Telnet host iface`,type:`text`,advanced:!0},{key:`macPort`,label:`MAC-Telnet port`,type:`number`,advanced:!0,placeholder:`20561`}],hte=[{id:`devices`,title:`Devices`,icon:`🖧`,kind:`deviceMap`,blurb:`MikroTik routers this server manages. Toggle a device off to hide it from the tools.`,fields:J7},{id:`mcp`,title:`MCP Server`,icon:`⚙️`,kind:`object`,path:`mcp`,blurb:`How the MCP server is exposed to the AI client.`,fields:[{key:`transport`,label:`Transport`,type:`select`,options:[`stdio`,`sse`,`streamable-http`]},{key:`host`,label:`Bind host`,type:`text`,placeholder:`0.0.0.0`},{key:`port`,label:`Bind port`,type:`number`,placeholder:`8000`},{key:`appViews`,label:`MCP App Views`,type:`bool`,help:`Expose rich App-view metadata to compatible clients.`},{key:`toolPageSize`,label:`Tool page size`,type:`number`,advanced:!0,help:`0 = no paging.`},{key:`allowedHosts`,label:`Allowed hosts`,type:`text`,advanced:!0,help:`Comma-separated.`},{key:`allowedOrigins`,label:`Allowed origins`,type:`text`,advanced:!0},{key:`corsOrigins`,label:`CORS origins`,type:`text`,advanced:!0}]},{id:`dashboard`,title:`Observability Dashboard`,icon:`📊`,kind:`object`,path:`dashboard`,enable:{key:`enabled`,label:`Dashboard`},blurb:`This web dashboard — records every tool call and serves the live UI.`,fields:[{key:`host`,label:`Bind host`,type:`text`,placeholder:`0.0.0.0`},{key:`port`,label:`Bind port`,type:`number`,placeholder:`9090`},{key:`token`,label:`Access token`,type:`password`,secret:!0,help:`Require this bearer token to view the dashboard.`},{key:`captureBody`,label:`Capture tool input/output`,type:`bool`},{key:`redactInput`,label:`Redact input bodies`,type:`bool`},{key:`dbPath`,label:`Database path`,type:`text`,advanced:!0},{key:`maxEvents`,label:`Max events kept`,type:`number`,advanced:!0},{key:`maxBodyBytes`,label:`Max body bytes`,type:`number`,advanced:!0}]},{id:`ssh`,title:`SSH Connection Pool`,icon:`🔌`,kind:`object`,path:`ssh`,enable:{key:`keepAlive`,label:`Keep-alive pooling`},blurb:`Reuse SSH connections across tool calls for lower latency.`,fields:[{key:`keepAliveInterval`,label:`Keep-alive interval (ms)`,type:`number`,placeholder:`10000`},{key:`idleTimeout`,label:`Idle timeout (ms)`,type:`number`,placeholder:`30000`}]},{id:`s3`,title:`S3 Backups`,icon:`☁️`,kind:`object`,path:`s3`,enable:{presence:!0,label:`S3 backups`},blurb:`Ship config backups to an S3-compatible bucket.`,fields:[{key:`bucket`,label:`Bucket`,type:`text`},{key:`region`,label:`Region`,type:`text`},{key:`endpoint`,label:`Endpoint`,type:`text`,placeholder:`https://s3.example.com`},{key:`accessKeyId`,label:`Access key ID`,type:`password`,secret:!0},{key:`secretAccessKey`,label:`Secret access key`,type:`password`,secret:!0},{key:`prefix`,label:`Key prefix`,type:`text`},{key:`sessionToken`,label:`Session token`,type:`password`,secret:!0,advanced:!0},{key:`presignExpiresIn`,label:`Presign expiry (s)`,type:`number`,advanced:!0,placeholder:`3600`}]},{id:`memory`,title:`Knowledge Memory`,icon:`🧠`,kind:`object`,path:`memory`,enable:{key:`enabled`,label:`Memory`},blurb:`Persistent knowledge graph the AI can read and write.`,fields:[{key:`dbPath`,label:`Database path`,type:`text`}]},{id:`modules`,title:`Tool Modules`,icon:`🧩`,kind:`modules`,blurb:`Curate which tool modules are exposed to the AI client.`,fields:[]},{id:`general`,title:`General`,icon:`🎛️`,kind:`object`,blurb:`Server-wide options.`,fields:[{key:`readOnly`,label:`Read-only mode`,type:`bool`,help:`Block all write/destructive tools.`},{key:`disableUpdateCheck`,label:`Disable update check`,type:`bool`},{key:`backupDir`,label:`Backup directory`,type:`text`,advanced:!0}]}];function Y7({className:e,size:t=`default`,...n}){return(0,W.jsx)(_v,{"data-slot":`switch`,"data-size":t,className:J(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,W.jsx)(yv,{"data-slot":`switch-thumb`,className:J(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`)})})}var gte=`«redacted»`,X7=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},Z7=e=>Array.isArray(e)?e:[],Q7=e=>[...new Set(e)],$7=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e);function e9(e,t){return t.path?X7(e[t.path]):e}function t9(e,t,n,r){if(t.path){let i={...X7(e[t.path])};return r===void 0||r===``?delete i[n]:i[n]=r,{...e,[t.path]:i}}let i={...e};return r===void 0||r===``?delete i[n]:i[n]=r,i}function n9(e,t){return t.enable?t.enable.presence?e[t.path??``]!==void 0:e9(e,t)[t.enable.key??`enabled`]!==!1:!0}function r9({field:e,value:t,onChange:n}){let r=`f_${e.key}`,i=e.type===`bool`,a;return a=e.type===`bool`?(0,W.jsx)(Y7,{checked:t===!0,onCheckedChange:n}):e.type===`select`?(0,W.jsx)(Jx,{value:$7(t??e.options?.[0]??``),onValueChange:n,options:(e.options??[]).map(e=>({value:e,label:e}))}):e.type===`number`?(0,W.jsx)(Wx,{id:r,type:`number`,placeholder:e.placeholder,value:t==null?``:$7(t),onChange:e=>n(e.target.value===``?void 0:Number(e.target.value))}):(0,W.jsx)(Wx,{id:r,type:e.type===`password`?`password`:`text`,placeholder:e.secret&&t===gte?`•••• unchanged`:e.placeholder,value:t==null?``:$7(t),onChange:e=>n(e.target.value)}),(0,W.jsxs)(`div`,{className:J(`flex min-w-0`,i?`flex-row items-center justify-between gap-2.5`:`flex-col gap-1.5`),children:[(0,W.jsxs)(vb,{htmlFor:r,className:`text-muted-foreground text-xs font-semibold`,children:[e.label,e.secret&&(0,W.jsx)(`span`,{className:`text-warning text-[10px] font-semibold tracking-[0.04em] uppercase`,children:`secret`})]}),a,e.help&&(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px] leading-[1.4]`,children:e.help})]})}function i9({fields:e,value:t,onField:n}){let[r,i]=(0,v.useState)(!1),a=e.filter(e=>!e.advanced),o=e.filter(e=>e.advanced);return(0,W.jsxs)(`div`,{className:`mt-1 grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-x-4 gap-y-3`,children:[a.map(e=>(0,W.jsx)(r9,{field:e,value:t[e.key],onChange:t=>n(e.key,t)},e.key)),o.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground col-span-full flex cursor-pointer items-center gap-1 border-0 bg-transparent py-1 text-left text-xs font-semibold`,onClick:()=>i(e=>!e),children:[r?(0,W.jsx)(Pc,{className:`size-3`}):(0,W.jsx)(Fc,{className:`size-3`}),` `,`Advanced (`,o.length,`)`]}),r&&o.map(e=>(0,W.jsx)(r9,{field:e,value:t[e.key],onChange:t=>n(e.key,t)},e.key))]})]})}var _te={prefix:``,presignExpiresIn:3600};function vte(e,t){let n=e9(e,t),r=e=>n[e]!=null&&n[e]!==``?$7(n[e]):``,i=r(`host`)?`${r(`host`)}:${r(`port`)}`:``;return t.id===`mcp`?[r(`transport`),i].filter(Boolean).join(` · `):t.id===`dashboard`?[i,n.token?`token set`:`open`].filter(Boolean).join(` · `):t.id===`ssh`?`interval ${r(`keepAliveInterval`)||`?`}ms · idle ${r(`idleTimeout`)||`?`}ms`:t.id===`s3`?n9(e,t)?[r(`bucket`),r(`region`),r(`endpoint`)].filter(Boolean).join(` · `)||`not configured`:``:t.id===`memory`?r(`dbPath`):t.id===`general`?`${e.readOnly?`read-only`:`read-write`}${e.disableUpdateCheck?` · no update check`:``}`:``}function yte({cfg:e,onChange:t,section:n}){let[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null),o=n9(e,n),s=r=>{if(n.enable?.presence){if(r)t({...e,[n.path]:a.current??(n.id===`s3`?_te:{})});else{a.current=X7(e[n.path]);let r={...e};delete r[n.path],t(r),i(!1)}return}t(t9(e,n,n.enable.key??`enabled`,r))},c=vte(e,n);return(0,W.jsxs)(Yx,{className:J(`px-4 py-3.5 transition-opacity`,!o&&`opacity-50`),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-lg leading-none`,"aria-hidden":`true`,children:n.icon}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`text-foreground flex items-center gap-2 text-sm font-bold`,children:[n.title,n.enable&&(0,W.jsx)(Bx,{type:o?`success`:`secondary`,children:o?`active`:`off`})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground mt-0.5 max-w-[520px] truncate font-mono text-xs`,children:c||n.blurb})]}),(0,W.jsx)(`span`,{className:`flex-1`}),n.enable&&(0,W.jsx)(Y7,{checked:o,onCheckedChange:s,title:`${o?`Deactivate`:`Activate`} ${n.enable.label??n.title}`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>i(!0),disabled:n.enable?.presence&&!o,children:`Edit`})]}),r&&(0,W.jsxs)(q7,{title:`${n.icon} ${n.title}`,subtitle:n.blurb,onClose:()=>i(!1),children:[n.enable&&(0,W.jsxs)(`label`,{className:`border-border bg-muted text-foreground flex items-center gap-2.5 rounded-md border px-3 py-2.5 text-[13px] font-semibold`,children:[(0,W.jsx)(Y7,{checked:o,onCheckedChange:s}),o?`Active`:`Inactive — enable ${n.enable.label??n.title}`]}),o?(0,W.jsx)(i9,{fields:n.fields,value:e9(e,n),onField:(r,i)=>t(t9(e,n,r,i))}):(0,W.jsx)(Lx,{type:`secondary`,label:!1,children:`This section is turned off. Toggle it on to edit its settings.`})]})]})}function bte({cfg:e,onChange:t,name:n,isNew:r,onClose:i}){let[a,o]=(0,v.useState)(n),[s,c]=(0,v.useState)(null),l=X7(e.devices),u=X7(l[n]),d=(r,i)=>{let a={...u};i===void 0||i===``?delete a[r]:a[r]=i,t({...e,devices:{...l,[n]:a}})},f=()=>{let r=a.trim();if(r===n)return!0;if(!r)return c(`Name cannot be empty.`),!1;if(l[r])return c(`A device named "${r}" already exists.`),!1;let i={...l,[r]:u};return delete i[n],t({...e,devices:i}),!0},p=()=>{f()&&i()};return(0,W.jsxs)(q7,{title:r?`Add device`:`Device · ${n}`,subtitle:r?`New MikroTik router`:void 0,onClose:p,footer:(0,W.jsx)(X,{type:`success`,size:`sm`,onClick:p,children:`Done`}),children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,W.jsx)(vb,{htmlFor:`dev_name`,className:`text-muted-foreground text-xs font-semibold`,children:`Name`}),(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(Wx,{id:`dev_name`,value:a,onChange:e=>{o(e.target.value),c(null)},placeholder:`core-router`}),!r&&a.trim()!==n&&(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>f(),children:`Rename`})]}),s&&(0,W.jsx)(`span`,{className:`text-destructive text-[11px]`,children:s})]}),(0,W.jsx)(i9,{fields:J7,value:u,onField:d})]})}function xte({cfg:e,onChange:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),o=X7(e.devices),s=Object.keys(o),c=$7(e.defaultDevice),l=()=>{let n=`device`,i=1,a=n;for(;o[a];)a=`${n}-${++i}`;t({...e,devices:{...o,[a]:{host:`192.168.88.1`,port:22,username:`admin`,password:``,timeoutMs:1e4}}}),r({name:a,isNew:!0})},u=(n,r)=>{t({...e,devices:{...o,[n]:{...X7(o[n]),disabled:r}}})},d=n=>{let r={...o};delete r[n];let i={...e,devices:r};c===n&&(i.defaultDevice=Object.keys(r)[0]??``),t(i),a(null)};return(0,W.jsxs)(Yx,{className:`px-4 py-3.5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-lg leading-none`,"aria-hidden":`true`,children:`🖧`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-foreground flex items-center gap-2 text-sm font-bold`,children:`Devices`}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 max-w-[520px] truncate font-mono text-xs`,children:[s.length,` device`,s.length===1?``:`s`,` · default: `,c||`—`]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`label`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Default`}),(0,W.jsx)(Jx,{value:c,onValueChange:n=>t({...e,defaultDevice:n}),options:s.map(e=>({value:e,label:e}))})]}),(0,W.jsx)(X,{size:`sm`,onClick:l,icon:(0,W.jsx)(Qc,{className:`size-4`}),children:`Add device`})]}),(0,W.jsxs)(`div`,{className:`mt-3 grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-3`,children:[s.map(e=>{let t=X7(o[e]),n=t.disabled===!0,s=t.mac?$7(t.mac):`${$7(t.host)||`?`}:${$7(t.port)||`22`}`;return(0,W.jsxs)(`div`,{className:J(`border-border bg-card hover:border-brand/40 flex flex-col gap-1.5 rounded-lg border px-[15px] py-3.5 transition-colors`,n&&`opacity-50 grayscale-[0.4]`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:J(`inline-block size-2 shrink-0 rounded-full`,n?`bg-muted-foreground/60`:`bg-success`)}),(0,W.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,children:e}),c===e&&(0,W.jsx)(Bx,{type:`accent`,children:`default`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Y7,{checked:!n,onCheckedChange:t=>u(e,!t),title:n?`Enable device`:`Disable device`})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-[11px] break-words`,children:s}),t.description?(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-[11px] break-words`,children:$7(t.description)}):null,(0,W.jsxs)(`div`,{className:`mt-auto flex gap-1.5 pt-1`,children:[(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>r({name:e,isNew:!1}),children:`Edit`}),i===e?(0,W.jsx)(X,{size:`sm`,type:`error`,onClick:()=>d(e),children:`Confirm?`}):(0,W.jsx)(X,{size:`sm`,ghost:!0,type:`error`,onClick:()=>a(e),children:`Remove`})]})]},e)}),s.length===0&&(0,W.jsxs)(Lx,{type:`secondary`,label:!1,children:[`No devices yet. Click `,(0,W.jsx)(`b`,{children:`Add device`}),` to configure your first router.`]})]}),n&&(0,W.jsx)(bte,{cfg:e,onChange:t,name:n.name,isNew:n.isNew,onClose:()=>r(null)})]})}function a9(e,t){let n=Z7(e.disabledModules),r=Z7(e.disabledGroups),i=Z7(e.enabledModules),a=Z7(e.enabledGroups);return n.includes(t.slug)||r.includes(t.group)?!1:i.length===0&&a.length===0?!0:i.includes(t.slug)||a.includes(t.group)}function Ste({cfg:e,onChange:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/modules`).then(e=>r(e.modules)).catch(()=>r([]))},[]);let o=X7(e.tools),s=(n,r)=>{let i=new Set(Z7(o.enabledModules)),a=new Set(Z7(o.disabledModules));r?(a.delete(n.slug),(Z7(o.enabledModules).length>0||Z7(o.enabledGroups).length>0)&&i.add(n.slug)):(i.delete(n.slug),a.add(n.slug)),t({...e,tools:{...o,enabledModules:Q7([...i]),disabledModules:Q7([...a])}})},c=(n??[]).filter(e=>{if(!i)return!0;let t=i.toLowerCase();return e.label.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t)||e.group.toLowerCase().includes(t)}),l=new Map;for(let e of c)l.set(e.group,[...l.get(e.group)??[],e]);let u=(n??[]).filter(e=>a9(o,e)).length;return(0,W.jsxs)(Yx,{className:`px-4 py-3.5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-lg leading-none`,"aria-hidden":`true`,children:`🧩`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-foreground flex items-center gap-2 text-sm font-bold`,children:`Tool Modules`}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 max-w-[520px] truncate font-mono text-xs`,children:[n?`${u}/${n.length} modules enabled`:`loading…`,` · applied on Save`]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Wx,{placeholder:`Filter modules…`,value:i,onChange:e=>a(e.target.value),className:`max-w-[190px]`}),(0,W.jsxs)(`label`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(Y7,{checked:X7(e.mcp).appViews===!0,onCheckedChange:n=>t({...e,mcp:{...X7(e.mcp),appViews:n}}),title:`MCP App Views`}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`App Views`})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 grid max-h-[440px] gap-[18px] overflow-auto`,children:[[...l.entries()].map(([e,t])=>(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[(0,W.jsx)(`div`,{className:`text-muted-foreground mt-2 mb-0.5 font-bold text-[11px] tracking-[0.05em] uppercase`,children:e}),t.map(e=>{let t=a9(o,e);return(0,W.jsxs)(`label`,{className:J(`bg-muted hover:border-brand/40 flex cursor-pointer items-start gap-2.5 rounded-md border px-[11px] py-[9px] transition-colors select-none`,t?`border-brand/50 bg-brand/10`:`border-border`),title:e.description,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:t,onChange:()=>s(e,!t),className:`accent-brand mt-0.5 cursor-pointer`}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`text-foreground flex flex-wrap items-center gap-[7px] text-xs font-semibold`,children:[e.label,(0,W.jsx)(`code`,{className:`text-muted-foreground bg-background border-border rounded border px-1.5 py-px font-mono text-[10px]`,children:e.slug})]}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px] leading-[1.35]`,children:e.description})]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground pt-px font-mono text-[10px] whitespace-nowrap`,children:[e.toolCount,` tool`,e.toolCount===1?``:`s`]})]},e.slug)})]},e)),n&&c.length===0&&(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`No modules match “`,i,`”.`]})]})]})}function Cte({cfg:e,onChange:t}){return(0,W.jsx)(`div`,{className:`mt-1 grid gap-3.5`,children:hte.map(n=>n.kind===`deviceMap`?(0,W.jsx)(xte,{cfg:e,onChange:t},n.id):n.kind===`modules`?(0,W.jsx)(Ste,{cfg:e,onChange:t},n.id):(0,W.jsx)(yte,{cfg:e,onChange:t,section:n},n.id))})}function wte(e){let t=new Set,n=new Set,r=e=>{if(!e||typeof e!=`object`)return;let i=e;if(i.properties&&typeof i.properties==`object`)for(let e of Object.keys(i.properties))t.add(e),r(i.properties[e]);if(Array.isArray(i.enum))for(let e of i.enum)typeof e==`string`&&n.add(e);for(let e of[`items`,`additionalProperties`,`anyOf`,`oneOf`,`allOf`]){let t=i[e];Array.isArray(t)?t.forEach(r):t&&typeof t==`object`&&r(t)}for(let e of[`$defs`,`definitions`,`patternProperties`]){let t=i[e];if(t&&typeof t==`object`)for(let e of Object.values(t))r(e)}};return r(e),{keys:[...t].sort(),enums:[...n.add(`true`).add(`false`)].sort()}}function Tte(e,t){let n=t;for(;n>0&&/[A-Za-z0-9_.-]/.test(e[n-1]);)n--;let r=e.slice(n,t),i=n-1;for(;i>=0&&/\s/.test(e[i]);)i--;return{word:r,start:n,isValue:e[i]===`:`}}var Ete=[[`revert in 30s`,3e4],[`revert in 60s`,6e4],[`revert in 2m`,12e4],[`no auto-revert`,0]];function Dte({value:e,onChange:t,onJsonError:n}){let[r,i]=(0,v.useState)(()=>JSON.stringify(e,null,2)),[a,o]=(0,v.useState)({keys:[],enums:[]}),[s,c]=(0,v.useState)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null);(0,v.useEffect)(()=>{gc(`/api/config-schema`).then(e=>o(wte(e))).catch(()=>{})},[]),(0,v.useEffect)(()=>{u.current!=null&&l.current&&(l.current.selectionStart=l.current.selectionEnd=u.current,u.current=null)});let p=(0,v.useRef)(t),m=(0,v.useRef)(n);p.current=t,m.current=n,(0,v.useEffect)(()=>{let e=setTimeout(()=>{try{let e=JSON.parse(r);m.current?.(null),p.current(e)}catch(e){m.current?.(e instanceof Error?e.message:String(e))}},300);return()=>clearTimeout(e)},[r]);let h=e=>{let{word:t,start:n,isValue:r}=Tte(e.value,e.selectionStart);if(t.length<1){c(null);return}let i=(r?a.enums:a.keys).filter(e=>e.startsWith(t)&&e!==t).slice(0,8);if(!i.length){c(null);return}let o=e.value.slice(0,e.selectionStart).split(`
|
|
140
|
+
`);return(0,W.jsx)(`pre`,{className:`text-muted-foreground m-0 overflow-auto rounded border border-border bg-background py-2 font-mono text-[11px] leading-[1.6] break-words whitespace-pre-wrap`,style:t?{maxHeight:t}:void 0,children:n.map((e,t)=>{let n=j7(e),r=n===`hunk`||n===`file`,i=n===`add`||n===`del`||n===`ctx`?e.slice(1):e;return(0,W.jsxs)(`div`,{className:J(`flex px-2`,M7[n]),children:[(0,W.jsx)(`span`,{className:J(`w-3 shrink-0 select-none text-center`,N7[n]),children:P7[n]}),(0,W.jsx)(`span`,{className:J(`min-w-0 flex-1 break-words whitespace-pre-wrap`,r&&`text-muted-foreground/80`),children:r?e:C7(i)})]},t)})})}function I7(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function L7(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function R7({onRestored:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),h=(0,v.useCallback)(()=>{gc(`/api/config/history`).then(n).catch(()=>n({versions:[],bytes:0,retention:50}))},[]);(0,v.useEffect)(()=>h(),[h]);let g=(e,t)=>_c(e,t).catch(()=>({error:`request failed`})),_=async()=>{let e=(p??``).trim();m(null);let t=await g(`/api/config/history/checkpoint`,{label:e||void 0});i(t.ok?`Checkpoint saved${e?` · “${e}”`:``}`:`Failed: ${t.error}`),t.ok?(Y.success(`Checkpoint saved`),h()):Y.error(t.error??`Checkpoint failed`)},y=async e=>{if(s===e){c(null),u(null);return}c(e),u(null);let t=await gc(`/api/config/history/diff?id=${encodeURIComponent(e)}`).catch(()=>null);u(t)},b=async t=>{f(null),o(!0);let n=await g(`/api/config/history/restore`,{id:t});o(!1),i(n.ok?`Restored ${t}${n.persisted===!1?` (applied live, not persisted)`:``}`:`Restore failed: ${n.error}`),n.ok?(Y.success(`Version restored`),h(),e()):Y.error(n.error??`Restore failed`)},x=async e=>{let t=await g(`/api/config/history/delete`,{id:e});i(t.ok?`Version deleted`:`Failed: ${t.error}`),t.ok?(Y.success(`Version deleted`),h()):Y.error(t.error??`Delete failed`)};return t?(0,W.jsxs)(W.Fragment,{children:[r&&(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-xs`,children:r}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,style:{marginBottom:14},children:[p===null?(0,W.jsx)(X,{size:`sm`,type:`accent`,icon:(0,W.jsx)(ul,{className:`size-4`}),onClick:()=>m(``),children:`Save checkpoint`}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`w-[min(48vw,380px)]`,autoFocus:!0,placeholder:`checkpoint name (e.g. pre-upgrade)`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&_(),e.key===`Escape`&&m(null)}}),(0,W.jsx)(X,{size:`sm`,type:`accent`,onClick:()=>void _(),children:`Save`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>m(null),children:`Cancel`})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[t.versions.length,` versions · `,I7(t.bytes),` · auto-keep `,t.retention]})]}),t.versions.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`No versions yet — they appear here after each config change.`}):(0,W.jsx)(`ol`,{className:`m-0 grid list-none p-0 pl-1.5`,children:t.versions.map((e,t)=>{let n=e.drift.added+e.drift.removed;return(0,W.jsxs)(`li`,{className:`hover:bg-foreground/5 relative grid grid-cols-[24px_minmax(0,1fr)_auto] items-start gap-3 rounded-md px-2.5 py-3.5 transition-colors before:absolute before:top-[25px] before:bottom-0 before:left-[22px] before:w-px before:bg-border last:before:hidden`,children:[(0,W.jsx)(`span`,{className:J(`relative z-[1] mt-1 justify-self-center rounded-full border-[2.5px]`,t===0?`border-brand bg-brand ring-brand/25 size-[14px] ring-4`:`border-border bg-card size-[13px]`),"aria-hidden":`true`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-[9px] text-[12.5px]`,children:[(0,W.jsx)(`span`,{className:J(`rounded-full border px-2 py-0.5 font-mono text-[10px] tracking-[0.05em] uppercase`,e.kind===`checkpoint`?`border-warning/45 bg-warning/10 text-warning`:`border-border text-muted-foreground`),children:e.kind===`checkpoint`?`★ checkpoint`:`auto`}),e.label&&(0,W.jsx)(`span`,{className:`text-foreground font-semibold`,children:e.label}),(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[11.5px]`,children:L7(e.ts)}),t===0?(0,W.jsx)(`span`,{className:`text-brand font-mono text-[10px] font-semibold tracking-[0.05em] uppercase`,children:`latest`}):n===0?(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11.5px]`,children:`identical to current`}):(0,W.jsxs)(`span`,{className:`inline-flex items-baseline gap-[7px] font-mono text-[11.5px]`,children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,e.drift.added]}),(0,W.jsxs)(`span`,{className:`text-destructive`,children:[`−`,e.drift.removed]}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:` vs current`})]})]}),s===e.id&&(0,W.jsx)(`div`,{className:`mt-2`,children:l?l.unified.trim()?(0,W.jsx)(F7,{unified:l.unified,maxHeight:280}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No differences from the current config.`}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`computing diff…`})})]}),(0,W.jsxs)(`div`,{className:`mt-px inline-flex flex-none items-center gap-1.5`,children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>void y(e.id),children:s===e.id?`Hide`:`Diff`}),d===e.id?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{size:`sm`,type:`accent`,disabled:a,onClick:()=>void b(e.id),children:`Confirm restore`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>f(null),children:`Cancel`})]}):(0,W.jsx)(X,{size:`sm`,disabled:t===0,title:t===0?`This is the current config`:`Restore this version`,onClick:()=>f(e.id),children:`Restore`}),e.kind===`checkpoint`&&(0,W.jsx)(X,{size:`sm`,ghost:!0,type:`error`,icon:(0,W.jsx)(gl,{className:`size-4`}),title:`Delete`,onClick:()=>void x(e.id)})]})]},e.id)})})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading history…`})}function z7(e){if(!e)return[];let t=[],n=e=>e?Array.isArray(e.enum)?`enum`:e.type===`array`?`array<${n(e.items)}>`:Array.isArray(e.type)?e.type.join(` | `):e.type??(e.properties?`object`:`any`):`any`,r=(e,i,a,o)=>{let s=e.properties??{};for(let[e,c]of Object.entries(s)){let s=i?`${i}.${e}`:e,l=a||e;t.push({path:s,section:l,type:n(c),def:c.default===void 0?void 0:JSON.stringify(c.default),desc:c.description,enumv:Array.isArray(c.enum)?c.enum:void 0,required:o.has(e)}),c.properties&&r(c,s,l,new Set(c.required??[]));let u=c.additionalProperties;u?.properties&&r(u,`${s}.<name>`,l,new Set(u.required??[]));let d=c.items;d?.properties&&r(d,`${s}[]`,l,new Set(d.required??[]))}};return r(e,``,``,new Set(e.required??[])),t}function B7(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/config-schema`).then(t).catch(()=>{})},[]);let i=(0,v.useMemo)(()=>z7(e),[e]),a=n.trim().toLowerCase(),o=a?i.filter(e=>e.path.toLowerCase().includes(a)||(e.desc??``).toLowerCase().includes(a)):i,s=(0,v.useMemo)(()=>{let e=new Map;for(let t of o){let n=e.get(t.section)??[];n.push(t),e.set(t.section,n)}return[...e.entries()]},[o]);return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,style:{marginBottom:12},children:[(0,W.jsx)(Wx,{className:`w-[min(360px,60vw)]`,placeholder:`Search fields & descriptions…`,value:n,onChange:e=>r(e.target.value)}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[o.length,` options`]})]}),s.length===0?(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[11px]`,children:[`No fields match “`,n,`”.`]}):(0,W.jsx)(`div`,{className:`grid gap-[18px]`,children:s.map(([e,t])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{className:`text-brand m-0 mb-2 font-mono text-[11px] tracking-[0.09em] uppercase`,children:e}),(0,W.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>(0,W.jsxs)(`div`,{className:`border-border bg-muted/45 hover:border-brand/40 rounded-md border px-[13px] py-[11px] transition-colors`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2.5`,children:[(0,W.jsx)(`code`,{className:`text-foreground font-mono text-[12.5px] font-medium`,children:e.path}),(0,W.jsx)(`span`,{className:`text-brand bg-brand/[0.13] rounded-full px-[7px] py-px font-mono text-[10.5px]`,children:e.type}),e.required&&(0,W.jsx)(`span`,{className:`text-destructive font-mono text-[10px] tracking-[0.05em] uppercase`,children:`required`}),e.def!==void 0&&(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`default `,(0,W.jsx)(`code`,{className:`text-muted-foreground`,children:e.def})]})]}),e.desc&&(0,W.jsx)(`p`,{className:`text-muted-foreground mt-1.5 mb-0 text-[12.5px] leading-[1.5]`,children:e.desc}),e.enumv&&(0,W.jsx)(`div`,{className:`mt-[7px] flex flex-wrap gap-1.5`,children:e.enumv.map(e=>(0,W.jsx)(`code`,{className:`border-border text-muted-foreground rounded-md border px-[7px] py-px font-mono text-[11px]`,children:e},e))})]},e.path))})]},e))})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading schema…`})}function V7({...e}){return(0,W.jsx)(hf,{"data-slot":`sheet`,...e})}function H7({...e}){return(0,W.jsx)(xf,{"data-slot":`sheet-portal`,...e})}function U7({className:e,...t}){return(0,W.jsx)(Cf,{"data-slot":`sheet-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function W7({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,W.jsxs)(H7,{children:[(0,W.jsx)(U7,{}),(0,W.jsxs)(Df,{"data-slot":`sheet-content`,className:J(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`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`,n===`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`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,W.jsxs)(If,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,W.jsx)(gl,{className:`size-4`}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function G7({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-header`,className:J(`flex flex-col gap-1.5 p-4`,e),...t})}function fte({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-footer`,className:J(`mt-auto flex flex-col gap-2 p-4`,e),...t})}function pte({className:e,...t}){return(0,W.jsx)(Mf,{"data-slot":`sheet-title`,className:J(`font-semibold text-foreground`,e),...t})}function mte({className:e,...t}){return(0,W.jsx)(Pf,{"data-slot":`sheet-description`,className:J(`text-sm text-muted-foreground`,e),...t})}var hte=500;function K7({title:e,subtitle:t,onClose:n,footer:r,children:i}){let[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(n);return c.current=n,(0,v.useEffect)(()=>{let e=requestAnimationFrame(()=>o(!0));return()=>{cancelAnimationFrame(e),s.current&&clearTimeout(s.current)}},[]),(0,W.jsx)(V7,{open:a,onOpenChange:(0,v.useCallback)(e=>{e||s.current||(o(!1),s.current=setTimeout(()=>c.current(),hte))},[]),children:(0,W.jsxs)(W7,{side:`right`,className:`w-full gap-0 sm:max-w-2xl`,children:[(0,W.jsxs)(G7,{className:`border-b`,children:[(0,W.jsx)(pte,{children:e}),t!=null&&(0,W.jsx)(mte,{children:t})]}),(0,W.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:i}),r!=null&&(0,W.jsx)(fte,{className:`border-t`,children:r})]})})}var q7=[{key:`host`,label:`Host / IP`,type:`text`,placeholder:`192.168.88.1`,help:`SSH host. Ignored when a MAC address is set (MAC-Telnet).`},{key:`port`,label:`SSH port`,type:`number`,placeholder:`22`},{key:`username`,label:`Username`,type:`text`,placeholder:`admin`},{key:`password`,label:`Password`,type:`password`,secret:!0},{key:`timeoutMs`,label:`Timeout (ms)`,type:`number`,placeholder:`10000`},{key:`description`,label:`Description`,type:`text`,placeholder:`Core router`,help:`Free-text label.`},{key:`keyFilename`,label:`SSH key file`,type:`text`,advanced:!0,help:`Path to a private-key file.`},{key:`privateKey`,label:`Private key (PEM)`,type:`password`,secret:!0,advanced:!0},{key:`keyPassphrase`,label:`Key passphrase`,type:`password`,secret:!0,advanced:!0},{key:`jumpVia`,label:`Jump via device`,type:`text`,advanced:!0,help:`Name of another device to use as an SSH bastion.`},{key:`mac`,label:`MAC address`,type:`text`,advanced:!0,help:`Set to reach the device over Layer-2 MAC-Telnet (no IP).`},{key:`sourceMac`,label:`Source MAC`,type:`text`,advanced:!0},{key:`macHost`,label:`MAC-Telnet host iface`,type:`text`,advanced:!0},{key:`macPort`,label:`MAC-Telnet port`,type:`number`,advanced:!0,placeholder:`20561`}],gte=[{id:`devices`,title:`Devices`,icon:`🖧`,kind:`deviceMap`,blurb:`MikroTik routers this server manages. Toggle a device off to hide it from the tools.`,fields:q7},{id:`mcp`,title:`MCP Server`,icon:`⚙️`,kind:`object`,path:`mcp`,blurb:`How the MCP server is exposed to the AI client.`,fields:[{key:`transport`,label:`Transport`,type:`select`,options:[`stdio`,`sse`,`streamable-http`]},{key:`host`,label:`Bind host`,type:`text`,placeholder:`0.0.0.0`},{key:`port`,label:`Bind port`,type:`number`,placeholder:`8000`},{key:`appViews`,label:`MCP App Views`,type:`bool`,help:`Expose rich App-view metadata to compatible clients.`},{key:`toolPageSize`,label:`Tool page size`,type:`number`,advanced:!0,help:`0 = no paging.`},{key:`allowedHosts`,label:`Allowed hosts`,type:`text`,advanced:!0,help:`Comma-separated.`},{key:`allowedOrigins`,label:`Allowed origins`,type:`text`,advanced:!0},{key:`corsOrigins`,label:`CORS origins`,type:`text`,advanced:!0}]},{id:`dashboard`,title:`Observability Dashboard`,icon:`📊`,kind:`object`,path:`dashboard`,enable:{key:`enabled`,label:`Dashboard`},blurb:`This web dashboard — records every tool call and serves the live UI.`,fields:[{key:`host`,label:`Bind host`,type:`text`,placeholder:`0.0.0.0`},{key:`port`,label:`Bind port`,type:`number`,placeholder:`9090`},{key:`token`,label:`Access token`,type:`password`,secret:!0,help:`Require this bearer token to view the dashboard.`},{key:`captureBody`,label:`Capture tool input/output`,type:`bool`},{key:`redactInput`,label:`Redact input bodies`,type:`bool`},{key:`dbPath`,label:`Database path`,type:`text`,advanced:!0},{key:`maxEvents`,label:`Max events kept`,type:`number`,advanced:!0},{key:`maxBodyBytes`,label:`Max body bytes`,type:`number`,advanced:!0}]},{id:`ssh`,title:`SSH Connection Pool`,icon:`🔌`,kind:`object`,path:`ssh`,enable:{key:`keepAlive`,label:`Keep-alive pooling`},blurb:`Reuse SSH connections across tool calls for lower latency.`,fields:[{key:`keepAliveInterval`,label:`Keep-alive interval (ms)`,type:`number`,placeholder:`10000`},{key:`idleTimeout`,label:`Idle timeout (ms)`,type:`number`,placeholder:`30000`}]},{id:`s3`,title:`S3 Backups`,icon:`☁️`,kind:`object`,path:`s3`,enable:{presence:!0,label:`S3 backups`},blurb:`Ship config backups to an S3-compatible bucket.`,fields:[{key:`bucket`,label:`Bucket`,type:`text`},{key:`region`,label:`Region`,type:`text`},{key:`endpoint`,label:`Endpoint`,type:`text`,placeholder:`https://s3.example.com`},{key:`accessKeyId`,label:`Access key ID`,type:`password`,secret:!0},{key:`secretAccessKey`,label:`Secret access key`,type:`password`,secret:!0},{key:`prefix`,label:`Key prefix`,type:`text`},{key:`sessionToken`,label:`Session token`,type:`password`,secret:!0,advanced:!0},{key:`presignExpiresIn`,label:`Presign expiry (s)`,type:`number`,advanced:!0,placeholder:`3600`}]},{id:`memory`,title:`Knowledge Memory`,icon:`🧠`,kind:`object`,path:`memory`,enable:{key:`enabled`,label:`Memory`},blurb:`Persistent knowledge graph the AI can read and write.`,fields:[{key:`dbPath`,label:`Database path`,type:`text`}]},{id:`modules`,title:`Tool Modules`,icon:`🧩`,kind:`modules`,blurb:`Curate which tool modules are exposed to the AI client.`,fields:[]},{id:`general`,title:`General`,icon:`🎛️`,kind:`object`,blurb:`Server-wide options.`,fields:[{key:`readOnly`,label:`Read-only mode`,type:`bool`,help:`Block all write/destructive tools.`},{key:`disableUpdateCheck`,label:`Disable update check`,type:`bool`},{key:`backupDir`,label:`Backup directory`,type:`text`,advanced:!0}]}];function J7({className:e,size:t=`default`,...n}){return(0,W.jsx)(vv,{"data-slot":`switch`,"data-size":t,className:J(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,W.jsx)(bv,{"data-slot":`switch-thumb`,className:J(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`)})})}var _te=`«redacted»`,Y7=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},X7=e=>Array.isArray(e)?e:[],Z7=e=>[...new Set(e)],Q7=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e);function $7(e,t){return t.path?Y7(e[t.path]):e}function e9(e,t,n,r){if(t.path){let i={...Y7(e[t.path])};return r===void 0||r===``?delete i[n]:i[n]=r,{...e,[t.path]:i}}let i={...e};return r===void 0||r===``?delete i[n]:i[n]=r,i}function t9(e,t){return t.enable?t.enable.presence?e[t.path??``]!==void 0:$7(e,t)[t.enable.key??`enabled`]!==!1:!0}function n9({field:e,value:t,onChange:n}){let r=`f_${e.key}`,i=e.type===`bool`,a;return a=e.type===`bool`?(0,W.jsx)(J7,{checked:t===!0,onCheckedChange:n}):e.type===`select`?(0,W.jsx)(Jx,{value:Q7(t??e.options?.[0]??``),onValueChange:n,options:(e.options??[]).map(e=>({value:e,label:e}))}):e.type===`number`?(0,W.jsx)(Wx,{id:r,type:`number`,placeholder:e.placeholder,value:t==null?``:Q7(t),onChange:e=>n(e.target.value===``?void 0:Number(e.target.value))}):(0,W.jsx)(Wx,{id:r,type:e.type===`password`?`password`:`text`,placeholder:e.secret&&t===_te?`•••• unchanged`:e.placeholder,value:t==null?``:Q7(t),onChange:e=>n(e.target.value)}),(0,W.jsxs)(`div`,{className:J(`flex min-w-0`,i?`flex-row items-center justify-between gap-2.5`:`flex-col gap-1.5`),children:[(0,W.jsxs)(vb,{htmlFor:r,className:`text-muted-foreground text-xs font-semibold`,children:[e.label,e.secret&&(0,W.jsx)(`span`,{className:`text-warning text-[10px] font-semibold tracking-[0.04em] uppercase`,children:`secret`})]}),a,e.help&&(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px] leading-[1.4]`,children:e.help})]})}function r9({fields:e,value:t,onField:n}){let[r,i]=(0,v.useState)(!1),a=e.filter(e=>!e.advanced),o=e.filter(e=>e.advanced);return(0,W.jsxs)(`div`,{className:`mt-1 grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-x-4 gap-y-3`,children:[a.map(e=>(0,W.jsx)(n9,{field:e,value:t[e.key],onChange:t=>n(e.key,t)},e.key)),o.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground col-span-full flex cursor-pointer items-center gap-1 border-0 bg-transparent py-1 text-left text-xs font-semibold`,onClick:()=>i(e=>!e),children:[r?(0,W.jsx)(Pc,{className:`size-3`}):(0,W.jsx)(Fc,{className:`size-3`}),` `,`Advanced (`,o.length,`)`]}),r&&o.map(e=>(0,W.jsx)(n9,{field:e,value:t[e.key],onChange:t=>n(e.key,t)},e.key))]})]})}var vte={prefix:``,presignExpiresIn:3600};function yte(e,t){let n=$7(e,t),r=e=>n[e]!=null&&n[e]!==``?Q7(n[e]):``,i=r(`host`)?`${r(`host`)}:${r(`port`)}`:``;return t.id===`mcp`?[r(`transport`),i].filter(Boolean).join(` · `):t.id===`dashboard`?[i,n.token?`token set`:`open`].filter(Boolean).join(` · `):t.id===`ssh`?`interval ${r(`keepAliveInterval`)||`?`}ms · idle ${r(`idleTimeout`)||`?`}ms`:t.id===`s3`?t9(e,t)?[r(`bucket`),r(`region`),r(`endpoint`)].filter(Boolean).join(` · `)||`not configured`:``:t.id===`memory`?r(`dbPath`):t.id===`general`?`${e.readOnly?`read-only`:`read-write`}${e.disableUpdateCheck?` · no update check`:``}`:``}function bte({cfg:e,onChange:t,section:n}){let[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null),o=t9(e,n),s=r=>{if(n.enable?.presence){if(r)t({...e,[n.path]:a.current??(n.id===`s3`?vte:{})});else{a.current=Y7(e[n.path]);let r={...e};delete r[n.path],t(r),i(!1)}return}t(e9(e,n,n.enable.key??`enabled`,r))},c=yte(e,n);return(0,W.jsxs)(Yx,{className:J(`px-4 py-3.5 transition-opacity`,!o&&`opacity-50`),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-lg leading-none`,"aria-hidden":`true`,children:n.icon}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`text-foreground flex items-center gap-2 text-sm font-bold`,children:[n.title,n.enable&&(0,W.jsx)(Bx,{type:o?`success`:`secondary`,children:o?`active`:`off`})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground mt-0.5 max-w-[520px] truncate font-mono text-xs`,children:c||n.blurb})]}),(0,W.jsx)(`span`,{className:`flex-1`}),n.enable&&(0,W.jsx)(J7,{checked:o,onCheckedChange:s,title:`${o?`Deactivate`:`Activate`} ${n.enable.label??n.title}`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>i(!0),disabled:n.enable?.presence&&!o,children:`Edit`})]}),r&&(0,W.jsxs)(K7,{title:`${n.icon} ${n.title}`,subtitle:n.blurb,onClose:()=>i(!1),children:[n.enable&&(0,W.jsxs)(`label`,{className:`border-border bg-muted text-foreground flex items-center gap-2.5 rounded-md border px-3 py-2.5 text-[13px] font-semibold`,children:[(0,W.jsx)(J7,{checked:o,onCheckedChange:s}),o?`Active`:`Inactive — enable ${n.enable.label??n.title}`]}),o?(0,W.jsx)(r9,{fields:n.fields,value:$7(e,n),onField:(r,i)=>t(e9(e,n,r,i))}):(0,W.jsx)(Lx,{type:`secondary`,label:!1,children:`This section is turned off. Toggle it on to edit its settings.`})]})]})}function xte({cfg:e,onChange:t,name:n,isNew:r,onClose:i}){let[a,o]=(0,v.useState)(n),[s,c]=(0,v.useState)(null),l=Y7(e.devices),u=Y7(l[n]),d=(r,i)=>{let a={...u};i===void 0||i===``?delete a[r]:a[r]=i,t({...e,devices:{...l,[n]:a}})},f=()=>{let r=a.trim();if(r===n)return!0;if(!r)return c(`Name cannot be empty.`),!1;if(l[r])return c(`A device named "${r}" already exists.`),!1;let i={...l,[r]:u};return delete i[n],t({...e,devices:i}),!0},p=()=>{f()&&i()};return(0,W.jsxs)(K7,{title:r?`Add device`:`Device · ${n}`,subtitle:r?`New MikroTik router`:void 0,onClose:p,footer:(0,W.jsx)(X,{type:`success`,size:`sm`,onClick:p,children:`Done`}),children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,W.jsx)(vb,{htmlFor:`dev_name`,className:`text-muted-foreground text-xs font-semibold`,children:`Name`}),(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(Wx,{id:`dev_name`,value:a,onChange:e=>{o(e.target.value),c(null)},placeholder:`core-router`}),!r&&a.trim()!==n&&(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>f(),children:`Rename`})]}),s&&(0,W.jsx)(`span`,{className:`text-destructive text-[11px]`,children:s})]}),(0,W.jsx)(r9,{fields:q7,value:u,onField:d})]})}function Ste({cfg:e,onChange:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),o=Y7(e.devices),s=Object.keys(o),c=Q7(e.defaultDevice),l=()=>{let n=`device`,i=1,a=n;for(;o[a];)a=`${n}-${++i}`;t({...e,devices:{...o,[a]:{host:`192.168.88.1`,port:22,username:`admin`,password:``,timeoutMs:1e4}}}),r({name:a,isNew:!0})},u=(n,r)=>{t({...e,devices:{...o,[n]:{...Y7(o[n]),disabled:r}}})},d=n=>{let r={...o};delete r[n];let i={...e,devices:r};c===n&&(i.defaultDevice=Object.keys(r)[0]??``),t(i),a(null)};return(0,W.jsxs)(Yx,{className:`px-4 py-3.5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-lg leading-none`,"aria-hidden":`true`,children:`🖧`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-foreground flex items-center gap-2 text-sm font-bold`,children:`Devices`}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 max-w-[520px] truncate font-mono text-xs`,children:[s.length,` device`,s.length===1?``:`s`,` · default: `,c||`—`]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`label`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Default`}),(0,W.jsx)(Jx,{value:c,onValueChange:n=>t({...e,defaultDevice:n}),options:s.map(e=>({value:e,label:e}))})]}),(0,W.jsx)(X,{size:`sm`,onClick:l,icon:(0,W.jsx)(Qc,{className:`size-4`}),children:`Add device`})]}),(0,W.jsxs)(`div`,{className:`mt-3 grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-3`,children:[s.map(e=>{let t=Y7(o[e]),n=t.disabled===!0,s=t.mac?Q7(t.mac):`${Q7(t.host)||`?`}:${Q7(t.port)||`22`}`;return(0,W.jsxs)(`div`,{className:J(`border-border bg-card hover:border-brand/40 flex flex-col gap-1.5 rounded-lg border px-[15px] py-3.5 transition-colors`,n&&`opacity-50 grayscale-[0.4]`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:J(`inline-block size-2 shrink-0 rounded-full`,n?`bg-muted-foreground/60`:`bg-success`)}),(0,W.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,children:e}),c===e&&(0,W.jsx)(Bx,{type:`accent`,children:`default`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(J7,{checked:!n,onCheckedChange:t=>u(e,!t),title:n?`Enable device`:`Disable device`})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-[11px] break-words`,children:s}),t.description?(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-[11px] break-words`,children:Q7(t.description)}):null,(0,W.jsxs)(`div`,{className:`mt-auto flex gap-1.5 pt-1`,children:[(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>r({name:e,isNew:!1}),children:`Edit`}),i===e?(0,W.jsx)(X,{size:`sm`,type:`error`,onClick:()=>d(e),children:`Confirm?`}):(0,W.jsx)(X,{size:`sm`,ghost:!0,type:`error`,onClick:()=>a(e),children:`Remove`})]})]},e)}),s.length===0&&(0,W.jsxs)(Lx,{type:`secondary`,label:!1,children:[`No devices yet. Click `,(0,W.jsx)(`b`,{children:`Add device`}),` to configure your first router.`]})]}),n&&(0,W.jsx)(xte,{cfg:e,onChange:t,name:n.name,isNew:n.isNew,onClose:()=>r(null)})]})}function i9(e,t){let n=X7(e.disabledModules),r=X7(e.disabledGroups),i=X7(e.enabledModules),a=X7(e.enabledGroups);return n.includes(t.slug)||r.includes(t.group)?!1:i.length===0&&a.length===0?!0:i.includes(t.slug)||a.includes(t.group)}function Cte({cfg:e,onChange:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/modules`).then(e=>r(e.modules)).catch(()=>r([]))},[]);let o=Y7(e.tools),s=(n,r)=>{let i=new Set(X7(o.enabledModules)),a=new Set(X7(o.disabledModules));r?(a.delete(n.slug),(X7(o.enabledModules).length>0||X7(o.enabledGroups).length>0)&&i.add(n.slug)):(i.delete(n.slug),a.add(n.slug)),t({...e,tools:{...o,enabledModules:Z7([...i]),disabledModules:Z7([...a])}})},c=(n??[]).filter(e=>{if(!i)return!0;let t=i.toLowerCase();return e.label.toLowerCase().includes(t)||e.slug.toLowerCase().includes(t)||e.group.toLowerCase().includes(t)}),l=new Map;for(let e of c)l.set(e.group,[...l.get(e.group)??[],e]);let u=(n??[]).filter(e=>i9(o,e)).length;return(0,W.jsxs)(Yx,{className:`px-4 py-3.5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:`text-lg leading-none`,"aria-hidden":`true`,children:`🧩`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-foreground flex items-center gap-2 text-sm font-bold`,children:`Tool Modules`}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 max-w-[520px] truncate font-mono text-xs`,children:[n?`${u}/${n.length} modules enabled`:`loading…`,` · applied on Save`]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Wx,{placeholder:`Filter modules…`,value:i,onChange:e=>a(e.target.value),className:`max-w-[190px]`}),(0,W.jsxs)(`label`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(J7,{checked:Y7(e.mcp).appViews===!0,onCheckedChange:n=>t({...e,mcp:{...Y7(e.mcp),appViews:n}}),title:`MCP App Views`}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`App Views`})]})]}),(0,W.jsxs)(`div`,{className:`mt-3 grid max-h-[440px] gap-[18px] overflow-auto`,children:[[...l.entries()].map(([e,t])=>(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[(0,W.jsx)(`div`,{className:`text-muted-foreground mt-2 mb-0.5 font-bold text-[11px] tracking-[0.05em] uppercase`,children:e}),t.map(e=>{let t=i9(o,e);return(0,W.jsxs)(`label`,{className:J(`bg-muted hover:border-brand/40 flex cursor-pointer items-start gap-2.5 rounded-md border px-[11px] py-[9px] transition-colors select-none`,t?`border-brand/50 bg-brand/10`:`border-border`),title:e.description,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:t,onChange:()=>s(e,!t),className:`accent-brand mt-0.5 cursor-pointer`}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`text-foreground flex flex-wrap items-center gap-[7px] text-xs font-semibold`,children:[e.label,(0,W.jsx)(`code`,{className:`text-muted-foreground bg-background border-border rounded border px-1.5 py-px font-mono text-[10px]`,children:e.slug})]}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px] leading-[1.35]`,children:e.description})]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground pt-px font-mono text-[10px] whitespace-nowrap`,children:[e.toolCount,` tool`,e.toolCount===1?``:`s`]})]},e.slug)})]},e)),n&&c.length===0&&(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`No modules match “`,i,`”.`]})]})]})}function wte({cfg:e,onChange:t}){return(0,W.jsx)(`div`,{className:`mt-1 grid gap-3.5`,children:gte.map(n=>n.kind===`deviceMap`?(0,W.jsx)(Ste,{cfg:e,onChange:t},n.id):n.kind===`modules`?(0,W.jsx)(Cte,{cfg:e,onChange:t},n.id):(0,W.jsx)(bte,{cfg:e,onChange:t,section:n},n.id))})}function Tte(e){let t=new Set,n=new Set,r=e=>{if(!e||typeof e!=`object`)return;let i=e;if(i.properties&&typeof i.properties==`object`)for(let e of Object.keys(i.properties))t.add(e),r(i.properties[e]);if(Array.isArray(i.enum))for(let e of i.enum)typeof e==`string`&&n.add(e);for(let e of[`items`,`additionalProperties`,`anyOf`,`oneOf`,`allOf`]){let t=i[e];Array.isArray(t)?t.forEach(r):t&&typeof t==`object`&&r(t)}for(let e of[`$defs`,`definitions`,`patternProperties`]){let t=i[e];if(t&&typeof t==`object`)for(let e of Object.values(t))r(e)}};return r(e),{keys:[...t].sort(),enums:[...n.add(`true`).add(`false`)].sort()}}function Ete(e,t){let n=t;for(;n>0&&/[A-Za-z0-9_.-]/.test(e[n-1]);)n--;let r=e.slice(n,t),i=n-1;for(;i>=0&&/\s/.test(e[i]);)i--;return{word:r,start:n,isValue:e[i]===`:`}}var Dte=[[`revert in 30s`,3e4],[`revert in 60s`,6e4],[`revert in 2m`,12e4],[`no auto-revert`,0]];function Ote({value:e,onChange:t,onJsonError:n}){let[r,i]=(0,v.useState)(()=>JSON.stringify(e,null,2)),[a,o]=(0,v.useState)({keys:[],enums:[]}),[s,c]=(0,v.useState)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null);(0,v.useEffect)(()=>{gc(`/api/config-schema`).then(e=>o(Tte(e))).catch(()=>{})},[]),(0,v.useEffect)(()=>{u.current!=null&&l.current&&(l.current.selectionStart=l.current.selectionEnd=u.current,u.current=null)});let p=(0,v.useRef)(t),m=(0,v.useRef)(n);p.current=t,m.current=n,(0,v.useEffect)(()=>{let e=setTimeout(()=>{try{let e=JSON.parse(r);m.current?.(null),p.current(e)}catch(e){m.current?.(e instanceof Error?e.message:String(e))}},300);return()=>clearTimeout(e)},[r]);let h=e=>{let{word:t,start:n,isValue:r}=Ete(e.value,e.selectionStart);if(t.length<1){c(null);return}let i=(r?a.enums:a.keys).filter(e=>e.startsWith(t)&&e!==t).slice(0,8);if(!i.length){c(null);return}let o=e.value.slice(0,e.selectionStart).split(`
|
|
141
141
|
`),s=o[o.length-1].length,l=Math.min(12+s*7.22-e.scrollLeft,e.clientWidth-160),u=10+o.length*18-e.scrollTop+4;c({items:i,index:0,start:n,x:Math.max(4,l),y:u})},g=e=>{let t=l.current;if(!t||!s)return;let n=r.slice(0,s.start)+e+r.slice(t.selectionStart);u.current=s.start+e.length,i(n),c(null)},_=e=>{if(!s){e.key===` `&&e.ctrlKey&&(e.preventDefault(),h(e.currentTarget));return}e.key===`ArrowDown`?(e.preventDefault(),c({...s,index:(s.index+1)%s.items.length})):e.key===`ArrowUp`?(e.preventDefault(),c({...s,index:(s.index-1+s.items.length)%s.items.length})):e.key===`Enter`||e.key===`Tab`?(e.preventDefault(),g(s.items[s.index])):e.key===`Escape`&&c(null)},y=r.split(`
|
|
142
142
|
`).length;return(0,W.jsxs)(`div`,{className:`border-border bg-background flex max-h-[420px] overflow-hidden rounded-md border`,children:[(0,W.jsx)(`pre`,{className:`bg-muted text-muted-foreground m-0 min-w-[38px] overflow-hidden px-2 py-2.5 text-right font-mono text-xs leading-[1.5] select-none`,"aria-hidden":`true`,ref:f,children:Array.from({length:y},(e,t)=>t+1).join(`
|
|
143
143
|
`)}),(0,W.jsxs)(`div`,{className:`relative flex-1`,children:[(0,W.jsxs)(`pre`,{className:`text-muted-foreground pointer-events-none absolute inset-0 z-0 m-0 box-border overflow-hidden px-3 py-2.5 font-mono text-xs leading-[1.5] whitespace-pre [tab-size:2] [&_.j-bool]:text-chart-4 [&_.j-key]:text-chart-1 [&_.j-null]:text-muted-foreground [&_.j-num]:text-chart-3 [&_.j-str]:text-chart-2`,"aria-hidden":`true`,ref:d,children:[C7(r),`
|
|
144
|
-
`]}),(0,W.jsx)(FS,{ref:l,className:`caret-brand selection:bg-brand/35 relative z-[1] m-0 box-border h-[400px] min-h-0 w-full resize-y rounded-none border-0 bg-transparent px-3 py-2.5 font-mono text-xs leading-[1.5] whitespace-pre text-transparent shadow-none [field-sizing:fixed] [tab-size:2] outline-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent`,spellCheck:!1,wrap:`off`,value:r,onChange:e=>{i(e.target.value),h(e.currentTarget)},onKeyDown:_,onClick:()=>c(null),onScroll:e=>{let t=e.currentTarget;d.current&&(d.current.scrollTop=t.scrollTop,d.current.scrollLeft=t.scrollLeft),f.current&&(f.current.scrollTop=t.scrollTop)}}),s&&(0,W.jsx)(`div`,{className:`border-brand bg-card absolute z-[5] max-h-[184px] min-w-[150px] overflow-y-auto rounded-md border shadow-lg`,style:{left:s.x,top:s.y},children:s.items.map((e,t)=>(0,W.jsx)(`div`,{className:J(`cursor-pointer px-[11px] py-[5px] font-mono text-xs`,t===s.index?`bg-brand/20 text-foreground`:`text-muted-foreground`),onMouseDown:t=>{t.preventDefault(),g(e)},children:e},e))})]})]})}var
|
|
145
|
-
`).map((e,t)=>(0,W.jsx)(`div`,{className:e.startsWith(`+`)?`text-success`:e.startsWith(`-`)?`text-destructive`:e.startsWith(`@@`)?`text-brand`:``,children:e||` `},t))})]})]})}function kte({x:e,y:t,text:n,className:r,textClassName:i,padX:a=9,fontSize:o=9}){let s=(0,v.useRef)(null),[c,l]=(0,v.useState)(()=>n.length*o*.62);(0,v.useLayoutEffect)(()=>{let e=s.current?.getComputedTextLength();e&&e>0&&l(e)},[n,o]);let u=Math.round(c+a*2);return(0,W.jsxs)(`g`,{transform:`translate(${e.toFixed(1)},${t.toFixed(1)})`,children:[(0,W.jsx)(`rect`,{className:r,x:-u/2,y:-9,rx:9,width:u,height:18}),(0,W.jsx)(`text`,{ref:s,className:i,x:0,y:3.5,textAnchor:`middle`,fontSize:o,children:n})]})}function s9(e){return e.reachable===!0?{label:`online`,color:`var(--foreground)`}:e.reachable===!1?{label:`offline`,color:`var(--destructive)`}:{label:`checking…`,color:`var(--muted-foreground)`}}function c9(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(t,31)+e.charCodeAt(n)>>>0;return`hsl(${t%360} 70% 62%)`}function l9(e,t,n,r){let i=1-r;return{x:i*i*e.x+2*i*r*t.x+r*r*n.x,y:i*i*e.y+2*i*r*t.y+r*r*n.y}}function u9(e,t,n,r){let i=1-r,a=2*i*(t.x-e.x)+2*r*(n.x-t.x),o=2*i*(t.y-e.y)+2*r*(n.y-t.y);return Math.atan2(o,a)*180/Math.PI}var d9=`var(--foreground)`,f9=`var(--muted-foreground)`,p9=`var(--warning)`;function m9(e){return e.jumpVia?e.jumpVia:e.jumpHost?`${e.jumpHost.host}:${e.jumpHost.port}`:null}var h9=18,Ate=e=>e.length>h9?`${e.slice(0,h9-1)}…`:e,jte=e=>Math.max(23,Math.min(70,e.length*3.1+12));function Mte({payload:e,pulses:t}){let n=e.devices,r=Math.max(1,n.length),i=n.map(e=>{let t=Ate(e.name);return{d:e,label:t,r:jte(t)}}),a=Math.max(23,...i.map(e=>e.r)),o=r>1?(a+18)/Math.sin(Math.PI/r):0,s=Math.max(110+a,o,120),c=a+60,l=Math.max(700,Math.round((s+a+40)*2)),u=Math.round((s+c)*2),d=l/2,f=u/2,p={x:d,y:f},m=i.map((e,t)=>{let n=t/r*Math.PI*2-Math.PI/2+(r%2==0?Math.PI/r:0);return{...e,i:t,x:d+s*Math.cos(n),y:f+s*Math.sin(n)}});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`svg`,{className:`conn`,viewBox:`0 0 ${l} ${u}`,width:`100%`,height:u,preserveAspectRatio:`xMidYMid meet`,children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`radialGradient`,{id:`conn-hub`,cx:`0.5`,cy:`0.34`,r:`0.75`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--foreground)`}),(0,W.jsx)(`stop`,{offset:`0.6`,stopColor:`color-mix(in srgb, var(--foreground) 70%, var(--muted-foreground))`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--muted-foreground)`})]}),(0,W.jsxs)(`radialGradient`,{id:`conn-orb`,cx:`0.5`,cy:`0.32`,r:`0.85`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--muted)`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--card)`})]}),(0,W.jsxs)(`radialGradient`,{id:`conn-burst`,cx:`0.5`,cy:`0.5`,r:`0.5`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--foreground)`}),(0,W.jsx)(`stop`,{offset:`0.5`,stopColor:`color-mix(in srgb, var(--foreground) 80%, transparent)`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--muted-foreground)`,stopOpacity:`0`})]}),(0,W.jsxs)(`linearGradient`,{id:`conn-tunnel-grad`,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:p9,stopOpacity:`0.15`}),(0,W.jsx)(`stop`,{offset:`0.5`,stopColor:p9,stopOpacity:`0.95`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:p9,stopOpacity:`0.15`})]}),(0,W.jsxs)(`filter`,{id:`conn-tunnel-glow`,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:[(0,W.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`b`}),(0,W.jsxs)(`feMerge`,{children:[(0,W.jsx)(`feMergeNode`,{in:`b`}),(0,W.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),[.5,.78,1].map((e,t)=>(0,W.jsx)(`circle`,{className:`conn-grid`,cx:d,cy:f,r:s*e},`g-${t}`)),[0,1,2].map(e=>(0,W.jsx)(`circle`,{className:`conn-sonar`,cx:d,cy:f,style:{animationDelay:`${e*1.1}s`}},`s-${e}`)),m.map(({d:e,i:n,x:r,y:i})=>{let a=s9(e.status),o=e.status.reachable===!0,s=e.status.reachable==null,c={x:r,y:i},l=(d+r)/2,u=(f+i)/2,m=r-d,h=i-f,g=Math.hypot(m,h)||1,_=-h/g,v=m/g,y={x:l+_*16,y:u+v*16},b={x:l-_*16,y:u-v*16},x=`M${d},${f} Q${y.x.toFixed(1)},${y.y.toFixed(1)} ${r.toFixed(1)},${i.toFixed(1)}`,S=`M${d},${f} Q${b.x.toFixed(1)},${b.y.toFixed(1)} ${r.toFixed(1)},${i.toFixed(1)}`,C=`M${d},${f} Q${l.toFixed(1)},${u.toFixed(1)} ${r.toFixed(1)},${i.toFixed(1)}`,w=l9(p,y,c,.52),T=u9(p,y,c,.52),E=l9(p,b,c,.48),D=u9(p,b,c,.48)+180,O=t[e.name]??0;return(0,W.jsxs)(`g`,{children:[(0,W.jsx)(`path`,{id:`conn-cmd-${n}`,className:`conn-link`,d:x,stroke:o?d9:a.color,strokeOpacity:o?.5:.32,strokeDasharray:s?`2 8`:o?void 0:`6 7`}),(0,W.jsx)(`path`,{id:`conn-res-${n}`,className:`conn-link`,d:S,stroke:o?f9:a.color,strokeOpacity:o?.5:.18,strokeDasharray:o?void 0:`6 7`}),o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{className:`conn-flow`,d:x,stroke:`var(--foreground)`}),(0,W.jsx)(`circle`,{className:`conn-packet`,r:3.2,fill:`var(--foreground)`,children:(0,W.jsx)(`animateMotion`,{dur:`2.6s`,repeatCount:`indefinite`,calcMode:`linear`,children:(0,W.jsx)(`mpath`,{href:`#conn-cmd-${n}`})})}),(0,W.jsx)(`rect`,{className:`conn-packet`,x:-2.6,y:-2.6,width:5.2,height:5.2,fill:`var(--muted-foreground)`,transform:`rotate(45)`,children:(0,W.jsx)(`animateMotion`,{dur:`2.6s`,begin:`0.9s`,repeatCount:`indefinite`,calcMode:`linear`,keyPoints:`1;0`,keyTimes:`0;1`,children:(0,W.jsx)(`mpath`,{href:`#conn-res-${n}`})})}),(0,W.jsx)(`path`,{className:`conn-chevron`,d:`M-4,-3 L4,0 L-4,3`,stroke:`var(--foreground)`,transform:`translate(${w.x.toFixed(1)},${w.y.toFixed(1)}) rotate(${T.toFixed(1)})`}),(0,W.jsx)(`path`,{className:`conn-chevron`,d:`M-4,-3 L4,0 L-4,3`,stroke:`var(--muted-foreground)`,transform:`translate(${E.x.toFixed(1)},${E.y.toFixed(1)}) rotate(${D.toFixed(1)})`})]}),O>0&&(0,W.jsx)(`g`,{children:(0,W.jsxs)(`circle`,{r:6,fill:`url(#conn-burst)`,children:[(0,W.jsx)(`animateMotion`,{dur:`1.1s`,repeatCount:`1`,calcMode:`linear`,keyPoints:`0;1;0`,keyTimes:`0;0.5;1`,path:C}),(0,W.jsx)(`animate`,{attributeName:`opacity`,values:`0;1;1;0`,keyTimes:`0;0.1;0.85;1`,dur:`1.1s`,repeatCount:`1`,fill:`freeze`})]})},`burst-${e.name}-${O}`)]},`l-${e.name}`)}),m.map(e=>{let t=e.d.jumpVia,n=t?m.find(e=>e.d.name===t):void 0,r=!n&&e.d.jumpHost?e.d.jumpHost:void 0;if(!n&&!r)return null;let i={x:e.x,y:e.y},a=Math.hypot(e.x-d,e.y-f)||1,o=(e.x-d)/a,s=(e.y-f)/a,c=n?{x:n.x,y:n.y}:{x:e.x+o*(e.r+46),y:e.y+s*(e.r+46)},l=(c.x+i.x)/2,u=(c.y+i.y)/2,p=Math.hypot(l-d,u-f)||1,h=n?50:16,g={x:l+(l-d)/p*h,y:u+(u-f)/p*h},_=`M${c.x.toFixed(1)},${c.y.toFixed(1)} Q${g.x.toFixed(1)},${g.y.toFixed(1)} ${i.x.toFixed(1)},${i.y.toFixed(1)}`,v=m9(e.d)??``,y=l9(c,g,i,.5),b=`conn-tunnel-${e.i}`;return(0,W.jsxs)(`g`,{className:`conn-tunnel-g`,children:[(0,W.jsx)(`path`,{className:`conn-tunnel-halo`,d:_,stroke:p9}),(0,W.jsx)(`path`,{id:b,className:`conn-tunnel`,d:_,stroke:`url(#conn-tunnel-grad)`,filter:`url(#conn-tunnel-glow)`}),r&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{className:`conn-tunnel-sat`,cx:c.x,cy:c.y,r:11,fill:`var(--background)`,stroke:`var(--warning)`}),(0,W.jsx)(`text`,{x:c.x,y:c.y+3.5,textAnchor:`middle`,fontSize:11,children:`🛡️`})]}),(0,W.jsxs)(`text`,{className:`conn-tunnel-lock`,fontSize:13,textAnchor:`middle`,children:[`🔒`,(0,W.jsx)(`animateMotion`,{dur:`2.4s`,repeatCount:`indefinite`,calcMode:`linear`,rotate:`auto`,children:(0,W.jsx)(`mpath`,{href:`#${b}`})})]}),(0,W.jsx)(kte,{x:y.x,y:y.y,text:`⤳ via ${v}`,className:`conn-tunnel-badge`,textClassName:`conn-tunnel-badge-tx`})]},`jump-${e.d.name}`)}),(0,W.jsx)(`circle`,{className:`conn-hub-glow`,cx:d,cy:f,r:42}),(0,W.jsx)(`circle`,{className:`conn-hub-ring`,cx:d,cy:f,r:37}),(0,W.jsx)(`circle`,{cx:d,cy:f,r:29,fill:`url(#conn-hub)`,stroke:`var(--border)`,strokeWidth:1.5}),(0,W.jsx)(`text`,{x:d,y:f-4,textAnchor:`middle`,fill:`var(--background)`,fontSize:12,fontWeight:700,children:`LLM`}),(0,W.jsx)(`text`,{x:d,y:f+8,textAnchor:`middle`,fill:`var(--background)`,fillOpacity:.66,fontSize:8,fontWeight:600,children:`⇄ MCP`}),(0,W.jsx)(`text`,{x:d,y:f+18,textAnchor:`middle`,fill:`var(--background)`,fillOpacity:.66,fontSize:7.5,fontWeight:600,children:`server`}),m.map(({d:e,x:t,y:n,r,label:i})=>{let a=s9(e.status),o=e.status.reachable===!0,s=o?`${e.status.latencyMs??`?`} ms`:a.label,c=c9(e.name);return(0,W.jsxs)(`g`,{className:`conn-node`,opacity:e.disabled?.35:1,children:[o&&(0,W.jsx)(`circle`,{className:`conn-node-halo`,cx:t,cy:n,r:r+1,stroke:c}),e.pool?.pooled&&(0,W.jsx)(`circle`,{cx:t,cy:n,r:r+5,fill:`none`,stroke:e.pool.inflight>0?`var(--chart-1)`:`var(--success)`,strokeWidth:1.5,strokeDasharray:e.pool.inflight>0?void 0:`4 4`,opacity:.5,className:e.pool.inflight>0?`conn-blink`:void 0}),(0,W.jsx)(`circle`,{cx:t,cy:n,r,fill:`url(#conn-orb)`}),(0,W.jsx)(`circle`,{cx:t,cy:n,r,fill:c,opacity:.16}),(0,W.jsx)(`circle`,{cx:t,cy:n,r,fill:`none`,stroke:c,strokeWidth:2.5}),(0,W.jsx)(`circle`,{className:o?`conn-blink`:void 0,cx:t+r*.7,cy:n-r*.7,r:4.5,fill:a.color,stroke:`var(--background)`,strokeWidth:1.5}),(0,W.jsx)(`text`,{x:t,y:n+3.5,textAnchor:`middle`,fill:`var(--foreground)`,fontSize:10,fontWeight:600,children:i}),(0,W.jsx)(`text`,{x:t,y:n+r+14,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:9,children:e.address??e.host}),(0,W.jsx)(`text`,{x:t,y:n+r+26,textAnchor:`middle`,fill:a.color,fontSize:9,fontWeight:600,children:s})]},`n-${e.name}`)})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-2 flex flex-wrap justify-center gap-4 text-[11px] [&>span]:inline-flex [&>span]:items-center [&>span]:gap-1.5 [&_i]:inline-block [&_i]:size-2.5 [&_i]:rounded-[3px]`,children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:d9}}),` command · LLM → device`]}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:f9}}),` response · device → LLM`]}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:d9}}),` live call (round-trip)`]}),e.devices.some(e=>m9(e))&&(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:`var(--warning)`}}),` 🔒 SSH jump tunnel (ProxyJump)`]}),e.devices.some(e=>e.pool?.pooled)&&(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:`var(--success)`}}),` pooled SSH connection`]})]})]})}function Nte({d:e,onToggle:t}){let n=s9(e.status),r=e.status.reachable===!0?`${n.label} · ${e.status.latencyMs??`?`}ms${e.status.version?` · v${e.status.version}`:``}`:e.status.reachable===!1?`${n.label}${e.status.error?` · ${e.status.error}`:``}`:n.label,i=c9(e.name);return(0,W.jsxs)(`div`,{className:J(`bg-card grid gap-2 rounded-lg border px-[15px] py-3.5 transition-[transform,border-color] duration-300`,`hover:border-chart-2/35 hover:-translate-y-0.5`,e.disabled&&`opacity-50 grayscale-[0.4]`),style:{borderLeft:`3px solid ${i}`},"data-disabled":e.disabled?`1`:void 0,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`size-[9px] shrink-0 rounded-full`,style:{background:i},title:`device colour`}),(0,W.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.name}),e.isDefault&&(0,W.jsx)(Bx,{type:`accent`,children:`default`}),e.disabled&&(0,W.jsx)(Bx,{type:`warning`,children:`disabled`}),(0,W.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full`,style:{background:n.color},title:n.label}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`span`,{onClick:e=>e.stopPropagation(),children:(0,W.jsx)(Y7,{checked:!e.disabled,onCheckedChange:()=>t?.(e.name,!e.disabled),title:e.disabled?`Enable device`:`Disable device`,"aria-label":e.disabled?`Enable device`:`Disable device`})}),(0,W.jsx)(Bx,{type:`secondary`,children:e.authMode})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground [&_b]:text-foreground grid grid-cols-[auto_1fr] gap-x-3 gap-y-[3px] text-[11px] [&_b]:font-medium [&_b]:break-words`,children:[(0,W.jsx)(`span`,{children:e.mac?`mac`:`host`}),(0,W.jsx)(`b`,{children:e.address??`${e.host}:${e.port}`}),(0,W.jsx)(`span`,{children:`user`}),(0,W.jsx)(`b`,{children:e.username}),(0,W.jsx)(`span`,{children:`status`}),(0,W.jsx)(`b`,{style:{color:n.color},children:r}),(0,W.jsx)(`span`,{children:`activity`}),(0,W.jsxs)(`b`,{children:[e.activity.calls,` calls · `,e.activity.errors,` err`,e.activity.avgMs?` · ${ux(e.activity.avgMs)} avg`:``]}),e.pool&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{children:`pool`}),(0,W.jsx)(`b`,{className:e.pool.dead?`text-destructive`:e.pool.inflight>0?`text-chart-1`:e.pool.pooled?`text-success`:`text-muted-foreground`,children:e.pool.pooled?e.pool.inflight>0?`${e.pool.inflight} inflight`:`connected`:`—`})]}),e.description&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{children:`note`}),(0,W.jsx)(`b`,{children:e.description})]})]}),m9(e)&&(0,W.jsxs)(`div`,{className:`border-warning/30 bg-warning/8 mt-2.5 mb-0.5 flex items-center gap-1.5 overflow-hidden rounded-[10px] border px-2.5 py-[7px] text-[10px]`,title:`Reached over SSH through the bastion ${m9(e)} (ProxyJump) — no port exposed on ${e.name}.`,children:[(0,W.jsxs)(`span`,{className:`border-warning/60 text-warning bg-background inline-flex items-center gap-1.5 rounded-[7px] border px-2 py-[3px] whitespace-nowrap`,children:[(0,W.jsx)(sl,{className:`size-3`}),` `,m9(e),e.jumpVia?(0,W.jsx)(`i`,{className:`bg-warning text-background rounded-[4px] px-1 py-px text-[7px] tracking-[0.08em] uppercase not-italic`,children:`jump`}):null]}),(0,W.jsx)(`span`,{className:`jump-route__wire jump-route__wire--enc`,children:(0,W.jsx)(`span`,{className:`jump-route__lock`,"aria-hidden":!0,children:`🔒`})}),(0,W.jsxs)(`span`,{className:`bg-background text-foreground inline-flex items-center gap-1.5 rounded-[7px] border px-2 py-[3px] whitespace-nowrap`,style:{borderColor:i},title:e.name,children:[(0,W.jsx)(el,{className:`size-3`}),` `,e.name]})]})]})}var Pte={READ:`text-success border-success/45 bg-success/10`,WRITE:`text-chart-1 border-chart-1/45 bg-chart-1/10`,WRITE_IDEMPOTENT:`text-chart-2 border-chart-2/45 bg-chart-2/10`,DESTRUCTIVE:`text-warning border-warning/45 bg-warning/10`,DANGEROUS:`text-destructive border-destructive/45 bg-destructive/10`},g9=`border-b border-border/60 px-3.5 py-[7px] text-xs [overflow-wrap:anywhere]`,_9=J(g9,`bg-muted/40 text-muted-foreground`),v9=J(g9,`text-foreground`),y9=`m-0 max-h-[40vh] overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap`,b9=`m-0 text-[11px] font-semibold tracking-wide text-muted-foreground uppercase`;function Fte({event:e,onClose:t}){let[n,r]=(0,v.useState)(D7);return(0,W.jsx)(q7,{title:(0,W.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:J(`inline-block rounded-full border px-2 py-px font-mono text-[10px] tracking-wide uppercase`,Pte[e.risk]??`text-muted-foreground`),children:e.risk}),(0,W.jsx)(`span`,{className:`font-mono text-[15px]`,children:e.tool}),(0,W.jsx)(cx,{text:e.tool,icon:!0,title:`Copy tool name`})]}),onClose:t,children:(0,W.jsxs)(`div`,{className:`grid gap-3`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-[minmax(120px,0.4fr)_1fr] overflow-hidden rounded-lg border border-border font-mono`,children:[(0,W.jsx)(`div`,{className:_9,children:`title`}),(0,W.jsx)(`div`,{className:v9,children:e.title}),e.reason&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:J(g9,`bg-muted/40 text-warning`),children:`reason`}),(0,W.jsx)(`div`,{className:J(g9,`text-foreground italic`),children:e.reason})]}),(0,W.jsx)(`div`,{className:_9,children:`time`}),(0,W.jsx)(`div`,{className:v9,children:new Date(e.ts).toLocaleString(void 0,{hour12:!1})}),(0,W.jsx)(`div`,{className:_9,children:`device`}),(0,W.jsx)(`div`,{className:v9,children:e.device??`—`}),(0,W.jsx)(`div`,{className:_9,children:`transport`}),(0,W.jsx)(`div`,{className:v9,children:e.transport??`—`}),(0,W.jsx)(`div`,{className:_9,children:`duration`}),(0,W.jsx)(`div`,{className:v9,children:ux(e.durationMs)}),(0,W.jsx)(`div`,{className:_9,children:`status`}),(0,W.jsx)(`div`,{className:v9,children:(0,W.jsx)(`span`,{className:e.isError?`text-destructive`:`text-success`,children:e.isError?`error`:`ok`})}),(0,W.jsx)(`div`,{className:_9,children:`output size`}),(0,W.jsxs)(`div`,{className:v9,children:[dx(e.outputBytes),e.truncated?` (truncated)`:``]}),(0,W.jsx)(`div`,{className:_9,children:`structured`}),(0,W.jsx)(`div`,{className:v9,children:e.hasStructured?`yes (renders an MCP App view)`:`no`})]}),e.error&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:b9,children:`ERROR`}),(0,W.jsx)(`pre`,{className:J(y9,`text-destructive`),children:e.error})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(`h2`,{className:b9,children:`INPUT`}),(0,W.jsx)(`span`,{className:`flex-1`}),e.input&&(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>r(e=>{let t=!e;return O7(t),t}),title:n?`Showing pretty-printed JSON — click for raw`:`Showing raw JSON — click to pretty-print`,children:n?`✦ Pretty`:`{ } Raw`}),(0,W.jsx)(cx,{text:e.input,title:`Copy input JSON`})]}),e.input?(0,W.jsx)(A7,{value:k7(e.input,n)}):(0,W.jsx)(`pre`,{className:J(y9,`text-muted-foreground`),children:`—`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(`h2`,{className:b9,children:`OUTPUT`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(cx,{text:e.output,title:`Copy output`})]}),(0,W.jsx)(`pre`,{className:J(y9,`text-muted-foreground`),children:e.output?T7(e.output):`—`})]})})}var x9=e=>e==null?`?`:dx(e);function Ite({d:e}){let t=e.status,n=e.history??[];return t.reachable===!0||n.length>0?(0,W.jsxs)(`div`,{className:`bg-card text-card-foreground flex flex-col gap-2.5 rounded-lg border p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Hx,{color:s9(t).color}),(0,W.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,children:e.name}),e.isDefault&&(0,W.jsx)(Bx,{type:`accent`,children:`default`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Bx,{type:t.version?`success`:`default`,children:t.version?`v${t.version}`:`—`})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground -mt-1 font-mono text-[11px]`,children:[t.boardName??`router`,t.architecture?` · ${t.architecture}`:``,t.cpuCount?` · ${t.cpuCount} cpu`:``,t.uptime?` · up ${t.uptime}`:``]}),(0,W.jsxs)(`div`,{className:`flex justify-around gap-3.5`,children:[(0,W.jsx)(s7,{value:t.cpuLoad,label:`CPU`,color:hx.cpu}),(0,W.jsx)(s7,{value:t.memUsedPct,label:`MEM`,color:hx.mem}),(0,W.jsx)(s7,{value:t.hddUsedPct,label:`DISK`,color:hx.disk})]}),(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[(0,W.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`CPU load`}),(0,W.jsx)(o7,{id:`${e.name}-cpu`,values:n.map(e=>e.cpuLoad),color:hx.cpu,maxValue:100,unit:`%`})]}),(0,W.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`Memory used`}),(0,W.jsx)(o7,{id:`${e.name}-mem`,values:n.map(e=>e.memUsedPct),color:hx.mem,maxValue:100,unit:`%`})]}),(0,W.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`Probe latency`}),(0,W.jsx)(o7,{id:`${e.name}-lat`,values:n.map(e=>e.latencyMs),color:hx.latency,unit:`ms`})]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground font-mono text-[11px]`,children:[`RAM `,x9(t.totalMemory&&t.freeMemory?t.totalMemory-t.freeMemory:void 0),` /`,` `,x9(t.totalMemory),` · free disk `,x9(t.freeHdd)]})]}):(0,W.jsxs)(`div`,{className:`bg-card text-card-foreground flex min-h-[120px] flex-col justify-center gap-1.5 rounded-lg border p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Hx,{color:s9(t).color}),(0,W.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,children:e.name}),e.isDefault&&(0,W.jsx)(Bx,{type:`accent`,children:`default`})]}),(0,W.jsx)(`p`,{className:`text-muted-foreground m-0 text-[11px]`,children:t.reachable===!1?`Offline — ${t.error??`unreachable`}`:e.mac?`Waiting for the first MAC-Telnet probe (these run every few minutes to avoid contending with tool calls)…`:`Waiting for the first health probe…`})]})}function Lte(e,t){let n=(0,v.useRef)(e),r=(0,v.useRef)(t);n.current=e,r.current=t,(0,v.useEffect)(()=>{let e=!1,t=null,i=null,a=()=>{e||(i=new EventSource(hc(`/api/sse`)),i.addEventListener(`hello`,()=>r.current(`sse`)),i.addEventListener(`tool`,e=>{try{n.current(JSON.parse(e.data))}catch{}}),i.onerror=()=>{i&&i.readyState===EventSource.CONNECTING&&r.current(`off`)})},o=()=>{if(e)return;let i=location.protocol===`https:`?`wss`:`ws`;t=new WebSocket(hc(`${i}://${location.host}/api/stream`));let s=!1;t.onopen=()=>{s=!0,r.current(`ws`)},t.onerror=()=>t?.close(),t.onmessage=e=>{try{let t=JSON.parse(e.data);t.type===`event`&&t.event&&n.current(t.event)}catch{}},t.onclose=()=>{e||(r.current(`off`),s?setTimeout(o,2e3):a())}};return o(),()=>{e=!0,t?.close(),i?.close()}},[])}function Rte(e){(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;document.documentElement.classList.add(`js-motion`);let n=new WeakSet,r=e=>{n.has(e)||(n.add(e),zi.set(e,{opacity:0,y:26}),ic.create({trigger:e,start:`top 90%`,once:!0,onEnter:()=>zi.to(e,{opacity:1,y:0,duration:.7,ease:`power3.out`})}))},i=e=>{for(let t of e.querySelectorAll(`.reveal`))r(t)};i(t);let a=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof Element&&(e.matches(`.reveal`)&&r(e),i(e))});a.observe(t,{childList:!0,subtree:!0});let o=setInterval(()=>ic.refresh(),1200),s=setTimeout(()=>clearInterval(o),7e3);return()=>{a.disconnect(),clearInterval(o),clearTimeout(s);for(let e of ic.getAll())e.kill();document.documentElement.classList.remove(`js-motion`)}},[e])}function S9(e){return new Date(e).toLocaleString()}function C9(e){let t=Date.now()-e;return t<6e4?`just now`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}var zte={"in-sync":`success`,drifted:`warning`,unknown:`secondary`,"no-baseline":`secondary`},Bte={"in-sync":`In Sync`,drifted:`Drifted`,unknown:`Unknown`,"no-baseline":`No Baseline`};function Vte({device:e,onDone:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/drift/history/${encodeURIComponent(e)}?limit=20`).then(e=>{r(e.snapshots),e.snapshots.length>0&&a(e.snapshots[0].id)})},[e]);let f=async()=>{if(!i)return;l(!0),d(``);let n=await _c(`/api/drift/baseline`,{device:e,snapshotId:i,label:o||void 0});if(l(!1),n.ok)Y.success(`Baseline set`),t();else{let e=n.error??`Failed`;d(e),Y.error(e)}};return n.length===0?(0,W.jsx)(`div`,{className:`p-2`,children:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No snapshots for this device. Capture one with capture_config_snapshot first.`})}):(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 p-2`,children:[(0,W.jsx)(Jx,{value:i,onValueChange:a,"aria-label":`Baseline snapshot`,className:`min-w-[200px] flex-1`,options:n.map(e=>({value:e.id,label:`${e.id} — ${S9(e.ts)} — ${e.lines} lines${e.label?` "${e.label}"`:``}`}))}),(0,W.jsx)(Wx,{placeholder:`Label (optional)`,value:o,onChange:e=>s(e.target.value),className:`w-40`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void f(),disabled:c||!i,children:c?`Setting...`:`Set as Baseline`}),u&&(0,W.jsx)(`span`,{className:`text-destructive text-xs`,children:u})]})}function Hte({unified:e}){return e?(0,W.jsx)(`pre`,{className:`m-0 max-h-[500px] overflow-auto rounded bg-background p-3 font-mono text-[11px] leading-normal`,children:e.split(`
|
|
146
|
-
`).map((e,t)=>{let n=`text-muted-foreground`;return e.startsWith(`+`)?n=`text-success bg-success/10`:e.startsWith(`-`)?n=`text-destructive bg-destructive/10`:e.startsWith(`@@`)?n=`text-brand`:e.startsWith(`/`)&&(n=`text-warning`),(0,W.jsx)(`div`,{className:J(`px-1`,n),children:e||`\xA0`},t)})}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No differences.`})}function Ute({sections:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.added+e.removed),1);return(0,W.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.slice(0,15).map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`w-[220px] truncate text-[11px] text-foreground`,title:e.path,children:e.path}),(0,W.jsxs)(`div`,{className:`flex h-3.5 flex-1 overflow-hidden rounded-[3px] bg-muted`,children:[(0,W.jsx)(`div`,{className:`h-full bg-success`,style:{width:`${e.added/t*100}%`}}),(0,W.jsx)(`div`,{className:`h-full bg-destructive`,style:{width:`${e.removed/t*100}%`}})]}),(0,W.jsxs)(`span`,{className:`min-w-[60px] text-[11px] text-muted-foreground`,children:[`+`,e.added,` -`,e.removed]})]},e.path))})}function Wte({attributions:e}){return e.length===0?(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No config-related log entries found.`}):(0,W.jsx)(`div`,{className:`max-h-[250px] overflow-auto`,children:(0,W.jsxs)(Yb,{className:`text-[11px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Time`}),(0,W.jsx)($b,{children:`User`}),(0,W.jsx)($b,{children:`Action`}),(0,W.jsx)($b,{children:`Section`}),(0,W.jsx)($b,{children:`Log`})]})}),(0,W.jsx)(Zb,{children:e.map((e,t)=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{className:`whitespace-nowrap`,children:e.timestamp??`—`}),(0,W.jsx)(ex,{children:e.user??`—`}),(0,W.jsx)(ex,{children:(0,W.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-px text-[10px]`,children:e.action??`?`})}),(0,W.jsx)(ex,{className:`max-w-[160px] truncate`,title:e.section,children:e.section}),(0,W.jsx)(ex,{className:`max-w-[300px] truncate text-muted-foreground`,title:e.logLine,children:e.logLine})]},t))})]})})}function Gte({device:e,onClose:t,onChanged:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=(0,v.useCallback)(async()=>{o(!0),c(``);try{let t=await gc(`/api/drift/check/${encodeURIComponent(e)}`);`error`in t?c(t.error):i(t)}catch(e){c(e instanceof Error?e.message:String(e))}o(!1)},[e]),u=async()=>{let t=await _c(`/api/drift/baseline`,{device:e,snapshotId:r?.baselineId,label:`promoted`});t.error?Y.error(t.error):(Y.success(`Drift promoted`),n())},d=async()=>{await vc(`/api/drift/baseline/${encodeURIComponent(e)}`,{}),Y.success(`Baseline removed`),n()};return(0,W.jsxs)(ax,{title:`${e} — Drift Detail`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>void l(),disabled:a,children:a?`Checking...`:`Check Now`}),(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,onClick:()=>void d(),children:`Remove Baseline`}),(0,W.jsx)(X,{size:`sm`,type:`secondary`,onClick:t,children:`Close`})]}),children:[s&&(0,W.jsx)(`div`,{className:`text-destructive`,children:s}),r&&(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-6 border-b border-border py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Hx,{type:r.identical?`success`:`warning`}),(0,W.jsx)(`strong`,{children:r.identical?`In Sync`:`Drifted`})]}),!r.identical&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{children:[`Score: `,(0,W.jsx)(`strong`,{children:r.score}),`/100`]}),(0,W.jsxs)(`div`,{className:`text-success`,children:[`+`,r.summary.added]}),(0,W.jsxs)(`div`,{className:`text-destructive`,children:[`-`,r.summary.removed]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[11px]`,children:[r.summary.unchanged,` unchanged`]}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void u(),children:`Promote as Baseline`})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground ml-auto text-[11px]`,children:[`Checked: `,S9(r.capturedAt)]})]}),r.sections.length>0&&(0,W.jsxs)(`div`,{className:`mb-4`,children:[(0,W.jsx)(`h4`,{className:`mt-0 mb-2 text-[13px]`,children:`Sections with drift`}),(0,W.jsx)(Ute,{sections:r.sections})]}),r.attributions.length>0&&(0,W.jsxs)(`div`,{className:`mb-4`,children:[(0,W.jsx)(`h4`,{className:`mt-0 mb-2 text-[13px]`,children:`Change attribution`}),(0,W.jsx)(Wte,{attributions:r.attributions})]}),!r.identical&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{className:`mt-0 mb-2 text-[13px]`,children:`Unified diff`}),(0,W.jsx)(Hte,{unified:r.unified})]})]}),!r&&!a&&!s&&(0,W.jsx)(`p`,{className:`text-muted-foreground text-center text-[11px]`,children:`Click "Check Now" to run a live drift check against the golden baseline.`})]})}function Kte(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(``),u=(0,v.useCallback)(async()=>{try{let[e,n]=await Promise.all([gc(`/api/drift/status`),gc(`/api/drift/baselines`)]);t(e.devices),r(n.baselines),l(``)}catch(e){l(e instanceof Error?e.message:String(e))}},[]);if((0,v.useEffect)(()=>{u();let e=setInterval(()=>void u(),15e3);return()=>clearInterval(e)},[u]),c&&e.length===0)return(0,W.jsx)(ax,{className:`reveal`,children:(0,W.jsx)(`p`,{className:`text-destructive`,children:c})});let d=e.filter(e=>e.status!==`no-baseline`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,W.jsx)(ox,{k:`Devices`,v:String(e.length)}),(0,W.jsx)(ox,{k:`With Baseline`,v:String(d.length)}),(0,W.jsx)(ox,{k:`In Sync`,v:String(e.filter(e=>e.status===`in-sync`).length)}),(0,W.jsx)(ox,{k:`Drifted`,v:String(e.filter(e=>e.status===`drifted`).length)})]}),(0,W.jsx)(ax,{title:`Fleet Drift Overview`,className:`reveal`,children:(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-3`,children:e.map(e=>(0,W.jsxs)(`div`,{onClick:()=>{e.status!==`no-baseline`&&a(e.device)},className:J(`rounded-lg border bg-card p-4 transition-colors`,i===e.device?`border-brand`:`border-border`,e.status===`no-baseline`?`cursor-default`:`cursor-pointer hover:border-brand/40`),children:[(0,W.jsxs)(`div`,{className:`mb-2 flex justify-between`,children:[(0,W.jsx)(`strong`,{className:`text-sm`,children:e.device}),(0,W.jsx)(Bx,{type:zte[e.status],children:Bte[e.status]})]}),e.baseline&&(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[11px]`,children:[(0,W.jsxs)(`div`,{children:[`Baseline: `,C9(e.baseline.setAt)]}),e.baseline.label&&(0,W.jsxs)(`div`,{children:[`Label: `,e.baseline.label]})]}),e.status===`no-baseline`&&(0,W.jsx)(X,{size:`sm`,className:`mt-2`,onClick:t=>{t.stopPropagation(),s(e.device)},children:`Set Baseline`})]},e.device))})}),o&&(0,W.jsx)(ax,{title:`Set baseline for ${o}`,className:`reveal`,extra:(0,W.jsx)(X,{size:`sm`,type:`secondary`,onClick:()=>s(null),children:`Cancel`}),children:(0,W.jsx)(Vte,{device:o,onDone:()=>{s(null),u()}})}),i&&(0,W.jsx)(Gte,{device:i,onClose:()=>a(null),onChanged:()=>{a(null),u()}}),n.length>0&&(0,W.jsx)(ax,{title:`Baseline Manager`,className:`reveal`,children:(0,W.jsx)(`div`,{className:`overflow-x-auto`,children:(0,W.jsxs)(Yb,{className:`text-xs`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Device`}),(0,W.jsx)($b,{children:`Snapshot ID`}),(0,W.jsx)($b,{children:`Set At`}),(0,W.jsx)($b,{children:`Set By`}),(0,W.jsx)($b,{children:`Label`}),(0,W.jsx)($b,{children:`Size`}),(0,W.jsx)($b,{children:`SHA`}),(0,W.jsx)($b,{})]})}),(0,W.jsx)(Zb,{children:n.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{children:(0,W.jsx)(`strong`,{children:e.device})}),(0,W.jsx)(ex,{className:`font-mono text-[11px]`,children:e.snapshotId}),(0,W.jsx)(ex,{title:S9(e.setAt),children:C9(e.setAt)}),(0,W.jsx)(ex,{children:e.setBy}),(0,W.jsx)(ex,{children:e.label??`—`}),(0,W.jsx)(ex,{children:e.snapshot?`${e.snapshot.lines} lines / ${e.snapshot.bytes} bytes`:`deleted`}),(0,W.jsx)(ex,{className:`font-mono text-[10px]`,children:e.snapshot?.sha?.slice(0,8)??`—`}),(0,W.jsx)(ex,{children:(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,onClick:()=>{vc(`/api/drift/baseline/${encodeURIComponent(e.device)}`,{}).then(()=>{Y.success(`Baseline removed`),u()})},children:`Remove`})})]},e.device))})]})})}),e.length===0&&!c&&(0,W.jsx)(ax,{className:`reveal`,children:(0,W.jsx)(`p`,{className:`text-muted-foreground text-center text-[11px]`,children:`No devices configured. Add devices to start using Drift Guard.`})})]})}function qte(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)&2147483647;return t%360}var w9=[`var(--entity-1)`,`var(--entity-2)`,`var(--entity-3)`,`var(--entity-4)`,`var(--entity-5)`,`var(--entity-6)`,`var(--entity-7)`,`var(--entity-8)`,`var(--entity-9)`,`var(--entity-10)`];function T9(e){return w9[Math.abs(qte(e))%w9.length]}var Jte={create_entity:`Created entity`,delete_entity:`Deleted entity`,create_relation:`Created relation`,delete_relation:`Deleted relation`,add_observation:`Added observations`,delete_observation:`Deleted observations`};function Yte(e,t,n,r){let i=n/2,a=r/2,o=e.map((t,o)=>{let s=2*Math.PI*o/Math.max(e.length,1),c=Math.min(n,r)*.3;return{id:t.name,label:t.name,type:t.entityType,x:i+c*Math.cos(s),y:a+c*Math.sin(s),vx:0,vy:0,obsCount:t.observations.length}}),s=t.map(e=>({source:e.from,target:e.to,label:e.relationType})),c=new Map(o.map(e=>[e.id,e])),l=.005,u=.85;for(let e=0;e<200;e++){for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++){let n=o[e],r=o[t],i=n.x-r.x,a=n.y-r.y,s=Math.sqrt(i*i+a*a)||1,c=3e3/(s*s);i=i/s*c,a=a/s*c,n.vx+=i,n.vy+=a,r.vx-=i,r.vy-=a}for(let e of s){let t=c.get(e.source),n=c.get(e.target);if(!t||!n)continue;let r=n.x-t.x,i=n.y-t.y,a=r*l,o=i*l;t.vx+=a,t.vy+=o,n.vx-=a,n.vy-=o}for(let e of o)e.vx+=(i-e.x)*.001,e.vy+=(a-e.y)*.001;for(let e of o){e.vx*=u,e.vy*=u,e.x+=e.vx,e.y+=e.vy;let t=Math.max(40,e.label.length*2.7+16);e.x=Math.max(t,Math.min(n-t,e.x)),e.y=Math.max(30,Math.min(r-30,e.y))}}return{nodes:o,edges:s}}function Xte({graph:e}){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(null),i=(0,v.useMemo)(()=>Yte(e.entities,e.relations,700,460),[e.entities,e.relations]),a=(0,v.useMemo)(()=>new Map(i.nodes.map(e=>[e.id,e])),[i.nodes]);return e.entities.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground flex items-center justify-center`,style:{height:460},children:(0,W.jsx)(`p`,{children:`No entities yet — create some via the MCP tools.`})}):(0,W.jsxs)(`svg`,{ref:t,viewBox:`0 0 700 460`,style:{width:`100%`,height:`auto`,maxHeight:460,display:`block`},children:[(0,W.jsx)(`defs`,{children:(0,W.jsx)(`marker`,{id:`mem-arrow`,viewBox:`0 0 10 6`,refX:`10`,refY:`3`,markerWidth:`8`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,W.jsx)(`path`,{d:`M0 0 L10 3 L0 6Z`,fill:`var(--muted-foreground)`})})}),i.edges.map((e,t)=>{let r=a.get(e.source),i=a.get(e.target);if(!r||!i)return null;let o=n!=null&&(e.source===n||e.target===n),s=n!=null&&!o,c=i.x-r.x,l=i.y-r.y,u=Math.sqrt(c*c+l*l)||1,d=e=>{let t=e.label.length*5.4,n=13+Math.min(e.obsCount,6);return Math.max(n,t/2+12)},f=d(r)+4,p=d(i)+4,m=r.x+c/u*f,h=r.y+l/u*f,g=i.x-c/u*p,_=i.y-l/u*p,v=(m+g)/2,y=(h+_)/2;return(0,W.jsxs)(`g`,{opacity:s?.15:1,children:[(0,W.jsx)(`line`,{x1:m,y1:h,x2:g,y2:_,stroke:o?`var(--foreground)`:`var(--border)`,strokeWidth:o?1.8:1,markerEnd:`url(#mem-arrow)`}),(0,W.jsx)(`text`,{x:v,y:y-5,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:`8`,style:{pointerEvents:`none`},children:e.label})]},t)}),i.nodes.map(e=>{let t=e.id===n,i=n!=null&&!t,a=T9(e.type),o=e.label,s=o.length*5.4,c=13+Math.min(e.obsCount,6),l=Math.max(c,s/2+12),u=c;return(0,W.jsxs)(`g`,{opacity:i?.25:1,style:{cursor:`pointer`},onClick:()=>r(t?null:e.id),children:[(0,W.jsx)(`rect`,{x:e.x-l,y:e.y-c,width:l*2,height:c*2,rx:u,ry:u,fill:a,fillOpacity:.15,stroke:t?`var(--foreground)`:a,strokeWidth:t?2:1.2}),(0,W.jsx)(`text`,{x:e.x,y:e.y+1,textAnchor:`middle`,dominantBaseline:`central`,fill:`var(--foreground)`,fontSize:`9`,fontWeight:t?600:400,style:{pointerEvents:`none`},children:o}),(0,W.jsx)(`text`,{x:e.x,y:e.y+c+11,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:`7`,style:{pointerEvents:`none`},children:e.type})]},e.id)})]})}function Zte({entity:e,relations:t,onClose:n,onDelete:r}){let i=t.filter(t=>t.to===e.name),a=t.filter(t=>t.from===e.name);return(0,W.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-5`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[(0,W.jsxs)(`h3`,{className:`m-0 flex items-center font-mono text-[15px]`,children:[(0,W.jsx)(Hx,{color:T9(e.entityType),className:`mr-2 size-2.5`}),e.name]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{type:`error`,ghost:!0,size:`sm`,onClick:r,title:`Delete entity`,children:`Delete`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,onClick:n,children:`Close`})]}),(0,W.jsxs)(`p`,{className:`mt-0 mb-2 text-xs text-muted-foreground`,children:[`Type: `,(0,W.jsx)(`strong`,{children:e.entityType}),` · Created:`,` `,new Date(e.createdAt).toLocaleString(),` · Updated:`,` `,new Date(e.updatedAt).toLocaleString()]}),e.observations.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`h4`,{className:`mt-3 mb-1.5 text-xs text-muted-foreground`,children:[`Observations (`,e.observations.length,`)`]}),(0,W.jsx)(`ul`,{className:`m-0 pl-[18px] text-[13px]`,children:e.observations.map((e,t)=>(0,W.jsx)(`li`,{className:`mb-0.5`,children:e},t))})]}),(a.length>0||i.length>0)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{className:`mt-3 mb-1.5 text-xs text-muted-foreground`,children:`Relations`}),(0,W.jsxs)(`div`,{className:`text-[13px]`,children:[a.map((e,t)=>(0,W.jsxs)(`div`,{children:[`→ `,(0,W.jsx)(`strong`,{children:e.relationType}),` → `,e.to]},`o${t}`)),i.map((e,t)=>(0,W.jsxs)(`div`,{children:[`← `,(0,W.jsx)(`strong`,{children:e.relationType}),` ← `,e.from]},`i${t}`))]})]})]})}function Qte({activity:e}){return e.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-[13px]`,children:`No activity yet.`}):(0,W.jsx)(`div`,{className:`max-h-[280px] overflow-y-auto`,children:(0,W.jsxs)(Yb,{className:`text-xs`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Time`}),(0,W.jsx)($b,{children:`Action`}),(0,W.jsx)($b,{children:`Subject`})]})}),(0,W.jsx)(Zb,{children:e.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{className:`whitespace-nowrap text-muted-foreground`,children:fx(e.ts)}),(0,W.jsx)(ex,{children:Jte[e.action]??e.action}),(0,W.jsx)(ex,{className:`max-w-[260px] truncate`,children:e.subject})]},e.id))})]})})}function $te({config:e,onSaved:t}){let[n,r]=(0,v.useState)(e.dbPath),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{r(e.dbPath)},[e.dbPath]);let c=(0,v.useCallback)(async()=>{a(!0),s(``);try{let e=await _c(`/api/memory/config`,{dbPath:n});if(e.ok)s(`Saved`),Y.success(`Config saved`),t();else{let t=e.error??`Failed`;s(t),Y.error(t)}}catch(e){s(String(e)),Y.error(String(e))}finally{a(!1)}},[n,t]);return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`mb-1 block text-xs text-muted-foreground`,children:`Database path`}),(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(Wx,{type:`text`,value:n,onChange:e=>r(e.target.value),className:`flex-1 text-[13px]`}),(0,W.jsx)(X,{size:`sm`,onClick:c,disabled:i||n===e.dbPath,children:i?`Saving…`:`Save`})]}),o&&(0,W.jsx)(`p`,{className:J(`mt-1 text-xs`,o===`Saved`?`text-success`:`text-destructive`),children:o}),e.stats&&(0,W.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 gap-3`,children:[(0,W.jsx)(ox,{k:`Entities`,v:String(e.stats.entities)}),(0,W.jsx)(ox,{k:`Relations`,v:String(e.stats.relations)}),(0,W.jsx)(ox,{k:`Observations`,v:String(e.stats.observations)})]})]})}function ene(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),m=(0,v.useCallback)(async()=>{try{let[e,n,i,o]=await Promise.all([gc(`/api/memory/graph`),gc(`/api/memory/stats`),gc(`/api/memory/config`),gc(`/api/memory/activity?limit=50`)]);t(e),r(n),a(i),s(o),p(``)}catch(e){p(String(e))}},[]);(0,v.useEffect)(()=>{m();let e=setInterval(()=>void m(),1e4);return()=>clearInterval(e)},[m]);let h=(0,v.useCallback)(async()=>{if(!u.trim()){m();return}try{let e=await gc(`/api/memory/search?q=${encodeURIComponent(u)}`);t(e)}catch(e){p(String(e))}},[u,m]),g=(0,v.useCallback)(async e=>{try{await vc(`/api/memory/entities`,{names:[e]}),Y.success(`Entity deleted`)}catch(e){Y.error(e instanceof Error?e.message:`Entity deletion failed`)}l(null),m()},[m]);return f&&!e?(0,W.jsx)(ax,{title:`Knowledge Graph`,children:(0,W.jsx)(`p`,{className:`text-destructive`,children:f})}):(0,W.jsxs)(W.Fragment,{children:[n&&(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5`,children:[(0,W.jsx)(ox,{k:`Entities`,v:String(n.entities)}),(0,W.jsx)(ox,{k:`Relations`,v:String(n.relations)}),(0,W.jsx)(ox,{k:`Observations`,v:String(n.observations)}),(0,W.jsx)(ox,{k:`Entity types`,v:String(n.entityTypes.length)}),(0,W.jsx)(ox,{k:`Relation types`,v:String(n.relationTypes.length)})]}),(0,W.jsx)(ax,{title:`Knowledge Graph`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(Wx,{type:`text`,placeholder:`Search entities…`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&h(),className:`w-[200px] text-xs`}),(0,W.jsx)(X,{size:`sm`,onClick:h,children:`Search`}),u&&(0,W.jsx)(X,{size:`sm`,type:`secondary`,onClick:()=>{d(``),m()},children:`Clear`})]}),children:e&&(0,W.jsx)(Xte,{graph:e})}),(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-4`,children:[(0,W.jsx)(ax,{title:`Entities`,children:e&&e.entities.length>0?(0,W.jsx)(`div`,{className:`max-h-[360px] overflow-y-auto`,children:(0,W.jsxs)(Yb,{className:`text-xs`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Name`}),(0,W.jsx)($b,{children:`Type`}),(0,W.jsx)($b,{children:`Obs`}),(0,W.jsx)($b,{children:`Created`})]})}),(0,W.jsx)(Zb,{children:e.entities.map(e=>(0,W.jsxs)(Qb,{className:`cursor-pointer`,"data-state":c?.name===e.name?`selected`:void 0,onClick:()=>l(e),children:[(0,W.jsxs)(ex,{children:[(0,W.jsx)(Hx,{color:T9(e.entityType),className:`mr-1.5`}),e.name]}),(0,W.jsx)(ex,{className:`text-muted-foreground`,children:e.entityType}),(0,W.jsx)(ex,{children:e.observations.length}),(0,W.jsx)(ex,{className:`text-muted-foreground`,children:fx(e.createdAt)})]},e.name))})]})}):(0,W.jsx)(`p`,{className:`text-muted-foreground text-[13px]`,children:e?`No entities.`:`Loading…`})}),c&&e?(0,W.jsx)(Zte,{entity:c,relations:e.relations,onClose:()=>l(null),onDelete:()=>g(c.name)}):(0,W.jsx)(ax,{title:`Activity Log`,children:(0,W.jsx)(Qte,{activity:o})})]}),n&&(n.entityTypes.length>0||n.relationTypes.length>0)&&(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-4`,children:[n.entityTypes.length>0&&(0,W.jsx)(ax,{title:`Entity Types`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.entityTypes.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-xl px-2.5 py-0.5 text-xs`,style:{background:`${T9(e.type)}22`,border:`1px solid ${T9(e.type)}44`},children:[(0,W.jsx)(Hx,{color:T9(e.type)}),e.type,(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.count,`)`]})]},e.type))})}),n.relationTypes.length>0&&(0,W.jsx)(ax,{title:`Relation Types`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.relationTypes.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-xl border border-border bg-muted px-2.5 py-0.5 text-xs`,children:[e.type,(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.count,`)`]})]},e.type))})})]}),i&&(0,W.jsx)(ax,{title:`Memory Configuration`,className:`reveal`,children:(0,W.jsx)($te,{config:i,onSaved:m})})]})}var E9=e=>J(`flex items-start gap-2.5 rounded-md border px-[11px] py-[9px] cursor-pointer select-none transition-colors`,e?`border-brand/50 bg-brand/10`:`border-border bg-card hover:border-brand/35`);function tne({m:e,busy:t,onToggle:n}){return(0,W.jsxs)(`label`,{className:E9(e.enabled),title:e.description,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 cursor-pointer accent-brand`,checked:e.enabled,disabled:t,onChange:()=>n(e.slug,!e.enabled)}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`flex flex-wrap items-center gap-[7px] text-xs font-semibold text-foreground`,children:[e.label,(0,W.jsx)(`code`,{className:`rounded border border-border bg-background px-[5px] py-px font-mono text-[10px] text-muted-foreground`,children:e.slug})]}),(0,W.jsx)(`span`,{className:`text-[11px] leading-[1.35] text-muted-foreground`,children:e.description})]}),(0,W.jsxs)(`span`,{className:`whitespace-nowrap pt-px font-mono text-[10px] text-muted-foreground`,children:[e.toolCount,` tool`,e.toolCount===1?``:`s`]})]})}function nne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(new Set),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),f=(0,v.useCallback)(()=>{gc(`/api/modules`).then(e=>{t(e),e.appViews!==void 0&&l(e.appViews)}).catch(()=>a(`could not load modules`))},[]);(0,v.useEffect)(()=>f(),[f]);let p=e=>t(t=>t?{...t,...e}:e),m=(0,v.useCallback)(async(e,n)=>{r(t=>new Set(t).add(e)),t(t=>t&&{...t,modules:t.modules.map(t=>t.slug===e?{...t,enabled:n}:t)});let i=await _c(`/api/modules/toggle`,{slug:e,enabled:n}).catch(()=>({error:`request failed`}));if(r(t=>{let n=new Set(t);return n.delete(e),n}),i.error||i.ok===!1){a(i.error??`toggle failed`),Y.error(i.error??`Toggle failed`),f();return}p(i);let o=i.persisted?`saved to config`:`applied live (not saved)`,s=i.warning?` ⚠ ${i.warning}`:``;a(`${e} ${n?`enabled`:`disabled`} — ${o}. Reconnect the MCP client (or restart the server) for the tool list to update.${s}`),Y.success(`Module ${n?`enabled`:`disabled`}`)},[f]),h=(0,v.useCallback)(async(e,t)=>{for(let n of e)await m(n,t)},[m]),g=(0,v.useCallback)(async e=>{d(!0),l(e);let t=await _c(`/api/modules/app-views`,{enabled:e}).catch(()=>({error:`request failed`}));if(d(!1),`error`in t&&t.error){a(t.error),Y.error(t.error),l(!e);return}`appViews`in t&&t.appViews!==void 0&&l(t.appViews);let n=`persisted`in t&&t.persisted?`saved to config`:`applied live (not saved)`,r=`warning`in t&&t.warning?` — ${t.warning}`:``;a(`App views ${e?`enabled`:`disabled`} — ${n}. Restart the server for the change to take effect.${r}`),Y.success(`App Views ${e?`enabled`:`disabled`}`)},[]),_=(0,v.useMemo)(()=>{if(!e)return[];let t=o.trim().toLowerCase(),n=e=>!t||e.slug.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||e.group.toLowerCase().includes(t)||e.description.toLowerCase().includes(t),r=new Map;for(let t of e.modules){if(!n(t))continue;let e=r.get(t.group)??[];e.push(t),r.set(t.group,e)}return[...r.entries()].map(([e,t])=>({group:e,modules:t}))},[e,o]);if(!e)return(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading modules…`});let y=_.reduce((e,t)=>e+t.modules.length,0);return(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsxs)(ax,{title:`Tool modules`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.enabledModules,`/`,e.total,` modules · `,e.enabledTools,`/`,e.totalTools,` `,`tools exposed`]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:f,children:`Refresh`})]}),children:[(0,W.jsxs)(`label`,{className:J(E9(c),`mb-2.5`),title:`Emit MCP App view metadata (_meta.ui) on read tools`,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 cursor-pointer accent-brand`,checked:c,disabled:u,onChange:()=>void g(!c)}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsx)(`span`,{className:`flex flex-wrap items-center gap-[7px] text-xs font-semibold text-foreground`,children:`MCP App Views`}),(0,W.jsxs)(`span`,{className:`text-[11px] leading-[1.35] text-muted-foreground`,children:[`When on, read tools emit interactive table/detail widgets via `,(0,W.jsx)(`code`,{children:`_meta.ui`}),`. Disable to keep the LLM context lean. Requires server restart.`]})]})]}),(0,W.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-[5px]`,children:[`writes to: `,(0,W.jsx)(`code`,{children:e.source?.path??`config file`})]}),(0,W.jsx)(`span`,{className:`inline-flex items-center gap-[5px]`,children:e.hasAllowList?`allow-list active`:`all modules on by default`})]}),(0,W.jsxs)(`p`,{className:`mb-3 text-muted-foreground text-xs`,children:[`Toggle a module to expose or hide all of its tools. Disabling adds it to`,` `,(0,W.jsx)(`code`,{children:`tools.disabledModules`}),` in your config file; enabling removes it (or adds it to`,` `,(0,W.jsx)(`code`,{children:`tools.enabledModules`}),` when an allow-list is in force). Trimming the surface below ~150–200 tools makes every remaining tool reliably findable by the MCP client. The client must reconnect for changes to take effect.`]}),(0,W.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Wx,{placeholder:`Filter modules by name, slug, group or description…`,value:o,onChange:e=>s(e.target.value)}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(e.modules.filter(e=>!e.enabled).map(e=>e.slug),!0),children:`Enable all`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(e.modules.filter(e=>e.enabled).map(e=>e.slug),!1),children:`Disable all`})]}),i&&(0,W.jsx)(`div`,{className:`mt-3 font-mono text-xs text-muted-foreground`,children:i}),y===0?(0,W.jsxs)(`div`,{className:`p-3 text-muted-foreground text-[11px]`,children:[`No modules match “`,o,`”.`]}):(0,W.jsx)(`div`,{className:`mt-3 flex flex-col gap-[18px]`,children:_.map(({group:e,modules:t})=>{let r=t.filter(e=>e.enabled).length,i=t.map(e=>e.slug);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5 border-b border-border pb-1.5`,children:[(0,W.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-foreground`,children:e}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[r,`/`,t.length,` on`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(i.filter(e=>{let n=t.find(t=>t.slug===e);return n?!n.enabled:!1}),!0),children:`Enable group`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(i.filter(e=>{let n=t.find(t=>t.slug===e);return n?n.enabled:!1}),!1),children:`Disable group`})]}),(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,360px),1fr))] gap-2`,children:t.map(e=>(0,W.jsx)(tne,{m:e,busy:n.has(e.slug),onToggle:(e,t)=>void m(e,t)},e.slug))})]},e)})})]})})}function rne({...e}){return(0,W.jsx)(hf,{"data-slot":`dialog`,...e})}function ine({...e}){return(0,W.jsx)(xf,{"data-slot":`dialog-portal`,...e})}function ane({className:e,...t}){return(0,W.jsx)(Cf,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function one({className:e,children:t,showCloseButton:n=!0,...r}){return(0,W.jsxs)(ine,{"data-slot":`dialog-portal`,children:[(0,W.jsx)(ane,{}),(0,W.jsxs)(Df,{"data-slot":`dialog-content`,className:J(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,W.jsxs)(If,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,W.jsx)(gl,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function sne({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function cne({className:e,showCloseButton:t=!1,children:n,...r}){return(0,W.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,W.jsx)(If,{asChild:!0,children:(0,W.jsx)(sb,{variant:`outline`,children:`Close`})})]})}function lne({className:e,...t}){return(0,W.jsx)(Mf,{"data-slot":`dialog-title`,className:J(`text-lg leading-none font-semibold`,e),...t})}function une({className:e,...t}){return(0,W.jsx)(Pf,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground`,e),...t})}var D9=` {0,3}`;function O9(e){let t=e.replace(/\r\n?/g,`
|
|
147
|
-
`);t=t.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);let n=[];t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(e,t,r)=>(n.push(`<pre><code>${r.trim()}</code></pre>`),`%%CB${n.length-1}%%`));let r=[];t=t.replace(/`([^`]+)`/g,(e,t)=>(r.push(`<code>${t}</code>`),`%%IC${r.length-1}%%`)),t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,`<img src="$2" alt="$1"/>`),t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,`<a href="$2" target="_blank" rel="noopener">$1</a>`),t=t.replace(/(?<!=["'])(https?:\/\/[^\s<>")\]]+)/g,`<a href="$1" target="_blank" rel="noopener">$1</a>`),t=t.replace(/\*\*\*(.+?)\*\*\*/g,`<strong><em>$1</em></strong>`),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g,`<em>$1</em>`),t=t.replace(/~~(.+?)~~/g,`<del>$1</del>`),t=t.replace(RegExp(`^${
|
|
148
|
-
`),t=t.replace(RegExp(`^${
|
|
149
|
-
`).filter(Boolean);if(t.length<2)return e;let n=e=>e.trim().split(`|`).slice(1,-1).map(e=>e.trim()),r=n(t[0]),i=/^(\|[\s:*-]+)+\|$/.test(t[1].trim().replace(/[^|:*-\s]/g,``)),a=i?n(t[1]):null,o=a?a.map(e=>e.startsWith(`:`)&&e.endsWith(`:`)?`center`:e.endsWith(`:`)?`right`:`left`):r.map(()=>`left`),s=t.slice(i?2:1),c=`<div class="wn-table-wrap"><table><thead><tr>`;for(let e=0;e<r.length;e++)c+=`<th style="text-align:${o[e]}">${r[e]}</th>`;c+=`</tr></thead><tbody>`;for(let e of s){let t=n(e);c+=`<tr>`;for(let e=0;e<r.length;e++)c+=`<td style="text-align:${o[e]}">${t[e]??``}</td>`;c+=`</tr>`}return`${c}</tbody></table></div>`}),t=t.replace(RegExp(`^${
|
|
150
|
-
<oli>`),t=t.replace(/((?:<oli>.*<\/oli>\n?)+)/g,e=>`<ol>${e.trimEnd().replace(/<\/?oli>/g,e=>e.replace(`oli`,`li`))}</ol>`),t=t.replace(RegExp(`^${
|
|
144
|
+
`]}),(0,W.jsx)(FS,{ref:l,className:`caret-brand selection:bg-brand/35 relative z-[1] m-0 box-border h-[400px] min-h-0 w-full resize-y rounded-none border-0 bg-transparent px-3 py-2.5 font-mono text-xs leading-[1.5] whitespace-pre text-transparent shadow-none [field-sizing:fixed] [tab-size:2] outline-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent`,spellCheck:!1,wrap:`off`,value:r,onChange:e=>{i(e.target.value),h(e.currentTarget)},onKeyDown:_,onClick:()=>c(null),onScroll:e=>{let t=e.currentTarget;d.current&&(d.current.scrollTop=t.scrollTop,d.current.scrollLeft=t.scrollLeft),f.current&&(f.current.scrollTop=t.scrollTop)}}),s&&(0,W.jsx)(`div`,{className:`border-brand bg-card absolute z-[5] max-h-[184px] min-w-[150px] overflow-y-auto rounded-md border shadow-lg`,style:{left:s.x,top:s.y},children:s.items.map((e,t)=>(0,W.jsx)(`div`,{className:J(`cursor-pointer px-[11px] py-[5px] font-mono text-xs`,t===s.index?`bg-brand/20 text-foreground`:`text-muted-foreground`),onMouseDown:t=>{t.preventDefault(),g(e)},children:e},e))})]})]})}var a9=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{};function kte({initial:e,onClose:t,onReload:n}){let[r,i]=(0,v.useState)(()=>a9(e)),[a,o]=(0,v.useState)(`form`),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(0),[b,x]=(0,v.useState)(6e4),[S,C]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=setTimeout(()=>{_c(`/api/config/validate`,r).then(e=>u(e.errors??[])).catch(()=>{})},350);return()=>clearTimeout(e)},[r]),(0,v.useEffect)(()=>{if(!h||_<=0)return;let e=setInterval(()=>y(e=>Math.max(0,e-1)),1e3);return()=>clearInterval(e)},[h,_]);let w=(0,v.useRef)(n);w.current=n,(0,v.useEffect)(()=>{h&&_===0&&(h.rollbackMs??0)>0&&(C(`Auto-reverted — changes were not confirmed in time.`),g(null),w.current())},[h,_]);let T=!s&&l.length===0,E=async()=>{let e=a9(r.devices);if(Object.keys(e).length===0){C(`No devices configured to test — add one first.`),Y.error(`No devices to test`);return}f({}),C(`Testing devices…`);let t={};for(let[n,r]of Object.entries(e)){let e=await _c(`/api/config/test-device`,{name:n,config:r}).catch(()=>({ok:!1}));t[n]=e.ok&&e.status?.reachable===!0?{ok:!0,label:`${Math.round(e.status.latencyMs??0)}ms · ${e.status.identity??`ok`}`}:{ok:!1,label:e.status?.error??e.errors?.[0]?.message??`unreachable`},f({...t})}C(null),Object.values(t).every(e=>e.ok)?Y.success(`Devices reachable`):Y.error(`Some devices unreachable`)},D=async()=>{m(await _c(`/api/config/preview`,r))},O=async()=>{C(`Saving…`);try{let e=await _c(`/api/config`,{config:r,rollbackMs:b});if(C(null),m(null),!e.ok){u(e.errors??[{path:`(root)`,message:`save rejected`}]),Y.error(e.errors?.[0]?.message??`Config save rejected`);return}g(e),y(Math.round((e.rollbackMs??0)/1e3)),Y.success(`Config applied`)}catch(e){C(null),Y.error(e instanceof Error?e.message:`Save failed`)}},k=async()=>{if(h?.pendingId)try{await _c(`/api/config/keep`,{pendingId:h.pendingId}),g(null),C(`Changes kept.`),n(),Y.success(`Change kept`)}catch(e){Y.error(e instanceof Error?e.message:`Keep failed`)}},A=async()=>{if(h?.pendingId)try{await _c(`/api/config/rollback`,{pendingId:h.pendingId}),g(null),C(`Reverted to the previous config.`),n(),Y.success(`Change rolled back`)}catch(e){Y.error(e instanceof Error?e.message:`Rollback failed`)}};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`border-border bg-muted inline-flex gap-0.5 rounded-md border p-0.5`,children:[(0,W.jsxs)(`button`,{className:J(`flex cursor-pointer items-center gap-1.5 rounded-[6px] border-0 bg-transparent px-[11px] py-1 text-xs font-semibold`,a===`form`?`bg-card text-foreground shadow-sm`:`text-muted-foreground`),onClick:()=>{c(null),o(`form`)},children:[(0,W.jsx)(Wc,{className:`size-3.5`}),` Form`]}),(0,W.jsxs)(`button`,{className:J(`flex cursor-pointer items-center gap-1.5 rounded-[6px] border-0 bg-transparent px-[11px] py-1 text-xs font-semibold`,a===`json`?`bg-card text-foreground shadow-sm`:`text-muted-foreground`),onClick:()=>o(`json`),children:[(0,W.jsx)(Mc,{className:`size-3.5`}),` JSON`]})]}),(0,W.jsx)(`span`,{className:J(`rounded-full border px-2.5 py-1 font-mono text-[11px]`,T?`border-success/40 bg-success/10 text-success`:`border-destructive/40 bg-destructive/10 text-destructive`),children:s?`invalid JSON`:l.length?`${l.length} schema issue(s)`:`valid ✓`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void E(),children:`Test devices`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void D(),disabled:!T,children:`Preview diff`}),(0,W.jsx)(Jx,{size:`sm`,value:String(b),onValueChange:e=>x(Number(e)),options:Dte.map(([e,t])=>({value:String(t),label:e})),"aria-label":`Auto-revert window`}),(0,W.jsx)(X,{size:`sm`,type:`accent`,onClick:()=>void O(),disabled:!T||!!h,children:`Save`}),(0,W.jsx)(X,{size:`sm`,onClick:t,children:`Close`})]}),S&&(0,W.jsx)(`div`,{className:`text-muted-foreground font-mono text-xs`,children:S}),h&&(0,W.jsxs)(`div`,{className:`border-warning/40 bg-warning/10 flex flex-wrap items-center gap-2 rounded-md border px-3 py-2.5 text-xs`,children:[(0,W.jsx)(`strong`,{children:`Applied.`}),` `,(h.rollbackMs??0)>0?(0,W.jsxs)(W.Fragment,{children:[`Reverting in `,(0,W.jsxs)(`span`,{className:`text-warning font-mono font-bold`,children:[_,`s`]}),` `,`unless you keep it.`]}):(0,W.jsx)(W.Fragment,{children:`Saved without an auto-revert window.`}),h.devicesChanged&&(0,W.jsxs)(`span`,{className:`text-warning text-[11px]`,children:[` `,`· device list changed — reconnect the MCP client to expose it to the model`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,type:`accent`,onClick:()=>void k(),children:`Keep changes`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void A(),children:`Revert now`})]}),Object.keys(d).length>0&&(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Object.entries(d).map(([e,t])=>(0,W.jsxs)(`span`,{className:J(`rounded-full border px-2.5 py-1 font-mono text-[11px]`,t.ok?`border-success/40 text-success`:`border-destructive/40 text-destructive`),children:[t.ok?`●`:`○`,` `,e,`: `,t.label]},e))}),a===`form`?(0,W.jsx)(wte,{cfg:r,onChange:i}):(0,W.jsx)(Ote,{value:r,onChange:e=>i(a9(e)),onJsonError:c}),(s||l.length>0)&&(0,W.jsx)(`div`,{className:`flex flex-col gap-[3px]`,children:s?(0,W.jsxs)(`div`,{className:`text-destructive font-mono text-[11px]`,children:[`JSON: `,s]}):l.slice(0,12).map((e,t)=>(0,W.jsxs)(`div`,{className:`text-destructive font-mono text-[11px]`,children:[(0,W.jsx)(`code`,{className:`text-warning`,children:e.path}),` — `,e.message]},t))}),p&&(0,W.jsxs)(`div`,{className:`border-border overflow-hidden rounded-md border`,children:[(0,W.jsxs)(`div`,{className:`bg-muted flex items-center gap-2 px-[13px] py-[9px] text-xs`,children:[(0,W.jsx)(`strong`,{children:`Diff vs current`}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:p.summary?.changed?`+${p.summary.added} / -${p.summary.removed}`:`no changes`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(gl,{className:`size-4`}),onClick:()=>m(null),"aria-label":`Close preview`})]}),(0,W.jsx)(`pre`,{className:`bg-background text-muted-foreground m-0 max-h-[320px] overflow-auto px-3 py-2.5 font-mono text-[11px] leading-[1.5]`,children:(p.unified||`(identical)`).split(`
|
|
145
|
+
`).map((e,t)=>(0,W.jsx)(`div`,{className:e.startsWith(`+`)?`text-success`:e.startsWith(`-`)?`text-destructive`:e.startsWith(`@@`)?`text-brand`:``,children:e||` `},t))})]})]})}function Ate({x:e,y:t,text:n,className:r,textClassName:i,padX:a=9,fontSize:o=9}){let s=(0,v.useRef)(null),[c,l]=(0,v.useState)(()=>n.length*o*.62);(0,v.useLayoutEffect)(()=>{let e=s.current?.getComputedTextLength();e&&e>0&&l(e)},[n,o]);let u=Math.round(c+a*2);return(0,W.jsxs)(`g`,{transform:`translate(${e.toFixed(1)},${t.toFixed(1)})`,children:[(0,W.jsx)(`rect`,{className:r,x:-u/2,y:-9,rx:9,width:u,height:18}),(0,W.jsx)(`text`,{ref:s,className:i,x:0,y:3.5,textAnchor:`middle`,fontSize:o,children:n})]})}function o9(e){return e.reachable===!0?{label:`online`,color:`var(--foreground)`}:e.reachable===!1?{label:`offline`,color:`var(--destructive)`}:{label:`checking…`,color:`var(--muted-foreground)`}}function s9(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(t,31)+e.charCodeAt(n)>>>0;return`hsl(${t%360} 70% 62%)`}function c9(e,t,n,r){let i=1-r;return{x:i*i*e.x+2*i*r*t.x+r*r*n.x,y:i*i*e.y+2*i*r*t.y+r*r*n.y}}function l9(e,t,n,r){let i=1-r,a=2*i*(t.x-e.x)+2*r*(n.x-t.x),o=2*i*(t.y-e.y)+2*r*(n.y-t.y);return Math.atan2(o,a)*180/Math.PI}var u9=`var(--foreground)`,d9=`var(--muted-foreground)`,f9=`var(--warning)`;function p9(e){return e.jumpVia?e.jumpVia:e.jumpHost?`${e.jumpHost.host}:${e.jumpHost.port}`:null}var m9=18,jte=e=>e.length>m9?`${e.slice(0,m9-1)}…`:e,Mte=e=>Math.max(23,Math.min(70,e.length*3.1+12));function Nte({payload:e,pulses:t}){let n=e.devices,r=Math.max(1,n.length),i=n.map(e=>{let t=jte(e.name);return{d:e,label:t,r:Mte(t)}}),a=Math.max(23,...i.map(e=>e.r)),o=r>1?(a+18)/Math.sin(Math.PI/r):0,s=Math.max(110+a,o,120),c=a+60,l=Math.max(700,Math.round((s+a+40)*2)),u=Math.round((s+c)*2),d=l/2,f=u/2,p={x:d,y:f},m=i.map((e,t)=>{let n=t/r*Math.PI*2-Math.PI/2+(r%2==0?Math.PI/r:0);return{...e,i:t,x:d+s*Math.cos(n),y:f+s*Math.sin(n)}});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`svg`,{className:`conn`,viewBox:`0 0 ${l} ${u}`,width:`100%`,height:u,preserveAspectRatio:`xMidYMid meet`,children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`radialGradient`,{id:`conn-hub`,cx:`0.5`,cy:`0.34`,r:`0.75`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--foreground)`}),(0,W.jsx)(`stop`,{offset:`0.6`,stopColor:`color-mix(in srgb, var(--foreground) 70%, var(--muted-foreground))`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--muted-foreground)`})]}),(0,W.jsxs)(`radialGradient`,{id:`conn-orb`,cx:`0.5`,cy:`0.32`,r:`0.85`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--muted)`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--card)`})]}),(0,W.jsxs)(`radialGradient`,{id:`conn-burst`,cx:`0.5`,cy:`0.5`,r:`0.5`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--foreground)`}),(0,W.jsx)(`stop`,{offset:`0.5`,stopColor:`color-mix(in srgb, var(--foreground) 80%, transparent)`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--muted-foreground)`,stopOpacity:`0`})]}),(0,W.jsxs)(`linearGradient`,{id:`conn-tunnel-grad`,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:f9,stopOpacity:`0.15`}),(0,W.jsx)(`stop`,{offset:`0.5`,stopColor:f9,stopOpacity:`0.95`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:f9,stopOpacity:`0.15`})]}),(0,W.jsxs)(`filter`,{id:`conn-tunnel-glow`,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:[(0,W.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`b`}),(0,W.jsxs)(`feMerge`,{children:[(0,W.jsx)(`feMergeNode`,{in:`b`}),(0,W.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),[.5,.78,1].map((e,t)=>(0,W.jsx)(`circle`,{className:`conn-grid`,cx:d,cy:f,r:s*e},`g-${t}`)),[0,1,2].map(e=>(0,W.jsx)(`circle`,{className:`conn-sonar`,cx:d,cy:f,style:{animationDelay:`${e*1.1}s`}},`s-${e}`)),m.map(({d:e,i:n,x:r,y:i})=>{let a=o9(e.status),o=e.status.reachable===!0,s=e.status.reachable==null,c={x:r,y:i},l=(d+r)/2,u=(f+i)/2,m=r-d,h=i-f,g=Math.hypot(m,h)||1,_=-h/g,v=m/g,y={x:l+_*16,y:u+v*16},b={x:l-_*16,y:u-v*16},x=`M${d},${f} Q${y.x.toFixed(1)},${y.y.toFixed(1)} ${r.toFixed(1)},${i.toFixed(1)}`,S=`M${d},${f} Q${b.x.toFixed(1)},${b.y.toFixed(1)} ${r.toFixed(1)},${i.toFixed(1)}`,C=`M${d},${f} Q${l.toFixed(1)},${u.toFixed(1)} ${r.toFixed(1)},${i.toFixed(1)}`,w=c9(p,y,c,.52),T=l9(p,y,c,.52),E=c9(p,b,c,.48),D=l9(p,b,c,.48)+180,O=t[e.name]??0;return(0,W.jsxs)(`g`,{children:[(0,W.jsx)(`path`,{id:`conn-cmd-${n}`,className:`conn-link`,d:x,stroke:o?u9:a.color,strokeOpacity:o?.5:.32,strokeDasharray:s?`2 8`:o?void 0:`6 7`}),(0,W.jsx)(`path`,{id:`conn-res-${n}`,className:`conn-link`,d:S,stroke:o?d9:a.color,strokeOpacity:o?.5:.18,strokeDasharray:o?void 0:`6 7`}),o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{className:`conn-flow`,d:x,stroke:`var(--foreground)`}),(0,W.jsx)(`circle`,{className:`conn-packet`,r:3.2,fill:`var(--foreground)`,children:(0,W.jsx)(`animateMotion`,{dur:`2.6s`,repeatCount:`indefinite`,calcMode:`linear`,children:(0,W.jsx)(`mpath`,{href:`#conn-cmd-${n}`})})}),(0,W.jsx)(`rect`,{className:`conn-packet`,x:-2.6,y:-2.6,width:5.2,height:5.2,fill:`var(--muted-foreground)`,transform:`rotate(45)`,children:(0,W.jsx)(`animateMotion`,{dur:`2.6s`,begin:`0.9s`,repeatCount:`indefinite`,calcMode:`linear`,keyPoints:`1;0`,keyTimes:`0;1`,children:(0,W.jsx)(`mpath`,{href:`#conn-res-${n}`})})}),(0,W.jsx)(`path`,{className:`conn-chevron`,d:`M-4,-3 L4,0 L-4,3`,stroke:`var(--foreground)`,transform:`translate(${w.x.toFixed(1)},${w.y.toFixed(1)}) rotate(${T.toFixed(1)})`}),(0,W.jsx)(`path`,{className:`conn-chevron`,d:`M-4,-3 L4,0 L-4,3`,stroke:`var(--muted-foreground)`,transform:`translate(${E.x.toFixed(1)},${E.y.toFixed(1)}) rotate(${D.toFixed(1)})`})]}),O>0&&(0,W.jsx)(`g`,{children:(0,W.jsxs)(`circle`,{r:6,fill:`url(#conn-burst)`,children:[(0,W.jsx)(`animateMotion`,{dur:`1.1s`,repeatCount:`1`,calcMode:`linear`,keyPoints:`0;1;0`,keyTimes:`0;0.5;1`,path:C}),(0,W.jsx)(`animate`,{attributeName:`opacity`,values:`0;1;1;0`,keyTimes:`0;0.1;0.85;1`,dur:`1.1s`,repeatCount:`1`,fill:`freeze`})]})},`burst-${e.name}-${O}`)]},`l-${e.name}`)}),m.map(e=>{let t=e.d.jumpVia,n=t?m.find(e=>e.d.name===t):void 0,r=!n&&e.d.jumpHost?e.d.jumpHost:void 0;if(!n&&!r)return null;let i={x:e.x,y:e.y},a=Math.hypot(e.x-d,e.y-f)||1,o=(e.x-d)/a,s=(e.y-f)/a,c=n?{x:n.x,y:n.y}:{x:e.x+o*(e.r+46),y:e.y+s*(e.r+46)},l=(c.x+i.x)/2,u=(c.y+i.y)/2,p=Math.hypot(l-d,u-f)||1,h=n?50:16,g={x:l+(l-d)/p*h,y:u+(u-f)/p*h},_=`M${c.x.toFixed(1)},${c.y.toFixed(1)} Q${g.x.toFixed(1)},${g.y.toFixed(1)} ${i.x.toFixed(1)},${i.y.toFixed(1)}`,v=p9(e.d)??``,y=c9(c,g,i,.5),b=`conn-tunnel-${e.i}`;return(0,W.jsxs)(`g`,{className:`conn-tunnel-g`,children:[(0,W.jsx)(`path`,{className:`conn-tunnel-halo`,d:_,stroke:f9}),(0,W.jsx)(`path`,{id:b,className:`conn-tunnel`,d:_,stroke:`url(#conn-tunnel-grad)`,filter:`url(#conn-tunnel-glow)`}),r&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{className:`conn-tunnel-sat`,cx:c.x,cy:c.y,r:11,fill:`var(--background)`,stroke:`var(--warning)`}),(0,W.jsx)(`text`,{x:c.x,y:c.y+3.5,textAnchor:`middle`,fontSize:11,children:`🛡️`})]}),(0,W.jsxs)(`text`,{className:`conn-tunnel-lock`,fontSize:13,textAnchor:`middle`,children:[`🔒`,(0,W.jsx)(`animateMotion`,{dur:`2.4s`,repeatCount:`indefinite`,calcMode:`linear`,rotate:`auto`,children:(0,W.jsx)(`mpath`,{href:`#${b}`})})]}),(0,W.jsx)(Ate,{x:y.x,y:y.y,text:`⤳ via ${v}`,className:`conn-tunnel-badge`,textClassName:`conn-tunnel-badge-tx`})]},`jump-${e.d.name}`)}),(0,W.jsx)(`circle`,{className:`conn-hub-glow`,cx:d,cy:f,r:42}),(0,W.jsx)(`circle`,{className:`conn-hub-ring`,cx:d,cy:f,r:37}),(0,W.jsx)(`circle`,{cx:d,cy:f,r:29,fill:`url(#conn-hub)`,stroke:`var(--border)`,strokeWidth:1.5}),(0,W.jsx)(`text`,{x:d,y:f-4,textAnchor:`middle`,fill:`var(--background)`,fontSize:12,fontWeight:700,children:`LLM`}),(0,W.jsx)(`text`,{x:d,y:f+8,textAnchor:`middle`,fill:`var(--background)`,fillOpacity:.66,fontSize:8,fontWeight:600,children:`⇄ MCP`}),(0,W.jsx)(`text`,{x:d,y:f+18,textAnchor:`middle`,fill:`var(--background)`,fillOpacity:.66,fontSize:7.5,fontWeight:600,children:`server`}),m.map(({d:e,x:t,y:n,r,label:i})=>{let a=o9(e.status),o=e.status.reachable===!0,s=o?`${e.status.latencyMs??`?`} ms`:a.label,c=s9(e.name);return(0,W.jsxs)(`g`,{className:`conn-node`,opacity:e.disabled?.35:1,children:[o&&(0,W.jsx)(`circle`,{className:`conn-node-halo`,cx:t,cy:n,r:r+1,stroke:c}),e.pool?.pooled&&(0,W.jsx)(`circle`,{cx:t,cy:n,r:r+5,fill:`none`,stroke:e.pool.inflight>0?`var(--chart-1)`:`var(--success)`,strokeWidth:1.5,strokeDasharray:e.pool.inflight>0?void 0:`4 4`,opacity:.5,className:e.pool.inflight>0?`conn-blink`:void 0}),(0,W.jsx)(`circle`,{cx:t,cy:n,r,fill:`url(#conn-orb)`}),(0,W.jsx)(`circle`,{cx:t,cy:n,r,fill:c,opacity:.16}),(0,W.jsx)(`circle`,{cx:t,cy:n,r,fill:`none`,stroke:c,strokeWidth:2.5}),(0,W.jsx)(`circle`,{className:o?`conn-blink`:void 0,cx:t+r*.7,cy:n-r*.7,r:4.5,fill:a.color,stroke:`var(--background)`,strokeWidth:1.5}),(0,W.jsx)(`text`,{x:t,y:n+3.5,textAnchor:`middle`,fill:`var(--foreground)`,fontSize:10,fontWeight:600,children:i}),(0,W.jsx)(`text`,{x:t,y:n+r+14,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:9,children:e.address??e.host}),(0,W.jsx)(`text`,{x:t,y:n+r+26,textAnchor:`middle`,fill:a.color,fontSize:9,fontWeight:600,children:s})]},`n-${e.name}`)})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-2 flex flex-wrap justify-center gap-4 text-[11px] [&>span]:inline-flex [&>span]:items-center [&>span]:gap-1.5 [&_i]:inline-block [&_i]:size-2.5 [&_i]:rounded-[3px]`,children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:u9}}),` command · LLM → device`]}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:d9}}),` response · device → LLM`]}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:u9}}),` live call (round-trip)`]}),e.devices.some(e=>p9(e))&&(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:`var(--warning)`}}),` 🔒 SSH jump tunnel (ProxyJump)`]}),e.devices.some(e=>e.pool?.pooled)&&(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{style:{background:`var(--success)`}}),` pooled SSH connection`]})]})]})}function Pte({d:e,onToggle:t}){let n=o9(e.status),r=e.status.reachable===!0?`${n.label} · ${e.status.latencyMs??`?`}ms${e.status.version?` · v${e.status.version}`:``}`:e.status.reachable===!1?`${n.label}${e.status.error?` · ${e.status.error}`:``}`:n.label,i=s9(e.name);return(0,W.jsxs)(`div`,{className:J(`bg-card grid gap-2 rounded-lg border px-[15px] py-3.5 transition-[transform,border-color] duration-300`,`hover:border-chart-2/35 hover:-translate-y-0.5`,e.disabled&&`opacity-50 grayscale-[0.4]`),style:{borderLeft:`3px solid ${i}`},"data-disabled":e.disabled?`1`:void 0,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`size-[9px] shrink-0 rounded-full`,style:{background:i},title:`device colour`}),(0,W.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.name}),e.isDefault&&(0,W.jsx)(Bx,{type:`accent`,children:`default`}),e.disabled&&(0,W.jsx)(Bx,{type:`warning`,children:`disabled`}),(0,W.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full`,style:{background:n.color},title:n.label}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`span`,{onClick:e=>e.stopPropagation(),children:(0,W.jsx)(J7,{checked:!e.disabled,onCheckedChange:()=>t?.(e.name,!e.disabled),title:e.disabled?`Enable device`:`Disable device`,"aria-label":e.disabled?`Enable device`:`Disable device`})}),(0,W.jsx)(Bx,{type:`secondary`,children:e.authMode})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground [&_b]:text-foreground grid grid-cols-[auto_1fr] gap-x-3 gap-y-[3px] text-[11px] [&_b]:font-medium [&_b]:break-words`,children:[(0,W.jsx)(`span`,{children:e.mac?`mac`:`host`}),(0,W.jsx)(`b`,{children:e.address??`${e.host}:${e.port}`}),(0,W.jsx)(`span`,{children:`user`}),(0,W.jsx)(`b`,{children:e.username}),(0,W.jsx)(`span`,{children:`status`}),(0,W.jsx)(`b`,{style:{color:n.color},children:r}),(0,W.jsx)(`span`,{children:`activity`}),(0,W.jsxs)(`b`,{children:[e.activity.calls,` calls · `,e.activity.errors,` err`,e.activity.avgMs?` · ${ux(e.activity.avgMs)} avg`:``]}),e.pool&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{children:`pool`}),(0,W.jsx)(`b`,{className:e.pool.dead?`text-destructive`:e.pool.inflight>0?`text-chart-1`:e.pool.pooled?`text-success`:`text-muted-foreground`,children:e.pool.pooled?e.pool.inflight>0?`${e.pool.inflight} inflight`:`connected`:`—`})]}),e.description&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{children:`note`}),(0,W.jsx)(`b`,{children:e.description})]})]}),p9(e)&&(0,W.jsxs)(`div`,{className:`border-warning/30 bg-warning/8 mt-2.5 mb-0.5 flex items-center gap-1.5 overflow-hidden rounded-[10px] border px-2.5 py-[7px] text-[10px]`,title:`Reached over SSH through the bastion ${p9(e)} (ProxyJump) — no port exposed on ${e.name}.`,children:[(0,W.jsxs)(`span`,{className:`border-warning/60 text-warning bg-background inline-flex items-center gap-1.5 rounded-[7px] border px-2 py-[3px] whitespace-nowrap`,children:[(0,W.jsx)(sl,{className:`size-3`}),` `,p9(e),e.jumpVia?(0,W.jsx)(`i`,{className:`bg-warning text-background rounded-[4px] px-1 py-px text-[7px] tracking-[0.08em] uppercase not-italic`,children:`jump`}):null]}),(0,W.jsx)(`span`,{className:`jump-route__wire jump-route__wire--enc`,children:(0,W.jsx)(`span`,{className:`jump-route__lock`,"aria-hidden":!0,children:`🔒`})}),(0,W.jsxs)(`span`,{className:`bg-background text-foreground inline-flex items-center gap-1.5 rounded-[7px] border px-2 py-[3px] whitespace-nowrap`,style:{borderColor:i},title:e.name,children:[(0,W.jsx)(el,{className:`size-3`}),` `,e.name]})]})]})}var Fte={READ:`text-success border-success/45 bg-success/10`,WRITE:`text-chart-1 border-chart-1/45 bg-chart-1/10`,WRITE_IDEMPOTENT:`text-chart-2 border-chart-2/45 bg-chart-2/10`,DESTRUCTIVE:`text-warning border-warning/45 bg-warning/10`,DANGEROUS:`text-destructive border-destructive/45 bg-destructive/10`},h9=`border-b border-border/60 px-3.5 py-[7px] text-xs [overflow-wrap:anywhere]`,g9=J(h9,`bg-muted/40 text-muted-foreground`),_9=J(h9,`text-foreground`),v9=`m-0 max-h-[40vh] overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap`,y9=`m-0 text-[11px] font-semibold tracking-wide text-muted-foreground uppercase`;function Ite({event:e,onClose:t}){let[n,r]=(0,v.useState)(D7);return(0,W.jsx)(K7,{title:(0,W.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(`span`,{className:J(`inline-block rounded-full border px-2 py-px font-mono text-[10px] tracking-wide uppercase`,Fte[e.risk]??`text-muted-foreground`),children:e.risk}),(0,W.jsx)(`span`,{className:`font-mono text-[15px]`,children:e.tool}),(0,W.jsx)(cx,{text:e.tool,icon:!0,title:`Copy tool name`})]}),onClose:t,children:(0,W.jsxs)(`div`,{className:`grid gap-3`,children:[(0,W.jsxs)(`div`,{className:`grid grid-cols-[minmax(120px,0.4fr)_1fr] overflow-hidden rounded-lg border border-border font-mono`,children:[(0,W.jsx)(`div`,{className:g9,children:`title`}),(0,W.jsx)(`div`,{className:_9,children:e.title}),e.reason&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:J(h9,`bg-muted/40 text-warning`),children:`reason`}),(0,W.jsx)(`div`,{className:J(h9,`text-foreground italic`),children:e.reason})]}),(0,W.jsx)(`div`,{className:g9,children:`time`}),(0,W.jsx)(`div`,{className:_9,children:new Date(e.ts).toLocaleString(void 0,{hour12:!1})}),(0,W.jsx)(`div`,{className:g9,children:`device`}),(0,W.jsx)(`div`,{className:_9,children:e.device??`—`}),(0,W.jsx)(`div`,{className:g9,children:`transport`}),(0,W.jsx)(`div`,{className:_9,children:e.transport??`—`}),(0,W.jsx)(`div`,{className:g9,children:`duration`}),(0,W.jsx)(`div`,{className:_9,children:ux(e.durationMs)}),(0,W.jsx)(`div`,{className:g9,children:`status`}),(0,W.jsx)(`div`,{className:_9,children:(0,W.jsx)(`span`,{className:e.isError?`text-destructive`:`text-success`,children:e.isError?`error`:`ok`})}),(0,W.jsx)(`div`,{className:g9,children:`output size`}),(0,W.jsxs)(`div`,{className:_9,children:[dx(e.outputBytes),e.truncated?` (truncated)`:``]}),(0,W.jsx)(`div`,{className:g9,children:`structured`}),(0,W.jsx)(`div`,{className:_9,children:e.hasStructured?`yes (renders an MCP App view)`:`no`})]}),e.error&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:y9,children:`ERROR`}),(0,W.jsx)(`pre`,{className:J(v9,`text-destructive`),children:e.error})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(`h2`,{className:y9,children:`INPUT`}),(0,W.jsx)(`span`,{className:`flex-1`}),e.input&&(0,W.jsx)(X,{type:`secondary`,size:`sm`,ghost:!0,onClick:()=>r(e=>{let t=!e;return O7(t),t}),title:n?`Showing pretty-printed JSON — click for raw`:`Showing raw JSON — click to pretty-print`,children:n?`✦ Pretty`:`{ } Raw`}),(0,W.jsx)(cx,{text:e.input,title:`Copy input JSON`})]}),e.input?(0,W.jsx)(A7,{value:k7(e.input,n)}):(0,W.jsx)(`pre`,{className:J(v9,`text-muted-foreground`),children:`—`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(`h2`,{className:y9,children:`OUTPUT`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(cx,{text:e.output,title:`Copy output`})]}),(0,W.jsx)(`pre`,{className:J(v9,`text-muted-foreground`),children:e.output?T7(e.output):`—`})]})})}var b9=e=>e==null?`?`:dx(e);function Lte({d:e}){let t=e.status,n=e.history??[];return t.reachable===!0||n.length>0?(0,W.jsxs)(`div`,{className:`bg-card text-card-foreground flex flex-col gap-2.5 rounded-lg border p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Hx,{color:o9(t).color}),(0,W.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,children:e.name}),e.isDefault&&(0,W.jsx)(Bx,{type:`accent`,children:`default`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Bx,{type:t.version?`success`:`default`,children:t.version?`v${t.version}`:`—`})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground -mt-1 font-mono text-[11px]`,children:[t.boardName??`router`,t.architecture?` · ${t.architecture}`:``,t.cpuCount?` · ${t.cpuCount} cpu`:``,t.uptime?` · up ${t.uptime}`:``]}),(0,W.jsxs)(`div`,{className:`flex justify-around gap-3.5`,children:[(0,W.jsx)(s7,{value:t.cpuLoad,label:`CPU`,color:hx.cpu}),(0,W.jsx)(s7,{value:t.memUsedPct,label:`MEM`,color:hx.mem}),(0,W.jsx)(s7,{value:t.hddUsedPct,label:`DISK`,color:hx.disk})]}),(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[(0,W.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`CPU load`}),(0,W.jsx)(o7,{id:`${e.name}-cpu`,values:n.map(e=>e.cpuLoad),color:hx.cpu,maxValue:100,unit:`%`})]}),(0,W.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`Memory used`}),(0,W.jsx)(o7,{id:`${e.name}-mem`,values:n.map(e=>e.memUsedPct),color:hx.mem,maxValue:100,unit:`%`})]}),(0,W.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`Probe latency`}),(0,W.jsx)(o7,{id:`${e.name}-lat`,values:n.map(e=>e.latencyMs),color:hx.latency,unit:`ms`})]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground font-mono text-[11px]`,children:[`RAM `,b9(t.totalMemory&&t.freeMemory?t.totalMemory-t.freeMemory:void 0),` /`,` `,b9(t.totalMemory),` · free disk `,b9(t.freeHdd)]}),t.disks&&t.disks.length>0&&(0,W.jsxs)(`div`,{className:`grid gap-1`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground font-mono text-[10px] tracking-[0.05em] uppercase`,children:`External storage`}),t.disks.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 font-mono text-[11px]`,children:[(0,W.jsxs)(`span`,{className:`truncate`,children:[(0,W.jsx)(Bx,{type:`secondary`,children:e.slot}),` `,e.model??e.mountPoint??`disk`,e.fs?` · ${e.fs}`:``]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground whitespace-nowrap`,children:[b9(e.free),` free / `,b9(e.size),e.usedPct==null?``:` · ${e.usedPct}%`]})]},e.slot))]})]}):(0,W.jsxs)(`div`,{className:`bg-card text-card-foreground flex min-h-[120px] flex-col justify-center gap-1.5 rounded-lg border p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Hx,{color:o9(t).color}),(0,W.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,children:e.name}),e.isDefault&&(0,W.jsx)(Bx,{type:`accent`,children:`default`})]}),(0,W.jsx)(`p`,{className:`text-muted-foreground m-0 text-[11px]`,children:t.reachable===!1?`Offline — ${t.error??`unreachable`}`:e.mac?`Waiting for the first MAC-Telnet probe (these run every few minutes to avoid contending with tool calls)…`:`Waiting for the first health probe…`})]})}function Rte(e,t){let n=(0,v.useRef)(e),r=(0,v.useRef)(t);n.current=e,r.current=t,(0,v.useEffect)(()=>{let e=!1,t=null,i=null,a=()=>{e||(i=new EventSource(hc(`/api/sse`)),i.addEventListener(`hello`,()=>r.current(`sse`)),i.addEventListener(`tool`,e=>{try{n.current(JSON.parse(e.data))}catch{}}),i.onerror=()=>{i&&i.readyState===EventSource.CONNECTING&&r.current(`off`)})},o=()=>{if(e)return;let i=location.protocol===`https:`?`wss`:`ws`;t=new WebSocket(hc(`${i}://${location.host}/api/stream`));let s=!1;t.onopen=()=>{s=!0,r.current(`ws`)},t.onerror=()=>t?.close(),t.onmessage=e=>{try{let t=JSON.parse(e.data);t.type===`event`&&t.event&&n.current(t.event)}catch{}},t.onclose=()=>{e||(r.current(`off`),s?setTimeout(o,2e3):a())}};return o(),()=>{e=!0,t?.close(),i?.close()}},[])}function zte(e){(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;document.documentElement.classList.add(`js-motion`);let n=new WeakSet,r=e=>{n.has(e)||(n.add(e),zi.set(e,{opacity:0,y:26}),ic.create({trigger:e,start:`top 90%`,once:!0,onEnter:()=>zi.to(e,{opacity:1,y:0,duration:.7,ease:`power3.out`})}))},i=e=>{for(let t of e.querySelectorAll(`.reveal`))r(t)};i(t);let a=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof Element&&(e.matches(`.reveal`)&&r(e),i(e))});a.observe(t,{childList:!0,subtree:!0});let o=setInterval(()=>ic.refresh(),1200),s=setTimeout(()=>clearInterval(o),7e3);return()=>{a.disconnect(),clearInterval(o),clearTimeout(s);for(let e of ic.getAll())e.kill();document.documentElement.classList.remove(`js-motion`)}},[e])}function x9(e){return new Date(e).toLocaleString()}function S9(e){let t=Date.now()-e;return t<6e4?`just now`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}var Bte={"in-sync":`success`,drifted:`warning`,unknown:`secondary`,"no-baseline":`secondary`},Vte={"in-sync":`In Sync`,drifted:`Drifted`,unknown:`Unknown`,"no-baseline":`No Baseline`};function Hte({device:e,onDone:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``);(0,v.useEffect)(()=>{gc(`/api/drift/history/${encodeURIComponent(e)}?limit=20`).then(e=>{r(e.snapshots),e.snapshots.length>0&&a(e.snapshots[0].id)})},[e]);let f=async()=>{if(!i)return;l(!0),d(``);let n=await _c(`/api/drift/baseline`,{device:e,snapshotId:i,label:o||void 0});if(l(!1),n.ok)Y.success(`Baseline set`),t();else{let e=n.error??`Failed`;d(e),Y.error(e)}};return n.length===0?(0,W.jsx)(`div`,{className:`p-2`,children:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No snapshots for this device. Capture one with capture_config_snapshot first.`})}):(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 p-2`,children:[(0,W.jsx)(Jx,{value:i,onValueChange:a,"aria-label":`Baseline snapshot`,className:`min-w-[200px] flex-1`,options:n.map(e=>({value:e.id,label:`${e.id} — ${x9(e.ts)} — ${e.lines} lines${e.label?` "${e.label}"`:``}`}))}),(0,W.jsx)(Wx,{placeholder:`Label (optional)`,value:o,onChange:e=>s(e.target.value),className:`w-40`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void f(),disabled:c||!i,children:c?`Setting...`:`Set as Baseline`}),u&&(0,W.jsx)(`span`,{className:`text-destructive text-xs`,children:u})]})}function Ute({unified:e}){return e?(0,W.jsx)(`pre`,{className:`m-0 max-h-[500px] overflow-auto rounded bg-background p-3 font-mono text-[11px] leading-normal`,children:e.split(`
|
|
146
|
+
`).map((e,t)=>{let n=`text-muted-foreground`;return e.startsWith(`+`)?n=`text-success bg-success/10`:e.startsWith(`-`)?n=`text-destructive bg-destructive/10`:e.startsWith(`@@`)?n=`text-brand`:e.startsWith(`/`)&&(n=`text-warning`),(0,W.jsx)(`div`,{className:J(`px-1`,n),children:e||`\xA0`},t)})}):(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No differences.`})}function Wte({sections:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.added+e.removed),1);return(0,W.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.slice(0,15).map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`w-[220px] truncate text-[11px] text-foreground`,title:e.path,children:e.path}),(0,W.jsxs)(`div`,{className:`flex h-3.5 flex-1 overflow-hidden rounded-[3px] bg-muted`,children:[(0,W.jsx)(`div`,{className:`h-full bg-success`,style:{width:`${e.added/t*100}%`}}),(0,W.jsx)(`div`,{className:`h-full bg-destructive`,style:{width:`${e.removed/t*100}%`}})]}),(0,W.jsxs)(`span`,{className:`min-w-[60px] text-[11px] text-muted-foreground`,children:[`+`,e.added,` -`,e.removed]})]},e.path))})}function Gte({attributions:e}){return e.length===0?(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`No config-related log entries found.`}):(0,W.jsx)(`div`,{className:`max-h-[250px] overflow-auto`,children:(0,W.jsxs)(Yb,{className:`text-[11px]`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Time`}),(0,W.jsx)($b,{children:`User`}),(0,W.jsx)($b,{children:`Action`}),(0,W.jsx)($b,{children:`Section`}),(0,W.jsx)($b,{children:`Log`})]})}),(0,W.jsx)(Zb,{children:e.map((e,t)=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{className:`whitespace-nowrap`,children:e.timestamp??`—`}),(0,W.jsx)(ex,{children:e.user??`—`}),(0,W.jsx)(ex,{children:(0,W.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-px text-[10px]`,children:e.action??`?`})}),(0,W.jsx)(ex,{className:`max-w-[160px] truncate`,title:e.section,children:e.section}),(0,W.jsx)(ex,{className:`max-w-[300px] truncate text-muted-foreground`,title:e.logLine,children:e.logLine})]},t))})]})})}function Kte({device:e,onClose:t,onChanged:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=(0,v.useCallback)(async()=>{o(!0),c(``);try{let t=await gc(`/api/drift/check/${encodeURIComponent(e)}`);`error`in t?c(t.error):i(t)}catch(e){c(e instanceof Error?e.message:String(e))}o(!1)},[e]),u=async()=>{let t=await _c(`/api/drift/baseline`,{device:e,snapshotId:r?.baselineId,label:`promoted`});t.error?Y.error(t.error):(Y.success(`Drift promoted`),n())},d=async()=>{await vc(`/api/drift/baseline/${encodeURIComponent(e)}`,{}),Y.success(`Baseline removed`),n()};return(0,W.jsxs)(ax,{title:`${e} — Drift Detail`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(X,{size:`sm`,onClick:()=>void l(),disabled:a,children:a?`Checking...`:`Check Now`}),(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,onClick:()=>void d(),children:`Remove Baseline`}),(0,W.jsx)(X,{size:`sm`,type:`secondary`,onClick:t,children:`Close`})]}),children:[s&&(0,W.jsx)(`div`,{className:`text-destructive`,children:s}),r&&(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-6 border-b border-border py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Hx,{type:r.identical?`success`:`warning`}),(0,W.jsx)(`strong`,{children:r.identical?`In Sync`:`Drifted`})]}),!r.identical&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{children:[`Score: `,(0,W.jsx)(`strong`,{children:r.score}),`/100`]}),(0,W.jsxs)(`div`,{className:`text-success`,children:[`+`,r.summary.added]}),(0,W.jsxs)(`div`,{className:`text-destructive`,children:[`-`,r.summary.removed]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[11px]`,children:[r.summary.unchanged,` unchanged`]}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void u(),children:`Promote as Baseline`})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground ml-auto text-[11px]`,children:[`Checked: `,x9(r.capturedAt)]})]}),r.sections.length>0&&(0,W.jsxs)(`div`,{className:`mb-4`,children:[(0,W.jsx)(`h4`,{className:`mt-0 mb-2 text-[13px]`,children:`Sections with drift`}),(0,W.jsx)(Wte,{sections:r.sections})]}),r.attributions.length>0&&(0,W.jsxs)(`div`,{className:`mb-4`,children:[(0,W.jsx)(`h4`,{className:`mt-0 mb-2 text-[13px]`,children:`Change attribution`}),(0,W.jsx)(Gte,{attributions:r.attributions})]}),!r.identical&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{className:`mt-0 mb-2 text-[13px]`,children:`Unified diff`}),(0,W.jsx)(Ute,{unified:r.unified})]})]}),!r&&!a&&!s&&(0,W.jsx)(`p`,{className:`text-muted-foreground text-center text-[11px]`,children:`Click "Check Now" to run a live drift check against the golden baseline.`})]})}function qte(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(``),u=(0,v.useCallback)(async()=>{try{let[e,n]=await Promise.all([gc(`/api/drift/status`),gc(`/api/drift/baselines`)]);t(e.devices),r(n.baselines),l(``)}catch(e){l(e instanceof Error?e.message:String(e))}},[]);if((0,v.useEffect)(()=>{u();let e=setInterval(()=>void u(),15e3);return()=>clearInterval(e)},[u]),c&&e.length===0)return(0,W.jsx)(ax,{className:`reveal`,children:(0,W.jsx)(`p`,{className:`text-destructive`,children:c})});let d=e.filter(e=>e.status!==`no-baseline`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,W.jsx)(ox,{k:`Devices`,v:String(e.length)}),(0,W.jsx)(ox,{k:`With Baseline`,v:String(d.length)}),(0,W.jsx)(ox,{k:`In Sync`,v:String(e.filter(e=>e.status===`in-sync`).length)}),(0,W.jsx)(ox,{k:`Drifted`,v:String(e.filter(e=>e.status===`drifted`).length)})]}),(0,W.jsx)(ax,{title:`Fleet Drift Overview`,className:`reveal`,children:(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-3`,children:e.map(e=>(0,W.jsxs)(`div`,{onClick:()=>{e.status!==`no-baseline`&&a(e.device)},className:J(`rounded-lg border bg-card p-4 transition-colors`,i===e.device?`border-brand`:`border-border`,e.status===`no-baseline`?`cursor-default`:`cursor-pointer hover:border-brand/40`),children:[(0,W.jsxs)(`div`,{className:`mb-2 flex justify-between`,children:[(0,W.jsx)(`strong`,{className:`text-sm`,children:e.device}),(0,W.jsx)(Bx,{type:Bte[e.status],children:Vte[e.status]})]}),e.baseline&&(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[11px]`,children:[(0,W.jsxs)(`div`,{children:[`Baseline: `,S9(e.baseline.setAt)]}),e.baseline.label&&(0,W.jsxs)(`div`,{children:[`Label: `,e.baseline.label]})]}),e.status===`no-baseline`&&(0,W.jsx)(X,{size:`sm`,className:`mt-2`,onClick:t=>{t.stopPropagation(),s(e.device)},children:`Set Baseline`})]},e.device))})}),o&&(0,W.jsx)(ax,{title:`Set baseline for ${o}`,className:`reveal`,extra:(0,W.jsx)(X,{size:`sm`,type:`secondary`,onClick:()=>s(null),children:`Cancel`}),children:(0,W.jsx)(Hte,{device:o,onDone:()=>{s(null),u()}})}),i&&(0,W.jsx)(Kte,{device:i,onClose:()=>a(null),onChanged:()=>{a(null),u()}}),n.length>0&&(0,W.jsx)(ax,{title:`Baseline Manager`,className:`reveal`,children:(0,W.jsx)(`div`,{className:`overflow-x-auto`,children:(0,W.jsxs)(Yb,{className:`text-xs`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Device`}),(0,W.jsx)($b,{children:`Snapshot ID`}),(0,W.jsx)($b,{children:`Set At`}),(0,W.jsx)($b,{children:`Set By`}),(0,W.jsx)($b,{children:`Label`}),(0,W.jsx)($b,{children:`Size`}),(0,W.jsx)($b,{children:`SHA`}),(0,W.jsx)($b,{})]})}),(0,W.jsx)(Zb,{children:n.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{children:(0,W.jsx)(`strong`,{children:e.device})}),(0,W.jsx)(ex,{className:`font-mono text-[11px]`,children:e.snapshotId}),(0,W.jsx)(ex,{title:x9(e.setAt),children:S9(e.setAt)}),(0,W.jsx)(ex,{children:e.setBy}),(0,W.jsx)(ex,{children:e.label??`—`}),(0,W.jsx)(ex,{children:e.snapshot?`${e.snapshot.lines} lines / ${e.snapshot.bytes} bytes`:`deleted`}),(0,W.jsx)(ex,{className:`font-mono text-[10px]`,children:e.snapshot?.sha?.slice(0,8)??`—`}),(0,W.jsx)(ex,{children:(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,onClick:()=>{vc(`/api/drift/baseline/${encodeURIComponent(e.device)}`,{}).then(()=>{Y.success(`Baseline removed`),u()})},children:`Remove`})})]},e.device))})]})})}),e.length===0&&!c&&(0,W.jsx)(ax,{className:`reveal`,children:(0,W.jsx)(`p`,{className:`text-muted-foreground text-center text-[11px]`,children:`No devices configured. Add devices to start using Drift Guard.`})})]})}function Jte(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)&2147483647;return t%360}var C9=[`var(--entity-1)`,`var(--entity-2)`,`var(--entity-3)`,`var(--entity-4)`,`var(--entity-5)`,`var(--entity-6)`,`var(--entity-7)`,`var(--entity-8)`,`var(--entity-9)`,`var(--entity-10)`];function w9(e){return C9[Math.abs(Jte(e))%C9.length]}var Yte={create_entity:`Created entity`,delete_entity:`Deleted entity`,create_relation:`Created relation`,delete_relation:`Deleted relation`,add_observation:`Added observations`,delete_observation:`Deleted observations`};function Xte(e,t,n,r){let i=n/2,a=r/2,o=e.map((t,o)=>{let s=2*Math.PI*o/Math.max(e.length,1),c=Math.min(n,r)*.3;return{id:t.name,label:t.name,type:t.entityType,x:i+c*Math.cos(s),y:a+c*Math.sin(s),vx:0,vy:0,obsCount:t.observations.length}}),s=t.map(e=>({source:e.from,target:e.to,label:e.relationType})),c=new Map(o.map(e=>[e.id,e])),l=.005,u=.85;for(let e=0;e<200;e++){for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++){let n=o[e],r=o[t],i=n.x-r.x,a=n.y-r.y,s=Math.sqrt(i*i+a*a)||1,c=3e3/(s*s);i=i/s*c,a=a/s*c,n.vx+=i,n.vy+=a,r.vx-=i,r.vy-=a}for(let e of s){let t=c.get(e.source),n=c.get(e.target);if(!t||!n)continue;let r=n.x-t.x,i=n.y-t.y,a=r*l,o=i*l;t.vx+=a,t.vy+=o,n.vx-=a,n.vy-=o}for(let e of o)e.vx+=(i-e.x)*.001,e.vy+=(a-e.y)*.001;for(let e of o){e.vx*=u,e.vy*=u,e.x+=e.vx,e.y+=e.vy;let t=Math.max(40,e.label.length*2.7+16);e.x=Math.max(t,Math.min(n-t,e.x)),e.y=Math.max(30,Math.min(r-30,e.y))}}return{nodes:o,edges:s}}function Zte({graph:e}){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(null),i=(0,v.useMemo)(()=>Xte(e.entities,e.relations,700,460),[e.entities,e.relations]),a=(0,v.useMemo)(()=>new Map(i.nodes.map(e=>[e.id,e])),[i.nodes]);return e.entities.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground flex items-center justify-center`,style:{height:460},children:(0,W.jsx)(`p`,{children:`No entities yet — create some via the MCP tools.`})}):(0,W.jsxs)(`svg`,{ref:t,viewBox:`0 0 700 460`,style:{width:`100%`,height:`auto`,maxHeight:460,display:`block`},children:[(0,W.jsx)(`defs`,{children:(0,W.jsx)(`marker`,{id:`mem-arrow`,viewBox:`0 0 10 6`,refX:`10`,refY:`3`,markerWidth:`8`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,W.jsx)(`path`,{d:`M0 0 L10 3 L0 6Z`,fill:`var(--muted-foreground)`})})}),i.edges.map((e,t)=>{let r=a.get(e.source),i=a.get(e.target);if(!r||!i)return null;let o=n!=null&&(e.source===n||e.target===n),s=n!=null&&!o,c=i.x-r.x,l=i.y-r.y,u=Math.sqrt(c*c+l*l)||1,d=e=>{let t=e.label.length*5.4,n=13+Math.min(e.obsCount,6);return Math.max(n,t/2+12)},f=d(r)+4,p=d(i)+4,m=r.x+c/u*f,h=r.y+l/u*f,g=i.x-c/u*p,_=i.y-l/u*p,v=(m+g)/2,y=(h+_)/2;return(0,W.jsxs)(`g`,{opacity:s?.15:1,children:[(0,W.jsx)(`line`,{x1:m,y1:h,x2:g,y2:_,stroke:o?`var(--foreground)`:`var(--border)`,strokeWidth:o?1.8:1,markerEnd:`url(#mem-arrow)`}),(0,W.jsx)(`text`,{x:v,y:y-5,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:`8`,style:{pointerEvents:`none`},children:e.label})]},t)}),i.nodes.map(e=>{let t=e.id===n,i=n!=null&&!t,a=w9(e.type),o=e.label,s=o.length*5.4,c=13+Math.min(e.obsCount,6),l=Math.max(c,s/2+12),u=c;return(0,W.jsxs)(`g`,{opacity:i?.25:1,style:{cursor:`pointer`},onClick:()=>r(t?null:e.id),children:[(0,W.jsx)(`rect`,{x:e.x-l,y:e.y-c,width:l*2,height:c*2,rx:u,ry:u,fill:a,fillOpacity:.15,stroke:t?`var(--foreground)`:a,strokeWidth:t?2:1.2}),(0,W.jsx)(`text`,{x:e.x,y:e.y+1,textAnchor:`middle`,dominantBaseline:`central`,fill:`var(--foreground)`,fontSize:`9`,fontWeight:t?600:400,style:{pointerEvents:`none`},children:o}),(0,W.jsx)(`text`,{x:e.x,y:e.y+c+11,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:`7`,style:{pointerEvents:`none`},children:e.type})]},e.id)})]})}function Qte({entity:e,relations:t,onClose:n,onDelete:r}){let i=t.filter(t=>t.to===e.name),a=t.filter(t=>t.from===e.name);return(0,W.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-5`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[(0,W.jsxs)(`h3`,{className:`m-0 flex items-center font-mono text-[15px]`,children:[(0,W.jsx)(Hx,{color:w9(e.entityType),className:`mr-2 size-2.5`}),e.name]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{type:`error`,ghost:!0,size:`sm`,onClick:r,title:`Delete entity`,children:`Delete`}),(0,W.jsx)(X,{type:`secondary`,size:`sm`,onClick:n,children:`Close`})]}),(0,W.jsxs)(`p`,{className:`mt-0 mb-2 text-xs text-muted-foreground`,children:[`Type: `,(0,W.jsx)(`strong`,{children:e.entityType}),` · Created:`,` `,new Date(e.createdAt).toLocaleString(),` · Updated:`,` `,new Date(e.updatedAt).toLocaleString()]}),e.observations.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`h4`,{className:`mt-3 mb-1.5 text-xs text-muted-foreground`,children:[`Observations (`,e.observations.length,`)`]}),(0,W.jsx)(`ul`,{className:`m-0 pl-[18px] text-[13px]`,children:e.observations.map((e,t)=>(0,W.jsx)(`li`,{className:`mb-0.5`,children:e},t))})]}),(a.length>0||i.length>0)&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{className:`mt-3 mb-1.5 text-xs text-muted-foreground`,children:`Relations`}),(0,W.jsxs)(`div`,{className:`text-[13px]`,children:[a.map((e,t)=>(0,W.jsxs)(`div`,{children:[`→ `,(0,W.jsx)(`strong`,{children:e.relationType}),` → `,e.to]},`o${t}`)),i.map((e,t)=>(0,W.jsxs)(`div`,{children:[`← `,(0,W.jsx)(`strong`,{children:e.relationType}),` ← `,e.from]},`i${t}`))]})]})]})}function $te({activity:e}){return e.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-[13px]`,children:`No activity yet.`}):(0,W.jsx)(`div`,{className:`max-h-[280px] overflow-y-auto`,children:(0,W.jsxs)(Yb,{className:`text-xs`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Time`}),(0,W.jsx)($b,{children:`Action`}),(0,W.jsx)($b,{children:`Subject`})]})}),(0,W.jsx)(Zb,{children:e.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{className:`whitespace-nowrap text-muted-foreground`,children:fx(e.ts)}),(0,W.jsx)(ex,{children:Yte[e.action]??e.action}),(0,W.jsx)(ex,{className:`max-w-[260px] truncate`,children:e.subject})]},e.id))})]})})}function ene({config:e,onSaved:t}){let[n,r]=(0,v.useState)(e.dbPath),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{r(e.dbPath)},[e.dbPath]);let c=(0,v.useCallback)(async()=>{a(!0),s(``);try{let e=await _c(`/api/memory/config`,{dbPath:n});if(e.ok)s(`Saved`),Y.success(`Config saved`),t();else{let t=e.error??`Failed`;s(t),Y.error(t)}}catch(e){s(String(e)),Y.error(String(e))}finally{a(!1)}},[n,t]);return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`mb-1 block text-xs text-muted-foreground`,children:`Database path`}),(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(Wx,{type:`text`,value:n,onChange:e=>r(e.target.value),className:`flex-1 text-[13px]`}),(0,W.jsx)(X,{size:`sm`,onClick:c,disabled:i||n===e.dbPath,children:i?`Saving…`:`Save`})]}),o&&(0,W.jsx)(`p`,{className:J(`mt-1 text-xs`,o===`Saved`?`text-success`:`text-destructive`),children:o}),e.stats&&(0,W.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 gap-3`,children:[(0,W.jsx)(ox,{k:`Entities`,v:String(e.stats.entities)}),(0,W.jsx)(ox,{k:`Relations`,v:String(e.stats.relations)}),(0,W.jsx)(ox,{k:`Observations`,v:String(e.stats.observations)})]})]})}function tne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),m=(0,v.useCallback)(async()=>{try{let[e,n,i,o]=await Promise.all([gc(`/api/memory/graph`),gc(`/api/memory/stats`),gc(`/api/memory/config`),gc(`/api/memory/activity?limit=50`)]);t(e),r(n),a(i),s(o),p(``)}catch(e){p(String(e))}},[]);(0,v.useEffect)(()=>{m();let e=setInterval(()=>void m(),1e4);return()=>clearInterval(e)},[m]);let h=(0,v.useCallback)(async()=>{if(!u.trim()){m();return}try{let e=await gc(`/api/memory/search?q=${encodeURIComponent(u)}`);t(e)}catch(e){p(String(e))}},[u,m]),g=(0,v.useCallback)(async e=>{try{await vc(`/api/memory/entities`,{names:[e]}),Y.success(`Entity deleted`)}catch(e){Y.error(e instanceof Error?e.message:`Entity deletion failed`)}l(null),m()},[m]);return f&&!e?(0,W.jsx)(ax,{title:`Knowledge Graph`,children:(0,W.jsx)(`p`,{className:`text-destructive`,children:f})}):(0,W.jsxs)(W.Fragment,{children:[n&&(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5`,children:[(0,W.jsx)(ox,{k:`Entities`,v:String(n.entities)}),(0,W.jsx)(ox,{k:`Relations`,v:String(n.relations)}),(0,W.jsx)(ox,{k:`Observations`,v:String(n.observations)}),(0,W.jsx)(ox,{k:`Entity types`,v:String(n.entityTypes.length)}),(0,W.jsx)(ox,{k:`Relation types`,v:String(n.relationTypes.length)})]}),(0,W.jsx)(ax,{title:`Knowledge Graph`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,W.jsx)(Wx,{type:`text`,placeholder:`Search entities…`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&h(),className:`w-[200px] text-xs`}),(0,W.jsx)(X,{size:`sm`,onClick:h,children:`Search`}),u&&(0,W.jsx)(X,{size:`sm`,type:`secondary`,onClick:()=>{d(``),m()},children:`Clear`})]}),children:e&&(0,W.jsx)(Zte,{graph:e})}),(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-4`,children:[(0,W.jsx)(ax,{title:`Entities`,children:e&&e.entities.length>0?(0,W.jsx)(`div`,{className:`max-h-[360px] overflow-y-auto`,children:(0,W.jsxs)(Yb,{className:`text-xs`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Name`}),(0,W.jsx)($b,{children:`Type`}),(0,W.jsx)($b,{children:`Obs`}),(0,W.jsx)($b,{children:`Created`})]})}),(0,W.jsx)(Zb,{children:e.entities.map(e=>(0,W.jsxs)(Qb,{className:`cursor-pointer`,"data-state":c?.name===e.name?`selected`:void 0,onClick:()=>l(e),children:[(0,W.jsxs)(ex,{children:[(0,W.jsx)(Hx,{color:w9(e.entityType),className:`mr-1.5`}),e.name]}),(0,W.jsx)(ex,{className:`text-muted-foreground`,children:e.entityType}),(0,W.jsx)(ex,{children:e.observations.length}),(0,W.jsx)(ex,{className:`text-muted-foreground`,children:fx(e.createdAt)})]},e.name))})]})}):(0,W.jsx)(`p`,{className:`text-muted-foreground text-[13px]`,children:e?`No entities.`:`Loading…`})}),c&&e?(0,W.jsx)(Qte,{entity:c,relations:e.relations,onClose:()=>l(null),onDelete:()=>g(c.name)}):(0,W.jsx)(ax,{title:`Activity Log`,children:(0,W.jsx)($te,{activity:o})})]}),n&&(n.entityTypes.length>0||n.relationTypes.length>0)&&(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-2 gap-4`,children:[n.entityTypes.length>0&&(0,W.jsx)(ax,{title:`Entity Types`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.entityTypes.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-xl px-2.5 py-0.5 text-xs`,style:{background:`${w9(e.type)}22`,border:`1px solid ${w9(e.type)}44`},children:[(0,W.jsx)(Hx,{color:w9(e.type)}),e.type,(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.count,`)`]})]},e.type))})}),n.relationTypes.length>0&&(0,W.jsx)(ax,{title:`Relation Types`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.relationTypes.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-xl border border-border bg-muted px-2.5 py-0.5 text-xs`,children:[e.type,(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.count,`)`]})]},e.type))})})]}),i&&(0,W.jsx)(ax,{title:`Memory Configuration`,className:`reveal`,children:(0,W.jsx)(ene,{config:i,onSaved:m})})]})}var T9=e=>J(`flex items-start gap-2.5 rounded-md border px-[11px] py-[9px] cursor-pointer select-none transition-colors`,e?`border-brand/50 bg-brand/10`:`border-border bg-card hover:border-brand/35`);function nne({m:e,busy:t,onToggle:n}){return(0,W.jsxs)(`label`,{className:T9(e.enabled),title:e.description,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 cursor-pointer accent-brand`,checked:e.enabled,disabled:t,onChange:()=>n(e.slug,!e.enabled)}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`flex flex-wrap items-center gap-[7px] text-xs font-semibold text-foreground`,children:[e.label,(0,W.jsx)(`code`,{className:`rounded border border-border bg-background px-[5px] py-px font-mono text-[10px] text-muted-foreground`,children:e.slug})]}),(0,W.jsx)(`span`,{className:`text-[11px] leading-[1.35] text-muted-foreground`,children:e.description})]}),(0,W.jsxs)(`span`,{className:`whitespace-nowrap pt-px font-mono text-[10px] text-muted-foreground`,children:[e.toolCount,` tool`,e.toolCount===1?``:`s`]})]})}function rne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(new Set),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),f=(0,v.useCallback)(()=>{gc(`/api/modules`).then(e=>{t(e),e.appViews!==void 0&&l(e.appViews)}).catch(()=>a(`could not load modules`))},[]);(0,v.useEffect)(()=>f(),[f]);let p=e=>t(t=>t?{...t,...e}:e),m=(0,v.useCallback)(async(e,n)=>{r(t=>new Set(t).add(e)),t(t=>t&&{...t,modules:t.modules.map(t=>t.slug===e?{...t,enabled:n}:t)});let i=await _c(`/api/modules/toggle`,{slug:e,enabled:n}).catch(()=>({error:`request failed`}));if(r(t=>{let n=new Set(t);return n.delete(e),n}),i.error||i.ok===!1){a(i.error??`toggle failed`),Y.error(i.error??`Toggle failed`),f();return}p(i);let o=i.persisted?`saved to config`:`applied live (not saved)`,s=i.warning?` ⚠ ${i.warning}`:``;a(`${e} ${n?`enabled`:`disabled`} — ${o}. Reconnect the MCP client (or restart the server) for the tool list to update.${s}`),Y.success(`Module ${n?`enabled`:`disabled`}`)},[f]),h=(0,v.useCallback)(async(e,t)=>{for(let n of e)await m(n,t)},[m]),g=(0,v.useCallback)(async e=>{d(!0),l(e);let t=await _c(`/api/modules/app-views`,{enabled:e}).catch(()=>({error:`request failed`}));if(d(!1),`error`in t&&t.error){a(t.error),Y.error(t.error),l(!e);return}`appViews`in t&&t.appViews!==void 0&&l(t.appViews);let n=`persisted`in t&&t.persisted?`saved to config`:`applied live (not saved)`,r=`warning`in t&&t.warning?` — ${t.warning}`:``;a(`App views ${e?`enabled`:`disabled`} — ${n}. Restart the server for the change to take effect.${r}`),Y.success(`App Views ${e?`enabled`:`disabled`}`)},[]),_=(0,v.useMemo)(()=>{if(!e)return[];let t=o.trim().toLowerCase(),n=e=>!t||e.slug.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)||e.group.toLowerCase().includes(t)||e.description.toLowerCase().includes(t),r=new Map;for(let t of e.modules){if(!n(t))continue;let e=r.get(t.group)??[];e.push(t),r.set(t.group,e)}return[...r.entries()].map(([e,t])=>({group:e,modules:t}))},[e,o]);if(!e)return(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading modules…`});let y=_.reduce((e,t)=>e+t.modules.length,0);return(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsxs)(ax,{title:`Tool modules`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.enabledModules,`/`,e.total,` modules · `,e.enabledTools,`/`,e.totalTools,` `,`tools exposed`]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:f,children:`Refresh`})]}),children:[(0,W.jsxs)(`label`,{className:J(T9(c),`mb-2.5`),title:`Emit MCP App view metadata (_meta.ui) on read tools`,children:[(0,W.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 cursor-pointer accent-brand`,checked:c,disabled:u,onChange:()=>void g(!c)}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsx)(`span`,{className:`flex flex-wrap items-center gap-[7px] text-xs font-semibold text-foreground`,children:`MCP App Views`}),(0,W.jsxs)(`span`,{className:`text-[11px] leading-[1.35] text-muted-foreground`,children:[`When on, read tools emit interactive table/detail widgets via `,(0,W.jsx)(`code`,{children:`_meta.ui`}),`. Disable to keep the LLM context lean. Requires server restart.`]})]})]}),(0,W.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-[5px]`,children:[`writes to: `,(0,W.jsx)(`code`,{children:e.source?.path??`config file`})]}),(0,W.jsx)(`span`,{className:`inline-flex items-center gap-[5px]`,children:e.hasAllowList?`allow-list active`:`all modules on by default`})]}),(0,W.jsxs)(`p`,{className:`mb-3 text-muted-foreground text-xs`,children:[`Toggle a module to expose or hide all of its tools. Disabling adds it to`,` `,(0,W.jsx)(`code`,{children:`tools.disabledModules`}),` in your config file; enabling removes it (or adds it to`,` `,(0,W.jsx)(`code`,{children:`tools.enabledModules`}),` when an allow-list is in force). Trimming the surface below ~150–200 tools makes every remaining tool reliably findable by the MCP client. The client must reconnect for changes to take effect.`]}),(0,W.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Wx,{placeholder:`Filter modules by name, slug, group or description…`,value:o,onChange:e=>s(e.target.value)}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(e.modules.filter(e=>!e.enabled).map(e=>e.slug),!0),children:`Enable all`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(e.modules.filter(e=>e.enabled).map(e=>e.slug),!1),children:`Disable all`})]}),i&&(0,W.jsx)(`div`,{className:`mt-3 font-mono text-xs text-muted-foreground`,children:i}),y===0?(0,W.jsxs)(`div`,{className:`p-3 text-muted-foreground text-[11px]`,children:[`No modules match “`,o,`”.`]}):(0,W.jsx)(`div`,{className:`mt-3 flex flex-col gap-[18px]`,children:_.map(({group:e,modules:t})=>{let r=t.filter(e=>e.enabled).length,i=t.map(e=>e.slug);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5 border-b border-border pb-1.5`,children:[(0,W.jsx)(`h3`,{className:`m-0 text-[13px] font-semibold text-foreground`,children:e}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[r,`/`,t.length,` on`]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(i.filter(e=>{let n=t.find(t=>t.slug===e);return n?!n.enabled:!1}),!0),children:`Enable group`}),(0,W.jsx)(X,{size:`sm`,onClick:()=>void h(i.filter(e=>{let n=t.find(t=>t.slug===e);return n?n.enabled:!1}),!1),children:`Disable group`})]}),(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,360px),1fr))] gap-2`,children:t.map(e=>(0,W.jsx)(nne,{m:e,busy:n.has(e.slug),onToggle:(e,t)=>void m(e,t)},e.slug))})]},e)})})]})})}function ine({...e}){return(0,W.jsx)(hf,{"data-slot":`dialog`,...e})}function ane({...e}){return(0,W.jsx)(xf,{"data-slot":`dialog-portal`,...e})}function one({className:e,...t}){return(0,W.jsx)(Cf,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function sne({className:e,children:t,showCloseButton:n=!0,...r}){return(0,W.jsxs)(ane,{"data-slot":`dialog-portal`,children:[(0,W.jsx)(one,{}),(0,W.jsxs)(Df,{"data-slot":`dialog-content`,className:J(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,W.jsxs)(If,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,W.jsx)(gl,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function cne({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function lne({className:e,showCloseButton:t=!1,children:n,...r}){return(0,W.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,W.jsx)(If,{asChild:!0,children:(0,W.jsx)(sb,{variant:`outline`,children:`Close`})})]})}function une({className:e,...t}){return(0,W.jsx)(Mf,{"data-slot":`dialog-title`,className:J(`text-lg leading-none font-semibold`,e),...t})}function dne({className:e,...t}){return(0,W.jsx)(Pf,{"data-slot":`dialog-description`,className:J(`text-sm text-muted-foreground`,e),...t})}var E9=` {0,3}`;function D9(e){let t=e.replace(/\r\n?/g,`
|
|
147
|
+
`);t=t.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);let n=[];t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(e,t,r)=>(n.push(`<pre><code>${r.trim()}</code></pre>`),`%%CB${n.length-1}%%`));let r=[];t=t.replace(/`([^`]+)`/g,(e,t)=>(r.push(`<code>${t}</code>`),`%%IC${r.length-1}%%`)),t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,`<img src="$2" alt="$1"/>`),t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,`<a href="$2" target="_blank" rel="noopener">$1</a>`),t=t.replace(/(?<!=["'])(https?:\/\/[^\s<>")\]]+)/g,`<a href="$1" target="_blank" rel="noopener">$1</a>`),t=t.replace(/\*\*\*(.+?)\*\*\*/g,`<strong><em>$1</em></strong>`),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g,`<em>$1</em>`),t=t.replace(/~~(.+?)~~/g,`<del>$1</del>`),t=t.replace(RegExp(`^${E9}#### (.+)$`,`gm`),`<h5>$1</h5>`),t=t.replace(RegExp(`^${E9}### (.+)$`,`gm`),`<h4>$1</h4>`),t=t.replace(RegExp(`^${E9}## (.+)$`,`gm`),`<h3>$1</h3>`),t=t.replace(RegExp(`^${E9}# (.+)$`,`gm`),`<h2>$1</h2>`),t=t.replace(RegExp(`^${E9}> (.+)$`,`gm`),`<blockquote>$1</blockquote>`),t=t.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
148
|
+
`),t=t.replace(RegExp(`^${E9}(?:-{3,}|\\*{3,}|_{3,})\\s*$`,`gm`),`<hr/>`),t=t.replace(RegExp(`((?:^${E9}\\|.+\\|\\n?)+)`,`gm`),e=>{let t=e.trim().split(`
|
|
149
|
+
`).filter(Boolean);if(t.length<2)return e;let n=e=>e.trim().split(`|`).slice(1,-1).map(e=>e.trim()),r=n(t[0]),i=/^(\|[\s:*-]+)+\|$/.test(t[1].trim().replace(/[^|:*-\s]/g,``)),a=i?n(t[1]):null,o=a?a.map(e=>e.startsWith(`:`)&&e.endsWith(`:`)?`center`:e.endsWith(`:`)?`right`:`left`):r.map(()=>`left`),s=t.slice(i?2:1),c=`<div class="wn-table-wrap"><table><thead><tr>`;for(let e=0;e<r.length;e++)c+=`<th style="text-align:${o[e]}">${r[e]}</th>`;c+=`</tr></thead><tbody>`;for(let e of s){let t=n(e);c+=`<tr>`;for(let e=0;e<r.length;e++)c+=`<td style="text-align:${o[e]}">${t[e]??``}</td>`;c+=`</tr>`}return`${c}</tbody></table></div>`}),t=t.replace(RegExp(`^${E9}(\\d+)\\. (.+)$`,`gm`),`<oli>$2</oli>`),t=t.replace(/<\/oli>\n\n+<oli>/g,`</oli>
|
|
150
|
+
<oli>`),t=t.replace(/((?:<oli>.*<\/oli>\n?)+)/g,e=>`<ol>${e.trimEnd().replace(/<\/?oli>/g,e=>e.replace(`oli`,`li`))}</ol>`),t=t.replace(RegExp(`^${E9}[-*+] (.+)$`,`gm`),`<li>$1</li>`),t=t.replace(/<\/li>\n\n+<li>/g,`</li>
|
|
151
151
|
<li>`),t=t.replace(/((?:<li>.*<\/li>\n?)+)/g,e=>`<ul>${e.trimEnd()}</ul>`),t=t.replace(/<li>\[x\] (.+?)<\/li>/gi,`<li class="wn-task done"><span class="wn-check">✓</span> $1</li>`),t=t.replace(/<li>\[ \] (.+?)<\/li>/g,`<li class="wn-task"><span class="wn-check">☐</span> $1</li>`);let i=/^<\/?(h[2-5]|ul|ol|li|pre|blockquote|hr|div|table|img)/;return t=t.split(`
|
|
152
152
|
`).map(e=>{let t=e.trim();return t?i.test(t)?t:`<p>${t}</p>`:``}).join(`
|
|
153
|
-
`),t=t.replace(/%%CB(\d+)%%/g,(e,t)=>n[Number(t)]),t=t.replace(/%%IC(\d+)%%/g,(e,t)=>r[Number(t)]),t}var k9=`mt-whats-new-dismissed`,A9=`mt-whats-new-seen-version`;function dne(e){try{return localStorage.getItem(k9)===e}catch{return!1}}function fne(e){try{localStorage.setItem(k9,e)}catch{}}function pne(e){try{let t=localStorage.getItem(A9);return localStorage.setItem(A9,e),t!==null&&t!==e}catch{return!1}}var j9=`text-[13px] leading-[1.7] text-muted-foreground [&_h2]:mt-[18px] [&_h2]:mb-1.5 [&_h2]:text-[17px] [&_h2]:font-bold [&_h2]:text-foreground [&_h3]:mt-[18px] [&_h3]:mb-1.5 [&_h3]:text-[15px] [&_h3]:font-bold [&_h3]:text-foreground [&_h4]:mt-[18px] [&_h4]:mb-1.5 [&_h4]:text-[14px] [&_h4]:font-bold [&_h4]:text-foreground [&_h5]:mt-[18px] [&_h5]:mb-1.5 [&_h5]:text-[14px] [&_h5]:font-bold [&_h5]:text-foreground [&_p]:my-[5px] [&_ul]:my-[5px] [&_ul]:list-disc [&_ul]:pl-[18px] [&_ol]:my-[5px] [&_ol]:list-decimal [&_ol]:pl-[22px] [&_li]:my-[3px] [&_li]:marker:text-brand [&_img]:my-1.5 [&_img]:max-w-full [&_img]:rounded-md [&_img]:border [&_img]:border-border [&_code]:rounded [&_code]:border [&_code]:border-border [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-xs [&_code]:text-brand [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-border [&_pre]:bg-background [&_pre]:p-3 [&_pre_code]:border-0 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-muted-foreground [&_a]:text-brand [&_a]:underline [&_a]:underline-offset-2 [&_strong]:font-semibold [&_strong]:text-foreground [&_blockquote]:my-2 [&_blockquote]:border-l-[3px] [&_blockquote]:border-brand/40 [&_blockquote]:px-3.5 [&_blockquote]:py-1.5 [&_blockquote]:italic [&_hr]:my-3.5 [&_hr]:border-0 [&_hr]:border-t [&_hr]:border-border [&_del]:text-muted-foreground [&_del]:opacity-60 [&_table]:w-full [&_table]:border-collapse [&_table]:font-mono [&_table]:text-xs [&_th]:border-b [&_th]:border-border [&_th]:bg-muted [&_th]:px-3 [&_th]:py-[7px] [&_th]:text-left [&_th]:text-[11px] [&_th]:font-semibold [&_th]:tracking-wide [&_th]:text-foreground [&_th]:uppercase [&_td]:border-b [&_td]:border-border [&_td]:px-3 [&_td]:py-[7px] [&_td]:text-muted-foreground [&_.wn-table-wrap]:my-2.5 [&_.wn-table-wrap]:overflow-x-auto [&_.wn-table-wrap]:rounded-md [&_.wn-table-wrap]:border [&_.wn-table-wrap]:border-border [&_.wn-task]:-ml-[18px] [&_.wn-task]:list-none [&_.wn-check]:inline-block [&_.wn-check]:w-4 [&_.wn-task.done_.wn-check]:text-success`,mne=600*1e3;function hne(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!e)return;let t=pne(e),r=null,a=()=>{gc(`/api/releases/latest`).then(e=>{n(e);let a=r===null,o=r!==null&&e.version!==r;if(r=e.version,a&&t){setTimeout(()=>i(!0),1200);return}e.isNewer&&!dne(e.version)&&(a||o)&&setTimeout(()=>i(!0),a?1200:0)}).catch(()=>{})};a();let o=setInterval(a,mne);return()=>clearInterval(o)},[e]);let a=(0,v.useCallback)(()=>{t?.isNewer&&fne(t.version),i(!1)},[t]),o=(0,v.useCallback)(()=>i(!0),[]);return{release:t,showModal:r,showIndicator:t!==null&&t.isNewer,openModal:o,dismissRelease:a}}function gne({release:e,onDismiss:t}){let n=new Date(e.publishedAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),r={__html:O9(e.body)};return(0,W.jsx)(rne,{open:!0,onOpenChange:e=>{e||t()},children:(0,W.jsxs)(one,{className:`max-h-[calc(100vh-80px)] gap-0 overflow-y-auto p-0 sm:max-w-[520px]`,children:[(0,W.jsxs)(sne,{className:`items-center gap-4 px-8 pt-10 pb-6 text-center`,children:[(0,W.jsx)(`span`,{className:`inline-block rounded-full border border-brand/30 bg-brand/10 px-3.5 py-1 font-mono text-[10px] font-bold tracking-[0.2em] text-brand uppercase`,children:e.isNewer?`NEW RELEASE`:`RELEASE NOTES`}),(0,W.jsxs)(lne,{className:`text-[44px] leading-none font-extrabold tracking-tight text-brand`,children:[`v`,e.version]}),(0,W.jsxs)(une,{className:`font-mono text-xs text-muted-foreground`,children:[`Released `,n,e.isNewer&&(0,W.jsxs)(W.Fragment,{children:[` · you’re on v`,e.currentVersion]})]})]}),(0,W.jsx)(`div`,{className:J(`px-8 py-5`,j9),dangerouslySetInnerHTML:r}),(0,W.jsxs)(cne,{className:`flex-row items-center justify-between border-t border-border px-8 pt-3.5 pb-6`,children:[(0,W.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground hover:text-foreground`,children:[`View on GitHub`,(0,W.jsx)(Hc,{className:`size-3.5`})]}),(0,W.jsx)(X,{type:`default`,size:`sm`,onClick:t,children:`Got it`})]})]})})}var M9=`@usex/mikrotik-mcp`;function _ne(e){try{return new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}catch{return e}}function N9(e){return e===`current`?{label:`Reinstall`,icon:(0,W.jsx)(rl,{className:`size-3.5`})}:e===`newer`?{label:`Upgrade`,icon:(0,W.jsx)(jc,{className:`size-3.5`})}:{label:`Downgrade`,icon:(0,W.jsx)(Ac,{className:`size-3.5`})}}function vne({body:e}){return e.trim()?(0,W.jsx)(`div`,{className:J(j9),dangerouslySetInnerHTML:{__html:O9(e)}}):(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No release notes.`})}function yne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(new Set),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(async()=>{r(!0);try{let e=await gc(`/api/releases`);t(e),a(null);let n=e.releases.find(t=>t.version===e.latestVersion);n&&s(new Set([n.version]))}catch(e){a(e instanceof Error?e.message:`Could not load releases`)}finally{r(!1)}},[]);(0,v.useEffect)(()=>{m()},[m]);let h=e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});async function g(e){l(null),d(!0),p(null);let t=Y.loading(`Installing ${M9}@${e}…`);try{let n=await _c(`/api/upgrade`,{version:e});n?.ok?(p(n.log??null),Y.success(`Installed v${n.version}`,{id:t,description:n.restarting?`Restarting on the new version — reconnect shortly.`:n.note})):(p(n?.log??null),Y.error(n?.error??`Install failed`,{id:t,description:`See the install log below.`}))}catch{Y.error(`Install failed (server unreachable)`,{id:t})}finally{d(!1)}}let _=e?.releases.find(t=>t.version===e.latestVersion)??null,y=(0,v.useMemo)(()=>e?(0,W.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card p-6`,children:[(0,W.jsx)(`div`,{className:`from-brand/10 pointer-events-none absolute -top-16 -right-16 size-56 rounded-full bg-gradient-to-br to-transparent blur-2xl`}),(0,W.jsxs)(`div`,{className:`relative flex flex-wrap items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px] font-medium tracking-[0.18em] uppercase`,children:`Running version`}),(0,W.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-foreground text-[40px] leading-none font-extrabold tracking-tight`,children:[`v`,e.currentVersion]}),e.updateAvailable?(0,W.jsxs)(`span`,{className:`bg-brand/10 text-brand ring-brand/30 inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-semibold ring-1`,children:[(0,W.jsx)(cl,{className:`size-3.5`}),` v`,e.latestVersion,` available`]}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-3 py-1 text-xs font-semibold text-emerald-500 ring-1 ring-emerald-500/30`,children:[(0,W.jsx)(Nc,{className:`size-3.5`}),` Up to date`]})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(X,{onClick:()=>void m(),title:`Re-check for updates`,children:[(0,W.jsx)(nl,{className:`size-3.5`}),` Re-check`]}),e.updateAvailable&&_&&(0,W.jsxs)(X,{onClick:()=>l(_),disabled:u,className:`bg-brand text-brand-foreground hover:bg-brand/90 border-transparent`,children:[(0,W.jsx)(jc,{className:`size-3.5`}),` Upgrade to latest`]})]})]})]}):null,[e,_,u,m]);return n?(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 p-6 text-sm`,children:[(0,W.jsx)(Ux,{}),` Loading releases…`]}):i||!e?(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsxs)(Lx,{type:`error`,label:`Couldn't load releases`,children:[i??`No data.`,` Check network access to GitHub.`]})}):(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[y,f&&(0,W.jsxs)(`div`,{className:`rounded-lg border bg-card p-3`,children:[(0,W.jsx)(`div`,{className:`text-muted-foreground mb-1.5 text-[11px] font-semibold tracking-wide uppercase`,children:`Install log`}),(0,W.jsx)(`pre`,{className:`text-muted-foreground max-h-52 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap`,children:f})]}),(0,W.jsxs)(`div`,{className:`relative pl-6`,children:[(0,W.jsx)(`div`,{className:`bg-border absolute top-2 bottom-2 left-[9px] w-px`,"aria-hidden":`true`}),(0,W.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.releases.map(t=>{let n=o.has(t.version),r=t.relation===`current`,i=t.version===e.latestVersion,a=N9(t.relation);return(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`span`,{className:J(`absolute top-3.5 -left-[21px] z-10 grid size-[19px] place-items-center rounded-full ring-4 ring-card`,r?`bg-emerald-500`:i?`bg-brand`:t.relation===`newer`?`bg-brand/60`:`bg-muted-foreground/40`),title:r?`You are here`:t.relation,children:r&&(0,W.jsx)(Nc,{className:`size-3 text-white`})}),(0,W.jsxs)(`div`,{className:J(`rounded-lg border bg-card transition-colors`,r&&`border-emerald-500/40`,i&&!r&&`border-brand/40`),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 p-3.5`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>h(t.version),className:`flex items-baseline gap-2 text-left`,title:n?`Hide notes`:`Show notes`,children:[(0,W.jsxs)(`span`,{className:`text-foreground text-lg font-bold tracking-tight`,children:[`v`,t.version]}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:_ne(t.publishedAt)})]}),r&&(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-semibold text-emerald-500 uppercase`,children:`current`}),i&&!r&&(0,W.jsx)(`span`,{className:`bg-brand/10 text-brand rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase`,children:`latest`}),t.prerelease&&(0,W.jsx)(`span`,{className:`text-muted-foreground rounded-full bg-muted px-2 py-0.5 text-[10px] font-semibold uppercase`,children:`pre-release`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs`,title:`Open on GitHub`,children:(0,W.jsx)(Hc,{className:`size-3.5`})}),(0,W.jsx)(X,{onClick:()=>h(t.version),children:n?`Hide notes`:`Notes`}),(0,W.jsxs)(X,{onClick:()=>l(t),disabled:u,className:J(t.relation===`older`&&`text-destructive`,t.relation===`newer`&&`bg-brand text-brand-foreground hover:bg-brand/90 border-transparent`),title:`${a.label} to v${t.version}`,children:[a.icon,` `,a.label]})]}),n&&(0,W.jsx)(`div`,{className:`border-t px-4 py-3.5`,children:(0,W.jsx)(vne,{body:t.body})})]})]},t.version)})})]}),(0,W.jsx)(cb,{open:c!==null,onOpenChange:e=>!e&&l(null),children:(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:c?`${N9(c.relation).label} to v${c.version}?`:``}),(0,W.jsxs)(mb,{children:[`This runs`,` `,(0,W.jsxs)(`code`,{className:`text-brand bg-muted rounded px-1.5 py-0.5 font-mono text-xs`,children:[`bun i -g `,M9,`@`,c?.version]}),` `,`on the server, then the server relaunches on that version and this connection drops briefly. Reconnect after.`,c?.relation===`older`&&(0,W.jsxs)(W.Fragment,{children:[` `,(0,W.jsx)(`b`,{className:`text-destructive`,children:`Downgrade`}),` — a newer config may not load on an older build; snapshot first if unsure.`]})]})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsxs)(hb,{className:J(ob({variant:c?.relation===`older`?`destructive`:`default`}),`gap-1.5`),onClick:()=>c&&void g(c.version),children:[c?N9(c.relation).icon:null,c?N9(c.relation).label:`Install`]})]})]})}),(0,W.jsxs)(`p`,{className:`text-muted-foreground flex items-center gap-1.5 text-[11px]`,children:[(0,W.jsx)(zc,{className:`size-3`}),` Prefer the CLI? Run`,` `,(0,W.jsxs)(`code`,{className:`bg-muted rounded px-1.5 py-0.5 font-mono`,children:[`bun i -g `,M9,`@latest`]})]})]})}var bne={critical:`text-destructive`,high:`text-orange-500`,medium:`text-yellow-500`,low:`text-muted-foreground`};function P9(e){return(0,W.jsx)(Bx,{type:e===`5ghz`?`success`:e===`2ghz`?`warning`:`secondary`,children:e===`2ghz`?`2.4G`:e===`5ghz`?`5G`:`?`})}async function F9(e,t,n,r){let i=Y.loading(`${n}…`);try{let a=await _c(e,{...t,confirm:!0});a?.ok?(Y.success(`${n} applied`,{id:i,description:a.snapshotId?`snapshot ${a.snapshotId}`:a.message}),r()):Y.error(a?.error??`${n} failed`,{id:i})}catch{Y.error(`${n} failed (server unreachable)`,{id:i})}}function xne({mac:e,cap:t,onDone:n}){return(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsxs)(X,{className:`h-6 px-2 text-[11px]`,children:[(0,W.jsx)(hl,{className:`size-3`}),` Steer`]})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsxs)(pb,{children:[`Steer `,e,` toward `,t,`?`]}),(0,W.jsx)(mb,{children:`Installs a hard signal-range reject on the client’s current radio so it re-associates on the stronger neighbor. This may briefly disconnect the client, and RouterOS ultimately lets the client decide (advisory). A config snapshot is taken first and the change runs in Safe Mode.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{className:ob({variant:`destructive`}),onClick:()=>void F9(`/api/capsman/apply/steer`,{mac:e,mode:`hard`},`Steer ${e}`,n),children:`Steer (hard)`})]})]})]})}function Sne(e){let t=Math.min(1,e.clientCount/30),n=Math.min(1,(e.cpuLoad??0)/100),r=e.conflicts.length>0?.4:0;return Math.max(0,1-(t*.5+n*.4+r))}function Cne(e){return e>.66?`bg-emerald-500/15 border-emerald-500/40`:e>.33?`bg-yellow-500/15 border-yellow-500/40`:`bg-destructive/15 border-destructive/50`}function wne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(null);async function f(){l(!0);try{let[e,n,i]=await Promise.all([gc(`/api/capsman/overview`),gc(`/api/capsman/clients`),gc(`/api/capsman/audit`)]);t(e),r(n.weak),a(i),d(null)}catch(e){d(e instanceof Error?e.message:`Could not load CAPsMAN data`)}finally{l(!1)}try{let e=await gc(`/api/capsman/trends`);s(e.series??[])}catch{s([])}}(0,v.useEffect)(()=>{f()},[]);let p=(0,v.useMemo)(()=>{let t=new Map;for(let n of e?.radios??[]){let e=n.floor??`?`;(t.get(e)??t.set(e,[]).get(e)).push(n)}return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[e]);return c&&!e?(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 p-6 text-sm`,children:[(0,W.jsx)(Ux,{}),` Loading CAPsMAN fabric…`]}):u?(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsxs)(Lx,{type:`error`,label:`CAPsMAN unavailable`,children:[u,`. This device may not run a CAPsMAN manager, or has no managed CAPs.`]})}):e?(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[!e.managerEnabled&&(0,W.jsx)(Lx,{type:`warning`,label:`No CAPsMAN manager`,children:`This device isn’t running a CAPsMAN manager (or no CAPs are provisioned). The audit still runs; the coverage grid will be empty.`}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-4 xl:grid-cols-6`,children:[(0,W.jsx)(ox,{k:`CAPs`,v:px(e.totals.caps),sub:`managed access points`}),(0,W.jsx)(ox,{k:`Radios`,v:px(e.totals.radios)}),(0,W.jsx)(ox,{k:`Clients`,v:px(e.totals.clients)}),(0,W.jsx)(ox,{k:`2.4G / 5G`,v:`${e.bandSplit[`2ghz`]} / ${e.bandSplit[`5ghz`]}`,sub:`client band split`}),(0,W.jsx)(ox,{k:`Co-channel`,v:px(e.cochannel.length),cls:e.cochannel.length?`text-destructive`:void 0,sub:`conflicting pairs`}),(0,W.jsx)(ox,{k:`Findings`,v:px(i?.total??0),cls:i&&i.total>0?`text-orange-500`:void 0})]}),(0,W.jsx)(ax,{title:`Coverage & load by floor`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.cochannel.length>0&&(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsxs)(X,{className:`h-6 px-2 text-[11px]`,children:[(0,W.jsx)(tl,{className:`size-3`}),` Apply channel plan`]})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Apply the proposed channel plan?`}),(0,W.jsxs)(mb,{children:[`Re-channels radios to the non-overlapping plan (2.4 GHz 1/6/11, 5 GHz DFS-aware) to clear the `,e.cochannel.length,` co-channel conflict(s). Clients on a re-channeled radio briefly re-associate. Snapshot + Safe Mode; idempotent. (v7 /interface wifi only.)`]})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void F9(`/api/capsman/apply/channel-plan`,{},`Channel plan`,()=>void f()),children:`Apply`})]})]})]}),(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsxs)(X,{className:`h-6 px-2 text-[11px]`,children:[(0,W.jsx)(il,{className:`size-3`}),` Auto-balance`]})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Apply resource-aware load balance?`}),(0,W.jsx)(mb,{children:`For each overloaded or CPU-constrained radio that has an idle adjacent neighbor, installs a connect-priority nudge so NEW clients prefer the neighbor. Existing clients are not disconnected. Snapshot + Safe Mode; idempotent.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void F9(`/api/capsman/apply/load-balance`,{},`Load balance`,()=>void f()),children:`Apply`})]})]})]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>void f(),className:`text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs`,children:[(0,W.jsx)(nl,{className:`size-3.5`}),` refresh`]})]}),children:p.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No managed radios.`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-4`,children:p.map(([t,n])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-muted-foreground mb-1.5 text-[11px] font-semibold tracking-wide uppercase`,children:t===`?`?`Unfloored (inferred by signal)`:`Floor ${t}`}),(0,W.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6`,children:n.map(t=>{let n=e.proposedChannels[t.radioId],r=n!=null&&n!==t.channel;return(0,W.jsxs)(`div`,{className:J(`flex flex-col gap-1 rounded-lg border p-2.5`,Cne(Sne(t))),title:`${t.cap} · ${t.adjacent.length} neighbors`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-1`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs font-semibold`,children:[(0,W.jsx)(tl,{className:`size-3`}),` `,t.cap]}),P9(t.band)]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between text-[11px]`,children:[(0,W.jsxs)(`span`,{className:J(t.conflicts.length>0&&`text-destructive font-medium`),children:[`ch `,t.channel??`?`,r&&(0,W.jsxs)(`span`,{className:`text-brand`,children:[` →`,n]})]}),(0,W.jsxs)(`span`,{children:[t.clientCount,` cl`]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between text-[11px]`,children:[(0,W.jsxs)(`span`,{children:[`CPU `,t.cpuLoad==null?`—`:`${t.cpuLoad}%`]}),t.conflicts.length>0&&(0,W.jsxs)(`span`,{className:`text-destructive inline-flex items-center gap-0.5`,children:[(0,W.jsx)(pl,{className:`size-3`}),` co-ch`]})]})]},t.radioId)})})]},t))})}),(0,W.jsx)(ax,{title:`Roaming (FT) & HA audit`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i&&i.findings.some(e=>e.category===`ft`)&&(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsxs)(X,{className:`h-6 px-2 text-[11px]`,children:[(0,W.jsx)(hl,{className:`size-3`}),` Enable FT`]})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Enable 802.11r fast-roaming?`}),(0,W.jsx)(mb,{children:`Turns on FT across the CAPsMAN security configs and converges them on ONE shared mobility domain, so clients roam between floors without a full re-auth. This briefly re-keys associated clients. Snapshot + Safe Mode; idempotent.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void F9(`/api/capsman/apply/ft`,{},`Enable FT`,()=>void f()),children:`Enable FT`})]})]})]}),i&&i.findings.some(e=>e.category===`ha`)&&(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsxs)(X,{className:`h-6 px-2 text-[11px]`,children:[(0,W.jsx)(pl,{className:`size-3`}),` Harden HA`]})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Harden CAPsMAN HA (require peer certificate)?`}),(0,W.jsx)(mb,{children:`Enables require-peer-certificate on this manager so a rogue manager can’t adopt your CAPs. Standing up a second manager and pointing every CAP at both is multi-device and NOT auto-applied — the tool returns those manual steps. Snapshot + Safe Mode; idempotent.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void F9(`/api/capsman/apply/ha`,{},`Harden HA`,()=>void f()),children:`Harden HA`})]})]})]})]}),children:!i||i.total===0?(0,W.jsx)(`p`,{className:`text-emerald-500 text-sm`,children:`No findings — roaming & redundancy look healthy. ✓`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.findings.map(e=>(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border p-2.5`,children:[(0,W.jsx)(`span`,{className:J(`mt-0.5 text-[10px] font-bold uppercase`,bne[e.severity]),children:e.severity.slice(0,4)}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,W.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.detail}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 text-xs`,children:[`→ `,e.recommendation,(0,W.jsxs)(`span`,{className:`ml-2 opacity-60`,children:[`[`,e.category,` · `,e.confidence,`]`]})]})]})]},e.finding_id))})}),(0,W.jsx)(ax,{title:`Weak-signal clients`,extra:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[n.length,` below threshold`]}),children:n.length===0?(0,W.jsx)(`p`,{className:`text-emerald-500 text-sm`,children:`No weak clients. ✓`}):(0,W.jsx)(`div`,{className:`overflow-x-auto`,children:(0,W.jsxs)(Yb,{children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Client`}),(0,W.jsx)($b,{children:`Signal`}),(0,W.jsx)($b,{children:`Band`}),(0,W.jsx)($b,{children:`Current AP`}),(0,W.jsx)($b,{children:`Recommended`}),(0,W.jsx)($b,{})]})}),(0,W.jsx)(Zb,{children:n.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{className:`font-mono text-xs`,children:e.mac}),(0,W.jsxs)(ex,{className:J(e.signal<-80?`text-destructive`:`text-orange-500`,`tabular-nums`),children:[e.signal,` dBm`]}),(0,W.jsx)(ex,{children:P9(e.band)}),(0,W.jsx)(ex,{className:`text-xs`,children:e.currentCap}),(0,W.jsx)(ex,{className:`text-xs`,children:e.recommendCap?(0,W.jsxs)(`span`,{className:`text-brand inline-flex items-center gap-1`,children:[(0,W.jsx)(hl,{className:`size-3`}),` `,e.recommendCap,` (+`,e.gainDb,` dB)`]}):(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:`coverage gap`})}),(0,W.jsx)(ex,{children:e.recommendCap&&(0,W.jsx)(xne,{mac:e.mac,cap:e.recommendCap,onDone:()=>void f()})})]},e.mac))})]})})}),o.length>0&&(0,W.jsx)(ax,{title:`Radio load trends`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`associated clients per radio · sampled every 5 min`}),children:(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-4 p-1 sm:grid-cols-2 xl:grid-cols-3`,children:o.map(e=>{let t=e.band===`5ghz`?`var(--success)`:e.band===`2ghz`?`var(--warning)`:`var(--muted-foreground)`;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[P9(e.band),(0,W.jsx)(`span`,{className:`truncate`,children:e.cap}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`/`,e.radioId]})]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`peak `,e.peak,` · avg `,e.avg]})]}),(0,W.jsx)(o7,{values:e.points.map(e=>e.clients),color:t,id:`capsman-${e.radioId}`})]},e.radioId)})})}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-[11px]`,children:`Steering, load-balance, channel-plan, FT and HA apply are all live (snapshot + Safe Mode, confirmed). All steering is advisory — RouterOS lets the client decide. Load trends fill in as the background sampler runs.`})]}):null}var Tne={TCP:`var(--chart-1)`,UDP:`var(--chart-2)`,ICMP:`var(--chart-3)`,ICMPv6:`var(--chart-3)`,ARP:`var(--chart-4)`,IPv6:`var(--chart-5)`},I9=e=>e&&Tne[e]||`var(--muted-foreground)`;function Ene(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=()=>void gc(`/api/capture/packets?limit=150`).then(t).catch(()=>{});e();let n=setInterval(e,1500);return()=>clearInterval(n)},[]);let i=e?.stats,a=e?.packets??[],o=async()=>{r(!0);let e=await _c(`/api/capture/stop`,{}).catch(()=>null);r(!1),e===null||e.ok===!1||e.error?Y.error(e?.error??`Capture stop failed`):Y.success(`Capture stopped`)};if(!i||!i.running&&i.packets===0)return(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[13px] leading-relaxed`,children:[`No capture running. Start one with the`,` `,(0,W.jsx)(`code`,{className:`text-brand font-mono`,children:`start_packet_capture`}),` tool — point the device's TZSP stream at this host — and decoded packets stream in here live.`]});let s=Math.max(1,...Object.values(i.protocols));return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(Hx,{color:i.running?`var(--success)`:`var(--muted-foreground)`,pulse:i.running}),(0,W.jsx)(`b`,{children:i.running?`capturing`:`stopped`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`UDP `,i.port]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[px(i.packets),` pkts · `,dx(i.bytes)]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`a`,{className:`bg-card hover:bg-accent inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs whitespace-nowrap`,href:hc(`/api/capture/pcap`),download:`capture.pcap`,children:[(0,W.jsx)(Vc,{className:`size-3.5`}),` pcap`]}),(0,W.jsx)(X,{type:`error`,ghost:!0,size:`sm`,icon:(0,W.jsx)(ll,{className:`size-3.5`}),onClick:()=>void o(),disabled:n||!i.running,children:`Stop`})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-[220px_1fr] gap-3 max-[720px]:grid-cols-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-[5px]`,children:[(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px] tracking-[0.05em] uppercase`,children:`Protocols`}),Object.entries(i.protocols).map(([e,t])=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[52px_1fr_34px] items-center gap-1.5 font-mono text-[11px]`,children:[(0,W.jsx)(`span`,{style:{color:I9(e)},children:e}),(0,W.jsx)(`span`,{className:`bg-muted h-2 overflow-hidden rounded-full`,children:(0,W.jsx)(`i`,{className:`block h-full rounded-full`,style:{width:`${t/s*100}%`,background:I9(e)}})}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-right`,children:t})]},e)),(0,W.jsx)(`div`,{className:`text-muted-foreground mt-3 text-[11px] tracking-[0.05em] uppercase`,children:`Top talkers`}),i.topTalkers.length===0&&(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`—`}),i.topTalkers.map(e=>(0,W.jsxs)(`div`,{className:`text-muted-foreground flex justify-between font-mono text-[11px] [&>b]:text-foreground`,children:[(0,W.jsx)(`span`,{children:e.addr}),(0,W.jsx)(`b`,{children:e.count})]},e.addr))]}),(0,W.jsx)(`div`,{className:`bg-background h-[360px] overflow-y-auto rounded-md border font-mono text-[11px]/[1.6]`,children:a.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground p-2.5 text-[11px]`,children:`waiting for packets…`}):a.map((e,t)=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[90px_64px_48px_1fr] gap-2 overflow-hidden px-2.5 py-px whitespace-nowrap odd:bg-card/40`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:fx(e.ts)}),(0,W.jsx)(`span`,{className:`font-semibold`,style:{color:I9(e.protocol)},children:e.protocol??e.ethType}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-right`,children:e.len}),(0,W.jsx)(`span`,{className:`text-foreground overflow-hidden text-ellipsis`,children:e.info})]},t))})]})]})}function Dne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=(0,v.useCallback)(()=>{gc(`/api/s3/list`).then(t).catch(()=>t({configured:!1,objects:[]}))},[]);(0,v.useEffect)(()=>c(),[c]);let l=e=>{gc(`/api/s3/presign?key=${encodeURIComponent(e)}`).then(e=>{e.url?window.open(e.url,`_blank`,`noopener`):(s(`could not generate download link`),Y.error(`Could not generate download link`))}).catch(()=>{s(`could not generate download link`),Y.error(`Could not generate download link`)})},u=async e=>{a(e);let t=await _c(`/api/s3/delete`,{key:e}).catch(()=>({error:`request failed`}));a(null),r(null),t.ok?(s(`Deleted ${e}`),Y.success(`S3 object deleted`),c()):(s(t.error??`delete failed`),Y.error(t.error??`S3 object delete failed`))};return e?e.configured?(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsxs)(ax,{title:`S3 backups`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.target,` · `,e.objects.length,` object`,e.objects.length===1?``:`s`,e.truncated?` (truncated)`:``]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:c,children:`Refresh`})]}),children:[o&&(0,W.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:o}),e.objects.length===0?(0,W.jsxs)(`div`,{className:`p-3 text-muted-foreground text-[11px]`,children:[`No objects in the bucket. Upload one with the `,(0,W.jsx)(`code`,{children:`upload_backup_to_s3`}),` tool.`]}):(0,W.jsxs)(Yb,{className:`font-mono`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`key`}),(0,W.jsx)($b,{className:`text-right tabular-nums`,children:`size`}),(0,W.jsx)($b,{children:`modified`}),(0,W.jsx)($b,{className:`w-[200px]`,children:`actions`})]})}),(0,W.jsx)(Zb,{children:e.objects.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{children:e.key}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:dx(e.size)}),(0,W.jsx)(ex,{children:e.lastModified?new Date(e.lastModified).toLocaleString(void 0,{hour12:!1}):`—`}),(0,W.jsxs)(ex,{className:`flex gap-1.5`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(Vc,{}),onClick:()=>l(e.key),children:`Download`}),n===e.key?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,icon:(0,W.jsx)(Nc,{}),disabled:i===e.key,onClick:()=>void u(e.key),children:`Confirm`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>r(null),children:`Cancel`})]}):(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(fl,{}),onClick:()=>r(e.key),children:`Delete`})]})]},e.key))})]})]})}):(0,W.jsxs)(`div`,{className:`grid justify-items-center gap-2 rounded-lg border border-dashed border-border px-4 py-[54px] text-center`,children:[(0,W.jsx)(Rc,{className:`size-7 text-muted-foreground opacity-80`}),(0,W.jsx)(`p`,{className:`m-0 font-semibold text-foreground`,children:`S3 is not configured`}),(0,W.jsxs)(`p`,{className:`m-0 max-w-[460px] text-muted-foreground text-xs`,children:[`Add an `,(0,W.jsx)(`code`,{children:`s3`}),` block (bucket + credentials) to your config to manage backup objects here.`]})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading S3 objects…`})}function One(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=(0,v.useCallback)(()=>{gc(`/api/snapshots`).then(e=>t(e.snapshots)).catch(()=>t([]))},[]);(0,v.useEffect)(()=>u(),[u]);let d=e=>{gc(`/api/snapshot/${encodeURIComponent(e)}`).then(s).catch(()=>{})},f=()=>{!n||!i||_c(`/api/snapshots/diff`,{from:n,to:i}).then(l).catch(()=>Y.error(`Diff failed`))};if(!e)return(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading snapshots…`});if(e.length===0)return(0,W.jsxs)(`div`,{className:`grid justify-items-center gap-2 rounded-lg border border-dashed border-border px-4 py-[54px] text-center`,children:[(0,W.jsx)(Uc,{className:`size-7 text-muted-foreground`}),(0,W.jsx)(`p`,{className:`font-semibold text-foreground`,children:`No config snapshots yet`}),(0,W.jsxs)(`p`,{className:`max-w-[460px] text-xs text-muted-foreground`,children:[`Capture one with the `,(0,W.jsx)(`code`,{children:`capture_config_snapshot`}),` tool — then time-travel diff any two here.`]})]});let p=e.map(e=>({value:e.id,label:`${e.device} · ${e.label??e.id} · ${fx(e.ts)}`}));return(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(ax,{title:`Config snapshots`,className:`reveal`,extra:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(nl,{}),onClick:u,children:`Refresh`}),children:[(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Jx,{value:n,onValueChange:r,"aria-label":`Diff from snapshot`,options:[{value:``,label:`diff from…`},...p]}),(0,W.jsx)(Jx,{value:i,onValueChange:a,"aria-label":`Diff to snapshot`,options:[{value:``,label:`to…`},...p]}),(0,W.jsx)(X,{size:`sm`,onClick:f,disabled:!n||!i,children:`Diff →`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.length,` snapshots`]})]}),(0,W.jsx)(`div`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border`,children:(0,W.jsxs)(Yb,{children:[(0,W.jsx)(Xb,{className:`sticky top-0 z-10 bg-card`,children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`captured`}),(0,W.jsx)($b,{children:`device`}),(0,W.jsx)($b,{children:`label`}),(0,W.jsx)($b,{children:`version`}),(0,W.jsx)($b,{className:`text-right`,children:`lines`}),(0,W.jsx)($b,{className:`text-right`,children:`size`}),(0,W.jsx)($b,{children:`output`})]})}),(0,W.jsx)(Zb,{children:e.map(e=>(0,W.jsxs)(Qb,{className:`cursor-pointer`,"data-state":o?.id===e.id?`selected`:void 0,onClick:()=>d(e.id),children:[(0,W.jsx)(ex,{children:fx(e.ts)}),(0,W.jsx)(ex,{children:e.device}),(0,W.jsx)(ex,{children:e.label??`—`}),(0,W.jsx)(ex,{children:e.rosVersion??`—`}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:e.lines}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:dx(e.bytes)}),(0,W.jsx)(ex,{className:`max-w-[320px] truncate text-muted-foreground`,children:`view export →`})]},e.id))})]})})]}),c&&(0,W.jsx)(ax,{title:`Time-travel diff`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:c.summary.changed?`+${c.summary.added} / -${c.summary.removed}`:`identical`}),children:(0,W.jsx)(`pre`,{className:`m-0 max-h-80 overflow-auto rounded bg-background p-3 font-mono text-[11px] leading-normal text-muted-foreground`,children:(c.unified||`(identical)`).split(`
|
|
154
|
-
`).map((e,t)=>(0,W.jsx)(`div`,{className:e.startsWith(`+`)?`text-success`:e.startsWith(`-`)?`text-destructive`:e.startsWith(`@@`)?`text-brand`:``,children:e||` `},t))})}),o&&(0,W.jsx)(ax,{title:`Snapshot · ${o.label??o.id}`,className:`reveal`,extra:(0,W.jsx)(X,{type:`secondary`,size:`sm`,icon:(0,W.jsx)(gl,{}),onClick:()=>s(null),children:`Close`}),children:(0,W.jsx)(`pre`,{className:`m-0 overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap`,style:{maxHeight:460},children:o.body||`(empty)`})})]})}function L9({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,W.jsx)(lv,{"data-slot":`separator`,decorative:n,orientation:t,className:J(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var R9=` hub`;function z9(e){let t=e;for(;t>Math.PI;)t-=Math.PI*2;for(;t<-Math.PI;)t+=Math.PI*2;return t}function kne(e,t,n){let r=new Map,i=new Map;r.set(R9,{x:450,y:310});let a=e.length<=1?110:Math.min(170,96+e.length*7),o=a+(e.length<=1?190:155);e.forEach((t,n)=>{let o=e.length===1?-Math.PI/2:n/e.length*Math.PI*2-Math.PI/2;i.set(t.id,o),r.set(t.id,{x:450+a*Math.cos(o),y:310+a*Math.sin(o)})});let s=new Map,c=new Map;for(let e of t){let t=n.get(e.id)??``,r=i.get(t)??-Math.PI/2,a=s.get(t)??0;s.set(t,a+1),c.set(e.id,r+Math.ceil(a/2)*(a%2==0?1:-1)*.34)}for(let e=0;e<10;e++)for(let e of t){let r=0;for(let n of t){if(e.id===n.id)continue;let t=z9((c.get(e.id)??0)-(c.get(n.id)??0)),i=Math.abs(t)*o;i<1?r+=e.id<n.id?.02:-.02:i<120&&(r+=Math.sign(t)*2600/(i*i*o))}let a=z9((i.get(n.get(e.id)??``)??-Math.PI/2)-(c.get(e.id)??0));c.set(e.id,(c.get(e.id)??0)+r+a*.06)}for(let e of t){let t=c.get(e.id)??0;r.set(e.id,{x:450+o*Math.cos(t),y:310+o*Math.sin(t)})}return{pos:r,rInner:a,rOuter:o}}function B9(e,t){let n=2*Math.PI*e,r=Math.min(100,Math.max(0,t??0))/100*n;return`${r} ${n-r}`}function Ane(e,t=7){let n=t*Math.PI/180,r=e*Math.cos(n),i=e*Math.sin(n);return`M 450 310 L ${450+r} ${310-i} A ${e} ${e} 0 0 1 ${450+r} ${310+i} Z`}function V9(e){return e==null?`var(--muted-foreground)`:e>=85?`var(--destructive)`:e>=60?`var(--warning)`:`var(--chart-2)`}function jne(e){return e.reachable===!0?`var(--chart-2)`:e.reachable===!1?`var(--destructive)`:e.kind===`device`?`var(--muted-foreground)`:`var(--border)`}function Mne({topo:e,onOnboard:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)({x:0,y:0,k:1}),[f,p]=(0,v.useState)(!1),m=(0,v.useRef)(null),h=(0,v.useRef)(null),g=(0,v.useMemo)(()=>e.nodes.filter(e=>e.kind===`device`),[e.nodes]),_=(0,v.useMemo)(()=>e.nodes.filter(e=>e.kind===`neighbor`),[e.nodes]),y=(0,v.useMemo)(()=>{let t=new Map,n=new Set(_.map(e=>e.id));for(let r of e.edges)n.has(r.to)&&!t.has(r.to)&&t.set(r.to,r.from);return t},[e.edges,_]),{pos:b,rInner:x,rOuter:S}=(0,v.useMemo)(()=>kne(g,_,y),[g,_,y]),C=(0,v.useMemo)(()=>new Map(e.nodes.map(e=>[e.id,e])),[e.nodes]),w=n?C.get(n):null,T=(0,v.useMemo)(()=>{let t=new Map,n=(e,n)=>{t.has(e)||t.set(e,new Set([e])),t.get(e).add(n)};for(let e of g)n(e.id,R9),n(R9,e.id);for(let t of e.edges)n(t.from,t.to),n(t.to,t.from);return t},[e.edges,g]),E=o.trim().toLowerCase(),D=(0,v.useCallback)(e=>c&&!e.onboardable?!1:E?[e.label,e.id,e.ip,e.mac,e.board,e.identity].filter(e=>!!e).some(e=>e.toLowerCase().includes(E)):!0,[E,c]),O=i?T.get(i):null,k=e=>{if(O)return!O.has(e);if(e===` hub`)return!1;let t=C.get(e);return t?!D(t):!1},A=e=>{let t=h.current?.getBoundingClientRect();if(!t)return;let n=(e.clientX-t.left)/t.width*900,r=(e.clientY-t.top)/t.height*620;d(t=>{let i=Math.min(3,Math.max(.5,t.k*(e.deltaY<0?1.12:1/1.12))),a=i/t.k;return{k:i,x:n-(n-t.x)*a,y:r-(r-t.y)*a}})},j=e=>{m.current={px:e.clientX,py:e.clientY,ox:u.x,oy:u.y},p(!0)},M=e=>{let t=m.current,n=h.current?.getBoundingClientRect();if(!t||!n)return;let r=900/n.width*(e.clientX-t.px),i=620/n.height*(e.clientY-t.py);d(e=>({...e,x:t.ox+r,y:t.oy+i}))},N=()=>{m.current=null,p(!1)},P=e=>d(t=>{let n=Math.min(3,Math.max(.5,t.k*e)),r=n/t.k;return{k:n,x:450-(450-t.x)*r,y:310-(310-t.y)*r}}),F=g.map(e=>({from:R9,to:e.id,interface:void 0}));return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`relative min-w-[200px] flex-1`,children:[(0,W.jsx)(al,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2`}),(0,W.jsx)(Wx,{className:`pl-8`,type:`search`,placeholder:`Filter by name, identity, IP, MAC or board…`,value:o,onChange:e=>s(e.target.value)})]}),(0,W.jsxs)(X,{size:`sm`,ghost:!0,type:c?`accent`:`default`,onClick:()=>l(e=>!e),title:`Dim everything except neighbours that can be onboarded`,icon:(0,W.jsx)($c,{}),children:[`Onboardable`,e.stats.onboardable>0?` (${e.stats.onboardable})`:``]}),(0,W.jsx)(L9,{orientation:`vertical`,className:`h-6`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>P(1/1.25),"aria-label":`Zoom out`,icon:(0,W.jsx)(Kc,{})}),(0,W.jsxs)(`span`,{className:`text-muted-foreground w-11 text-center font-mono text-[11px] tabular-nums`,children:[Math.round(u.k*100),`%`]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>P(1.25),"aria-label":`Zoom in`,icon:(0,W.jsx)(Qc,{})}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>d({x:0,y:0,k:1}),title:`Reset view`,icon:(0,W.jsx)(Bc,{}),children:`Reset`})]}),(0,W.jsxs)(`div`,{className:`bg-card relative overflow-hidden rounded-xl border`,children:[(0,W.jsxs)(`svg`,{ref:h,viewBox:`0 0 900 620`,width:`100%`,height:560,preserveAspectRatio:`xMidYMid meet`,className:J(`block w-full touch-none select-none`,f?`cursor-grabbing`:`cursor-grab`),onWheel:A,onPointerDown:j,onPointerMove:M,onPointerUp:N,onPointerLeave:N,onClick:()=>r(null),style:{background:`radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 62%)`},children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`linearGradient`,{id:`topo-beam`,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--brand)`,stopOpacity:`0.3`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--brand)`,stopOpacity:`0`})]}),(0,W.jsxs)(`radialGradient`,{id:`topo-hub`,cx:`0.5`,cy:`0.35`,r:`0.75`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--foreground)`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--muted-foreground)`})]})]}),(0,W.jsxs)(`g`,{transform:`translate(${u.x},${u.y}) scale(${u.k})`,children:[(0,W.jsx)(`g`,{className:`topo-ring`,children:[x,S,S+62].map(e=>(0,W.jsx)(`circle`,{cx:450,cy:310,r:e,fill:`none`,className:`stroke-border/70`,strokeDasharray:`2 8`},e))}),(0,W.jsx)(`g`,{className:`topo-sweep`,style:{transformOrigin:`450px 310px`},children:(0,W.jsx)(`path`,{d:Ane(S+62),fill:`url(#topo-beam)`})}),[...F,...e.edges].map((t,n)=>{let r=b.get(t.from),i=b.get(t.to);if(!r||!i)return null;let a=C.get(t.to)?.kind===`neighbor`,o=k(t.from)||k(t.to),s=-(i.y-r.y),c=i.x-r.x,l=Math.hypot(s,c)||1,u=a?16:8,d=(r.x+i.x)/2+s/l*u,f=(r.y+i.y)/2+c/l*u;return(0,W.jsx)(`path`,{d:`M ${r.x} ${r.y} Q ${d} ${f} ${i.x} ${i.y}`,fill:`none`,strokeWidth:a?1.2:1.6,strokeDasharray:a?`4 4`:`6 10`,className:J(`transition-opacity`,a?`stroke-brand/55`:`topo-flow stroke-chart-2/70`,o&&`opacity-15`),children:(0,W.jsxs)(`title`,{children:[t.from===` hub`?e.server:t.from,` → `,t.to,t.interface?` (${t.interface})`:``]})},`e-${n}`)}),(0,W.jsxs)(`g`,{className:J(`transition-opacity`,O&&!O.has(` hub`)&&`opacity-15`),onMouseEnter:()=>a(R9),onMouseLeave:()=>a(null),children:[(0,W.jsx)(`circle`,{cx:450,cy:310,r:40,className:`fill-brand/15`}),(0,W.jsx)(`circle`,{cx:450,cy:310,r:27,fill:`url(#topo-hub)`,className:`stroke-border`}),(0,W.jsx)(ol,{x:441,y:295,width:18,height:18,className:`stroke-background pointer-events-none`}),(0,W.jsx)(`text`,{x:450,y:326,textAnchor:`middle`,className:`fill-background pointer-events-none font-mono text-[8px] font-bold`,children:`MCP`}),(0,W.jsx)(`text`,{x:450,y:368,textAnchor:`middle`,className:`fill-muted-foreground pointer-events-none font-mono text-[10px]`,children:e.server})]}),e.nodes.map(e=>{let t=b.get(e.id);if(!t)return null;let i=e.kind===`device`,o=n===e.id,s=k(e.id),c=jne(e),l=i?26:15;return(0,W.jsxs)(`g`,{transform:`translate(${t.x},${t.y})`,className:J(`cursor-pointer transition-opacity`,s&&`opacity-15`),onMouseEnter:()=>a(e.id),onMouseLeave:()=>a(null),onClick:t=>{t.stopPropagation(),r(t=>t===e.id?null:e.id)},children:[o&&(0,W.jsx)(`circle`,{r:l+8,className:`topo-halo stroke-brand fill-none`,strokeWidth:2}),i?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{r:l+7,className:`stroke-border/60 fill-none`,strokeWidth:3}),(0,W.jsx)(`circle`,{r:l+7,fill:`none`,strokeWidth:3,strokeLinecap:`round`,transform:`rotate(-90)`,style:{stroke:V9(e.cpuLoad)},strokeDasharray:B9(l+7,e.cpuLoad)}),(0,W.jsx)(`circle`,{r:l+2,className:`stroke-border/40 fill-none`,strokeWidth:2}),(0,W.jsx)(`circle`,{r:l+2,fill:`none`,strokeWidth:2,strokeLinecap:`round`,transform:`rotate(-90)`,style:{stroke:V9(e.memUsedPct)},strokeDasharray:B9(l+2,e.memUsedPct)}),(0,W.jsx)(`circle`,{r:l-4,className:`fill-muted`,style:{stroke:c},strokeWidth:1.6}),(0,W.jsx)(`text`,{textAnchor:`middle`,y:3,className:`fill-foreground pointer-events-none font-mono text-[9px] font-bold`,children:(e.label||e.id).slice(0,4).toUpperCase()})]}):(0,W.jsxs)(W.Fragment,{children:[e.onboardable&&(0,W.jsx)(`circle`,{r:l+5,className:`topo-pulse fill-brand/25`}),(0,W.jsx)(`rect`,{x:-l*.72,y:-l*.72,width:l*1.44,height:l*1.44,rx:3,transform:`rotate(45)`,className:`fill-card`,style:{stroke:c},strokeWidth:1.4,strokeDasharray:e.onboardable?`3 2`:void 0}),e.onboardable&&(0,W.jsx)(Qc,{x:-5,y:-5,width:10,height:10,className:`stroke-brand pointer-events-none`})]}),(0,W.jsx)(`text`,{textAnchor:`middle`,y:l+(i?22:18),className:`fill-foreground pointer-events-none font-mono text-[10px]`,children:(e.label||e.id).slice(0,18)}),i&&(0,W.jsx)(`text`,{textAnchor:`middle`,y:l+34,className:`fill-muted-foreground pointer-events-none font-mono text-[9px]`,children:e.ip||e.board||``})]},e.id)})]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground pointer-events-none absolute top-3 left-3 flex flex-col gap-1 font-mono text-[10px]`,children:[(0,W.jsx)(`span`,{className:`text-foreground text-[11px] font-semibold`,children:`Layer-2 fabric`}),(0,W.jsxs)(`span`,{children:[e.stats.devices,` managed · `,e.stats.neighbors,` discovered`]}),e.stats.onboardable>0&&(0,W.jsxs)(`span`,{className:`text-brand`,children:[e.stats.onboardable,` awaiting onboard`]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground pointer-events-none absolute right-3 bottom-3 flex flex-col items-end gap-1 font-mono text-[10px]`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`bg-chart-2 inline-block size-2 rounded-full`}),` online`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`bg-destructive inline-block size-2 rounded-full`}),` offline`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`border-border inline-block size-2 rotate-45 border`}),` neighbour`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`bg-brand/40 inline-block size-2 rounded-full`}),` onboardable`]})]})]}),w&&(0,W.jsx)(Nne,{node:w,onClose:()=>r(null),onOnboard:t})]})}function Nne({node:e,onClose:t,onOnboard:n}){let r=e.suggestedConfig?JSON.stringify({[e.suggestedConfig.name]:H9(e.suggestedConfig)},null,2):null,i=[[`identity`,e.identity],[`address`,e.ip],[`mac`,e.mac],[`board`,e.board],[`platform`,e.platform],[`version`,e.version],[`uptime`,e.uptime]].filter(e=>!!e[1]);return(0,W.jsxs)(`div`,{className:`bg-card rounded-xl border p-4`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`strong`,{className:`font-mono text-sm`,children:e.label||e.id}),(0,W.jsx)(wx,{variant:e.kind===`device`?`secondary`:`outline`,children:e.kind}),e.onboardable&&(0,W.jsx)(wx,{className:`bg-brand text-brand-foreground`,children:`onboardable`}),e.reachable===!1&&(0,W.jsx)(wx,{variant:`destructive`,children:`offline`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{ghost:!0,size:`sm`,icon:(0,W.jsx)(gl,{}),onClick:t,"aria-label":`Close`})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 font-mono text-[11px]`,children:i.length===0?(0,W.jsx)(`span`,{children:`no details advertised`}):i.map(([e,t])=>(0,W.jsxs)(v.Fragment,{children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`span`,{className:`text-foreground break-all`,children:t})]},e))}),e.kind===`device`&&(e.cpuLoad!=null||e.memUsedPct!=null)&&(0,W.jsxs)(`div`,{className:`mt-3 flex gap-4 font-mono text-[11px]`,children:[e.cpuLoad!=null&&(0,W.jsxs)(`span`,{style:{color:V9(e.cpuLoad)},children:[`cpu `,e.cpuLoad,`%`]}),e.memUsedPct!=null&&(0,W.jsxs)(`span`,{style:{color:V9(e.memUsedPct)},children:[`mem `,e.memUsedPct,`%`]})]}),r&&e.suggestedConfig&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(L9,{className:`my-3`}),(0,W.jsx)(`p`,{className:`text-muted-foreground mb-1.5 text-[11px]`,children:`Not managed yet — add this to your device config to onboard it:`}),(0,W.jsx)(`pre`,{className:`bg-background text-foreground m-0 mb-2 overflow-x-auto rounded-md border px-2.5 py-2 font-mono text-[11px]/[1.5] whitespace-pre`,children:r}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(cx,{title:`Copy config stub`,label:`Copy config stub`,text:r}),n&&(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>n(e.suggestedConfig.name,H9(e.suggestedConfig)),children:`Add to config →`})]})]})]})}function H9(e){let t={port:e.port,username:e.username};return e.host&&(t.host=e.host),e.mac&&(t.mac=e.mac),t}function U9(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}function Pne(e){return!e||!e.pooled?`var(--muted-foreground)`:e.dead?`var(--destructive)`:e.inflight>0?`var(--chart-1)`:`var(--success)`}function Fne(e){return!e||!e.pooled?`no connection`:e.dead?`reconnecting`:e.inflight>0?`${e.inflight} inflight`:`ready`}function Ine({device:e}){let t=e.pool,n=!t||!t.pooled?`border-dashed opacity-60`:t.dead?`border-destructive/50`:t.inflight>0?`border-chart-1/50`:`border-success/35`,r=!!t&&t.pooled&&t.inflight>0,i=Pne(t),a=!t||!t.pooled?0:t.inflight>0?Math.min(8+t.inflight*15,100):100;return(0,W.jsxs)(`div`,{className:J(`bg-card rounded-lg border px-3 py-2.5 transition-colors hover:border-muted-foreground/40`,n),children:[(0,W.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full`,style:{background:i}}),(0,W.jsx)(`span`,{className:`text-foreground overflow-hidden text-xs font-semibold text-ellipsis whitespace-nowrap`,children:e.name}),(0,W.jsx)(`span`,{className:`ml-auto text-[10px] font-semibold tracking-[0.04em] uppercase`,style:{color:i},children:Fne(t)})]}),(0,W.jsxs)(`div`,{className:`bg-muted relative h-1.5 overflow-hidden rounded-[3px]`,children:[(0,W.jsx)(`div`,{className:J(`h-full rounded-[3px] opacity-65 transition-[width] duration-[400ms]`,r&&`animate-pulse`),style:{width:`${a}%`,background:i}}),t&&t.pooled&&t.inflight>0&&(0,W.jsxs)(`span`,{className:`text-foreground absolute -top-px right-1 text-[8px] leading-[8px] font-bold [text-shadow:0_0_3px_rgba(0,0,0,0.6)]`,children:[t.inflight,` ch`]})]})]})}function W9({k:e,v:t,sub:n}){return(0,W.jsx)(ox,{k:e,v:t,sub:n,cls:`min-w-[100px]`})}function Lne({devices:e,poolPayload:t}){let n=e.filter(e=>e.pool!==null&&e.pool!==void 0);if(!(t?.enabled??n.length>0)&&n.length===0)return(0,W.jsxs)(`details`,{className:`my-3`,open:!0,children:[(0,W.jsx)(`summary`,{className:`mb-2 cursor-pointer font-semibold`,children:`SSH Connection Pool`}),(0,W.jsxs)(`p`,{className:`text-muted-foreground my-1 text-[13px]`,children:[`Connection pooling is disabled. Enable it with`,` `,(0,W.jsx)(`code`,{className:`text-chart-1 text-xs`,children:`--ssh-keep-alive true`}),` or`,` `,(0,W.jsx)(`code`,{className:`text-chart-1 text-xs`,children:`MIKROTIK_SSH__KEEP_ALIVE=true`}),` to keep persistent SSH connections across tool calls.`]})]});let r=t?.aggregate,i=t?.config;return(0,W.jsxs)(`details`,{className:`my-3`,open:!0,children:[(0,W.jsx)(`summary`,{className:`mb-2 cursor-pointer font-semibold`,children:`SSH Connection Pool`}),r&&(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:[(0,W.jsx)(W9,{k:`Connections`,v:String(r.totalConnections)}),(0,W.jsx)(W9,{k:`Inflight`,v:String(r.totalInflight),sub:`channels`}),(0,W.jsx)(W9,{k:`Idle`,v:String(r.totalIdle)}),(0,W.jsx)(W9,{k:`Busy`,v:String(r.totalBusy)}),i&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(W9,{k:`Keepalive`,v:U9(i.keepAliveInterval)}),(0,W.jsx)(W9,{k:`Idle timeout`,v:U9(i.idleTimeout)})]})]}),n.length>0&&(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2`,children:n.map(e=>(0,W.jsx)(Ine,{device:e},e.name))})]})}zi.registerPlugin(ic);function G9(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,document.body.append(i),i.click(),i.remove(),URL.revokeObjectURL(r)}var K9=[{id:`overview`,label:`Overview`,sub:`Calls, latency & risk at a glance`},{id:`devices`,label:`Devices`,sub:`Connectivity radar & system health`},{id:`clients`,label:`Clients`,sub:`Connected LAN devices — usage, block/allow, pin IP`},{id:`aaa`,label:`RADIUS & UM`,sub:`RADIUS client & User Manager RADIUS server`},{id:`topology`,label:`Topology`,sub:`Layer-2 neighbours via MNDP / CDP / LLDP`},{id:`packets`,label:`Packets`,sub:`Live TZSP capture & decode`},{id:`snapshots`,label:`Snapshots`,sub:`Config history & time-travel diff`},{id:`drift`,label:`Drift Guard`,sub:`Golden config baselines & live drift detection`},{id:`plan`,label:`Change Plan`,sub:`Dry-run intended RouterOS commands`},{id:`s3`,label:`S3 Backups`,sub:`List, download & delete S3 backup objects`},{id:`backups`,label:`Backups`,sub:`Local config vault — create, restore, manage`},{id:`modules`,label:`Modules`,sub:`Enable/disable tool modules — curate the surface`},{id:`config`,label:`Config`,sub:`Effective configuration & safe editor`},{id:`memory`,label:`Memory`,sub:`Knowledge graph — entities, relations & observations`},{id:`releases`,label:`Releases`,sub:`Update, downgrade & read every version's notes`},{id:`capsman`,label:`CAPsMAN`,sub:`Wi-Fi fabric: coverage, weak signal, load, FT & HA`},{id:`feed`,label:`Live Feed`,sub:`Every tool call, in real time`}],q9=new Set(K9.map(e=>e.id)),J9=`mt-view`;function Y9(){try{let e=location.hash.replace(/^#\/?/,``);return q9.has(e)?e:null}catch{return null}}function Rne(){let e=Y9();if(e)return e;try{let e=localStorage.getItem(J9);if(e&&q9.has(e))return e}catch{}return`overview`}var X9=[`var(--foreground)`,`var(--muted-foreground)`],Z9={overview:X9,devices:X9,clients:X9,aaa:X9,topology:X9,packets:X9,snapshots:X9,drift:X9,plan:X9,s3:X9,backups:X9,modules:X9,config:X9,memory:X9,releases:X9,capsman:X9,feed:X9},zne={overview:{what:`A live pulse of all MCP tool activity: total calls, error rate, p50/p95 latency, the busiest tools, and a risk breakdown — over a time window you choose.`,tips:[`Change the time window (top-right) to zoom from the last 5 minutes out to 24 hours.`,`The risk donut splits calls by annotation: read · write · destructive · dangerous.`,`A rising error line usually points at one device or one tool — jump to Live Feed to see which.`]},devices:{what:`Every configured router with its live reachability (SSH or MAC-Telnet), latency, identity, and system health — CPU, memory and disk — refreshed continuously.`,tips:[`Each device gets a stable colour so you can track it across the connectivity radar.`,`Health (CPU/Mem/Disk) is probed periodically; MAC-Telnet devices are probed on a slower cadence.`,`Latency tiers are colour-coded green → amber → red; a grey node is currently unreachable.`,`The SSH Connection Pool panel shows persistent connections: green = idle/ready, blue = busy with inflight channels, red = reconnecting.`]},clients:{what:`The LAN devices connected to a router — merged from its DHCP leases and ARP table — with live Download/Upload charts, and one-click controls to block/allow a device, pin (reserve) its IP, change that IP, or relabel it.`,tips:[`Pick the router (top-right) to inspect its connected devices; filter by IP, MAC or name.`,`Click a device to open its live ↓/↑ traffic chart — needs a simple queue targeting its IP.`,`Block/allow is enforced by MAC, so it survives the device changing IP; “Pin IP” makes its lease static.`]},aaa:{what:"Full management of the router's RADIUS client (`/radius`) and the built-in User Manager RADIUS server (`/user-manager`): RADIUS servers + incoming CoA, and User Manager users, service profiles, rate/quota limitations, NAS clients, profile assignments, accounting sessions, and global settings.",tips:[`Pick the router (top-right), then switch tabs across RADIUS, Users, Profiles, Limitations, NAS, Assignments, Sessions and Settings.`,`Every tab is full CRUD: add, edit, enable/disable and remove — secrets are write-only and shown redacted.`,`The Usage & Heatmap tab shows each user's 3-month download/upload and a GitHub-style connection heatmap, persisted locally.`,`If a device lacks the user-manager package, the User Manager tabs explain how to install it; RADIUS-client tabs still work.`]},topology:{what:`A Layer-2 map of neighbours each router discovers via MNDP / CDP / LLDP — the physical adjacency of your network, drawn live.`,tips:[`Solid nodes are configured devices; faint nodes are discovered-but-unmanaged neighbours.`,`Use “Add to config →” on an unmanaged neighbour to pre-fill it in the Config editor.`,`Drag to pan; the layout settles automatically as new neighbours arrive.`]},packets:{what:`Live packet capture streamed from a router over TZSP — decode headers in real time without leaving the dashboard.`,tips:[`Pick a device and start the capture; packets decode as they arrive.`,`Stop the capture when done — it frees the router-side sniffer.`,`Great for debugging a protocol issue alongside the Live Feed of tool calls.`]},snapshots:{what:`Point-in-time captures of a device’s full configuration (/export), stored locally so you can diff any two and see exactly what changed.`,tips:[`Capture a snapshot before a risky change, then diff after to audit the delta.`,`The diff is line-level: green added, red removed.`,`Snapshots are device config exports — for the dashboard’s OWN config history see the Config page.`]},drift:{what:`Detect when router configs drift from their golden baseline — with change attribution and one-click reconciliation.`,tips:[`Set a baseline via MCP tools (config_set_baseline) or the Baseline Manager below.`,`Click a device card to run a live drift check against its golden config.`,`Promote accepted changes as the new baseline, or reconcile to roll back.`]},plan:{what:`Dry-run the exact RouterOS commands a change would run before it touches a device — a change plan you can review and trust.`,tips:[`Paste or build intended commands to see them validated and ordered.`,`Nothing is sent to the device from here — it’s a preview.`,`Pair with Safe Mode (auto-revert) when you do apply for real.`]},s3:{what:`Browse, download, and delete backup objects in your configured S3-compatible bucket — your off-box archive of device backups and exports.`,tips:[`Filter by key prefix to find a device’s backups quickly.`,`Download fetches the object through a presigned URL; delete is permanent.`,`For host-side .rsc backups instead, use the Backups page.`]},backups:{what:`A local config vault on the MCP server: capture a device’s /export as a timestamped .rsc file, then download, upload, rename, restore (via Safe Mode), or delete it.`,tips:[`Restore offers a dry-run (applies then rolls back) before you commit for real.`,`Edit the vault path inline in the header — it’s saved to your config.`,`Filenames are stamped in the device’s local 24-hour clock.`]},modules:{what:"Every tool module in the catalog with a live on/off switch. Toggling one writes your config file's `tools` block (disabledModules / enabledModules) and applies it immediately, so you can curate exactly which scopes the MCP server exposes.",tips:[`MCP clients search-rank tools and degrade past ~100; trim the surface below ~150–200 tools so every remaining tool is reliably findable.`,`Disable adds the module to tools.disabledModules; enable removes it (or adds it to an active allow-list) — your config file is updated live on each toggle.`,`Changes need an MCP client reconnect (or a server restart) to actually shrink/grow the visible tool list.`]},config:{what:`View the effective configuration, edit it safely with schema-aware validation and auto-rollback, browse a full field guide, and travel through config version history.`,tips:[`Every successful apply is auto-saved to the version timeline — restore any point in time.`,`Save a named checkpoint before a big change for an easy, labelled rollback.`,`The Field Guide documents every config option, its type, and default — straight from the schema.`]},memory:{what:`A persistent knowledge graph the AI builds across sessions — entities (routers, subnets, users), relations between them, and free-text observations.`,tips:[`Entities are created by the AI via MCP tools — you can browse and delete them here.`,`The graph visualization shows entities as circles and relations as directed edges; click a node to inspect it.`,`Change the database path to switch between different knowledge bases.`]},releases:{what:`Every published version of the server on a timeline, with its release notes. Upgrade to the latest, or install any specific version to upgrade or downgrade.`,tips:[`The green dot marks the version you're running now; the brand dot marks the latest.`,"Install runs `bun i -g @usex/mikrotik-mcp@<version>` on the server, then it self-restarts onto that version (the connection drops briefly).",`Click a version to expand its release notes; the latest is expanded by default.`]},capsman:{what:`The CAPsMAN Wi-Fi fabric for this controller: managed APs grouped by floor with per-radio health (client load, CPU, co-channel conflicts), weak-signal clients with the recommended neighbor AP to steer toward, and a roaming (802.11r FT) + HA redundancy audit.`,tips:[`Radio cards are colored by health; a red 'co-ch' badge means an adjacent radio shares its channel — the proposed channel is shown as →N.`,`Floors come from the AP identity/comment tag (e.g. AP-F3-E); unfloored APs are grouped by inferred signal adjacency.`,`This page is read-only in this release — steering, channel-plan apply, FT enable and HA setup arrive in later phases.`]},feed:{what:`Every tool call as it happens — tool, device, risk, duration, and success/error — with full request/response detail on click.`,tips:[`Filter by status to isolate failures, or by tool/device to follow one thread.`,`Click any row to open the full (secret-redacted) request and response.`,`Pause the stream when you want to inspect without rows shifting under you.`]}};function Q9({icon:e,title:t,sub:n,body:r,className:i}){return(0,W.jsxs)(`div`,{className:J(`text-muted-foreground flex flex-col items-center gap-2 rounded-lg border border-dashed px-6 py-14 text-center`,i),children:[e,(0,W.jsx)(`p`,{className:`text-foreground text-sm font-medium`,children:t}),n!=null&&(0,W.jsx)(`p`,{className:`max-w-md text-xs`,children:n}),r]})}function Bne({view:e}){let t=zne[e];return(0,W.jsxs)(`div`,{className:`bg-card reveal flex gap-3 rounded-lg border p-4`,role:`region`,"aria-label":`Page help`,children:[(0,W.jsx)(Lc,{className:`text-brand mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,W.jsx)(`p`,{className:`text-sm`,children:t.what}),(0,W.jsx)(`ul`,{className:`text-muted-foreground list-disc space-y-1 pl-4 text-xs`,children:t.tips.map((e,t)=>(0,W.jsx)(`li`,{children:e},t))})]})]})}function Vne(){return(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:`size-3.5`,children:(0,W.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M21 12a9 9 0 1 1-2.64-6.36`}),(0,W.jsx)(`path`,{d:`M21 3v6h-6`})]})})}function Hne(){let[e,t]=(0,v.useState)(!1);async function n(e){t(!0);let n=Y.loading(e?`Restarting server…`:`Reloading config…`);try{let t=await _c(`/api/reload`,{hard:e});t?.ok?e?Y.success(`Restarting — reconnect shortly`,{id:n,description:t.note}):Y.success(`Config reloaded · ${t.count??`?`} device${t.count===1?``:`s`}`,{id:n}):Y.error(t?.error??(e?`Restart failed`:`Reload failed`),{id:n})}catch{Y.error(`${e?`Restart`:`Reload`} failed (server unreachable)`,{id:n})}finally{t(!1)}}return(0,W.jsxs)(`div`,{className:`inline-flex w-fit -space-x-px`,role:`group`,"aria-label":`Reload server`,children:[(0,W.jsxs)(sb,{variant:`outline`,size:`sm`,disabled:e,onClick:()=>void n(!1),title:`Re-read the config from disk and apply it live (no downtime)`,className:`rounded-r-none focus-visible:z-10`,children:[(0,W.jsx)(Vne,{}),`Reload Server`]}),(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(sb,{variant:`outline`,size:`sm`,disabled:e,title:`Fully restart the server process (relaunches itself, drops the connection briefly)`,className:`rounded-l-none px-2 focus-visible:z-10`,children:`Restart`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Restart the MCP server?`}),(0,W.jsxs)(mb,{children:[`The server relaunches itself and rebinds the same port(s) in ~1.5s — no external supervisor needed. The current connection drops briefly; reconnect after. To pick up a newly added device without downtime, use `,(0,W.jsx)(`b`,{children:`Reload Server`}),` instead.`]})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{className:ob({variant:`destructive`}),onClick:()=>void n(!0),children:`Restart`})]})]})]})]})}function Une({name:e}){return(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:{overview:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:`3`,y:`3`,width:`8`,height:`8`,rx:`1.6`}),(0,W.jsx)(`rect`,{x:`13`,y:`3`,width:`8`,height:`5`,rx:`1.6`}),(0,W.jsx)(`rect`,{x:`13`,y:`10`,width:`8`,height:`11`,rx:`1.6`}),(0,W.jsx)(`rect`,{x:`3`,y:`13`,width:`8`,height:`8`,rx:`1.6`})]}),devices:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`7`,rx:`2`}),(0,W.jsx)(`rect`,{x:`3`,y:`13`,width:`18`,height:`7`,rx:`2`}),(0,W.jsx)(`path`,{d:`M7 7.5h.01M7 16.5h.01`})]}),clients:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`9`,cy:`8`,r:`3`}),(0,W.jsx)(`path`,{d:`M3.5 19a5.5 5.5 0 0 1 11 0`}),(0,W.jsx)(`path`,{d:`M16 7.5a2.5 2.5 0 0 1 0 5M17.5 19a4.5 4.5 0 0 0-2-3.6`})]}),aaa:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 3 4 6v5c0 4.4 3.2 7.6 8 9 4.8-1.4 8-4.6 8-9V6l-8-3Z`}),(0,W.jsx)(`path`,{d:`M9.5 11.5 11 13l3.5-3.5`})]}),topology:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`5`,r:`2.4`}),(0,W.jsx)(`circle`,{cx:`5`,cy:`19`,r:`2.4`}),(0,W.jsx)(`circle`,{cx:`19`,cy:`19`,r:`2.4`}),(0,W.jsx)(`path`,{d:`M12 7.4 6.4 16.6M12 7.4 17.6 16.6`})]}),packets:(0,W.jsx)(`path`,{d:`M3 12h4l2-7 4 14 2-7h6`}),snapshots:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 3 3 7.5 12 12 21 7.5 12 3Z`}),(0,W.jsx)(`path`,{d:`M3 12 12 16.5 21 12`}),(0,W.jsx)(`path`,{d:`M3 16.5 12 21 21 16.5`})]}),drift:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10Z`}),(0,W.jsx)(`path`,{d:`M9 12l2 2 4-4`}),(0,W.jsx)(`path`,{d:`M12 6v2M12 16v2M6 12h2M16 12h2`})]}),plan:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`6`,cy:`6`,r:`2.3`}),(0,W.jsx)(`circle`,{cx:`6`,cy:`18`,r:`2.3`}),(0,W.jsx)(`circle`,{cx:`18`,cy:`8`,r:`2.3`}),(0,W.jsx)(`path`,{d:`M6 8.3v7.4M8.3 6H13a3 3 0 0 1 3 3v0`})]}),s3:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`ellipse`,{cx:`12`,cy:`6`,rx:`7`,ry:`2.6`}),(0,W.jsx)(`path`,{d:`M5 6v12c0 1.5 3.1 2.6 7 2.6s7-1.1 7-2.6V6`}),(0,W.jsx)(`path`,{d:`M5 12c0 1.5 3.1 2.6 7 2.6s7-1.1 7-2.6`})]}),backups:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M3 6.5 5 3.5h14l2 3`}),(0,W.jsx)(`rect`,{x:`3`,y:`6.5`,width:`18`,height:`14`,rx:`2`}),(0,W.jsx)(`path`,{d:`M9.5 12h5`})]}),modules:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:`3`,y:`5`,width:`18`,height:`6`,rx:`3`}),(0,W.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,W.jsx)(`rect`,{x:`3`,y:`13`,width:`18`,height:`6`,rx:`3`}),(0,W.jsx)(`circle`,{cx:`16`,cy:`16`,r:`1.5`})]}),config:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M4 7h8M16 7h4M4 17h4M12 17h8`}),(0,W.jsx)(`circle`,{cx:`14`,cy:`7`,r:`2.2`}),(0,W.jsx)(`circle`,{cx:`10`,cy:`17`,r:`2.2`})]}),memory:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`6`,r:`2`}),(0,W.jsx)(`circle`,{cx:`6`,cy:`14`,r:`2`}),(0,W.jsx)(`circle`,{cx:`18`,cy:`14`,r:`2`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`20`,r:`2`}),(0,W.jsx)(`path`,{d:`M12 8v-0.5M12 8 7.2 12.5M12 8 16.8 12.5M6 16 10.5 18.5M18 16 13.5 18.5`})]}),releases:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 3v12`}),(0,W.jsx)(`path`,{d:`M8 11l4 4 4-4`}),(0,W.jsx)(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`})]}),capsman:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M5 12a7 7 0 0 1 14 0`}),(0,W.jsx)(`path`,{d:`M8.5 12a3.5 3.5 0 0 1 7 0`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`path`,{d:`M12 13.4V20`})]}),feed:(0,W.jsx)(`path`,{d:`M4 6h16M4 12h16M4 18h10`})}[e]})}function Wne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=hne(n?.version),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(36e5),S=Number(d?.dashboard?.feedLimit)||200,C=(0,v.useCallback)(async e=>{if(!d)return;let t={...d.dashboard,feedLimit:e};await _c(`/api/config`,{config:{...d,dashboard:t},rollbackMs:0}).catch(()=>Y.error(`Could not save the feed limit`)),await gc(`/api/config`).then(f).catch(()=>{})},[d]),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(`off`),[O,k]=(0,v.useState)(null),[A,j]=(0,v.useState)(()=>new Set),[M,N]=(0,v.useState)({}),[P,F]=(0,v.useState)({tool:``,risk:``,device:``,status:``,q:``}),I=(0,v.useRef)(w);I.current=w;let L=(0,v.useRef)(null);Rte(L);let[R,ee]=(0,v.useState)(Rne),te=(0,v.useCallback)(e=>{ee(e);try{Y9()!==e&&(location.hash=e),localStorage.setItem(J9,e)}catch{}},[]);(0,v.useEffect)(()=>{if(Y9()!==R)try{location.hash=R}catch{}let e=()=>{let e=Y9();e&&te(e)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let[z,B]=(0,v.useState)(()=>{try{let e=localStorage.getItem(`mt-help-open`);return new Set(e?JSON.parse(e):[])}catch{return new Set}}),V=e=>B(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(`mt-help-open`,JSON.stringify([...n]))}catch{}return n}),[ne,re]=(0,v.useState)(``),[ie,ae]=(0,v.useState)(`all`),oe=(0,v.useMemo)(()=>{let e=i?.devices??[];return{online:e.filter(e=>e.status.reachable===!0).length,offline:e.filter(e=>e.status.reachable===!1).length,total:e.length}},[i]),se=(0,v.useMemo)(()=>{let e=i?.devices??[],t=ne.trim().toLowerCase();return e.filter(e=>!(ie===`online`&&e.status.reachable!==!0||ie===`offline`&&e.status.reachable!==!1||t&&!e.name.toLowerCase().includes(t)&&!(e.address??e.host??``).toLowerCase().includes(t)))},[i,ne,ie]);Lte((0,v.useCallback)(e=>{if(I.current)return;y(t=>[e,...t].slice(0,yx));let t=e.device;t&&N(e=>({...e,[t]:(e[t]??0)+1}))},[]),(0,v.useCallback)(e=>D(e),[])),(0,v.useEffect)(()=>{gc(`/api/events?limit=${yx}`).then(e=>y(e.events)).catch(()=>{})},[]);let H=(0,v.useCallback)(()=>{gc(`/api/stats?window=${b}&buckets=60`).then(t).catch(()=>{})},[b]);(0,v.useEffect)(()=>{H();let e=()=>{H(),gc(`/api/meta`).then(r).catch(()=>{}),gc(`/api/devices`).then(a).catch(()=>{}),gc(`/api/ssh-pool`).then(s).catch(()=>{}),gc(`/api/topology`).then(u).catch(()=>{})};e();let t=setInterval(()=>{I.current||e()},4e3);return()=>clearInterval(t)},[H]),(0,v.useEffect)(()=>{let e=()=>void gc(`/api/config`).then(f).catch(()=>{});e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[]);let ce=(0,v.useCallback)((e,t)=>{_c(`/api/devices/toggle`,{device:e,disabled:t}).then(n=>{a(n),Y.success(`Device ${e} ${t?`disabled`:`enabled`}`)}).catch(()=>Y.error(`Could not ${t?`disable`:`enable`} ${e}`))},[]);(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&k(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let le=(0,v.useMemo)(()=>{let e=P.q.trim().toLowerCase();return _.filter(t=>!(P.tool&&t.tool!==P.tool||P.risk&&t.risk!==P.risk||P.device&&t.device!==P.device||P.status===`ok`&&t.isError||P.status===`error`&&!t.isError||e&&!t.tool.toLowerCase().includes(e)&&!t.input.toLowerCase().includes(e)&&!t.output.toLowerCase().includes(e)&&!(t.error??``).toLowerCase().includes(e))).sort((e,t)=>t.ts-e.ts)},[_,P]),ue=!!(P.tool||P.risk||P.device||P.status||P.q),de=(0,v.useMemo)(()=>_.filter(e=>e.isError),[_]),fe=(0,v.useMemo)(()=>({ok:_.length-de.length,error:de.length}),[_,de]),pe=(0,v.useCallback)(async e=>{try{k(await gc(`/api/event/${encodeURIComponent(e.id)}`))}catch{k(e)}},[]),me=(0,v.useMemo)(()=>le.slice(0,S),[le,S]),he=(0,v.useMemo)(()=>me.map(e=>e.id),[me]),ge=he.length>0&&he.every(e=>A.has(e)),_e=!ge&&he.some(e=>A.has(e)),ve=(0,v.useCallback)(e=>{j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ye=(0,v.useCallback)(()=>{j(e=>{let t=new Set(e);if(he.length>0&&he.every(e=>t.has(e)))for(let e of he)t.delete(e);else for(let e of he)t.add(e);return t})},[he]),[be,xe]=(0,v.useState)(!1),Se=(0,v.useCallback)(async()=>{let e=[...A];if(e.length!==0)try{await yc({ids:e});let t=new Set(e);y(e=>e.filter(e=>!t.has(e.id))),j(new Set),Y.success(`Deleted ${e.length} event${e.length===1?``:`s`}`)}catch{Y.error(`Could not delete the selected events`)}finally{xe(!1)}},[A]),Ce=e=>{if(e===`json`){G9(`mcp-events.json`,JSON.stringify(le,null,2),`application/json`);return}let t=[`ts`,`tool`,`risk`,`device`,`durationMs`,`isError`,`error`,`reason`],n=e=>/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e,r=le.map(e=>[new Date(e.ts).toISOString(),e.tool,e.risk,e.device??``,String(e.durationMs),String(e.isError),e.error??``,e.reason??``].map(n).join(`,`)).join(`
|
|
155
|
-
`);G9(`mcp-events.csv`,`${t.join(`,`)}\n${r}\n`,`text/csv`)},we=e?e.errorRate>=.2?`text-destructive`:e.errorRate>=.05?`text-warning`:``:``,Te=d?.mcp??{},Ee=d?.dashboard??{},De=d?.ssh??{},Oe=(e,t,n)=>(0,W.jsx)(Jx,{size:`sm`,"aria-label":t,value:P[e],onValueChange:t=>F(n=>({...n,[e]:t})),options:[{value:``,label:t},...n.map(e=>({value:e,label:e}))]}),ke=K9.find(e=>e.id===R)??K9[0];return(0,W.jsxs)(`div`,{className:`bg-background text-foreground grid min-h-screen grid-cols-[240px_1fr]`,ref:L,"data-view":R,style:{"--page-accent":Z9[R][0],"--page-accent-2":Z9[R][1]},children:[(0,W.jsxs)(`aside`,{className:`bg-card sticky top-0 flex h-screen flex-col gap-4 border-r p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`bg-foreground text-background grid size-9 shrink-0 place-items-center rounded-md`,children:(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:`size-5`,children:(0,W.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12 12 L4 5 M12 12 L20 5 M12 12 L12 20`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`4`,cy:`5`,r:`1.9`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`20`,cy:`5`,r:`1.9`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`20`,r:`1.9`,fill:`currentColor`,stroke:`none`})]})})}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,W.jsx)(`b`,{className:`truncate text-sm`,children:`MikroTik MCP`}),(0,W.jsxs)(`small`,{className:J(`text-muted-foreground inline-flex items-center gap-1 text-[11px]`,c.release&&`hover:text-foreground cursor-pointer`),title:c.release?`View release notes`:void 0,onClick:c.release?()=>c.openModal():void 0,children:[n?.version?`v${n.version}`:`Observability`,c.showIndicator&&(0,W.jsx)(`span`,{className:`bg-brand inline-block size-1.5 rounded-full`,title:`v${c.release?.version} available`})]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Oee,{})]}),(0,W.jsx)(`nav`,{className:`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto`,children:K9.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:J(`flex items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] transition-colors`,`[&_svg]:size-4 [&_svg]:shrink-0`,R===e.id?`bg-accent text-accent-foreground font-medium`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`),onClick:()=>te(e.id),children:[(0,W.jsx)(Une,{name:e.id}),(0,W.jsx)(`span`,{className:`truncate`,children:e.label}),e.id===`feed`&&_.length>0&&(0,W.jsx)(`span`,{className:`bg-brand text-brand-foreground animate-in zoom-in-50 ml-auto rounded-full px-1.5 py-0.5 text-[10px] tabular-nums`,children:_.length>999?`999+`:_.length},_.length)]},e.id))}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t pt-3`,children:[(0,W.jsx)(Hne,{}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[11px]`,title:`Live transport: WebSocket (preferred) or SSE fallback`,children:[(0,W.jsx)(Hx,{type:E===`off`?`secondary`:`success`,pulse:E!==`off`}),E===`off`?`offline`:`live · ${E}`]}),(0,W.jsx)(`small`,{className:`text-muted-foreground text-[11px]`,children:n?`${px(n.total)} events · ${n.transport}`:`connecting…`})]})]}),(0,W.jsxs)(`main`,{className:`flex min-w-0 flex-col gap-5 p-6`,"data-view":R,children:[(0,W.jsxs)(`header`,{className:`reveal flex flex-wrap items-center gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`h1`,{className:`truncate text-xl font-semibold`,children:ke.label}),(0,W.jsx)(`small`,{className:`text-muted-foreground text-xs`,children:ke.sub})]}),(0,W.jsx)(`span`,{className:`flex-1`}),R===`overview`&&(0,W.jsx)(Jx,{size:`sm`,"aria-label":`Stats time window`,value:String(b),onValueChange:e=>x(Number(e)),options:vx.map(([e,t])=>({value:String(t),label:`window: ${e}`}))}),(0,W.jsx)(X,{size:`sm`,ghost:!0,type:z.has(R)?`accent`:`default`,onClick:()=>V(R),"aria-expanded":z.has(R),title:`About this page`,icon:(0,W.jsx)(Lc,{}),children:`Help`})]}),z.has(R)&&(0,W.jsx)(Bne,{view:R}),R===`overview`&&(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsx)(`div`,{className:`reveal grid grid-cols-[repeat(auto-fit,minmax(9rem,1fr))] gap-3`,children:e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ox,{k:`Calls (window)`,v:px(e.total)}),(0,W.jsx)(ox,{k:`Calls / min`,v:e.callsPerMin.toFixed(1)}),(0,W.jsx)(ox,{k:`Error rate`,v:`${(e.errorRate*100).toFixed(1)}%`,sub:`${e.errors} err`,cls:we}),(0,W.jsx)(ox,{k:`Avg latency`,v:ux(e.latency.avg)}),(0,W.jsx)(ox,{k:`p95 latency`,v:ux(e.latency.p95)}),(0,W.jsx)(ox,{k:`p99 latency`,v:ux(e.latency.p99)}),(0,W.jsx)(ox,{k:`Distinct tools`,v:px(e.distinctTools)}),(0,W.jsx)(ox,{k:`Output volume`,v:dx(e.outputBytes)})]}):(0,W.jsx)(ox,{k:`Loading…`,v:`—`})}),(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-1 gap-4 xl:grid-cols-3`,children:[(0,W.jsx)(ax,{title:`Calls over time`,className:`xl:col-span-2`,children:e?(0,W.jsx)(i7,{series:e.series}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`no data`})}),e&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ax,{title:`By risk`,children:(0,W.jsx)(a7,{segments:Object.keys(e.byRisk).map(t=>({label:t,value:e.byRisk[t],color:gx[t]}))})}),(0,W.jsx)(ax,{title:`Top tools`,className:`xl:col-span-2`,children:(0,W.jsx)(sx,{rows:e.byTool.map(e=>({label:e.tool,value:e.count,sub:`${e.count}× · ${ux(e.p95Ms)} p95${e.errors?` · ${e.errors} err`:``}`,color:e.errors?`var(--destructive)`:void 0}))})}),(0,W.jsx)(ax,{title:`Status`,children:(0,W.jsx)(a7,{centerLabel:`calls`,segments:[{label:`ok`,value:fe.ok,color:`var(--muted-foreground)`},{label:`error`,value:fe.error,color:`var(--destructive)`}]})}),(0,W.jsx)(ax,{title:`By device`,children:e.byDevice.length?(0,W.jsx)(sx,{rows:e.byDevice.map(e=>({label:e.device,value:e.count}))}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`single device`})}),(0,W.jsx)(ax,{title:`Recent errors`,children:de.length?(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:de.slice(0,8).map(e=>(0,W.jsxs)(`div`,{className:`hover:bg-accent/50 grid cursor-pointer grid-cols-[auto_1fr] items-center gap-3 rounded-md px-1 py-0.5`,onClick:()=>void pe(e),children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:fx(e.ts)}),(0,W.jsxs)(`span`,{className:`text-destructive min-w-0 truncate text-xs`,title:e.error??e.output,children:[e.tool,`: `,e.error??e.output??`error`]})]},e.id))}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`no errors 🎉`})})]})]})]}),R===`devices`&&(i&&i.devices.length>0?(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(`div`,{className:`reveal flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`min-w-[180px] flex-1`,type:`search`,placeholder:`Search devices by name or address…`,value:ne,onChange:e=>re(e.target.value)}),(0,W.jsx)(`div`,{className:`bg-muted flex gap-0.5 rounded-md p-0.5`,children:[`all`,`online`,`offline`].map(e=>(0,W.jsx)(`button`,{type:`button`,className:J(`rounded-sm px-2.5 py-1 text-xs transition-colors`,ie===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),onClick:()=>ae(e),children:e===`all`?`All ${oe.total}`:e===`online`?`Online ${oe.online}`:`Offline ${oe.offline}`},e))}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[se.length,`/`,oe.total,` shown`]})]}),(0,W.jsxs)(`details`,{className:`bg-card reveal rounded-lg border p-4`,open:oe.total<=8,children:[(0,W.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[`Connectivity radar`,(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[` `,`· `,oe.online,` online · `,oe.offline,` offline ·`,` `,oe.total,` total`]})]}),(0,W.jsx)(Mte,{payload:i,pulses:M})]}),(0,W.jsx)(Lne,{devices:se,poolPayload:o}),se.length===0?(0,W.jsx)(Q9,{className:`reveal`,icon:(0,W.jsx)(al,{className:`size-6`}),title:`No devices match`,sub:`Try a different search or status filter.`}):(0,W.jsx)(`div`,{className:`reveal grid grid-cols-[repeat(auto-fill,minmax(20rem,1fr))] gap-4`,children:se.map(e=>(0,W.jsx)(Nte,{d:e,onToggle:ce},e.name))}),se.length>0&&(0,W.jsx)(ax,{title:`Device system health`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`CPU · memory · disk · latency · live probe`}),children:(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(22rem,1fr))] gap-3`,children:se.map(e=>(0,W.jsx)(Ite,{d:e},e.name))})})]}):(0,W.jsx)(Q9,{icon:(0,W.jsx)(Jc,{className:`size-6`}),title:`No devices configured`,body:(0,W.jsx)(Lx,{type:`secondary`,label:`Tip`,children:`Add a device to your config to see connectivity and system health here.`})})),R===`clients`&&(0,W.jsx)(x7,{}),R===`aaa`&&(0,W.jsx)(PS,{}),R===`topology`&&(l&&l.nodes.length>0?(0,W.jsx)(`section`,{className:`reveal grid content-start gap-[18px]`,children:(0,W.jsx)(Mne,{topo:l,onOnboard:(e,t)=>{g({name:e,body:t}),m(!0),te(`config`)}})}):(0,W.jsx)(Q9,{icon:(0,W.jsx)($c,{className:`size-6`}),title:`No neighbours discovered yet`,sub:`Layer-2 neighbours (MNDP / CDP / LLDP) appear here as the device reports them.`})),R===`packets`&&(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsx)(ax,{title:`Packet capture`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`live TZSP decode · /tool sniffer streaming`}),children:(0,W.jsx)(Ene,{})})}),R===`snapshots`&&(0,W.jsx)(One,{}),R===`drift`&&(0,W.jsx)(Kte,{}),R===`plan`&&(0,W.jsx)(RS,{}),R===`s3`&&(0,W.jsx)(Dne,{}),R===`backups`&&(0,W.jsx)(Xx,{}),R===`modules`&&(0,W.jsx)(nne,{}),R===`config`&&(d?(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsx)(ax,{title:`Configuration`,className:`reveal`,extra:(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>m(e=>!e),title:`Edit the config JSON with autocomplete, validation and safe-apply`,icon:p?void 0:(0,W.jsx)(Xc,{}),children:p?`View`:`Edit config`}),children:p?(0,W.jsx)(Ote,{initial:h?{...d,devices:{...d.devices,[h.name]:h.body}}:d,onClose:()=>{m(!1),g(null)},onReload:()=>{g(null),gc(`/api/config`).then(f).catch(()=>{})}},h?`seed-${h.name}`:`config`):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`text-muted-foreground mb-2.5 flex flex-wrap gap-x-4 gap-y-1 text-[11px]`,children:[(0,W.jsxs)(`span`,{children:[`transport: `,mx(Te.transport)]}),(0,W.jsxs)(`span`,{children:[`read-only: `,d.readOnly?`yes`:`no`]}),(0,W.jsxs)(`span`,{children:[`dashboard: `,mx(Ee.host),`:`,mx(Ee.port)]}),(0,W.jsxs)(`span`,{children:[`capture: `,Ee.captureBody?`on`:`off`]}),(0,W.jsxs)(`span`,{children:[`s3: `,d.s3?`configured`:`off`]}),(0,W.jsxs)(`span`,{children:[`ssh pool: `,De.keepAlive===!1?`off`:`on`]})]}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-sm`,children:`Full effective configuration (secrets redacted)`}),(0,W.jsx)(A7,{value:d,maxHeight:340})]})]})}),(0,W.jsx)(ax,{title:`Dashboard preferences`,className:`reveal`,extra:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`saved to `,(0,W.jsx)(`code`,{children:`dashboard.feedLimit`}),` in the config`]}),children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(vb,{className:`text-[12.5px]`,children:`Live Feed rows`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`How many matching calls the feed table renders. Up to `,px(1e4),` are kept in memory regardless; this only bounds what is drawn.`]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Jx,{size:`sm`,"aria-label":`Live Feed rows`,value:String(S),onValueChange:e=>void C(Number(e)),options:lx.map(e=>({value:String(e),label:`${px(e)} rows${e===200?` (default)`:``}`}))})]})}),(0,W.jsx)(ax,{title:`Version history`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`point-in-time snapshots · diff & restore`}),children:(0,W.jsx)(R7,{onRestored:()=>void gc(`/api/config`).then(f).catch(()=>{})})}),(0,W.jsx)(ax,{title:`Field guide`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`every config option, documented from the schema`}),children:(0,W.jsx)(B7,{})})]}):(0,W.jsx)(Q9,{icon:(0,W.jsx)(Ux,{}),title:`Loading configuration…`})),R===`memory`&&(0,W.jsx)(ene,{}),R===`releases`&&(0,W.jsx)(yne,{}),R===`capsman`&&(0,W.jsx)(wne,{}),R===`feed`&&(0,W.jsxs)(ax,{className:`reveal`,title:`Live tool calls`,extra:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[px(me.length),` shown`,le.length>me.length&&` of ${px(le.length)} matching`,` ·`,` `,px(_.length),` buffered`]}),children:[(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`min-w-[180px] flex-1`,type:`search`,placeholder:`Search tool / input / output / error…`,value:P.q,onChange:e=>F(t=>({...t,q:e.target.value}))}),Oe(`tool`,`all tools`,n?.tools??[]),Oe(`risk`,`all risk`,[`READ`,`WRITE`,`WRITE_IDEMPOTENT`,`DESTRUCTIVE`,`DANGEROUS`]),Oe(`device`,`all devices`,n?.devices??[]),Oe(`status`,`all status`,[`ok`,`error`]),(0,W.jsx)(X,{size:`sm`,ghost:!0,type:w?`accent`:`default`,onClick:()=>T(e=>!e),icon:w?(0,W.jsx)(Zc,{}):(0,W.jsx)(Yc,{}),children:w?`Resume`:`Pause`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>Ce(`csv`),children:`CSV`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>Ce(`json`),children:`JSON`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>F({tool:``,risk:``,device:``,status:``,q:``}),children:`Clear`}),be&&A.size>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(X,{size:`sm`,type:`error`,onClick:()=>void Se(),icon:(0,W.jsx)(Nc,{}),children:[`Confirm delete (`,A.size,`)`]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>xe(!1),children:`Cancel`})]}):(0,W.jsxs)(X,{size:`sm`,ghost:!0,disabled:A.size===0,onClick:()=>xe(!0),title:`Delete the selected rows`,icon:(0,W.jsx)(fl,{}),children:[`Delete`,A.size>0?` (${A.size})`:``]})]}),le.length===0?ue?(0,W.jsx)(Q9,{icon:(0,W.jsx)(al,{className:`size-6`}),title:`No calls match your filters`,sub:`${_.length} call${_.length===1?``:`s`} buffered — try widening the search or the risk / device / status filters.`,body:(0,W.jsx)(X,{size:`sm`,ghost:!0,className:`mt-2`,onClick:()=>F({tool:``,risk:``,device:``,status:``,q:``}),children:`Clear filters`})}):(0,W.jsx)(Q9,{icon:(0,W.jsx)(Hx,{type:E===`off`?`secondary`:`success`,pulse:E!==`off`,className:`size-3`}),title:E===`off`?`Not connected`:`Listening for tool calls…`,sub:E===`off`?`The live stream is offline — it will reconnect automatically.`:`Tool calls the LLM makes against this server stream in here in real time.`}):(0,W.jsx)(`div`,{className:`max-h-[60vh] overflow-auto`,children:(0,W.jsxs)(Yb,{children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{className:`w-7`,children:(0,W.jsx)(_b,{"aria-label":`Select all shown rows`,checked:ge?!0:_e?`indeterminate`:!1,onCheckedChange:ye})}),(0,W.jsx)($b,{children:`time`}),(0,W.jsx)($b,{children:`tool`}),(0,W.jsx)($b,{children:`risk`}),(0,W.jsx)($b,{children:`device`}),(0,W.jsx)($b,{className:`text-right`,children:`dur`}),(0,W.jsx)($b,{children:`status`}),(0,W.jsx)($b,{children:`output`})]})}),(0,W.jsx)(Zb,{children:me.map(e=>(0,W.jsxs)(Qb,{"data-state":A.has(e.id)?`selected`:void 0,className:J(`cursor-pointer`,e.isError&&`bg-destructive/8`),onClick:()=>void pe(e),children:[(0,W.jsx)(ex,{onClick:e=>e.stopPropagation(),children:(0,W.jsx)(_b,{"aria-label":`Select row`,checked:A.has(e.id),onCheckedChange:()=>ve(e.id)})}),(0,W.jsx)(ex,{className:`tabular-nums`,children:fx(e.ts)}),(0,W.jsx)(ex,{children:e.tool}),(0,W.jsx)(ex,{children:(0,W.jsx)(`span`,{className:J(`rounded-full border px-1.5 py-0.5 text-[10px]`,_x[e.risk]),children:e.risk.replace(`WRITE_IDEMPOTENT`,`WRITE·I`)})}),(0,W.jsx)(ex,{children:e.device??`—`}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:ux(e.durationMs)}),(0,W.jsx)(ex,{children:(0,W.jsx)(`span`,{className:e.isError?`text-destructive`:`text-muted-foreground`,children:e.isError?`error`:`ok`})}),(0,W.jsx)(ex,{className:`text-muted-foreground max-w-[24rem] truncate`,children:e.isError?e.error??`error`:e.reason?(0,W.jsx)(`span`,{className:`italic`,children:e.reason}):e.output||`—`})]},e.id))})]})})]})]}),c.showModal&&c.release&&(0,W.jsx)(gne,{release:c.release,onDismiss:c.dismissRelease}),O&&(0,W.jsx)(Fte,{event:O,onClose:()=>k(null)}),(0,W.jsx)(kee,{})]})}var $9=document.getElementById(`root`);$9&&(0,y.createRoot)($9).render((0,W.jsx)(Wne,{}));
|
|
153
|
+
`),t=t.replace(/%%CB(\d+)%%/g,(e,t)=>n[Number(t)]),t=t.replace(/%%IC(\d+)%%/g,(e,t)=>r[Number(t)]),t}var O9=`mt-whats-new-dismissed`,k9=`mt-whats-new-seen-version`;function fne(e){try{return localStorage.getItem(O9)===e}catch{return!1}}function pne(e){try{localStorage.setItem(O9,e)}catch{}}function mne(e){try{let t=localStorage.getItem(k9);return localStorage.setItem(k9,e),t!==null&&t!==e}catch{return!1}}var A9=`text-[13px] leading-[1.7] text-muted-foreground [&_h2]:mt-[18px] [&_h2]:mb-1.5 [&_h2]:text-[17px] [&_h2]:font-bold [&_h2]:text-foreground [&_h3]:mt-[18px] [&_h3]:mb-1.5 [&_h3]:text-[15px] [&_h3]:font-bold [&_h3]:text-foreground [&_h4]:mt-[18px] [&_h4]:mb-1.5 [&_h4]:text-[14px] [&_h4]:font-bold [&_h4]:text-foreground [&_h5]:mt-[18px] [&_h5]:mb-1.5 [&_h5]:text-[14px] [&_h5]:font-bold [&_h5]:text-foreground [&_p]:my-[5px] [&_ul]:my-[5px] [&_ul]:list-disc [&_ul]:pl-[18px] [&_ol]:my-[5px] [&_ol]:list-decimal [&_ol]:pl-[22px] [&_li]:my-[3px] [&_li]:marker:text-brand [&_img]:my-1.5 [&_img]:max-w-full [&_img]:rounded-md [&_img]:border [&_img]:border-border [&_code]:rounded [&_code]:border [&_code]:border-border [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-xs [&_code]:text-brand [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:border-border [&_pre]:bg-background [&_pre]:p-3 [&_pre_code]:border-0 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-muted-foreground [&_a]:text-brand [&_a]:underline [&_a]:underline-offset-2 [&_strong]:font-semibold [&_strong]:text-foreground [&_blockquote]:my-2 [&_blockquote]:border-l-[3px] [&_blockquote]:border-brand/40 [&_blockquote]:px-3.5 [&_blockquote]:py-1.5 [&_blockquote]:italic [&_hr]:my-3.5 [&_hr]:border-0 [&_hr]:border-t [&_hr]:border-border [&_del]:text-muted-foreground [&_del]:opacity-60 [&_table]:w-full [&_table]:border-collapse [&_table]:font-mono [&_table]:text-xs [&_th]:border-b [&_th]:border-border [&_th]:bg-muted [&_th]:px-3 [&_th]:py-[7px] [&_th]:text-left [&_th]:text-[11px] [&_th]:font-semibold [&_th]:tracking-wide [&_th]:text-foreground [&_th]:uppercase [&_td]:border-b [&_td]:border-border [&_td]:px-3 [&_td]:py-[7px] [&_td]:text-muted-foreground [&_.wn-table-wrap]:my-2.5 [&_.wn-table-wrap]:overflow-x-auto [&_.wn-table-wrap]:rounded-md [&_.wn-table-wrap]:border [&_.wn-table-wrap]:border-border [&_.wn-task]:-ml-[18px] [&_.wn-task]:list-none [&_.wn-check]:inline-block [&_.wn-check]:w-4 [&_.wn-task.done_.wn-check]:text-success`,hne=600*1e3;function gne(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!e)return;let t=mne(e),r=null,a=()=>{gc(`/api/releases/latest`).then(e=>{n(e);let a=r===null,o=r!==null&&e.version!==r;if(r=e.version,a&&t){setTimeout(()=>i(!0),1200);return}e.isNewer&&!fne(e.version)&&(a||o)&&setTimeout(()=>i(!0),a?1200:0)}).catch(()=>{})};a();let o=setInterval(a,hne);return()=>clearInterval(o)},[e]);let a=(0,v.useCallback)(()=>{t?.isNewer&&pne(t.version),i(!1)},[t]),o=(0,v.useCallback)(()=>i(!0),[]);return{release:t,showModal:r,showIndicator:t!==null&&t.isNewer,openModal:o,dismissRelease:a}}function _ne({release:e,onDismiss:t}){let n=new Date(e.publishedAt).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),r={__html:D9(e.body)};return(0,W.jsx)(ine,{open:!0,onOpenChange:e=>{e||t()},children:(0,W.jsxs)(sne,{className:`max-h-[calc(100vh-80px)] gap-0 overflow-y-auto p-0 sm:max-w-[520px]`,children:[(0,W.jsxs)(cne,{className:`items-center gap-4 px-8 pt-10 pb-6 text-center`,children:[(0,W.jsx)(`span`,{className:`inline-block rounded-full border border-brand/30 bg-brand/10 px-3.5 py-1 font-mono text-[10px] font-bold tracking-[0.2em] text-brand uppercase`,children:e.isNewer?`NEW RELEASE`:`RELEASE NOTES`}),(0,W.jsxs)(une,{className:`text-[44px] leading-none font-extrabold tracking-tight text-brand`,children:[`v`,e.version]}),(0,W.jsxs)(dne,{className:`font-mono text-xs text-muted-foreground`,children:[`Released `,n,e.isNewer&&(0,W.jsxs)(W.Fragment,{children:[` · you’re on v`,e.currentVersion]})]})]}),(0,W.jsx)(`div`,{className:J(`px-8 py-5`,A9),dangerouslySetInnerHTML:r}),(0,W.jsxs)(lne,{className:`flex-row items-center justify-between border-t border-border px-8 pt-3.5 pb-6`,children:[(0,W.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground hover:text-foreground`,children:[`View on GitHub`,(0,W.jsx)(Hc,{className:`size-3.5`})]}),(0,W.jsx)(X,{type:`default`,size:`sm`,onClick:t,children:`Got it`})]})]})})}var j9=`@usex/mikrotik-mcp`;function vne(e){try{return new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}catch{return e}}function M9(e){return e===`current`?{label:`Reinstall`,icon:(0,W.jsx)(rl,{className:`size-3.5`})}:e===`newer`?{label:`Upgrade`,icon:(0,W.jsx)(jc,{className:`size-3.5`})}:{label:`Downgrade`,icon:(0,W.jsx)(Ac,{className:`size-3.5`})}}function yne({body:e}){return e.trim()?(0,W.jsx)(`div`,{className:J(A9),dangerouslySetInnerHTML:{__html:D9(e)}}):(0,W.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No release notes.`})}function bne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(new Set),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),m=(0,v.useCallback)(async()=>{r(!0);try{let e=await gc(`/api/releases`);t(e),a(null);let n=e.releases.find(t=>t.version===e.latestVersion);n&&s(new Set([n.version]))}catch(e){a(e instanceof Error?e.message:`Could not load releases`)}finally{r(!1)}},[]);(0,v.useEffect)(()=>{m()},[m]);let h=e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});async function g(e){l(null),d(!0),p(null);let t=Y.loading(`Installing ${j9}@${e}…`);try{let n=await _c(`/api/upgrade`,{version:e});n?.ok?(p(n.log??null),Y.success(`Installed v${n.version}`,{id:t,description:n.restarting?`Restarting on the new version — reconnect shortly.`:n.note})):(p(n?.log??null),Y.error(n?.error??`Install failed`,{id:t,description:`See the install log below.`}))}catch{Y.error(`Install failed (server unreachable)`,{id:t})}finally{d(!1)}}let _=e?.releases.find(t=>t.version===e.latestVersion)??null,y=(0,v.useMemo)(()=>e?(0,W.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl border bg-card p-6`,children:[(0,W.jsx)(`div`,{className:`from-brand/10 pointer-events-none absolute -top-16 -right-16 size-56 rounded-full bg-gradient-to-br to-transparent blur-2xl`}),(0,W.jsxs)(`div`,{className:`relative flex flex-wrap items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px] font-medium tracking-[0.18em] uppercase`,children:`Running version`}),(0,W.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-foreground text-[40px] leading-none font-extrabold tracking-tight`,children:[`v`,e.currentVersion]}),e.updateAvailable?(0,W.jsxs)(`span`,{className:`bg-brand/10 text-brand ring-brand/30 inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-semibold ring-1`,children:[(0,W.jsx)(cl,{className:`size-3.5`}),` v`,e.latestVersion,` available`]}):(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-3 py-1 text-xs font-semibold text-emerald-500 ring-1 ring-emerald-500/30`,children:[(0,W.jsx)(Nc,{className:`size-3.5`}),` Up to date`]})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(X,{onClick:()=>void m(),title:`Re-check for updates`,children:[(0,W.jsx)(nl,{className:`size-3.5`}),` Re-check`]}),e.updateAvailable&&_&&(0,W.jsxs)(X,{onClick:()=>l(_),disabled:u,className:`bg-brand text-brand-foreground hover:bg-brand/90 border-transparent`,children:[(0,W.jsx)(jc,{className:`size-3.5`}),` Upgrade to latest`]})]})]})]}):null,[e,_,u,m]);return n?(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 p-6 text-sm`,children:[(0,W.jsx)(Ux,{}),` Loading releases…`]}):i||!e?(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsxs)(Lx,{type:`error`,label:`Couldn't load releases`,children:[i??`No data.`,` Check network access to GitHub.`]})}):(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[y,f&&(0,W.jsxs)(`div`,{className:`rounded-lg border bg-card p-3`,children:[(0,W.jsx)(`div`,{className:`text-muted-foreground mb-1.5 text-[11px] font-semibold tracking-wide uppercase`,children:`Install log`}),(0,W.jsx)(`pre`,{className:`text-muted-foreground max-h-52 overflow-auto font-mono text-[11px] leading-relaxed whitespace-pre-wrap`,children:f})]}),(0,W.jsxs)(`div`,{className:`relative pl-6`,children:[(0,W.jsx)(`div`,{className:`bg-border absolute top-2 bottom-2 left-[9px] w-px`,"aria-hidden":`true`}),(0,W.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.releases.map(t=>{let n=o.has(t.version),r=t.relation===`current`,i=t.version===e.latestVersion,a=M9(t.relation);return(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`span`,{className:J(`absolute top-3.5 -left-[21px] z-10 grid size-[19px] place-items-center rounded-full ring-4 ring-card`,r?`bg-emerald-500`:i?`bg-brand`:t.relation===`newer`?`bg-brand/60`:`bg-muted-foreground/40`),title:r?`You are here`:t.relation,children:r&&(0,W.jsx)(Nc,{className:`size-3 text-white`})}),(0,W.jsxs)(`div`,{className:J(`rounded-lg border bg-card transition-colors`,r&&`border-emerald-500/40`,i&&!r&&`border-brand/40`),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 p-3.5`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>h(t.version),className:`flex items-baseline gap-2 text-left`,title:n?`Hide notes`:`Show notes`,children:[(0,W.jsxs)(`span`,{className:`text-foreground text-lg font-bold tracking-tight`,children:[`v`,t.version]}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:vne(t.publishedAt)})]}),r&&(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-semibold text-emerald-500 uppercase`,children:`current`}),i&&!r&&(0,W.jsx)(`span`,{className:`bg-brand/10 text-brand rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase`,children:`latest`}),t.prerelease&&(0,W.jsx)(`span`,{className:`text-muted-foreground rounded-full bg-muted px-2 py-0.5 text-[10px] font-semibold uppercase`,children:`pre-release`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`a`,{href:t.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs`,title:`Open on GitHub`,children:(0,W.jsx)(Hc,{className:`size-3.5`})}),(0,W.jsx)(X,{onClick:()=>h(t.version),children:n?`Hide notes`:`Notes`}),(0,W.jsxs)(X,{onClick:()=>l(t),disabled:u,className:J(t.relation===`older`&&`text-destructive`,t.relation===`newer`&&`bg-brand text-brand-foreground hover:bg-brand/90 border-transparent`),title:`${a.label} to v${t.version}`,children:[a.icon,` `,a.label]})]}),n&&(0,W.jsx)(`div`,{className:`border-t px-4 py-3.5`,children:(0,W.jsx)(yne,{body:t.body})})]})]},t.version)})})]}),(0,W.jsx)(cb,{open:c!==null,onOpenChange:e=>!e&&l(null),children:(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:c?`${M9(c.relation).label} to v${c.version}?`:``}),(0,W.jsxs)(mb,{children:[`This runs`,` `,(0,W.jsxs)(`code`,{className:`text-brand bg-muted rounded px-1.5 py-0.5 font-mono text-xs`,children:[`bun i -g `,j9,`@`,c?.version]}),` `,`on the server, then the server relaunches on that version and this connection drops briefly. Reconnect after.`,c?.relation===`older`&&(0,W.jsxs)(W.Fragment,{children:[` `,(0,W.jsx)(`b`,{className:`text-destructive`,children:`Downgrade`}),` — a newer config may not load on an older build; snapshot first if unsure.`]})]})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsxs)(hb,{className:J(ob({variant:c?.relation===`older`?`destructive`:`default`}),`gap-1.5`),onClick:()=>c&&void g(c.version),children:[c?M9(c.relation).icon:null,c?M9(c.relation).label:`Install`]})]})]})}),(0,W.jsxs)(`p`,{className:`text-muted-foreground flex items-center gap-1.5 text-[11px]`,children:[(0,W.jsx)(zc,{className:`size-3`}),` Prefer the CLI? Run`,` `,(0,W.jsxs)(`code`,{className:`bg-muted rounded px-1.5 py-0.5 font-mono`,children:[`bun i -g `,j9,`@latest`]})]})]})}var xne={critical:`text-destructive`,high:`text-orange-500`,medium:`text-yellow-500`,low:`text-muted-foreground`};function N9(e){return(0,W.jsx)(Bx,{type:e===`5ghz`?`success`:e===`2ghz`?`warning`:`secondary`,children:e===`2ghz`?`2.4G`:e===`5ghz`?`5G`:`?`})}async function P9(e,t,n,r){let i=Y.loading(`${n}…`);try{let a=await _c(e,{...t,confirm:!0});a?.ok?(Y.success(`${n} applied`,{id:i,description:a.snapshotId?`snapshot ${a.snapshotId}`:a.message}),r()):Y.error(a?.error??`${n} failed`,{id:i})}catch{Y.error(`${n} failed (server unreachable)`,{id:i})}}function Sne({mac:e,cap:t,onDone:n}){return(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(hl,{}),children:`Steer`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsxs)(pb,{children:[`Steer `,e,` toward `,t,`?`]}),(0,W.jsx)(mb,{children:`Installs a hard signal-range reject on the client’s current radio so it re-associates on the stronger neighbor. This may briefly disconnect the client, and RouterOS ultimately lets the client decide (advisory). A config snapshot is taken first and the change runs in Safe Mode.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{className:ob({variant:`destructive`}),onClick:()=>void P9(`/api/capsman/apply/steer`,{mac:e,mode:`hard`},`Steer ${e}`,n),children:`Steer (hard)`})]})]})]})}function Cne(e){let t=Math.min(1,e.clientCount/30),n=Math.min(1,(e.cpuLoad??0)/100),r=e.conflicts.length>0?.4:0;return Math.max(0,1-(t*.5+n*.4+r))}function wne(e){return e>.66?`bg-emerald-500/15 border-emerald-500/40`:e>.33?`bg-yellow-500/15 border-yellow-500/40`:`bg-destructive/15 border-destructive/50`}function Tne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(null);async function f(){l(!0);try{let[e,n,i]=await Promise.all([gc(`/api/capsman/overview`),gc(`/api/capsman/clients`),gc(`/api/capsman/audit`)]);t(e),r(n.weak),a(i),d(null)}catch(e){d(e instanceof Error?e.message:`Could not load CAPsMAN data`)}finally{l(!1)}try{let e=await gc(`/api/capsman/trends`);s(e.series??[])}catch{s([])}}(0,v.useEffect)(()=>{f()},[]);let p=(0,v.useMemo)(()=>{let t=new Map;for(let n of e?.radios??[]){let e=n.floor??`?`;(t.get(e)??t.set(e,[]).get(e)).push(n)}return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[e]);return c&&!e?(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 p-6 text-sm`,children:[(0,W.jsx)(Ux,{}),` Loading CAPsMAN fabric…`]}):u?(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsxs)(Lx,{type:`error`,label:`CAPsMAN unavailable`,children:[u,`. This device may not run a CAPsMAN manager, or has no managed CAPs.`]})}):e?(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[!e.managerEnabled&&(0,W.jsx)(Lx,{type:`warning`,label:`No CAPsMAN manager`,children:`This device isn’t running a CAPsMAN manager (or no CAPs are provisioned). The audit still runs; the coverage grid will be empty.`}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-4 xl:grid-cols-6`,children:[(0,W.jsx)(ox,{k:`CAPs`,v:px(e.totals.caps),sub:`managed access points`}),(0,W.jsx)(ox,{k:`Radios`,v:px(e.totals.radios)}),(0,W.jsx)(ox,{k:`Clients`,v:px(e.totals.clients)}),(0,W.jsx)(ox,{k:`2.4G / 5G`,v:`${e.bandSplit[`2ghz`]} / ${e.bandSplit[`5ghz`]}`,sub:`client band split`}),(0,W.jsx)(ox,{k:`Co-channel`,v:px(e.cochannel.length),cls:e.cochannel.length?`text-destructive`:void 0,sub:`conflicting pairs`}),(0,W.jsx)(ox,{k:`Findings`,v:px(i?.total??0),cls:i&&i.total>0?`text-orange-500`:void 0})]}),(0,W.jsx)(ax,{title:`Coverage & load by floor`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.cochannel.length>0&&(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(tl,{}),children:`Apply channel plan`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Apply the proposed channel plan?`}),(0,W.jsxs)(mb,{children:[`Re-channels radios to the non-overlapping plan (2.4 GHz 1/6/11, 5 GHz DFS-aware) to clear the `,e.cochannel.length,` co-channel conflict(s). Clients on a re-channeled radio briefly re-associate. Snapshot + Safe Mode; idempotent. (v7 /interface wifi only.)`]})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void P9(`/api/capsman/apply/channel-plan`,{},`Channel plan`,()=>void f()),children:`Apply`})]})]})]}),(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(il,{}),children:`Auto-balance`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Apply resource-aware load balance?`}),(0,W.jsx)(mb,{children:`For each overloaded or CPU-constrained radio that has an idle adjacent neighbor, installs a connect-priority nudge so NEW clients prefer the neighbor. Existing clients are not disconnected. Snapshot + Safe Mode; idempotent.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void P9(`/api/capsman/apply/load-balance`,{},`Load balance`,()=>void f()),children:`Apply`})]})]})]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>void f(),className:`text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs`,children:[(0,W.jsx)(nl,{className:`size-3.5`}),` refresh`]})]}),children:p.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No managed radios.`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-4`,children:p.map(([t,n])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-muted-foreground mb-1.5 text-[11px] font-semibold tracking-wide uppercase`,children:t===`?`?`Unfloored (inferred by signal)`:`Floor ${t}`}),(0,W.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6`,children:n.map(t=>{let n=e.proposedChannels[t.radioId],r=n!=null&&n!==t.channel;return(0,W.jsxs)(`div`,{className:J(`flex flex-col gap-1 rounded-lg border p-2.5`,wne(Cne(t))),title:`${t.cap} · ${t.adjacent.length} neighbors`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-1`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs font-semibold`,children:[(0,W.jsx)(tl,{className:`size-3`}),` `,t.cap]}),N9(t.band)]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between text-[11px]`,children:[(0,W.jsxs)(`span`,{className:J(t.conflicts.length>0&&`text-destructive font-medium`),children:[`ch `,t.channel??`?`,r&&(0,W.jsxs)(`span`,{className:`text-brand`,children:[` →`,n]})]}),(0,W.jsxs)(`span`,{children:[t.clientCount,` cl`]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between text-[11px]`,children:[(0,W.jsxs)(`span`,{children:[`CPU `,t.cpuLoad==null?`—`:`${t.cpuLoad}%`]}),t.conflicts.length>0&&(0,W.jsxs)(`span`,{className:`text-destructive inline-flex items-center gap-0.5`,children:[(0,W.jsx)(pl,{className:`size-3`}),` co-ch`]})]})]},t.radioId)})})]},t))})}),(0,W.jsx)(ax,{title:`Roaming (FT) & HA audit`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i&&i.findings.some(e=>e.category===`ft`)&&(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(hl,{}),children:`Enable FT`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Enable 802.11r fast-roaming?`}),(0,W.jsx)(mb,{children:`Turns on FT across the CAPsMAN security configs and converges them on ONE shared mobility domain, so clients roam between floors without a full re-auth. This briefly re-keys associated clients. Snapshot + Safe Mode; idempotent.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void P9(`/api/capsman/apply/ft`,{},`Enable FT`,()=>void f()),children:`Enable FT`})]})]})]}),i&&i.findings.some(e=>e.category===`ha`)&&(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(pl,{}),children:`Harden HA`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Harden CAPsMAN HA (require peer certificate)?`}),(0,W.jsx)(mb,{children:`Enables require-peer-certificate on this manager so a rogue manager can’t adopt your CAPs. Standing up a second manager and pointing every CAP at both is multi-device and NOT auto-applied — the tool returns those manual steps. Snapshot + Safe Mode; idempotent.`})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{onClick:()=>void P9(`/api/capsman/apply/ha`,{},`Harden HA`,()=>void f()),children:`Harden HA`})]})]})]})]}),children:!i||i.total===0?(0,W.jsx)(`p`,{className:`text-emerald-500 text-sm`,children:`No findings — roaming & redundancy look healthy. ✓`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.findings.map(e=>(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border p-2.5`,children:[(0,W.jsx)(`span`,{className:J(`mt-0.5 text-[10px] font-bold uppercase`,xne[e.severity]),children:e.severity.slice(0,4)}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium`,children:e.title}),(0,W.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.detail}),(0,W.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 text-xs`,children:[`→ `,e.recommendation,(0,W.jsxs)(`span`,{className:`ml-2 opacity-60`,children:[`[`,e.category,` · `,e.confidence,`]`]})]})]})]},e.finding_id))})}),(0,W.jsx)(ax,{title:`Weak-signal clients`,extra:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[n.length,` below threshold`]}),children:n.length===0?(0,W.jsx)(`p`,{className:`text-emerald-500 text-sm`,children:`No weak clients. ✓`}):(0,W.jsx)(`div`,{className:`overflow-x-auto`,children:(0,W.jsxs)(Yb,{children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`Client`}),(0,W.jsx)($b,{children:`Signal`}),(0,W.jsx)($b,{children:`Band`}),(0,W.jsx)($b,{children:`Current AP`}),(0,W.jsx)($b,{children:`Recommended`}),(0,W.jsx)($b,{})]})}),(0,W.jsx)(Zb,{children:n.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{className:`font-mono text-xs`,children:e.mac}),(0,W.jsxs)(ex,{className:J(e.signal<-80?`text-destructive`:`text-orange-500`,`tabular-nums`),children:[e.signal,` dBm`]}),(0,W.jsx)(ex,{children:N9(e.band)}),(0,W.jsx)(ex,{className:`text-xs`,children:e.currentCap}),(0,W.jsx)(ex,{className:`text-xs`,children:e.recommendCap?(0,W.jsxs)(`span`,{className:`text-brand inline-flex items-center gap-1`,children:[(0,W.jsx)(hl,{className:`size-3`}),` `,e.recommendCap,` (+`,e.gainDb,` dB)`]}):(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:`coverage gap`})}),(0,W.jsx)(ex,{children:e.recommendCap&&(0,W.jsx)(Sne,{mac:e.mac,cap:e.recommendCap,onDone:()=>void f()})})]},e.mac))})]})})}),o.length>0&&(0,W.jsx)(ax,{title:`Radio load trends`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`associated clients per radio · sampled every 5 min`}),children:(0,W.jsx)(`div`,{className:`grid grid-cols-1 gap-4 p-1 sm:grid-cols-2 xl:grid-cols-3`,children:o.map(e=>{let t=e.band===`5ghz`?`var(--success)`:e.band===`2ghz`?`var(--warning)`:`var(--muted-foreground)`;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[N9(e.band),(0,W.jsx)(`span`,{className:`truncate`,children:e.cap}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`/`,e.radioId]})]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`peak `,e.peak,` · avg `,e.avg]})]}),(0,W.jsx)(o7,{values:e.points.map(e=>e.clients),color:t,id:`capsman-${e.radioId}`})]},e.radioId)})})}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-[11px]`,children:`Steering, load-balance, channel-plan, FT and HA apply are all live (snapshot + Safe Mode, confirmed). All steering is advisory — RouterOS lets the client decide. Load trends fill in as the background sampler runs.`})]}):null}var Ene={TCP:`var(--chart-1)`,UDP:`var(--chart-2)`,ICMP:`var(--chart-3)`,ICMPv6:`var(--chart-3)`,ARP:`var(--chart-4)`,IPv6:`var(--chart-5)`},F9=e=>e&&Ene[e]||`var(--muted-foreground)`;function Dne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=()=>void gc(`/api/capture/packets?limit=150`).then(t).catch(()=>{});e();let n=setInterval(e,1500);return()=>clearInterval(n)},[]);let i=e?.stats,a=e?.packets??[],o=async()=>{r(!0);let e=await _c(`/api/capture/stop`,{}).catch(()=>null);r(!1),e===null||e.ok===!1||e.error?Y.error(e?.error??`Capture stop failed`):Y.success(`Capture stopped`)};if(!i||!i.running&&i.packets===0)return(0,W.jsxs)(`div`,{className:`text-muted-foreground text-[13px] leading-relaxed`,children:[`No capture running. Start one with the`,` `,(0,W.jsx)(`code`,{className:`text-brand font-mono`,children:`start_packet_capture`}),` tool — point the device's TZSP stream at this host — and decoded packets stream in here live.`]});let s=Math.max(1,...Object.values(i.protocols));return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,W.jsx)(Hx,{color:i.running?`var(--success)`:`var(--muted-foreground)`,pulse:i.running}),(0,W.jsx)(`b`,{children:i.running?`capturing`:`stopped`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`UDP `,i.port]}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[px(i.packets),` pkts · `,dx(i.bytes)]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsxs)(`a`,{className:`bg-card hover:bg-accent inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs whitespace-nowrap`,href:hc(`/api/capture/pcap`),download:`capture.pcap`,children:[(0,W.jsx)(Vc,{className:`size-3.5`}),` pcap`]}),(0,W.jsx)(X,{type:`error`,ghost:!0,size:`sm`,icon:(0,W.jsx)(ll,{className:`size-3.5`}),onClick:()=>void o(),disabled:n||!i.running,children:`Stop`})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-[220px_1fr] gap-3 max-[720px]:grid-cols-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-[5px]`,children:[(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px] tracking-[0.05em] uppercase`,children:`Protocols`}),Object.entries(i.protocols).map(([e,t])=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[52px_1fr_34px] items-center gap-1.5 font-mono text-[11px]`,children:[(0,W.jsx)(`span`,{style:{color:F9(e)},children:e}),(0,W.jsx)(`span`,{className:`bg-muted h-2 overflow-hidden rounded-full`,children:(0,W.jsx)(`i`,{className:`block h-full rounded-full`,style:{width:`${t/s*100}%`,background:F9(e)}})}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-right`,children:t})]},e)),(0,W.jsx)(`div`,{className:`text-muted-foreground mt-3 text-[11px] tracking-[0.05em] uppercase`,children:`Top talkers`}),i.topTalkers.length===0&&(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`—`}),i.topTalkers.map(e=>(0,W.jsxs)(`div`,{className:`text-muted-foreground flex justify-between font-mono text-[11px] [&>b]:text-foreground`,children:[(0,W.jsx)(`span`,{children:e.addr}),(0,W.jsx)(`b`,{children:e.count})]},e.addr))]}),(0,W.jsx)(`div`,{className:`bg-background h-[360px] overflow-y-auto rounded-md border font-mono text-[11px]/[1.6]`,children:a.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground p-2.5 text-[11px]`,children:`waiting for packets…`}):a.map((e,t)=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[90px_64px_48px_1fr] gap-2 overflow-hidden px-2.5 py-px whitespace-nowrap odd:bg-card/40`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:fx(e.ts)}),(0,W.jsx)(`span`,{className:`font-semibold`,style:{color:F9(e.protocol)},children:e.protocol??e.ethType}),(0,W.jsx)(`span`,{className:`text-muted-foreground text-right`,children:e.len}),(0,W.jsx)(`span`,{className:`text-foreground overflow-hidden text-ellipsis`,children:e.info})]},t))})]})]})}function One(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=(0,v.useCallback)(()=>{gc(`/api/s3/list`).then(t).catch(()=>t({configured:!1,objects:[]}))},[]);(0,v.useEffect)(()=>c(),[c]);let l=e=>{gc(`/api/s3/presign?key=${encodeURIComponent(e)}`).then(e=>{e.url?window.open(e.url,`_blank`,`noopener`):(s(`could not generate download link`),Y.error(`Could not generate download link`))}).catch(()=>{s(`could not generate download link`),Y.error(`Could not generate download link`)})},u=async e=>{a(e);let t=await _c(`/api/s3/delete`,{key:e}).catch(()=>({error:`request failed`}));a(null),r(null),t.ok?(s(`Deleted ${e}`),Y.success(`S3 object deleted`),c()):(s(t.error??`delete failed`),Y.error(t.error??`S3 object delete failed`))};return e?e.configured?(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsxs)(ax,{title:`S3 backups`,className:`reveal`,extra:(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.target,` · `,e.objects.length,` object`,e.objects.length===1?``:`s`,e.truncated?` (truncated)`:``]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(nl,{}),onClick:c,children:`Refresh`})]}),children:[o&&(0,W.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:o}),e.objects.length===0?(0,W.jsxs)(`div`,{className:`p-3 text-muted-foreground text-[11px]`,children:[`No objects in the bucket. Upload one with the `,(0,W.jsx)(`code`,{children:`upload_backup_to_s3`}),` tool.`]}):(0,W.jsxs)(Yb,{className:`font-mono`,children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`key`}),(0,W.jsx)($b,{className:`text-right tabular-nums`,children:`size`}),(0,W.jsx)($b,{children:`modified`}),(0,W.jsx)($b,{className:`w-[200px]`,children:`actions`})]})}),(0,W.jsx)(Zb,{children:e.objects.map(e=>(0,W.jsxs)(Qb,{children:[(0,W.jsx)(ex,{children:e.key}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:dx(e.size)}),(0,W.jsx)(ex,{children:e.lastModified?new Date(e.lastModified).toLocaleString(void 0,{hour12:!1}):`—`}),(0,W.jsxs)(ex,{className:`flex gap-1.5`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(Vc,{}),onClick:()=>l(e.key),children:`Download`}),n===e.key?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{size:`sm`,type:`error`,ghost:!0,icon:(0,W.jsx)(Nc,{}),disabled:i===e.key,onClick:()=>void u(e.key),children:`Confirm`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>r(null),children:`Cancel`})]}):(0,W.jsx)(X,{size:`sm`,ghost:!0,icon:(0,W.jsx)(fl,{}),onClick:()=>r(e.key),children:`Delete`})]})]},e.key))})]})]})}):(0,W.jsxs)(`div`,{className:`grid justify-items-center gap-2 rounded-lg border border-dashed border-border px-4 py-[54px] text-center`,children:[(0,W.jsx)(Rc,{className:`size-7 text-muted-foreground opacity-80`}),(0,W.jsx)(`p`,{className:`m-0 font-semibold text-foreground`,children:`S3 is not configured`}),(0,W.jsxs)(`p`,{className:`m-0 max-w-[460px] text-muted-foreground text-xs`,children:[`Add an `,(0,W.jsx)(`code`,{children:`s3`}),` block (bucket + credentials) to your config to manage backup objects here.`]})]}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading S3 objects…`})}function kne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),u=(0,v.useCallback)(()=>{gc(`/api/snapshots`).then(e=>t(e.snapshots)).catch(()=>t([]))},[]);(0,v.useEffect)(()=>u(),[u]);let d=e=>{gc(`/api/snapshot/${encodeURIComponent(e)}`).then(s).catch(()=>{})},f=()=>{!n||!i||_c(`/api/snapshots/diff`,{from:n,to:i}).then(l).catch(()=>Y.error(`Diff failed`))};if(!e)return(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`loading snapshots…`});if(e.length===0)return(0,W.jsxs)(`div`,{className:`grid justify-items-center gap-2 rounded-lg border border-dashed border-border px-4 py-[54px] text-center`,children:[(0,W.jsx)(Uc,{className:`size-7 text-muted-foreground`}),(0,W.jsx)(`p`,{className:`font-semibold text-foreground`,children:`No config snapshots yet`}),(0,W.jsxs)(`p`,{className:`max-w-[460px] text-xs text-muted-foreground`,children:[`Capture one with the `,(0,W.jsx)(`code`,{children:`capture_config_snapshot`}),` tool — then time-travel diff any two here.`]})]});let p=e.map(e=>({value:e.id,label:`${e.device} · ${e.label??e.id} · ${fx(e.ts)}`}));return(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(ax,{title:`Config snapshots`,className:`reveal`,extra:(0,W.jsx)(X,{size:`sm`,icon:(0,W.jsx)(nl,{}),onClick:u,children:`Refresh`}),children:[(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Jx,{value:n,onValueChange:r,"aria-label":`Diff from snapshot`,options:[{value:``,label:`diff from…`},...p]}),(0,W.jsx)(Jx,{value:i,onValueChange:a,"aria-label":`Diff to snapshot`,options:[{value:``,label:`to…`},...p]}),(0,W.jsx)(X,{size:`sm`,onClick:f,disabled:!n||!i,children:`Diff →`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[e.length,` snapshots`]})]}),(0,W.jsx)(`div`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border`,children:(0,W.jsxs)(Yb,{children:[(0,W.jsx)(Xb,{className:`sticky top-0 z-10 bg-card`,children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{children:`captured`}),(0,W.jsx)($b,{children:`device`}),(0,W.jsx)($b,{children:`label`}),(0,W.jsx)($b,{children:`version`}),(0,W.jsx)($b,{className:`text-right`,children:`lines`}),(0,W.jsx)($b,{className:`text-right`,children:`size`}),(0,W.jsx)($b,{children:`output`})]})}),(0,W.jsx)(Zb,{children:e.map(e=>(0,W.jsxs)(Qb,{className:`cursor-pointer`,"data-state":o?.id===e.id?`selected`:void 0,onClick:()=>d(e.id),children:[(0,W.jsx)(ex,{children:fx(e.ts)}),(0,W.jsx)(ex,{children:e.device}),(0,W.jsx)(ex,{children:e.label??`—`}),(0,W.jsx)(ex,{children:e.rosVersion??`—`}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:e.lines}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:dx(e.bytes)}),(0,W.jsx)(ex,{className:`max-w-[320px] truncate text-muted-foreground`,children:`view export →`})]},e.id))})]})})]}),c&&(0,W.jsx)(ax,{title:`Time-travel diff`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:c.summary.changed?`+${c.summary.added} / -${c.summary.removed}`:`identical`}),children:(0,W.jsx)(`pre`,{className:`m-0 max-h-80 overflow-auto rounded bg-background p-3 font-mono text-[11px] leading-normal text-muted-foreground`,children:(c.unified||`(identical)`).split(`
|
|
154
|
+
`).map((e,t)=>(0,W.jsx)(`div`,{className:e.startsWith(`+`)?`text-success`:e.startsWith(`-`)?`text-destructive`:e.startsWith(`@@`)?`text-brand`:``,children:e||` `},t))})}),o&&(0,W.jsx)(ax,{title:`Snapshot · ${o.label??o.id}`,className:`reveal`,extra:(0,W.jsx)(X,{type:`secondary`,size:`sm`,icon:(0,W.jsx)(gl,{}),onClick:()=>s(null),children:`Close`}),children:(0,W.jsx)(`pre`,{className:`m-0 overflow-auto rounded border border-border bg-background p-3 font-mono text-xs break-words whitespace-pre-wrap`,style:{maxHeight:460},children:o.body||`(empty)`})})]})}function I9({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,W.jsx)(uv,{"data-slot":`separator`,decorative:n,orientation:t,className:J(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var L9=` hub`;function R9(e){let t=e;for(;t>Math.PI;)t-=Math.PI*2;for(;t<-Math.PI;)t+=Math.PI*2;return t}function z9(e,t,n){let r=new Map,i=new Map;r.set(L9,{x:450,y:310});let a=e.length<=1?110:Math.min(170,96+e.length*7),o=a+(e.length<=1?190:155);e.forEach((t,n)=>{let o=e.length===1?-Math.PI/2:n/e.length*Math.PI*2-Math.PI/2;i.set(t.id,o),r.set(t.id,{x:450+a*Math.cos(o),y:310+a*Math.sin(o)})});let s=new Map,c=new Map;for(let e of t){let t=n.get(e.id)??``,r=i.get(t)??-Math.PI/2,a=s.get(t)??0;s.set(t,a+1),c.set(e.id,r+Math.ceil(a/2)*(a%2==0?1:-1)*.34)}for(let e=0;e<10;e++)for(let e of t){let r=0;for(let n of t){if(e.id===n.id)continue;let t=R9((c.get(e.id)??0)-(c.get(n.id)??0)),i=Math.abs(t)*o;i<1?r+=e.id<n.id?.02:-.02:i<120&&(r+=Math.sign(t)*2600/(i*i*o))}let a=R9((i.get(n.get(e.id)??``)??-Math.PI/2)-(c.get(e.id)??0));c.set(e.id,(c.get(e.id)??0)+r+a*.06)}for(let e of t){let t=c.get(e.id)??0;r.set(e.id,{x:450+o*Math.cos(t),y:310+o*Math.sin(t)})}return{pos:r,rInner:a,rOuter:o}}function B9(e,t){let n=2*Math.PI*e,r=Math.min(100,Math.max(0,t??0))/100*n;return`${r} ${n-r}`}function Ane(e,t=7){let n=t*Math.PI/180,r=e*Math.cos(n),i=e*Math.sin(n);return`M 450 310 L ${450+r} ${310-i} A ${e} ${e} 0 0 1 ${450+r} ${310+i} Z`}function V9(e){return e==null?`var(--muted-foreground)`:e>=85?`var(--destructive)`:e>=60?`var(--warning)`:`var(--chart-2)`}function jne(e){return e.reachable===!0?`var(--chart-2)`:e.reachable===!1?`var(--destructive)`:e.kind===`device`?`var(--muted-foreground)`:`var(--border)`}function Mne({topo:e,onOnboard:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)({x:0,y:0,k:1}),[f,p]=(0,v.useState)(!1),m=(0,v.useRef)(null),h=(0,v.useRef)(null),g=(0,v.useMemo)(()=>e.nodes.filter(e=>e.kind===`device`),[e.nodes]),_=(0,v.useMemo)(()=>e.nodes.filter(e=>e.kind===`neighbor`),[e.nodes]),y=(0,v.useMemo)(()=>{let t=new Map,n=new Set(_.map(e=>e.id));for(let r of e.edges)n.has(r.to)&&!t.has(r.to)&&t.set(r.to,r.from);return t},[e.edges,_]),{pos:b,rInner:x,rOuter:S}=(0,v.useMemo)(()=>z9(g,_,y),[g,_,y]),C=(0,v.useMemo)(()=>new Map(e.nodes.map(e=>[e.id,e])),[e.nodes]),w=n?C.get(n):null,T=(0,v.useMemo)(()=>{let t=new Map,n=(e,n)=>{t.has(e)||t.set(e,new Set([e])),t.get(e).add(n)};for(let e of g)n(e.id,L9),n(L9,e.id);for(let t of e.edges)n(t.from,t.to),n(t.to,t.from);return t},[e.edges,g]),E=o.trim().toLowerCase(),D=(0,v.useCallback)(e=>c&&!e.onboardable?!1:E?[e.label,e.id,e.ip,e.mac,e.board,e.identity].filter(e=>!!e).some(e=>e.toLowerCase().includes(E)):!0,[E,c]),O=i?T.get(i):null,k=e=>{if(O)return!O.has(e);if(e===` hub`)return!1;let t=C.get(e);return t?!D(t):!1},A=e=>{let t=h.current?.getBoundingClientRect();if(!t)return;let n=(e.clientX-t.left)/t.width*900,r=(e.clientY-t.top)/t.height*620;d(t=>{let i=Math.min(3,Math.max(.5,t.k*(e.deltaY<0?1.12:1/1.12))),a=i/t.k;return{k:i,x:n-(n-t.x)*a,y:r-(r-t.y)*a}})},j=e=>{m.current={px:e.clientX,py:e.clientY,ox:u.x,oy:u.y},p(!0)},M=e=>{let t=m.current,n=h.current?.getBoundingClientRect();if(!t||!n)return;let r=900/n.width*(e.clientX-t.px),i=620/n.height*(e.clientY-t.py);d(e=>({...e,x:t.ox+r,y:t.oy+i}))},N=()=>{m.current=null,p(!1)},P=e=>d(t=>{let n=Math.min(3,Math.max(.5,t.k*e)),r=n/t.k;return{k:n,x:450-(450-t.x)*r,y:310-(310-t.y)*r}}),F=g.map(e=>({from:L9,to:e.id,interface:void 0}));return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`relative min-w-[200px] flex-1`,children:[(0,W.jsx)(al,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2`}),(0,W.jsx)(Wx,{className:`pl-8`,type:`search`,placeholder:`Filter by name, identity, IP, MAC or board…`,value:o,onChange:e=>s(e.target.value)})]}),(0,W.jsxs)(X,{size:`sm`,ghost:!0,type:c?`accent`:`default`,onClick:()=>l(e=>!e),title:`Dim everything except neighbours that can be onboarded`,icon:(0,W.jsx)($c,{}),children:[`Onboardable`,e.stats.onboardable>0?` (${e.stats.onboardable})`:``]}),(0,W.jsx)(I9,{orientation:`vertical`,className:`h-6`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>P(1/1.25),"aria-label":`Zoom out`,icon:(0,W.jsx)(Kc,{})}),(0,W.jsxs)(`span`,{className:`text-muted-foreground w-11 text-center font-mono text-[11px] tabular-nums`,children:[Math.round(u.k*100),`%`]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>P(1.25),"aria-label":`Zoom in`,icon:(0,W.jsx)(Qc,{})}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>d({x:0,y:0,k:1}),title:`Reset view`,icon:(0,W.jsx)(Bc,{}),children:`Reset`})]}),(0,W.jsxs)(`div`,{className:`bg-card relative overflow-hidden rounded-xl border`,children:[(0,W.jsxs)(`svg`,{ref:h,viewBox:`0 0 900 620`,width:`100%`,height:560,preserveAspectRatio:`xMidYMid meet`,className:J(`block w-full touch-none select-none`,f?`cursor-grabbing`:`cursor-grab`),onWheel:A,onPointerDown:j,onPointerMove:M,onPointerUp:N,onPointerLeave:N,onClick:()=>r(null),style:{background:`radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 62%)`},children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`linearGradient`,{id:`topo-beam`,x1:`0`,y1:`0`,x2:`1`,y2:`0`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--brand)`,stopOpacity:`0.3`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--brand)`,stopOpacity:`0`})]}),(0,W.jsxs)(`radialGradient`,{id:`topo-hub`,cx:`0.5`,cy:`0.35`,r:`0.75`,children:[(0,W.jsx)(`stop`,{offset:`0`,stopColor:`var(--foreground)`}),(0,W.jsx)(`stop`,{offset:`1`,stopColor:`var(--muted-foreground)`})]})]}),(0,W.jsxs)(`g`,{transform:`translate(${u.x},${u.y}) scale(${u.k})`,children:[(0,W.jsx)(`g`,{className:`topo-ring`,children:[x,S,S+62].map(e=>(0,W.jsx)(`circle`,{cx:450,cy:310,r:e,fill:`none`,className:`stroke-border/70`,strokeDasharray:`2 8`},e))}),(0,W.jsx)(`g`,{className:`topo-sweep`,style:{transformOrigin:`450px 310px`},children:(0,W.jsx)(`path`,{d:Ane(S+62),fill:`url(#topo-beam)`})}),[...F,...e.edges].map((t,n)=>{let r=b.get(t.from),i=b.get(t.to);if(!r||!i)return null;let a=C.get(t.to)?.kind===`neighbor`,o=k(t.from)||k(t.to),s=-(i.y-r.y),c=i.x-r.x,l=Math.hypot(s,c)||1,u=a?16:8,d=(r.x+i.x)/2+s/l*u,f=(r.y+i.y)/2+c/l*u;return(0,W.jsx)(`path`,{d:`M ${r.x} ${r.y} Q ${d} ${f} ${i.x} ${i.y}`,fill:`none`,strokeWidth:a?1.2:1.6,strokeDasharray:a?`4 4`:`6 10`,className:J(`transition-opacity`,a?`stroke-brand/55`:`topo-flow stroke-chart-2/70`,o&&`opacity-15`),children:(0,W.jsxs)(`title`,{children:[t.from===` hub`?e.server:t.from,` → `,t.to,t.interface?` (${t.interface})`:``]})},`e-${n}`)}),(0,W.jsxs)(`g`,{className:J(`transition-opacity`,O&&!O.has(` hub`)&&`opacity-15`),onMouseEnter:()=>a(L9),onMouseLeave:()=>a(null),children:[(0,W.jsx)(`circle`,{cx:450,cy:310,r:40,className:`fill-brand/15`}),(0,W.jsx)(`circle`,{cx:450,cy:310,r:27,fill:`url(#topo-hub)`,className:`stroke-border`}),(0,W.jsx)(ol,{x:441,y:295,width:18,height:18,className:`stroke-background pointer-events-none`}),(0,W.jsx)(`text`,{x:450,y:326,textAnchor:`middle`,className:`fill-background pointer-events-none font-mono text-[8px] font-bold`,children:`MCP`}),(0,W.jsx)(`text`,{x:450,y:368,textAnchor:`middle`,className:`fill-muted-foreground pointer-events-none font-mono text-[10px]`,children:e.server})]}),e.nodes.map(e=>{let t=b.get(e.id);if(!t)return null;let i=e.kind===`device`,o=n===e.id,s=k(e.id),c=jne(e),l=i?26:15;return(0,W.jsxs)(`g`,{transform:`translate(${t.x},${t.y})`,className:J(`cursor-pointer transition-opacity`,s&&`opacity-15`),onMouseEnter:()=>a(e.id),onMouseLeave:()=>a(null),onClick:t=>{t.stopPropagation(),r(t=>t===e.id?null:e.id)},children:[o&&(0,W.jsx)(`circle`,{r:l+8,className:`topo-halo stroke-brand fill-none`,strokeWidth:2}),i?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{r:l+7,className:`stroke-border/60 fill-none`,strokeWidth:3}),(0,W.jsx)(`circle`,{r:l+7,fill:`none`,strokeWidth:3,strokeLinecap:`round`,transform:`rotate(-90)`,style:{stroke:V9(e.cpuLoad)},strokeDasharray:B9(l+7,e.cpuLoad)}),(0,W.jsx)(`circle`,{r:l+2,className:`stroke-border/40 fill-none`,strokeWidth:2}),(0,W.jsx)(`circle`,{r:l+2,fill:`none`,strokeWidth:2,strokeLinecap:`round`,transform:`rotate(-90)`,style:{stroke:V9(e.memUsedPct)},strokeDasharray:B9(l+2,e.memUsedPct)}),(0,W.jsx)(`circle`,{r:l-4,className:`fill-muted`,style:{stroke:c},strokeWidth:1.6}),(0,W.jsx)(`text`,{textAnchor:`middle`,y:3,className:`fill-foreground pointer-events-none font-mono text-[9px] font-bold`,children:(e.label||e.id).slice(0,4).toUpperCase()})]}):(0,W.jsxs)(W.Fragment,{children:[e.onboardable&&(0,W.jsx)(`circle`,{r:l+5,className:`topo-pulse fill-brand/25`}),(0,W.jsx)(`rect`,{x:-l*.72,y:-l*.72,width:l*1.44,height:l*1.44,rx:3,transform:`rotate(45)`,className:`fill-card`,style:{stroke:c},strokeWidth:1.4,strokeDasharray:e.onboardable?`3 2`:void 0}),e.onboardable&&(0,W.jsx)(Qc,{x:-5,y:-5,width:10,height:10,className:`stroke-brand pointer-events-none`})]}),(0,W.jsx)(`text`,{textAnchor:`middle`,y:l+(i?22:18),className:`fill-foreground pointer-events-none font-mono text-[10px]`,children:(e.label||e.id).slice(0,18)}),i&&(0,W.jsx)(`text`,{textAnchor:`middle`,y:l+34,className:`fill-muted-foreground pointer-events-none font-mono text-[9px]`,children:e.ip||e.board||``})]},e.id)})]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground pointer-events-none absolute top-3 left-3 flex flex-col gap-1 font-mono text-[10px]`,children:[(0,W.jsx)(`span`,{className:`text-foreground text-[11px] font-semibold`,children:`Layer-2 fabric`}),(0,W.jsxs)(`span`,{children:[e.stats.devices,` managed · `,e.stats.neighbors,` discovered`]}),e.stats.onboardable>0&&(0,W.jsxs)(`span`,{className:`text-brand`,children:[e.stats.onboardable,` awaiting onboard`]})]}),(0,W.jsxs)(`div`,{className:`text-muted-foreground pointer-events-none absolute right-3 bottom-3 flex flex-col items-end gap-1 font-mono text-[10px]`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`bg-chart-2 inline-block size-2 rounded-full`}),` online`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`bg-destructive inline-block size-2 rounded-full`}),` offline`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`border-border inline-block size-2 rotate-45 border`}),` neighbour`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`i`,{className:`bg-brand/40 inline-block size-2 rounded-full`}),` onboardable`]})]})]}),w&&(0,W.jsx)(Nne,{node:w,onClose:()=>r(null),onOnboard:t})]})}function Nne({node:e,onClose:t,onOnboard:n}){let r=e.suggestedConfig?JSON.stringify({[e.suggestedConfig.name]:H9(e.suggestedConfig)},null,2):null,i=[[`identity`,e.identity],[`address`,e.ip],[`mac`,e.mac],[`board`,e.board],[`platform`,e.platform],[`version`,e.version],[`uptime`,e.uptime]].filter(e=>!!e[1]);return(0,W.jsxs)(`div`,{className:`bg-card rounded-xl border p-4`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`strong`,{className:`font-mono text-sm`,children:e.label||e.id}),(0,W.jsx)(wx,{variant:e.kind===`device`?`secondary`:`outline`,children:e.kind}),e.onboardable&&(0,W.jsx)(wx,{className:`bg-brand text-brand-foreground`,children:`onboardable`}),e.reachable===!1&&(0,W.jsx)(wx,{variant:`destructive`,children:`offline`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(X,{ghost:!0,size:`sm`,icon:(0,W.jsx)(gl,{}),onClick:t,"aria-label":`Close`})]}),(0,W.jsx)(`div`,{className:`text-muted-foreground grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 font-mono text-[11px]`,children:i.length===0?(0,W.jsx)(`span`,{children:`no details advertised`}):i.map(([e,t])=>(0,W.jsxs)(v.Fragment,{children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`span`,{className:`text-foreground break-all`,children:t})]},e))}),e.kind===`device`&&(e.cpuLoad!=null||e.memUsedPct!=null)&&(0,W.jsxs)(`div`,{className:`mt-3 flex gap-4 font-mono text-[11px]`,children:[e.cpuLoad!=null&&(0,W.jsxs)(`span`,{style:{color:V9(e.cpuLoad)},children:[`cpu `,e.cpuLoad,`%`]}),e.memUsedPct!=null&&(0,W.jsxs)(`span`,{style:{color:V9(e.memUsedPct)},children:[`mem `,e.memUsedPct,`%`]})]}),r&&e.suggestedConfig&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(I9,{className:`my-3`}),(0,W.jsx)(`p`,{className:`text-muted-foreground mb-1.5 text-[11px]`,children:`Not managed yet — add this to your device config to onboard it:`}),(0,W.jsx)(`pre`,{className:`bg-background text-foreground m-0 mb-2 overflow-x-auto rounded-md border px-2.5 py-2 font-mono text-[11px]/[1.5] whitespace-pre`,children:r}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(cx,{title:`Copy config stub`,label:`Copy config stub`,text:r}),n&&(0,W.jsx)(X,{type:`accent`,size:`sm`,onClick:()=>n(e.suggestedConfig.name,H9(e.suggestedConfig)),children:`Add to config →`})]})]})]})}function H9(e){let t={port:e.port,username:e.username};return e.host&&(t.host=e.host),e.mac&&(t.mac=e.mac),t}function U9(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}function Pne(e){return!e||!e.pooled?`var(--muted-foreground)`:e.dead?`var(--destructive)`:e.inflight>0?`var(--chart-1)`:`var(--success)`}function Fne(e){return!e||!e.pooled?`no connection`:e.dead?`reconnecting`:e.inflight>0?`${e.inflight} inflight`:`ready`}function Ine({device:e}){let t=e.pool,n=!t||!t.pooled?`border-dashed opacity-60`:t.dead?`border-destructive/50`:t.inflight>0?`border-chart-1/50`:`border-success/35`,r=!!t&&t.pooled&&t.inflight>0,i=Pne(t),a=!t||!t.pooled?0:t.inflight>0?Math.min(8+t.inflight*15,100):100;return(0,W.jsxs)(`div`,{className:J(`bg-card rounded-lg border px-3 py-2.5 transition-colors hover:border-muted-foreground/40`,n),children:[(0,W.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`size-[7px] shrink-0 rounded-full`,style:{background:i}}),(0,W.jsx)(`span`,{className:`text-foreground overflow-hidden text-xs font-semibold text-ellipsis whitespace-nowrap`,children:e.name}),(0,W.jsx)(`span`,{className:`ml-auto text-[10px] font-semibold tracking-[0.04em] uppercase`,style:{color:i},children:Fne(t)})]}),(0,W.jsxs)(`div`,{className:`bg-muted relative h-1.5 overflow-hidden rounded-[3px]`,children:[(0,W.jsx)(`div`,{className:J(`h-full rounded-[3px] opacity-65 transition-[width] duration-[400ms]`,r&&`animate-pulse`),style:{width:`${a}%`,background:i}}),t&&t.pooled&&t.inflight>0&&(0,W.jsxs)(`span`,{className:`text-foreground absolute -top-px right-1 text-[8px] leading-[8px] font-bold [text-shadow:0_0_3px_rgba(0,0,0,0.6)]`,children:[t.inflight,` ch`]})]})]})}function W9({k:e,v:t,sub:n}){return(0,W.jsx)(ox,{k:e,v:t,sub:n,cls:`min-w-[100px]`})}function Lne({devices:e,poolPayload:t}){let n=e.filter(e=>e.pool!==null&&e.pool!==void 0);if(!(t?.enabled??n.length>0)&&n.length===0)return(0,W.jsxs)(`details`,{className:`my-3`,open:!0,children:[(0,W.jsx)(`summary`,{className:`mb-2 cursor-pointer font-semibold`,children:`SSH Connection Pool`}),(0,W.jsxs)(`p`,{className:`text-muted-foreground my-1 text-[13px]`,children:[`Connection pooling is disabled. Enable it with`,` `,(0,W.jsx)(`code`,{className:`text-chart-1 text-xs`,children:`--ssh-keep-alive true`}),` or`,` `,(0,W.jsx)(`code`,{className:`text-chart-1 text-xs`,children:`MIKROTIK_SSH__KEEP_ALIVE=true`}),` to keep persistent SSH connections across tool calls.`]})]});let r=t?.aggregate,i=t?.config;return(0,W.jsxs)(`details`,{className:`my-3`,open:!0,children:[(0,W.jsx)(`summary`,{className:`mb-2 cursor-pointer font-semibold`,children:`SSH Connection Pool`}),r&&(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:[(0,W.jsx)(W9,{k:`Connections`,v:String(r.totalConnections)}),(0,W.jsx)(W9,{k:`Inflight`,v:String(r.totalInflight),sub:`channels`}),(0,W.jsx)(W9,{k:`Idle`,v:String(r.totalIdle)}),(0,W.jsx)(W9,{k:`Busy`,v:String(r.totalBusy)}),i&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(W9,{k:`Keepalive`,v:U9(i.keepAliveInterval)}),(0,W.jsx)(W9,{k:`Idle timeout`,v:U9(i.idleTimeout)})]})]}),n.length>0&&(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2`,children:n.map(e=>(0,W.jsx)(Ine,{device:e},e.name))})]})}zi.registerPlugin(ic);function G9(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement(`a`);i.href=r,i.download=e,document.body.append(i),i.click(),i.remove(),URL.revokeObjectURL(r)}var K9=[{id:`overview`,label:`Overview`,sub:`Calls, latency & risk at a glance`},{id:`devices`,label:`Devices`,sub:`Connectivity radar & system health`},{id:`clients`,label:`Clients`,sub:`Connected LAN devices — usage, block/allow, pin IP`},{id:`aaa`,label:`RADIUS & UM`,sub:`RADIUS client & User Manager RADIUS server`},{id:`topology`,label:`Topology`,sub:`Layer-2 neighbours via MNDP / CDP / LLDP`},{id:`packets`,label:`Packets`,sub:`Live TZSP capture & decode`},{id:`snapshots`,label:`Snapshots`,sub:`Config history & time-travel diff`},{id:`drift`,label:`Drift Guard`,sub:`Golden config baselines & live drift detection`},{id:`plan`,label:`Change Plan`,sub:`Dry-run intended RouterOS commands`},{id:`s3`,label:`S3 Backups`,sub:`List, download & delete S3 backup objects`},{id:`backups`,label:`Backups`,sub:`Local config vault — create, restore, manage`},{id:`modules`,label:`Modules`,sub:`Enable/disable tool modules — curate the surface`},{id:`config`,label:`Config`,sub:`Effective configuration & safe editor`},{id:`memory`,label:`Memory`,sub:`Knowledge graph — entities, relations & observations`},{id:`releases`,label:`Releases`,sub:`Update, downgrade & read every version's notes`},{id:`capsman`,label:`CAPsMAN`,sub:`Wi-Fi fabric: coverage, weak signal, load, FT & HA`},{id:`feed`,label:`Live Feed`,sub:`Every tool call, in real time`}],q9=new Set(K9.map(e=>e.id)),J9=`mt-view`;function Y9(){try{let e=location.hash.replace(/^#\/?/,``);return q9.has(e)?e:null}catch{return null}}function Rne(){let e=Y9();if(e)return e;try{let e=localStorage.getItem(J9);if(e&&q9.has(e))return e}catch{}return`overview`}var X9=[`var(--foreground)`,`var(--muted-foreground)`],Z9={overview:X9,devices:X9,clients:X9,aaa:X9,topology:X9,packets:X9,snapshots:X9,drift:X9,plan:X9,s3:X9,backups:X9,modules:X9,config:X9,memory:X9,releases:X9,capsman:X9,feed:X9},zne={overview:{what:`A live pulse of all MCP tool activity: total calls, error rate, p50/p95 latency, the busiest tools, and a risk breakdown — over a time window you choose.`,tips:[`Change the time window (top-right) to zoom from the last 5 minutes out to 24 hours.`,`The risk donut splits calls by annotation: read · write · destructive · dangerous.`,`A rising error line usually points at one device or one tool — jump to Live Feed to see which.`]},devices:{what:`Every configured router with its live reachability (SSH or MAC-Telnet), latency, identity, and system health — CPU, memory and disk — refreshed continuously.`,tips:[`Each device gets a stable colour so you can track it across the connectivity radar.`,`Health (CPU/Mem/Disk) is probed periodically; MAC-Telnet devices are probed on a slower cadence.`,`Latency tiers are colour-coded green → amber → red; a grey node is currently unreachable.`,`The SSH Connection Pool panel shows persistent connections: green = idle/ready, blue = busy with inflight channels, red = reconnecting.`]},clients:{what:`The LAN devices connected to a router — merged from its DHCP leases and ARP table — with live Download/Upload charts, and one-click controls to block/allow a device, pin (reserve) its IP, change that IP, or relabel it.`,tips:[`Pick the router (top-right) to inspect its connected devices; filter by IP, MAC or name.`,`Click a device to open its live ↓/↑ traffic chart — needs a simple queue targeting its IP.`,`Block/allow is enforced by MAC, so it survives the device changing IP; “Pin IP” makes its lease static.`]},aaa:{what:"Full management of the router's RADIUS client (`/radius`) and the built-in User Manager RADIUS server (`/user-manager`): RADIUS servers + incoming CoA, and User Manager users, service profiles, rate/quota limitations, NAS clients, profile assignments, accounting sessions, and global settings.",tips:[`Pick the router (top-right), then switch tabs across RADIUS, Users, Profiles, Limitations, NAS, Assignments, Sessions and Settings.`,`Every tab is full CRUD: add, edit, enable/disable and remove — secrets are write-only and shown redacted.`,`The Usage & Heatmap tab shows each user's 3-month download/upload and a GitHub-style connection heatmap, persisted locally.`,`If a device lacks the user-manager package, the User Manager tabs explain how to install it; RADIUS-client tabs still work.`]},topology:{what:`A Layer-2 map of neighbours each router discovers via MNDP / CDP / LLDP — the physical adjacency of your network, drawn live.`,tips:[`Solid nodes are configured devices; faint nodes are discovered-but-unmanaged neighbours.`,`Use “Add to config →” on an unmanaged neighbour to pre-fill it in the Config editor.`,`Drag to pan; the layout settles automatically as new neighbours arrive.`]},packets:{what:`Live packet capture streamed from a router over TZSP — decode headers in real time without leaving the dashboard.`,tips:[`Pick a device and start the capture; packets decode as they arrive.`,`Stop the capture when done — it frees the router-side sniffer.`,`Great for debugging a protocol issue alongside the Live Feed of tool calls.`]},snapshots:{what:`Point-in-time captures of a device’s full configuration (/export), stored locally so you can diff any two and see exactly what changed.`,tips:[`Capture a snapshot before a risky change, then diff after to audit the delta.`,`The diff is line-level: green added, red removed.`,`Snapshots are device config exports — for the dashboard’s OWN config history see the Config page.`]},drift:{what:`Detect when router configs drift from their golden baseline — with change attribution and one-click reconciliation.`,tips:[`Set a baseline via MCP tools (config_set_baseline) or the Baseline Manager below.`,`Click a device card to run a live drift check against its golden config.`,`Promote accepted changes as the new baseline, or reconcile to roll back.`]},plan:{what:`Dry-run the exact RouterOS commands a change would run before it touches a device — a change plan you can review and trust.`,tips:[`Paste or build intended commands to see them validated and ordered.`,`Nothing is sent to the device from here — it’s a preview.`,`Pair with Safe Mode (auto-revert) when you do apply for real.`]},s3:{what:`Browse, download, and delete backup objects in your configured S3-compatible bucket — your off-box archive of device backups and exports.`,tips:[`Filter by key prefix to find a device’s backups quickly.`,`Download fetches the object through a presigned URL; delete is permanent.`,`For host-side .rsc backups instead, use the Backups page.`]},backups:{what:`A local config vault on the MCP server: capture a device’s /export as a timestamped .rsc file, then download, upload, rename, restore (via Safe Mode), or delete it.`,tips:[`Restore offers a dry-run (applies then rolls back) before you commit for real.`,`Edit the vault path inline in the header — it’s saved to your config.`,`Filenames are stamped in the device’s local 24-hour clock.`]},modules:{what:"Every tool module in the catalog with a live on/off switch. Toggling one writes your config file's `tools` block (disabledModules / enabledModules) and applies it immediately, so you can curate exactly which scopes the MCP server exposes.",tips:[`MCP clients search-rank tools and degrade past ~100; trim the surface below ~150–200 tools so every remaining tool is reliably findable.`,`Disable adds the module to tools.disabledModules; enable removes it (or adds it to an active allow-list) — your config file is updated live on each toggle.`,`Changes need an MCP client reconnect (or a server restart) to actually shrink/grow the visible tool list.`]},config:{what:`View the effective configuration, edit it safely with schema-aware validation and auto-rollback, browse a full field guide, and travel through config version history.`,tips:[`Every successful apply is auto-saved to the version timeline — restore any point in time.`,`Save a named checkpoint before a big change for an easy, labelled rollback.`,`The Field Guide documents every config option, its type, and default — straight from the schema.`]},memory:{what:`A persistent knowledge graph the AI builds across sessions — entities (routers, subnets, users), relations between them, and free-text observations.`,tips:[`Entities are created by the AI via MCP tools — you can browse and delete them here.`,`The graph visualization shows entities as circles and relations as directed edges; click a node to inspect it.`,`Change the database path to switch between different knowledge bases.`]},releases:{what:`Every published version of the server on a timeline, with its release notes. Upgrade to the latest, or install any specific version to upgrade or downgrade.`,tips:[`The green dot marks the version you're running now; the brand dot marks the latest.`,"Install runs `bun i -g @usex/mikrotik-mcp@<version>` on the server, then it self-restarts onto that version (the connection drops briefly).",`Click a version to expand its release notes; the latest is expanded by default.`]},capsman:{what:`The CAPsMAN Wi-Fi fabric for this controller: managed APs grouped by floor with per-radio health (client load, CPU, co-channel conflicts), weak-signal clients with the recommended neighbor AP to steer toward, and a roaming (802.11r FT) + HA redundancy audit.`,tips:[`Radio cards are colored by health; a red 'co-ch' badge means an adjacent radio shares its channel — the proposed channel is shown as →N.`,`Floors come from the AP identity/comment tag (e.g. AP-F3-E); unfloored APs are grouped by inferred signal adjacency.`,`This page is read-only in this release — steering, channel-plan apply, FT enable and HA setup arrive in later phases.`]},feed:{what:`Every tool call as it happens — tool, device, risk, duration, and success/error — with full request/response detail on click.`,tips:[`Filter by status to isolate failures, or by tool/device to follow one thread.`,`Click any row to open the full (secret-redacted) request and response.`,`Pause the stream when you want to inspect without rows shifting under you.`]}};function Q9({icon:e,title:t,sub:n,body:r,className:i}){return(0,W.jsxs)(`div`,{className:J(`text-muted-foreground flex flex-col items-center gap-2 rounded-lg border border-dashed px-6 py-14 text-center`,i),children:[e,(0,W.jsx)(`p`,{className:`text-foreground text-sm font-medium`,children:t}),n!=null&&(0,W.jsx)(`p`,{className:`max-w-md text-xs`,children:n}),r]})}function Bne({view:e}){let t=zne[e];return(0,W.jsxs)(`div`,{className:`bg-card reveal flex gap-3 rounded-lg border p-4`,role:`region`,"aria-label":`Page help`,children:[(0,W.jsx)(Lc,{className:`text-brand mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,W.jsx)(`p`,{className:`text-sm`,children:t.what}),(0,W.jsx)(`ul`,{className:`text-muted-foreground list-disc space-y-1 pl-4 text-xs`,children:t.tips.map((e,t)=>(0,W.jsx)(`li`,{children:e},t))})]})]})}function Vne(){return(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:`size-3.5`,children:(0,W.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M21 12a9 9 0 1 1-2.64-6.36`}),(0,W.jsx)(`path`,{d:`M21 3v6h-6`})]})})}function Hne(){let[e,t]=(0,v.useState)(!1);async function n(e){t(!0);let n=Y.loading(e?`Restarting server…`:`Reloading config…`);try{let t=await _c(`/api/reload`,{hard:e});t?.ok?e?Y.success(`Restarting — reconnect shortly`,{id:n,description:t.note}):Y.success(`Config reloaded · ${t.count??`?`} device${t.count===1?``:`s`}`,{id:n}):Y.error(t?.error??(e?`Restart failed`:`Reload failed`),{id:n})}catch{Y.error(`${e?`Restart`:`Reload`} failed (server unreachable)`,{id:n})}finally{t(!1)}}return(0,W.jsxs)(`div`,{className:`inline-flex w-fit -space-x-px`,role:`group`,"aria-label":`Reload server`,children:[(0,W.jsxs)(sb,{variant:`outline`,size:`sm`,disabled:e,onClick:()=>void n(!1),title:`Re-read the config from disk and apply it live (no downtime)`,className:`rounded-r-none focus-visible:z-10`,children:[(0,W.jsx)(Vne,{}),`Reload Server`]}),(0,W.jsxs)(cb,{children:[(0,W.jsx)(lb,{asChild:!0,children:(0,W.jsx)(sb,{variant:`outline`,size:`sm`,disabled:e,title:`Fully restart the server process (relaunches itself, drops the connection briefly)`,className:`rounded-l-none px-2 focus-visible:z-10`,children:`Restart`})}),(0,W.jsxs)(ub,{children:[(0,W.jsxs)(db,{children:[(0,W.jsx)(pb,{children:`Restart the MCP server?`}),(0,W.jsxs)(mb,{children:[`The server relaunches itself and rebinds the same port(s) in ~1.5s — no external supervisor needed. The current connection drops briefly; reconnect after. To pick up a newly added device without downtime, use `,(0,W.jsx)(`b`,{children:`Reload Server`}),` instead.`]})]}),(0,W.jsxs)(fb,{children:[(0,W.jsx)(gb,{children:`Cancel`}),(0,W.jsx)(hb,{className:ob({variant:`destructive`}),onClick:()=>void n(!0),children:`Restart`})]})]})]})]})}function Une({name:e}){return(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:{overview:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:`3`,y:`3`,width:`8`,height:`8`,rx:`1.6`}),(0,W.jsx)(`rect`,{x:`13`,y:`3`,width:`8`,height:`5`,rx:`1.6`}),(0,W.jsx)(`rect`,{x:`13`,y:`10`,width:`8`,height:`11`,rx:`1.6`}),(0,W.jsx)(`rect`,{x:`3`,y:`13`,width:`8`,height:`8`,rx:`1.6`})]}),devices:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`7`,rx:`2`}),(0,W.jsx)(`rect`,{x:`3`,y:`13`,width:`18`,height:`7`,rx:`2`}),(0,W.jsx)(`path`,{d:`M7 7.5h.01M7 16.5h.01`})]}),clients:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`9`,cy:`8`,r:`3`}),(0,W.jsx)(`path`,{d:`M3.5 19a5.5 5.5 0 0 1 11 0`}),(0,W.jsx)(`path`,{d:`M16 7.5a2.5 2.5 0 0 1 0 5M17.5 19a4.5 4.5 0 0 0-2-3.6`})]}),aaa:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 3 4 6v5c0 4.4 3.2 7.6 8 9 4.8-1.4 8-4.6 8-9V6l-8-3Z`}),(0,W.jsx)(`path`,{d:`M9.5 11.5 11 13l3.5-3.5`})]}),topology:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`5`,r:`2.4`}),(0,W.jsx)(`circle`,{cx:`5`,cy:`19`,r:`2.4`}),(0,W.jsx)(`circle`,{cx:`19`,cy:`19`,r:`2.4`}),(0,W.jsx)(`path`,{d:`M12 7.4 6.4 16.6M12 7.4 17.6 16.6`})]}),packets:(0,W.jsx)(`path`,{d:`M3 12h4l2-7 4 14 2-7h6`}),snapshots:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 3 3 7.5 12 12 21 7.5 12 3Z`}),(0,W.jsx)(`path`,{d:`M3 12 12 16.5 21 12`}),(0,W.jsx)(`path`,{d:`M3 16.5 12 21 21 16.5`})]}),drift:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10Z`}),(0,W.jsx)(`path`,{d:`M9 12l2 2 4-4`}),(0,W.jsx)(`path`,{d:`M12 6v2M12 16v2M6 12h2M16 12h2`})]}),plan:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`6`,cy:`6`,r:`2.3`}),(0,W.jsx)(`circle`,{cx:`6`,cy:`18`,r:`2.3`}),(0,W.jsx)(`circle`,{cx:`18`,cy:`8`,r:`2.3`}),(0,W.jsx)(`path`,{d:`M6 8.3v7.4M8.3 6H13a3 3 0 0 1 3 3v0`})]}),s3:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`ellipse`,{cx:`12`,cy:`6`,rx:`7`,ry:`2.6`}),(0,W.jsx)(`path`,{d:`M5 6v12c0 1.5 3.1 2.6 7 2.6s7-1.1 7-2.6V6`}),(0,W.jsx)(`path`,{d:`M5 12c0 1.5 3.1 2.6 7 2.6s7-1.1 7-2.6`})]}),backups:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M3 6.5 5 3.5h14l2 3`}),(0,W.jsx)(`rect`,{x:`3`,y:`6.5`,width:`18`,height:`14`,rx:`2`}),(0,W.jsx)(`path`,{d:`M9.5 12h5`})]}),modules:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`rect`,{x:`3`,y:`5`,width:`18`,height:`6`,rx:`3`}),(0,W.jsx)(`circle`,{cx:`8`,cy:`8`,r:`1.5`}),(0,W.jsx)(`rect`,{x:`3`,y:`13`,width:`18`,height:`6`,rx:`3`}),(0,W.jsx)(`circle`,{cx:`16`,cy:`16`,r:`1.5`})]}),config:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M4 7h8M16 7h4M4 17h4M12 17h8`}),(0,W.jsx)(`circle`,{cx:`14`,cy:`7`,r:`2.2`}),(0,W.jsx)(`circle`,{cx:`10`,cy:`17`,r:`2.2`})]}),memory:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`6`,r:`2`}),(0,W.jsx)(`circle`,{cx:`6`,cy:`14`,r:`2`}),(0,W.jsx)(`circle`,{cx:`18`,cy:`14`,r:`2`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`20`,r:`2`}),(0,W.jsx)(`path`,{d:`M12 8v-0.5M12 8 7.2 12.5M12 8 16.8 12.5M6 16 10.5 18.5M18 16 13.5 18.5`})]}),releases:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M12 3v12`}),(0,W.jsx)(`path`,{d:`M8 11l4 4 4-4`}),(0,W.jsx)(`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`})]}),capsman:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{d:`M5 12a7 7 0 0 1 14 0`}),(0,W.jsx)(`path`,{d:`M8.5 12a3.5 3.5 0 0 1 7 0`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1.4`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`path`,{d:`M12 13.4V20`})]}),feed:(0,W.jsx)(`path`,{d:`M4 6h16M4 12h16M4 18h10`})}[e]})}function Wne(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=gne(n?.version),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(36e5),S=Number(d?.dashboard?.feedLimit)||200,C=(0,v.useCallback)(async e=>{if(!d)return;let t={...d.dashboard,feedLimit:e};await _c(`/api/config`,{config:{...d,dashboard:t},rollbackMs:0}).catch(()=>Y.error(`Could not save the feed limit`)),await gc(`/api/config`).then(f).catch(()=>{})},[d]),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(`off`),[O,k]=(0,v.useState)(null),[A,j]=(0,v.useState)(()=>new Set),[M,N]=(0,v.useState)({}),[P,F]=(0,v.useState)({tool:``,risk:``,device:``,status:``,q:``}),I=(0,v.useRef)(w);I.current=w;let L=(0,v.useRef)(null);zte(L);let[R,ee]=(0,v.useState)(Rne),te=(0,v.useCallback)(e=>{ee(e);try{Y9()!==e&&(location.hash=e),localStorage.setItem(J9,e)}catch{}},[]);(0,v.useEffect)(()=>{if(Y9()!==R)try{location.hash=R}catch{}let e=()=>{let e=Y9();e&&te(e)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let[z,B]=(0,v.useState)(()=>{try{let e=localStorage.getItem(`mt-help-open`);return new Set(e?JSON.parse(e):[])}catch{return new Set}}),V=e=>B(t=>{let n=new Set(t);n.has(e)?n.delete(e):n.add(e);try{localStorage.setItem(`mt-help-open`,JSON.stringify([...n]))}catch{}return n}),[ne,re]=(0,v.useState)(``),[ie,ae]=(0,v.useState)(`all`),oe=(0,v.useMemo)(()=>{let e=i?.devices??[];return{online:e.filter(e=>e.status.reachable===!0).length,offline:e.filter(e=>e.status.reachable===!1).length,total:e.length}},[i]),se=(0,v.useMemo)(()=>{let e=i?.devices??[],t=ne.trim().toLowerCase();return e.filter(e=>!(ie===`online`&&e.status.reachable!==!0||ie===`offline`&&e.status.reachable!==!1||t&&!e.name.toLowerCase().includes(t)&&!(e.address??e.host??``).toLowerCase().includes(t)))},[i,ne,ie]);Rte((0,v.useCallback)(e=>{if(I.current)return;y(t=>[e,...t].slice(0,yx));let t=e.device;t&&N(e=>({...e,[t]:(e[t]??0)+1}))},[]),(0,v.useCallback)(e=>D(e),[])),(0,v.useEffect)(()=>{gc(`/api/events?limit=${yx}`).then(e=>y(e.events)).catch(()=>{})},[]);let H=(0,v.useCallback)(()=>{gc(`/api/stats?window=${b}&buckets=60`).then(t).catch(()=>{})},[b]);(0,v.useEffect)(()=>{H();let e=()=>{H(),gc(`/api/meta`).then(r).catch(()=>{}),gc(`/api/devices`).then(a).catch(()=>{}),gc(`/api/ssh-pool`).then(s).catch(()=>{}),gc(`/api/topology`).then(u).catch(()=>{})};e();let t=setInterval(()=>{I.current||e()},4e3);return()=>clearInterval(t)},[H]),(0,v.useEffect)(()=>{let e=()=>void gc(`/api/config`).then(f).catch(()=>{});e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[]);let ce=(0,v.useCallback)((e,t)=>{_c(`/api/devices/toggle`,{device:e,disabled:t}).then(n=>{a(n),Y.success(`Device ${e} ${t?`disabled`:`enabled`}`)}).catch(()=>Y.error(`Could not ${t?`disable`:`enable`} ${e}`))},[]);(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&k(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let le=(0,v.useMemo)(()=>{let e=P.q.trim().toLowerCase();return _.filter(t=>!(P.tool&&t.tool!==P.tool||P.risk&&t.risk!==P.risk||P.device&&t.device!==P.device||P.status===`ok`&&t.isError||P.status===`error`&&!t.isError||e&&!t.tool.toLowerCase().includes(e)&&!t.input.toLowerCase().includes(e)&&!t.output.toLowerCase().includes(e)&&!(t.error??``).toLowerCase().includes(e))).sort((e,t)=>t.ts-e.ts)},[_,P]),ue=!!(P.tool||P.risk||P.device||P.status||P.q),de=(0,v.useMemo)(()=>_.filter(e=>e.isError),[_]),fe=(0,v.useMemo)(()=>({ok:_.length-de.length,error:de.length}),[_,de]),pe=(0,v.useCallback)(async e=>{try{k(await gc(`/api/event/${encodeURIComponent(e.id)}`))}catch{k(e)}},[]),me=(0,v.useMemo)(()=>le.slice(0,S),[le,S]),he=(0,v.useMemo)(()=>me.map(e=>e.id),[me]),ge=he.length>0&&he.every(e=>A.has(e)),_e=!ge&&he.some(e=>A.has(e)),ve=(0,v.useCallback)(e=>{j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ye=(0,v.useCallback)(()=>{j(e=>{let t=new Set(e);if(he.length>0&&he.every(e=>t.has(e)))for(let e of he)t.delete(e);else for(let e of he)t.add(e);return t})},[he]),[be,xe]=(0,v.useState)(!1),Se=(0,v.useCallback)(async()=>{let e=[...A];if(e.length!==0)try{await yc({ids:e});let t=new Set(e);y(e=>e.filter(e=>!t.has(e.id))),j(new Set),Y.success(`Deleted ${e.length} event${e.length===1?``:`s`}`)}catch{Y.error(`Could not delete the selected events`)}finally{xe(!1)}},[A]),Ce=e=>{if(e===`json`){G9(`mcp-events.json`,JSON.stringify(le,null,2),`application/json`);return}let t=[`ts`,`tool`,`risk`,`device`,`durationMs`,`isError`,`error`,`reason`],n=e=>/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e,r=le.map(e=>[new Date(e.ts).toISOString(),e.tool,e.risk,e.device??``,String(e.durationMs),String(e.isError),e.error??``,e.reason??``].map(n).join(`,`)).join(`
|
|
155
|
+
`);G9(`mcp-events.csv`,`${t.join(`,`)}\n${r}\n`,`text/csv`)},we=e?e.errorRate>=.2?`text-destructive`:e.errorRate>=.05?`text-warning`:``:``,Te=d?.mcp??{},Ee=d?.dashboard??{},De=d?.ssh??{},Oe=(e,t,n)=>(0,W.jsx)(Jx,{size:`sm`,"aria-label":t,value:P[e],onValueChange:t=>F(n=>({...n,[e]:t})),options:[{value:``,label:t},...n.map(e=>({value:e,label:e}))]}),ke=K9.find(e=>e.id===R)??K9[0];return(0,W.jsxs)(`div`,{className:`bg-background text-foreground grid min-h-screen grid-cols-[240px_1fr]`,ref:L,"data-view":R,style:{"--page-accent":Z9[R][0],"--page-accent-2":Z9[R][1]},children:[(0,W.jsxs)(`aside`,{className:`bg-card sticky top-0 flex h-screen flex-col gap-4 border-r p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`bg-foreground text-background grid size-9 shrink-0 place-items-center rounded-md`,children:(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:`size-5`,children:(0,W.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12 12 L4 5 M12 12 L20 5 M12 12 L12 20`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`4`,cy:`5`,r:`1.9`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`20`,cy:`5`,r:`1.9`,fill:`currentColor`,stroke:`none`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`20`,r:`1.9`,fill:`currentColor`,stroke:`none`})]})})}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col leading-tight`,children:[(0,W.jsx)(`b`,{className:`truncate text-sm`,children:`MikroTik MCP`}),(0,W.jsxs)(`small`,{className:J(`text-muted-foreground inline-flex items-center gap-1 text-[11px]`,c.release&&`hover:text-foreground cursor-pointer`),title:c.release?`View release notes`:void 0,onClick:c.release?()=>c.openModal():void 0,children:[n?.version?`v${n.version}`:`Observability`,c.showIndicator&&(0,W.jsx)(`span`,{className:`bg-brand inline-block size-1.5 rounded-full`,title:`v${c.release?.version} available`})]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Oee,{})]}),(0,W.jsx)(`nav`,{className:`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto`,children:K9.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:J(`flex items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] transition-colors`,`[&_svg]:size-4 [&_svg]:shrink-0`,R===e.id?`bg-accent text-accent-foreground font-medium`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`),onClick:()=>te(e.id),children:[(0,W.jsx)(Une,{name:e.id}),(0,W.jsx)(`span`,{className:`truncate`,children:e.label}),e.id===`feed`&&_.length>0&&(0,W.jsx)(`span`,{className:`bg-brand text-brand-foreground animate-in zoom-in-50 ml-auto rounded-full px-1.5 py-0.5 text-[10px] tabular-nums`,children:_.length>999?`999+`:_.length},_.length)]},e.id))}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5 border-t pt-3`,children:[(0,W.jsx)(Hne,{}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[11px]`,title:`Live transport: WebSocket (preferred) or SSE fallback`,children:[(0,W.jsx)(Hx,{type:E===`off`?`secondary`:`success`,pulse:E!==`off`}),E===`off`?`offline`:`live · ${E}`]}),(0,W.jsx)(`small`,{className:`text-muted-foreground text-[11px]`,children:n?`${px(n.total)} events · ${n.transport}`:`connecting…`})]})]}),(0,W.jsxs)(`main`,{className:`flex min-w-0 flex-col gap-5 p-6`,"data-view":R,children:[(0,W.jsxs)(`header`,{className:`reveal flex flex-wrap items-center gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`h1`,{className:`truncate text-xl font-semibold`,children:ke.label}),(0,W.jsx)(`small`,{className:`text-muted-foreground text-xs`,children:ke.sub})]}),(0,W.jsx)(`span`,{className:`flex-1`}),R===`overview`&&(0,W.jsx)(Jx,{size:`sm`,"aria-label":`Stats time window`,value:String(b),onValueChange:e=>x(Number(e)),options:vx.map(([e,t])=>({value:String(t),label:`window: ${e}`}))}),(0,W.jsx)(X,{size:`sm`,ghost:!0,type:z.has(R)?`accent`:`default`,onClick:()=>V(R),"aria-expanded":z.has(R),title:`About this page`,icon:(0,W.jsx)(Lc,{}),children:`Help`})]}),z.has(R)&&(0,W.jsx)(Bne,{view:R}),R===`overview`&&(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsx)(`div`,{className:`reveal grid grid-cols-[repeat(auto-fit,minmax(9rem,1fr))] gap-3`,children:e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ox,{k:`Calls (window)`,v:px(e.total)}),(0,W.jsx)(ox,{k:`Calls / min`,v:e.callsPerMin.toFixed(1)}),(0,W.jsx)(ox,{k:`Error rate`,v:`${(e.errorRate*100).toFixed(1)}%`,sub:`${e.errors} err`,cls:we}),(0,W.jsx)(ox,{k:`Avg latency`,v:ux(e.latency.avg)}),(0,W.jsx)(ox,{k:`p95 latency`,v:ux(e.latency.p95)}),(0,W.jsx)(ox,{k:`p99 latency`,v:ux(e.latency.p99)}),(0,W.jsx)(ox,{k:`Distinct tools`,v:px(e.distinctTools)}),(0,W.jsx)(ox,{k:`Output volume`,v:dx(e.outputBytes)})]}):(0,W.jsx)(ox,{k:`Loading…`,v:`—`})}),(0,W.jsxs)(`div`,{className:`reveal grid grid-cols-1 gap-4 xl:grid-cols-3`,children:[(0,W.jsx)(ax,{title:`Calls over time`,className:`xl:col-span-2`,children:e?(0,W.jsx)(i7,{series:e.series}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`no data`})}),e&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ax,{title:`By risk`,children:(0,W.jsx)(a7,{segments:Object.keys(e.byRisk).map(t=>({label:t,value:e.byRisk[t],color:gx[t]}))})}),(0,W.jsx)(ax,{title:`Top tools`,className:`xl:col-span-2`,children:(0,W.jsx)(sx,{rows:e.byTool.map(e=>({label:e.tool,value:e.count,sub:`${e.count}× · ${ux(e.p95Ms)} p95${e.errors?` · ${e.errors} err`:``}`,color:e.errors?`var(--destructive)`:void 0}))})}),(0,W.jsx)(ax,{title:`Status`,children:(0,W.jsx)(a7,{centerLabel:`calls`,segments:[{label:`ok`,value:fe.ok,color:`var(--muted-foreground)`},{label:`error`,value:fe.error,color:`var(--destructive)`}]})}),(0,W.jsx)(ax,{title:`By device`,children:e.byDevice.length?(0,W.jsx)(sx,{rows:e.byDevice.map(e=>({label:e.device,value:e.count}))}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`single device`})}),(0,W.jsx)(ax,{title:`Recent errors`,children:de.length?(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:de.slice(0,8).map(e=>(0,W.jsxs)(`div`,{className:`hover:bg-accent/50 grid cursor-pointer grid-cols-[auto_1fr] items-center gap-3 rounded-md px-1 py-0.5`,onClick:()=>void pe(e),children:[(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:fx(e.ts)}),(0,W.jsxs)(`span`,{className:`text-destructive min-w-0 truncate text-xs`,title:e.error??e.output,children:[e.tool,`: `,e.error??e.output??`error`]})]},e.id))}):(0,W.jsx)(`div`,{className:`text-muted-foreground text-[11px]`,children:`no errors 🎉`})})]})]})]}),R===`devices`&&(i&&i.devices.length>0?(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsxs)(`div`,{className:`reveal flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`min-w-[180px] flex-1`,type:`search`,placeholder:`Search devices by name or address…`,value:ne,onChange:e=>re(e.target.value)}),(0,W.jsx)(`div`,{className:`bg-muted flex gap-0.5 rounded-md p-0.5`,children:[`all`,`online`,`offline`].map(e=>(0,W.jsx)(`button`,{type:`button`,className:J(`rounded-sm px-2.5 py-1 text-xs transition-colors`,ie===e?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),onClick:()=>ae(e),children:e===`all`?`All ${oe.total}`:e===`online`?`Online ${oe.online}`:`Offline ${oe.offline}`},e))}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[se.length,`/`,oe.total,` shown`]})]}),(0,W.jsxs)(`details`,{className:`bg-card reveal rounded-lg border p-4`,open:oe.total<=8,children:[(0,W.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[`Connectivity radar`,(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[` `,`· `,oe.online,` online · `,oe.offline,` offline ·`,` `,oe.total,` total`]})]}),(0,W.jsx)(Nte,{payload:i,pulses:M})]}),(0,W.jsx)(Lne,{devices:se,poolPayload:o}),se.length===0?(0,W.jsx)(Q9,{className:`reveal`,icon:(0,W.jsx)(al,{className:`size-6`}),title:`No devices match`,sub:`Try a different search or status filter.`}):(0,W.jsx)(`div`,{className:`reveal grid grid-cols-[repeat(auto-fill,minmax(20rem,1fr))] gap-4`,children:se.map(e=>(0,W.jsx)(Pte,{d:e,onToggle:ce},e.name))}),se.length>0&&(0,W.jsx)(ax,{title:`Device system health`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`CPU · memory · disk · latency · live probe`}),children:(0,W.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(22rem,1fr))] gap-3`,children:se.map(e=>(0,W.jsx)(Lte,{d:e},e.name))})})]}):(0,W.jsx)(Q9,{icon:(0,W.jsx)(Jc,{className:`size-6`}),title:`No devices configured`,body:(0,W.jsx)(Lx,{type:`secondary`,label:`Tip`,children:`Add a device to your config to see connectivity and system health here.`})})),R===`clients`&&(0,W.jsx)(x7,{}),R===`aaa`&&(0,W.jsx)(PS,{}),R===`topology`&&(l&&l.nodes.length>0?(0,W.jsx)(`section`,{className:`reveal grid content-start gap-[18px]`,children:(0,W.jsx)(Mne,{topo:l,onOnboard:(e,t)=>{g({name:e,body:t}),m(!0),te(`config`)}})}):(0,W.jsx)(Q9,{icon:(0,W.jsx)($c,{className:`size-6`}),title:`No neighbours discovered yet`,sub:`Layer-2 neighbours (MNDP / CDP / LLDP) appear here as the device reports them.`})),R===`packets`&&(0,W.jsx)(`section`,{className:`grid content-start gap-[18px]`,children:(0,W.jsx)(ax,{title:`Packet capture`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`live TZSP decode · /tool sniffer streaming`}),children:(0,W.jsx)(Dne,{})})}),R===`snapshots`&&(0,W.jsx)(kne,{}),R===`drift`&&(0,W.jsx)(qte,{}),R===`plan`&&(0,W.jsx)(RS,{}),R===`s3`&&(0,W.jsx)(One,{}),R===`backups`&&(0,W.jsx)(Xx,{}),R===`modules`&&(0,W.jsx)(rne,{}),R===`config`&&(d?(0,W.jsxs)(`section`,{className:`grid content-start gap-[18px]`,children:[(0,W.jsx)(ax,{title:`Configuration`,className:`reveal`,extra:(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>m(e=>!e),title:`Edit the config JSON with autocomplete, validation and safe-apply`,icon:p?void 0:(0,W.jsx)(Xc,{}),children:p?`View`:`Edit config`}),children:p?(0,W.jsx)(kte,{initial:h?{...d,devices:{...d.devices,[h.name]:h.body}}:d,onClose:()=>{m(!1),g(null)},onReload:()=>{g(null),gc(`/api/config`).then(f).catch(()=>{})}},h?`seed-${h.name}`:`config`):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`text-muted-foreground mb-2.5 flex flex-wrap gap-x-4 gap-y-1 text-[11px]`,children:[(0,W.jsxs)(`span`,{children:[`transport: `,mx(Te.transport)]}),(0,W.jsxs)(`span`,{children:[`read-only: `,d.readOnly?`yes`:`no`]}),(0,W.jsxs)(`span`,{children:[`dashboard: `,mx(Ee.host),`:`,mx(Ee.port)]}),(0,W.jsxs)(`span`,{children:[`capture: `,Ee.captureBody?`on`:`off`]}),(0,W.jsxs)(`span`,{children:[`s3: `,d.s3?`configured`:`off`]}),(0,W.jsxs)(`span`,{children:[`ssh pool: `,De.keepAlive===!1?`off`:`on`]})]}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-sm`,children:`Full effective configuration (secrets redacted)`}),(0,W.jsx)(A7,{value:d,maxHeight:340})]})]})}),(0,W.jsx)(ax,{title:`Dashboard preferences`,className:`reveal`,extra:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`saved to `,(0,W.jsx)(`code`,{children:`dashboard.feedLimit`}),` in the config`]}),children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(vb,{className:`text-[12.5px]`,children:`Live Feed rows`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[`How many matching calls the feed table renders. Up to `,px(1e4),` are kept in memory regardless; this only bounds what is drawn.`]})]}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Jx,{size:`sm`,"aria-label":`Live Feed rows`,value:String(S),onValueChange:e=>void C(Number(e)),options:lx.map(e=>({value:String(e),label:`${px(e)} rows${e===200?` (default)`:``}`}))})]})}),(0,W.jsx)(ax,{title:`Version history`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`point-in-time snapshots · diff & restore`}),children:(0,W.jsx)(R7,{onRestored:()=>void gc(`/api/config`).then(f).catch(()=>{})})}),(0,W.jsx)(ax,{title:`Field guide`,className:`reveal`,extra:(0,W.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`every config option, documented from the schema`}),children:(0,W.jsx)(B7,{})})]}):(0,W.jsx)(Q9,{icon:(0,W.jsx)(Ux,{}),title:`Loading configuration…`})),R===`memory`&&(0,W.jsx)(tne,{}),R===`releases`&&(0,W.jsx)(bne,{}),R===`capsman`&&(0,W.jsx)(Tne,{}),R===`feed`&&(0,W.jsxs)(ax,{className:`reveal`,title:`Live tool calls`,extra:(0,W.jsxs)(`span`,{className:`text-muted-foreground text-[11px]`,children:[px(me.length),` shown`,le.length>me.length&&` of ${px(le.length)} matching`,` ·`,` `,px(_.length),` buffered`]}),children:[(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(Wx,{className:`min-w-[180px] flex-1`,type:`search`,placeholder:`Search tool / input / output / error…`,value:P.q,onChange:e=>F(t=>({...t,q:e.target.value}))}),Oe(`tool`,`all tools`,n?.tools??[]),Oe(`risk`,`all risk`,[`READ`,`WRITE`,`WRITE_IDEMPOTENT`,`DESTRUCTIVE`,`DANGEROUS`]),Oe(`device`,`all devices`,n?.devices??[]),Oe(`status`,`all status`,[`ok`,`error`]),(0,W.jsx)(X,{size:`sm`,ghost:!0,type:w?`accent`:`default`,onClick:()=>T(e=>!e),icon:w?(0,W.jsx)(Zc,{}):(0,W.jsx)(Yc,{}),children:w?`Resume`:`Pause`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>Ce(`csv`),children:`CSV`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>Ce(`json`),children:`JSON`}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>F({tool:``,risk:``,device:``,status:``,q:``}),children:`Clear`}),be&&A.size>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(X,{size:`sm`,type:`error`,onClick:()=>void Se(),icon:(0,W.jsx)(Nc,{}),children:[`Confirm delete (`,A.size,`)`]}),(0,W.jsx)(X,{size:`sm`,ghost:!0,onClick:()=>xe(!1),children:`Cancel`})]}):(0,W.jsxs)(X,{size:`sm`,ghost:!0,disabled:A.size===0,onClick:()=>xe(!0),title:`Delete the selected rows`,icon:(0,W.jsx)(fl,{}),children:[`Delete`,A.size>0?` (${A.size})`:``]})]}),le.length===0?ue?(0,W.jsx)(Q9,{icon:(0,W.jsx)(al,{className:`size-6`}),title:`No calls match your filters`,sub:`${_.length} call${_.length===1?``:`s`} buffered — try widening the search or the risk / device / status filters.`,body:(0,W.jsx)(X,{size:`sm`,ghost:!0,className:`mt-2`,onClick:()=>F({tool:``,risk:``,device:``,status:``,q:``}),children:`Clear filters`})}):(0,W.jsx)(Q9,{icon:(0,W.jsx)(Hx,{type:E===`off`?`secondary`:`success`,pulse:E!==`off`,className:`size-3`}),title:E===`off`?`Not connected`:`Listening for tool calls…`,sub:E===`off`?`The live stream is offline — it will reconnect automatically.`:`Tool calls the LLM makes against this server stream in here in real time.`}):(0,W.jsx)(`div`,{className:`max-h-[60vh] overflow-auto`,children:(0,W.jsxs)(Yb,{children:[(0,W.jsx)(Xb,{children:(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{className:`w-7`,children:(0,W.jsx)(_b,{"aria-label":`Select all shown rows`,checked:ge?!0:_e?`indeterminate`:!1,onCheckedChange:ye})}),(0,W.jsx)($b,{children:`time`}),(0,W.jsx)($b,{children:`tool`}),(0,W.jsx)($b,{children:`risk`}),(0,W.jsx)($b,{children:`device`}),(0,W.jsx)($b,{className:`text-right`,children:`dur`}),(0,W.jsx)($b,{children:`status`}),(0,W.jsx)($b,{children:`output`})]})}),(0,W.jsx)(Zb,{children:me.map(e=>(0,W.jsxs)(Qb,{"data-state":A.has(e.id)?`selected`:void 0,className:J(`cursor-pointer`,e.isError&&`bg-destructive/8`),onClick:()=>void pe(e),children:[(0,W.jsx)(ex,{onClick:e=>e.stopPropagation(),children:(0,W.jsx)(_b,{"aria-label":`Select row`,checked:A.has(e.id),onCheckedChange:()=>ve(e.id)})}),(0,W.jsx)(ex,{className:`tabular-nums`,children:fx(e.ts)}),(0,W.jsx)(ex,{children:e.tool}),(0,W.jsx)(ex,{children:(0,W.jsx)(`span`,{className:J(`rounded-full border px-1.5 py-0.5 text-[10px]`,_x[e.risk]),children:e.risk.replace(`WRITE_IDEMPOTENT`,`WRITE·I`)})}),(0,W.jsx)(ex,{children:e.device??`—`}),(0,W.jsx)(ex,{className:`text-right tabular-nums`,children:ux(e.durationMs)}),(0,W.jsx)(ex,{children:(0,W.jsx)(`span`,{className:e.isError?`text-destructive`:`text-muted-foreground`,children:e.isError?`error`:`ok`})}),(0,W.jsx)(ex,{className:`text-muted-foreground max-w-[24rem] truncate`,children:e.isError?e.error??`error`:e.reason?(0,W.jsx)(`span`,{className:`italic`,children:e.reason}):e.output||`—`})]},e.id))})]})})]})]}),c.showModal&&c.release&&(0,W.jsx)(_ne,{release:c.release,onDismiss:c.dismissRelease}),O&&(0,W.jsx)(Ite,{event:O,onClose:()=>k(null)}),(0,W.jsx)(kee,{})]})}var $9=document.getElementById(`root`);$9&&(0,y.createRoot)($9).render((0,W.jsx)(Wne,{}));
|
|
156
156
|
</script>
|
|
157
157
|
<style>
|
|
158
158
|
@import "https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap";@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:var(--font-mt);--font-mono:var(--font-mt);--color-orange-500:oklch(70.5% .213 47.604);--color-yellow-500:oklch(79.5% .184 86.047);--color-emerald-500:oklch(69.6% .17 162.48);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-2xl:40px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-mt);--default-mono-font-family:var(--font-mt);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--font-mt:"JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--background);font-family:var(--font-mt);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components{@media (prefers-reduced-motion:no-preference){.js-motion .reveal{opacity:0}}}@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.-top-16{top:calc(var(--spacing) * -16)}.-top-px{top:-1px}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\[50\%\]{top:50%}.-right-16{right:calc(var(--spacing) * -16)}.right-0{right:0}.right-0\.5{right:calc(var(--spacing) * .5)}.right-1{right:var(--spacing)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-1\.5{bottom:calc(var(--spacing) * -1.5)}.bottom-0{bottom:0}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.-left-\[21px\]{left:-21px}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-\[9px\]{left:9px}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-0{z-index:0}.z-10{z-index:10}.z-30{z-index:30}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[5\]{z-index:5}.col-span-full{grid-column:1/-1}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1{margin-block:var(--spacing)}.my-2\.5{margin-block:calc(var(--spacing) * 2.5)}.my-3{margin-block:calc(var(--spacing) * 3)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-\[3px\]{margin-top:3px}.mt-\[7px\]{margin-top:7px}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\.5{margin-bottom:calc(var(--spacing) * 3.5)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.\[field-sizing\:fixed\]{field-sizing:fixed}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-56{width:calc(var(--spacing) * 56);height:calc(var(--spacing) * 56)}.size-\[7px\]{width:7px;height:7px}.size-\[9px\]{width:9px;height:9px}.size-\[11px\]{width:11px;height:11px}.size-\[12px\]{width:12px;height:12px}.size-\[13px\]{width:13px;height:13px}.size-\[14px\]{width:14px;height:14px}.size-\[18px\]{width:18px;height:18px}.size-\[19px\]{width:19px;height:19px}.size-\[72px\]{width:72px;height:72px}.size-full{width:100%;height:100%}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-40{height:calc(var(--spacing) * 40)}.h-\[18px\]{height:18px}.h-\[46px\]{height:46px}.h-\[150px\]{height:150px}.h-\[200px\]{height:200px}.h-\[360px\]{height:360px}.h-\[400px\]{height:400px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-52{max-height:calc(var(--spacing) * 52)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[40vh\]{max-height:40vh}.max-h-\[60vh\]{max-height:60vh}.max-h-\[184px\]{max-height:184px}.max-h-\[250px\]{max-height:250px}.max-h-\[280px\]{max-height:280px}.max-h-\[320px\]{max-height:320px}.max-h-\[360px\]{max-height:360px}.max-h-\[420px\]{max-height:420px}.max-h-\[440px\]{max-height:440px}.max-h-\[500px\]{max-height:500px}.max-h-\[calc\(100vh-80px\)\]{max-height:calc(100vh - 80px)}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-\[120px\]{min-height:120px}.min-h-screen{min-height:100vh}.w-0{width:0}.w-1{width:var(--spacing)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\/4{width:75%}.w-7{width:calc(var(--spacing) * 7)}.w-11{width:calc(var(--spacing) * 11)}.w-20{width:calc(var(--spacing) * 20)}.w-40{width:calc(var(--spacing) * 40)}.w-\[90px\]{width:90px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[150px\]{width:150px}.w-\[170px\]{width:170px}.w-\[200px\]{width:200px}.w-\[220px\]{width:220px}.w-\[380px\]{width:380px}.w-\[min\(48vw\,380px\)\]{width:min(48vw,380px)}.w-\[min\(360px\,60vw\)\]{width:min(360px,60vw)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[24rem\]{max-width:24rem}.max-w-\[120px\]{max-width:120px}.max-w-\[160px\]{max-width:160px}.max-w-\[180px\]{max-width:180px}.max-w-\[190px\]{max-width:190px}.max-w-\[200px\]{max-width:200px}.max-w-\[260px\]{max-width:260px}.max-w-\[300px\]{max-width:300px}.max-w-\[320px\]{max-width:320px}.max-w-\[460px\]{max-width:460px}.max-w-\[520px\]{max-width:520px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-\[min\(60vw\,520px\)\]{max-width:min(60vw,520px)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:0}.min-w-\[8rem\]{min-width:8rem}.min-w-\[38px\]{min-width:38px}.min-w-\[48px\]{min-width:48px}.min-w-\[60px\]{min-width:60px}.min-w-\[100px\]{min-width:100px}.min-w-\[150px\]{min-width:150px}.min-w-\[180px\]{min-width:180px}.min-w-\[200px\]{min-width:200px}.min-w-\[980px\]{min-width:980px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.table-fixed{table-layout:fixed}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y:calc(-50% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-100\%-9px\)\]{--tw-translate-y:calc(-100% - 9px);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-y{resize:vertical}.scroll-my-1{scroll-margin-block:var(--spacing)}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-cols-\[24px_minmax\(0\,1fr\)_auto\]{grid-template-columns:24px minmax(0,1fr) auto}.grid-cols-\[52px_1fr_34px\]{grid-template-columns:52px 1fr 34px}.grid-cols-\[90px_64px_48px_1fr\]{grid-template-columns:90px 64px 48px 1fr}.grid-cols-\[220px_1fr\]{grid-template-columns:220px 1fr}.grid-cols-\[240px_1fr\]{grid-template-columns:240px 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[minmax\(0\,7rem\)_1fr_auto\]{grid-template-columns:minmax(0,7rem) 1fr auto}.grid-cols-\[minmax\(120px\,0\.4fr\)_1fr\]{grid-template-columns:minmax(120px,.4fr) 1fr}.grid-cols-\[repeat\(auto-fill\,minmax\(20rem\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(20rem,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(22rem\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(22rem,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(200px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(220px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(240px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(min\(100\%\,360px\)\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr))}.grid-cols-\[repeat\(auto-fit\,minmax\(9rem\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-content-center{place-content:center}.place-items-center{place-items:center}.content-start{align-content:flex-start}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-around{justify-content:space-around}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-center{justify-items:center}.justify-items-start{justify-items:start}.gap-0{gap:0}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\[3px\]{gap:3px}.gap-\[5px\]{gap:5px}.gap-\[7px\]{gap:7px}.gap-\[9px\]{gap:9px}.gap-\[18px\]{gap:18px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-3\.5{column-gap:calc(var(--spacing) * 3.5)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2\.5{row-gap:calc(var(--spacing) * 2.5)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-\[3px\]{row-gap:3px}.self-start{align-self:flex-start}.justify-self-center{justify-self:center}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[3px\]{border-radius:3px}.rounded-\[4px\]{border-radius:4px}.rounded-\[6px\]{border-radius:6px}.rounded-\[7px\]{border-radius:7px}.rounded-\[10px\]{border-radius:10px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) + 2px)}.rounded-md{border-radius:var(--radius)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[2\.5px\]{border-style:var(--tw-border-style);border-width:2.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\(--color-border\){border-color:var(--color-border)}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\/50{border-color:color-mix(in oklab, var(--border) 50%, transparent)}}.border-border\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-brand,.border-brand\/30{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/30{border-color:color-mix(in oklab, var(--brand) 30%, transparent)}}.border-brand\/40{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/40{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.border-brand\/50{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/50{border-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.border-brand\/55{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/55{border-color:color-mix(in oklab, var(--brand) 55%, transparent)}}.border-chart-1\/40{border-color:var(--chart-1)}@supports (color:color-mix(in lab, red, red)){.border-chart-1\/40{border-color:color-mix(in oklab, var(--chart-1) 40%, transparent)}}.border-chart-1\/45{border-color:var(--chart-1)}@supports (color:color-mix(in lab, red, red)){.border-chart-1\/45{border-color:color-mix(in oklab, var(--chart-1) 45%, transparent)}}.border-chart-1\/50{border-color:var(--chart-1)}@supports (color:color-mix(in lab, red, red)){.border-chart-1\/50{border-color:color-mix(in oklab, var(--chart-1) 50%, transparent)}}.border-chart-2\/40{border-color:var(--chart-2)}@supports (color:color-mix(in lab, red, red)){.border-chart-2\/40{border-color:color-mix(in oklab, var(--chart-2) 40%, transparent)}}.border-chart-2\/45{border-color:var(--chart-2)}@supports (color:color-mix(in lab, red, red)){.border-chart-2\/45{border-color:color-mix(in oklab, var(--chart-2) 45%, transparent)}}.border-chart-3\/35{border-color:var(--chart-3)}@supports (color:color-mix(in lab, red, red)){.border-chart-3\/35{border-color:color-mix(in oklab, var(--chart-3) 35%, transparent)}}.border-chart-3\/40{border-color:var(--chart-3)}@supports (color:color-mix(in lab, red, red)){.border-chart-3\/40{border-color:color-mix(in oklab, var(--chart-3) 40%, transparent)}}.border-chart-4\/40{border-color:var(--chart-4)}@supports (color:color-mix(in lab, red, red)){.border-chart-4\/40{border-color:color-mix(in oklab, var(--chart-4) 40%, transparent)}}.border-destructive\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\/40{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.border-destructive\/45{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\/45{border-color:color-mix(in oklab, var(--destructive) 45%, transparent)}}.border-destructive\/50{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\/50{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\/40{border-color:color-mix(in oklab, var(--color-emerald-500) 40%, transparent)}}.border-input{border-color:var(--input)}.border-success\/35{border-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.border-success\/35{border-color:color-mix(in oklab, var(--success) 35%, transparent)}}.border-success\/40{border-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.border-success\/40{border-color:color-mix(in oklab, var(--success) 40%, transparent)}}.border-success\/45{border-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.border-success\/45{border-color:color-mix(in oklab, var(--success) 45%, transparent)}}.border-transparent{border-color:#0000}.border-warning\/30{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\/30{border-color:color-mix(in oklab, var(--warning) 30%, transparent)}}.border-warning\/40{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\/40{border-color:color-mix(in oklab, var(--warning) 40%, transparent)}}.border-warning\/45{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\/45{border-color:color-mix(in oklab, var(--warning) 45%, transparent)}}.border-warning\/60{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\/60{border-color:color-mix(in oklab, var(--warning) 60%, transparent)}}.border-yellow-500\/40{border-color:#edb20066}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\/40{border-color:color-mix(in oklab, var(--color-yellow-500) 40%, transparent)}}.border-t-transparent{border-top-color:#0000}.border-l-border{border-left-color:var(--border)}.border-l-destructive{border-left-color:var(--destructive)}.border-l-success{border-left-color:var(--success)}.border-l-transparent{border-left-color:#0000}.border-l-warning{border-left-color:var(--warning)}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-border{background-color:var(--border)}.bg-brand,.bg-brand\/10{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/10{background-color:color-mix(in oklab, var(--brand) 10%, transparent)}}.bg-brand\/15{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/15{background-color:color-mix(in oklab, var(--brand) 15%, transparent)}}.bg-brand\/20{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/20{background-color:color-mix(in oklab, var(--brand) 20%, transparent)}}.bg-brand\/40{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/40{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.bg-brand\/60{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/60{background-color:color-mix(in oklab, var(--brand) 60%, transparent)}}.bg-brand\/\[0\.13\]{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/\[0\.13\]{background-color:color-mix(in oklab, var(--brand) 13%, transparent)}}.bg-card{background-color:var(--card)}.bg-chart-1\/10{background-color:var(--chart-1)}@supports (color:color-mix(in lab, red, red)){.bg-chart-1\/10{background-color:color-mix(in oklab, var(--chart-1) 10%, transparent)}}.bg-chart-2,.bg-chart-2\/10{background-color:var(--chart-2)}@supports (color:color-mix(in lab, red, red)){.bg-chart-2\/10{background-color:color-mix(in oklab, var(--chart-2) 10%, transparent)}}.bg-destructive,.bg-destructive\/8{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/8{background-color:color-mix(in oklab, var(--destructive) 8%, transparent)}}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-destructive\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\/15{background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground,.bg-muted-foreground\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-muted-foreground\/60{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\/60{background-color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/40{background-color:color-mix(in oklab, var(--muted) 40%, transparent)}}.bg-muted\/45{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/45{background-color:color-mix(in oklab, var(--muted) 45%, transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/50{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-success,.bg-success\/10{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.bg-success\/10{background-color:color-mix(in oklab, var(--success) 10%, transparent)}}.bg-transparent{background-color:#0000}.bg-warning,.bg-warning\/8{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\/8{background-color:color-mix(in oklab, var(--warning) 8%, transparent)}}.bg-warning\/10{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\/10{background-color:color-mix(in oklab, var(--warning) 10%, transparent)}}.bg-yellow-500\/15{background-color:#edb20026}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\/15{background-color:color-mix(in oklab, var(--color-yellow-500) 15%, transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-brand\/10{--tw-gradient-from:var(--brand)}@supports (color:color-mix(in lab, red, red)){.from-brand\/10{--tw-gradient-from:color-mix(in oklab, var(--brand) 10%, transparent)}}.from-brand\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-background{fill:var(--background)}.fill-brand\/15{fill:var(--brand)}@supports (color:color-mix(in lab, red, red)){.fill-brand\/15{fill:color-mix(in oklab, var(--brand) 15%, transparent)}}.fill-brand\/25{fill:var(--brand)}@supports (color:color-mix(in lab, red, red)){.fill-brand\/25{fill:color-mix(in oklab, var(--brand) 25%, transparent)}}.fill-card{fill:var(--card)}.fill-chart-3\/20{fill:var(--chart-3)}@supports (color:color-mix(in lab, red, red)){.fill-chart-3\/20{fill:color-mix(in oklab, var(--chart-3) 20%, transparent)}}.fill-chart-4\/15{fill:var(--chart-4)}@supports (color:color-mix(in lab, red, red)){.fill-chart-4\/15{fill:color-mix(in oklab, var(--chart-4) 15%, transparent)}}.fill-current{fill:currentColor}.fill-foreground{fill:var(--foreground)}.fill-muted{fill:var(--muted)}.fill-muted-foreground{fill:var(--muted-foreground)}.fill-none{fill:none}.fill-success\/20{fill:var(--success)}@supports (color:color-mix(in lab, red, red)){.fill-success\/20{fill:color-mix(in oklab, var(--success) 20%, transparent)}}.fill-warning\/15{fill:var(--warning)}@supports (color:color-mix(in lab, red, red)){.fill-warning\/15{fill:color-mix(in oklab, var(--warning) 15%, transparent)}}.stroke-background{stroke:var(--background)}.stroke-border,.stroke-border\/40{stroke:var(--border)}@supports (color:color-mix(in lab, red, red)){.stroke-border\/40{stroke:color-mix(in oklab, var(--border) 40%, transparent)}}.stroke-border\/60{stroke:var(--border)}@supports (color:color-mix(in lab, red, red)){.stroke-border\/60{stroke:color-mix(in oklab, var(--border) 60%, transparent)}}.stroke-border\/70{stroke:var(--border)}@supports (color:color-mix(in lab, red, red)){.stroke-border\/70{stroke:color-mix(in oklab, var(--border) 70%, transparent)}}.stroke-brand,.stroke-brand\/55{stroke:var(--brand)}@supports (color:color-mix(in lab, red, red)){.stroke-brand\/55{stroke:color-mix(in oklab, var(--brand) 55%, transparent)}}.stroke-chart-2\/70{stroke:var(--chart-2)}@supports (color:color-mix(in lab, red, red)){.stroke-chart-2\/70{stroke:color-mix(in oklab, var(--chart-2) 70%, transparent)}}.stroke-chart-3{stroke:var(--chart-3)}.stroke-chart-4{stroke:var(--chart-4)}.stroke-foreground{stroke:var(--foreground)}.stroke-none{stroke:none}.stroke-success{stroke:var(--success)}.stroke-warning{stroke:var(--warning)}.stroke-1{stroke-width:1px}.stroke-2{stroke-width:2px}.stroke-\[1\.5px\]{stroke-width:1.5px}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-\[5px\]{padding-inline:5px}.px-\[7px\]{padding-inline:7px}.px-\[11px\]{padding-inline:11px}.px-\[13px\]{padding-inline:13px}.px-\[15px\]{padding-inline:15px}.py-0{padding-block:0}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-\[3px\]{padding-block:3px}.py-\[5px\]{padding-block:5px}.py-\[7px\]{padding-block:7px}.py-\[9px\]{padding-block:9px}.py-\[11px\]{padding-block:11px}.py-\[54px\]{padding-block:54px}.py-px{padding-block:1px}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-3\.5{padding-top:calc(var(--spacing) * 3.5)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pt-px{padding-top:1px}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-\[18px\]{padding-left:18px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mt)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-\[11px\]\/\[1\.5\]{font-size:11px;line-height:1.5}.text-\[11px\]\/\[1\.6\]{font-size:11px;line-height:1.6}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[40px\]{font-size:40px}.text-\[44px\]{font-size:44px}.leading-\[1\.4\]{--tw-leading:1.4;line-height:1.4}.leading-\[1\.5\]{--tw-leading:1.5;line-height:1.5}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-\[1\.7\]{--tw-leading:1.7;line-height:1.7}.leading-\[1\.35\]{--tw-leading:1.35;line-height:1.35}.leading-\[8px\]{--tw-leading:8px;line-height:8px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.04em\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\[0\.05em\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\[0\.09em\]{--tw-tracking:.09em;letter-spacing:.09em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.\[overflow-wrap\:anywhere\]{overflow-wrap:anywhere}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.\[tab-size\:2\]{tab-size:2}.text-accent-foreground{color:var(--accent-foreground)}.text-background{color:var(--background)}.text-brand{color:var(--brand)}.text-brand-foreground{color:var(--brand-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-chart-1{color:var(--chart-1)}.text-chart-2{color:var(--chart-2)}.text-chart-3{color:var(--chart-3)}.text-chart-4{color:var(--chart-4)}.text-chart-5{color:var(--chart-5)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-emerald-500{color:var(--color-emerald-500)}.text-foreground,.text-foreground\/60{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\/60{color:color-mix(in oklab, var(--foreground) 60%, transparent)}}.text-muted-foreground,.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/50{color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.text-muted-foreground\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-orange-500{color:var(--color-orange-500)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-success{color:var(--success)}.text-transparent{color:#0000}.text-warning{color:var(--warning)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline-offset-4{text-underline-offset:4px}.caret-brand{caret-color:var(--brand)}.accent-brand{accent-color:var(--brand)}.opacity-15{opacity:.15}.opacity-45{opacity:.45}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-brand\/25{--tw-ring-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ring-brand\/25{--tw-ring-color:color-mix(in oklab, var(--brand) 25%, transparent)}}.ring-brand\/30{--tw-ring-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ring-brand\/30{--tw-ring-color:color-mix(in oklab, var(--brand) 30%, transparent)}}.ring-card{--tw-ring-color:var(--card)}.ring-emerald-500\/30{--tw-ring-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.ring-emerald-500\/30{--tw-ring-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur-2xl{--tw-blur:blur(var(--blur-2xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale-\[0\.4\]{--tw-grayscale:grayscale(.4);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,border-color\]{transition-property:transform,border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-\[400ms\]{--tw-duration:.4s;transition-duration:.4s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-50{--tw-enter-scale:.5}.zoom-in-95{--tw-enter-scale:.95}.\[text-shadow\:0_0_3px_rgba\(0\,0\,0\,0\.6\)\]{text-shadow:0 0 3px #0009}.\[transition\:stroke_0\.1s_ease\]{transition:stroke .1s}.\[vector-effect\:non-scaling-stroke\]{vector-effect:non-scaling-stroke}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[orientation\=horizontal\]\/tabs\:h-9:is(:where(.group\/tabs)[data-orientation=horizontal] *){height:calc(var(--spacing) * 9)}.group-data-\[orientation\=vertical\]\/tabs\:h-fit:is(:where(.group\/tabs)[data-orientation=vertical] *){height:fit-content}.group-data-\[orientation\=vertical\]\/tabs\:w-full:is(:where(.group\/tabs)[data-orientation=vertical] *){width:100%}.group-data-\[orientation\=vertical\]\/tabs\:flex-col:is(:where(.group\/tabs)[data-orientation=vertical] *){flex-direction:column}.group-data-\[orientation\=vertical\]\/tabs\:justify-start:is(:where(.group\/tabs)[data-orientation=vertical] *){justify-content:flex-start}.group-data-\[size\=default\]\/switch\:size-4:is(:where(.group\/switch)[data-size=default] *){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\[size\=sm\]\/switch\:size-3:is(:where(.group\/switch)[data-size=sm] *){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.group-data-\[variant\=line\]\/tabs-list\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *){background-color:#0000}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--primary)}.group-\[\.toast\]\:text-destructive:is(:where(.group).toast *){color:var(--destructive)}.group-\[\.toast\]\:text-foreground:is(:where(.group).toast *){color:var(--foreground)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--primary-foreground)}.group-\[\.toaster\]\:border:is(:where(.group).toaster *){border-style:var(--tw-border-style);border-width:1px}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-brand\/35 ::selection{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.selection\:bg-brand\/35 ::selection{background-color:color-mix(in oklab, var(--brand) 35%, transparent)}}.selection\:bg-brand\/35::selection{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.selection\:bg-brand\/35::selection{background-color:color-mix(in oklab, var(--brand) 35%, transparent)}}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:top-\[25px\]:before{content:var(--tw-content);top:25px}.before\:bottom-0:before{content:var(--tw-content);bottom:0}.before\:left-\[22px\]:before{content:var(--tw-content);left:22px}.before\:w-px:before{content:var(--tw-content);width:1px}.before\:bg-border:before{content:var(--tw-content);background-color:var(--border)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.after\:opacity-0:after{content:var(--tw-content);opacity:0}.after\:transition-opacity:after{content:var(--tw-content);transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.group-data-\[orientation\=horizontal\]\/tabs\:after\:inset-x-0:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);inset-inline:0}.group-data-\[orientation\=horizontal\]\/tabs\:after\:bottom-\[-5px\]:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);bottom:-5px}.group-data-\[orientation\=horizontal\]\/tabs\:after\:h-0\.5:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);height:calc(var(--spacing) * .5)}.group-data-\[orientation\=vertical\]\/tabs\:after\:inset-y-0:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);inset-block:0}.group-data-\[orientation\=vertical\]\/tabs\:after\:-right-1:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);right:calc(var(--spacing) * -1)}.group-data-\[orientation\=vertical\]\/tabs\:after\:w-0\.5:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);width:calc(var(--spacing) * .5)}.last\:before\:hidden:last-child:before{content:var(--tw-content);display:none}.odd\:bg-card\/40:nth-child(odd){background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.odd\:bg-card\/40:nth-child(odd){background-color:color-mix(in oklab, var(--card) 40%, transparent)}}@media (hover:hover){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-brand\/35:hover{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\:border-brand\/35:hover{border-color:color-mix(in oklab, var(--brand) 35%, transparent)}}.hover\:border-brand\/40:hover{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\:border-brand\/40:hover{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.hover\:border-chart-2\/35:hover{border-color:var(--chart-2)}@supports (color:color-mix(in lab, red, red)){.hover\:border-chart-2\/35:hover{border-color:color-mix(in oklab, var(--chart-2) 35%, transparent)}}.hover\:border-muted-foreground\/40:hover{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.hover\:border-muted-foreground\/40:hover{border-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.hover\:bg-accent:hover,.hover\:bg-accent\/50:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent\/50:hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.hover\:bg-brand\/10:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-brand\/10:hover{background-color:color-mix(in oklab, var(--brand) 10%, transparent)}}.hover\:bg-brand\/90:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-brand\/90:hover{background-color:color-mix(in oklab, var(--brand) 90%, transparent)}}.hover\:bg-destructive\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/10:hover{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-foreground\/5:hover{background-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-foreground\/5:hover{background-color:color-mix(in oklab, var(--foreground) 5%, transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:bg-success\/10:hover{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-success\/10:hover{background-color:color-mix(in oklab, var(--success) 10%, transparent)}}.hover\:bg-success\/90:hover{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-success\/90:hover{background-color:color-mix(in oklab, var(--success) 90%, transparent)}}.hover\:bg-warning\/10:hover{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-warning\/10:hover{background-color:color-mix(in oklab, var(--warning) 10%, transparent)}}.hover\:bg-warning\/90:hover{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-warning\/90:hover{background-color:color-mix(in oklab, var(--warning) 90%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-0:focus-visible{border-style:var(--tw-border-style);border-width:0}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=horizontal\]\:flex-col[data-orientation=horizontal]{flex-direction:column}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=default\]\:h-\[1\.15rem\][data-size=default]{height:1.15rem}.data-\[size\=default\]\:w-8[data-size=default]{width:calc(var(--spacing) * 8)}.data-\[size\=sm\]\:h-3\.5[data-size=sm]{height:calc(var(--spacing) * 3.5)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}.data-\[size\=sm\]\:w-6[data-size=sm]{width:calc(var(--spacing) * 6)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab, var(--destructive) 90%, transparent)}}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.group-data-\[variant\=default\]\/tabs-list\:data-\[state\=active\]\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *)[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]:after{content:var(--tw-content);opacity:1}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x:calc(100% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=line\]\:rounded-none[data-variant=line]{border-radius:0}@media not all and (width>=720px){.max-\[720px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media (width>=40rem){.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-\[520px\]{max-width:520px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (width>=64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=80rem){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\:bg-transparent:is(.dark *){background-color:#0000}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\:hover\:text-foreground:is(.dark *):hover{color:var(--foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{border-color:#0000}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab, var(--input) 80%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\[\&_\.j-bool\]\:text-chart-4 .j-bool{color:var(--chart-4)}.\[\&_\.j-key\]\:text-chart-1 .j-key{color:var(--chart-1)}.\[\&_\.j-null\]\:text-muted-foreground .j-null{color:var(--muted-foreground)}.\[\&_\.j-num\]\:text-chart-3 .j-num{color:var(--chart-3)}.\[\&_\.j-str\]\:text-chart-2 .j-str{color:var(--chart-2)}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke=\#ccc]{stroke:var(--border)}@supports (color:color-mix(in lab, red, red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke=\#ccc]{stroke:color-mix(in oklab, var(--border) 50%, transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke=\#fff]{stroke:#0000}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke=\#ccc]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke=\#ccc]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke=\#fff]{stroke:#0000}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline-offset:2px;outline:2px solid #0000}}.\[\&_\.wn-check\]\:inline-block .wn-check{display:inline-block}.\[\&_\.wn-check\]\:w-4 .wn-check{width:calc(var(--spacing) * 4)}.\[\&_\.wn-table-wrap\]\:my-2\.5 .wn-table-wrap{margin-block:calc(var(--spacing) * 2.5)}.\[\&_\.wn-table-wrap\]\:overflow-x-auto .wn-table-wrap{overflow-x:auto}.\[\&_\.wn-table-wrap\]\:rounded-md .wn-table-wrap{border-radius:var(--radius)}.\[\&_\.wn-table-wrap\]\:border .wn-table-wrap{border-style:var(--tw-border-style);border-width:1px}.\[\&_\.wn-table-wrap\]\:border-border .wn-table-wrap{border-color:var(--border)}.\[\&_\.wn-task\]\:-ml-\[18px\] .wn-task{margin-left:-18px}.\[\&_\.wn-task\]\:list-none .wn-task{list-style-type:none}.\[\&_\.wn-task\.done_\.wn-check\]\:text-success .wn-task.done .wn-check{color:var(--success)}.\[\&_a\]\:text-brand a{color:var(--brand)}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\]\:underline-offset-2 a{text-underline-offset:2px}.\[\&_b\]\:font-medium b{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_b\]\:break-words b{overflow-wrap:break-word}.\[\&_b\]\:text-foreground b{color:var(--foreground)}.\[\&_blockquote\]\:my-2 blockquote{margin-block:calc(var(--spacing) * 2)}.\[\&_blockquote\]\:border-l-\[3px\] blockquote{border-left-style:var(--tw-border-style);border-left-width:3px}.\[\&_blockquote\]\:border-brand\/40 blockquote{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.\[\&_blockquote\]\:border-brand\/40 blockquote{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.\[\&_blockquote\]\:px-3\.5 blockquote{padding-inline:calc(var(--spacing) * 3.5)}.\[\&_blockquote\]\:py-1\.5 blockquote{padding-block:calc(var(--spacing) * 1.5)}.\[\&_blockquote\]\:italic blockquote{font-style:italic}.\[\&_code\]\:rounded code{border-radius:.25rem}.\[\&_code\]\:border code{border-style:var(--tw-border-style);border-width:1px}.\[\&_code\]\:border-border code{border-color:var(--border)}.\[\&_code\]\:bg-muted code{background-color:var(--muted)}.\[\&_code\]\:px-1\.5 code{padding-inline:calc(var(--spacing) * 1.5)}.\[\&_code\]\:py-0\.5 code{padding-block:calc(var(--spacing) * .5)}.\[\&_code\]\:font-mono code{font-family:var(--font-mt)}.\[\&_code\]\:text-xs code{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_code\]\:text-brand code{color:var(--brand)}.\[\&_del\]\:text-muted-foreground del{color:var(--muted-foreground)}.\[\&_del\]\:opacity-60 del{opacity:.6}.\[\&_h2\]\:mt-\[18px\] h2{margin-top:18px}.\[\&_h2\]\:mb-1\.5 h2{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h2\]\:text-\[17px\] h2{font-size:17px}.\[\&_h2\]\:font-bold h2{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h2\]\:text-foreground h2{color:var(--foreground)}.\[\&_h3\]\:mt-\[18px\] h3{margin-top:18px}.\[\&_h3\]\:mb-1\.5 h3{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h3\]\:text-\[15px\] h3{font-size:15px}.\[\&_h3\]\:font-bold h3{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h3\]\:text-foreground h3{color:var(--foreground)}.\[\&_h4\]\:mt-\[18px\] h4{margin-top:18px}.\[\&_h4\]\:mb-1\.5 h4{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h4\]\:text-\[14px\] h4{font-size:14px}.\[\&_h4\]\:font-bold h4{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h4\]\:text-foreground h4{color:var(--foreground)}.\[\&_h5\]\:mt-\[18px\] h5{margin-top:18px}.\[\&_h5\]\:mb-1\.5 h5{margin-bottom:calc(var(--spacing) * 1.5)}.\[\&_h5\]\:text-\[14px\] h5{font-size:14px}.\[\&_h5\]\:font-bold h5{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.\[\&_h5\]\:text-foreground h5{color:var(--foreground)}.\[\&_hr\]\:my-3\.5 hr{margin-block:calc(var(--spacing) * 3.5)}.\[\&_hr\]\:border-0 hr{border-style:var(--tw-border-style);border-width:0}.\[\&_hr\]\:border-t hr{border-top-style:var(--tw-border-style);border-top-width:1px}.\[\&_hr\]\:border-border hr{border-color:var(--border)}.\[\&_i\]\:inline-block i{display:inline-block}.\[\&_i\]\:size-2\.5 i{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.\[\&_i\]\:rounded-\[3px\] i{border-radius:3px}.\[\&_img\]\:my-1\.5 img{margin-block:calc(var(--spacing) * 1.5)}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_img\]\:rounded-md img{border-radius:var(--radius)}.\[\&_img\]\:border img{border-style:var(--tw-border-style);border-width:1px}.\[\&_img\]\:border-border img{border-color:var(--border)}.\[\&_li\]\:my-\[3px\] li{margin-block:3px}.\[\&_li\]\:marker\:text-brand li ::marker{color:var(--brand)}.\[\&_li\]\:marker\:text-brand li::marker{color:var(--brand)}.\[\&_li\]\:marker\:text-brand li ::-webkit-details-marker{color:var(--brand)}.\[\&_li\]\:marker\:text-brand li::-webkit-details-marker{color:var(--brand)}.\[\&_ol\]\:my-\[5px\] ol{margin-block:5px}.\[\&_ol\]\:list-decimal ol{list-style-type:decimal}.\[\&_ol\]\:pl-\[22px\] ol{padding-left:22px}.\[\&_p\]\:my-\[5px\] p{margin-block:5px}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_pre\]\:my-2 pre{margin-block:calc(var(--spacing) * 2)}.\[\&_pre\]\:overflow-x-auto pre{overflow-x:auto}.\[\&_pre\]\:rounded-md pre{border-radius:var(--radius)}.\[\&_pre\]\:border pre{border-style:var(--tw-border-style);border-width:1px}.\[\&_pre\]\:border-border pre{border-color:var(--border)}.\[\&_pre\]\:bg-background pre{background-color:var(--background)}.\[\&_pre\]\:p-3 pre{padding:calc(var(--spacing) * 3)}.\[\&_pre_code\]\:border-0 pre code{border-style:var(--tw-border-style);border-width:0}.\[\&_pre_code\]\:bg-transparent pre code{background-color:#0000}.\[\&_pre_code\]\:p-0 pre code{padding:0}.\[\&_pre_code\]\:text-muted-foreground pre code{color:var(--muted-foreground)}.\[\&_strong\]\:font-semibold strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_strong\]\:text-foreground strong{color:var(--foreground)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_table\]\:w-full table{width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_table\]\:font-mono table{font-family:var(--font-mt)}.\[\&_table\]\:text-xs table{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_td\]\:border-b td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_td\]\:border-border td{border-color:var(--border)}.\[\&_td\]\:px-3 td{padding-inline:calc(var(--spacing) * 3)}.\[\&_td\]\:py-\[7px\] td{padding-block:7px}.\[\&_td\]\:text-muted-foreground td{color:var(--muted-foreground)}.\[\&_th\]\:border-b th{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_th\]\:border-border th{border-color:var(--border)}.\[\&_th\]\:bg-muted th{background-color:var(--muted)}.\[\&_th\]\:px-3 th{padding-inline:calc(var(--spacing) * 3)}.\[\&_th\]\:py-\[7px\] th{padding-block:7px}.\[\&_th\]\:text-left th{text-align:left}.\[\&_th\]\:text-\[11px\] th{font-size:11px}.\[\&_th\]\:font-semibold th{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.\[\&_th\]\:tracking-wide th{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.\[\&_th\]\:text-foreground th{color:var(--foreground)}.\[\&_th\]\:uppercase th{text-transform:uppercase}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&_ul\]\:my-\[5px\] ul{margin-block:5px}.\[\&_ul\]\:list-disc ul{list-style-type:disc}.\[\&_ul\]\:pl-\[18px\] ul{padding-left:18px}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>b\]\:text-foreground>b{color:var(--foreground)}.\[\&\>span\]\:inline-flex>span{display:inline-flex}.\[\&\>span\]\:items-center>span{align-items:center}.\[\&\>span\]\:gap-1\.5>span{gap:calc(var(--spacing) * 1.5)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing) * 3)}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentColor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab, var(--secondary) 90%, transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}a.\[a\&\]\:hover\:underline:hover{text-decoration-line:underline}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.conn{display:block;overflow:visible}.conn-grid{fill:none;stroke:var(--border);stroke-opacity:.7;stroke-dasharray:2 7}.conn-sonar{fill:none;stroke:var(--brand);stroke-width:1.5px;opacity:0;animation:3.3s ease-out infinite conn-sonar}.conn-hub-glow{fill:var(--brand);opacity:.22;filter:blur(11px)}.conn-hub-ring{fill:none;stroke:var(--brand);stroke-width:1.4px;stroke-dasharray:4 9;opacity:.7;transform-box:fill-box;transform-origin:50%;animation:15s linear infinite conn-rot}.conn-node text{pointer-events:none}.conn-node-halo{fill:none;stroke-width:2px;transform-box:fill-box;transform-origin:50%;animation:2.4s ease-in-out infinite conn-halo}.conn-link{fill:none;stroke-width:1.6px;opacity:.38}.conn-flow{fill:none;stroke-width:2.4px;stroke-linecap:round;stroke-dasharray:2 13;opacity:.9;filter:drop-shadow(0 0 4px);animation:1.05s linear infinite conn-flow}.conn-packet{filter:drop-shadow(0 0 6px var(--chart-2))}.conn-chevron{fill:none;stroke-width:1.6px;stroke-linecap:round;stroke-linejoin:round;opacity:.6}.conn-tunnel-halo{fill:none;stroke-width:8px;stroke-linecap:round;opacity:.1}.conn-tunnel{fill:none;stroke-width:2.4px;stroke-linecap:round;stroke-dasharray:6 6;animation:.9s linear infinite conn-tunnel-flow}.conn-tunnel-lock{filter:drop-shadow(0 0 4px var(--warning))}@supports (color:color-mix(in lab, red, red)){.conn-tunnel-lock{filter:drop-shadow(0 0 4px color-mix(in srgb, var(--warning) 80%, transparent))}}.conn-tunnel-sat{stroke-width:1.5px;filter:drop-shadow(0 0 5px var(--warning))}@supports (color:color-mix(in lab, red, red)){.conn-tunnel-sat{filter:drop-shadow(0 0 5px color-mix(in srgb, var(--warning) 53%, transparent))}}.conn-tunnel-badge{fill:var(--warning)}@supports (color:color-mix(in lab, red, red)){.conn-tunnel-badge{fill:color-mix(in srgb, var(--warning) 16%, var(--background))}}.conn-tunnel-badge{stroke:var(--warning)}@supports (color:color-mix(in lab, red, red)){.conn-tunnel-badge{stroke:color-mix(in srgb, var(--warning) 60%, var(--border))}}.conn-tunnel-badge{stroke-width:1px}.conn-tunnel-badge-tx{fill:var(--warning);letter-spacing:.02em;font-weight:700}.jump-route__wire{background-image:linear-gradient(90deg, var(--border) 0 50%, transparent 50% 100%);background-size:8px 2px;border-radius:2px;flex:1;min-width:18px;height:2px;animation:.7s linear infinite jump-wire}.jump-route__wire--enc{background-image:linear-gradient(90deg, var(--warning) 0 55%, transparent 55% 100%);min-width:34px;height:3px;box-shadow:0 0 8px -1px var(--warning);background-size:10px 3px;position:relative}@supports (color:color-mix(in lab, red, red)){.jump-route__wire--enc{box-shadow:0 0 8px -1px color-mix(in srgb, var(--warning) 53%, transparent)}}.jump-route__lock{filter:drop-shadow(0 0 3px var(--warning));font-size:11px;animation:2.2s linear infinite jump-lock;position:absolute;top:50%}.topo-sweep{animation:8s linear infinite topo-sweep}.topo-ring{transform-box:fill-box;transform-origin:50%;animation:90s linear infinite reverse topo-ring}.topo-flow{animation:1.4s linear infinite topo-flow}.topo-pulse{transform-box:fill-box;transform-origin:50%;animation:2.6s ease-in-out infinite topo-pulse}.topo-halo{transform-box:fill-box;transform-origin:50%;animation:2.2s ease-out infinite topo-halo}@keyframes topo-sweep{to{transform:rotate(360deg)}}@keyframes topo-ring{to{transform:rotate(360deg)}}@keyframes topo-flow{to{stroke-dashoffset:-16px}}@keyframes topo-pulse{0%,to{opacity:.55;transform:scale(1)}50%{opacity:1;transform:scale(1.12)}}@keyframes topo-halo{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.9)}}@keyframes conn-sonar{0%{r:30px;opacity:.5}to{r:150px;opacity:0}}@keyframes conn-flow{to{stroke-dashoffset:-60px}}@keyframes conn-rot{to{transform:rotate(360deg)}}@keyframes conn-halo{0%,to{opacity:.45;transform:scale(1)}50%{opacity:0;transform:scale(1.55)}}@keyframes conn-tunnel-flow{to{stroke-dashoffset:-24px}}@keyframes jump-wire{to{background-position:8px 0}}@keyframes jump-lock{0%{left:-4px;transform:translateY(-50%)scale(.9)}50%{transform:translateY(-50%)scale(1.1)}to{left:calc(100% - 8px);transform:translateY(-50%)scale(.9)}}@media (prefers-reduced-motion:reduce){.conn-sonar,.topo-sweep{display:none}.conn-flow,.conn-hub-ring,.conn-node-halo,.conn-tunnel,.jump-route__wire,.jump-route__lock,.topo-ring,.topo-flow,.topo-pulse,.topo-halo{animation:none}.conn-packet animateMotion,.conn-tunnel-lock animateMotion{display:none}}:root{--background:#fff;--foreground:#0a0a0a;--card:#fff;--card-foreground:#0a0a0a;--popover:#fff;--popover-foreground:#0a0a0a;--primary:#0a0a0a;--primary-foreground:#fafafa;--secondary:#f4f4f5;--secondary-foreground:#0a0a0a;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#f4f4f5;--accent-foreground:#0a0a0a;--destructive:#e5484d;--destructive-foreground:#fff;--success:#18794e;--warning:#ab6400;--border:#e4e4e7;--input:#e4e4e7;--radius:.5rem;--page-accent:var(--foreground);--page-accent-2:var(--muted-foreground);--brand:var(--page-accent);--brand-foreground:var(--background);--ring:var(--brand);--chart-1:#0068d6;--chart-2:#0f8a7e;--chart-3:#3d8f2f;--chart-4:#a35200;--chart-5:#7048c4;--entity-1:#0068d6;--entity-2:#087a52;--entity-3:#6d3fc4;--entity-4:#a35200;--entity-5:#c02a2a;--entity-6:#0f8a7e;--entity-7:#c0267a;--entity-8:#2563eb;--entity-9:#8a6a00;--entity-10:#b4530f}.dark{--background:#0a0a0a;--foreground:#ededed;--card:#111;--card-foreground:#ededed;--popover:#111;--popover-foreground:#ededed;--primary:#ededed;--primary-foreground:#0a0a0a;--secondary:#1a1a1a;--secondary-foreground:#ededed;--muted:#1a1a1a;--muted-foreground:#a1a1a1;--accent:#1a1a1a;--accent-foreground:#ededed;--destructive:#ff5c5c;--destructive-foreground:#fff;--success:#2dd4a7;--warning:#f5a623;--border:#2a2a2a;--input:#2a2a2a;--chart-1:#3291ff;--chart-2:#2dd4bf;--chart-3:#69d05a;--chart-4:#f5a623;--chart-5:#9d7bff;--entity-1:#3291ff;--entity-2:#34d399;--entity-3:#a78bfa;--entity-4:#f59e0b;--entity-5:#ef4444;--entity-6:#2dd4bf;--entity-7:#f472b6;--entity-8:#60a5fa;--entity-9:#facc15;--entity-10:#fb923c}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}
|