function BV(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var yp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x0={exports:{}},Fd={};var Ik;function zV(){if(Ik)return Fd;Ik=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Fd.Fragment=t,Fd.jsx=n,Fd.jsxs=n,Fd}var Lk;function qV(){return Lk||(Lk=1,x0.exports=zV()),x0.exports}var i=qV(),b0={exports:{}},Ve={};var Bk;function FV(){if(Bk)return Ve;Bk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function N(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}N.prototype.isReactComponent={},N.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,B,"setState")},N.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=N.prototype;function C(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}var A=C.prototype=new O;A.constructor=C,b(A,N.prototype),A.isPureReactComponent=!0;var E=Array.isArray;function k(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function $(I,B,Y){var ne=Y.ref;return{$$typeof:e,type:I,key:B,ref:ne!==void 0?ne:null,props:Y}}function z(I,B){return $(I.type,B,I.props)}function D(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return B[Y]})}var V=/\/+/g;function H(I,B){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):B.toString(36)}function G(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(k,k):(I.status="pending",I.then(function(B){I.status==="pending"&&(I.status="fulfilled",I.value=B)},function(B){I.status==="pending"&&(I.status="rejected",I.reason=B)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function L(I,B,Y,ne,oe){var xe=typeof I;(xe==="undefined"||xe==="boolean")&&(I=null);var ee=!1;if(I===null)ee=!0;else switch(xe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(I.$$typeof){case e:case t:ee=!0;break;case m:return ee=I._init,L(ee(I._payload),B,Y,ne,oe)}}if(ee)return oe=oe(I),ee=ne===""?"."+H(I,0):ne,E(oe)?(Y="",ee!=null&&(Y=ee.replace(V,"$&/")+"/"),L(oe,B,Y,"",function(pe){return pe})):oe!=null&&(D(oe)&&(oe=z(oe,Y+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+ee)),B.push(oe)),1;ee=0;var ae=ne===""?".":ne+":";if(E(I))for(var Z=0;Z>>1,te=L[K];if(0>>1;Ka(Y,F))nea(oe,Y)?(L[K]=oe,L[ne]=F,K=ne):(L[K]=Y,L[B]=F,K=B);else if(nea(oe,F))L[K]=oe,L[ne]=F,K=ne;else break e}}return R}function a(L,R){var F=L.sortIndex-R.sortIndex;return F!==0?F:L.id-R.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,x=!1,j=!1,b=!1,w=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(L){for(var R=n(f);R!==null;){if(R.callback===null)r(f);else if(R.startTime<=L)r(f),R.sortIndex=R.expirationTime,t(d,R);else break;R=n(f)}}function E(L){if(b=!1,A(L),!j)if(n(d)!==null)j=!0,k||(k=!0,U());else{var R=n(f);R!==null&&G(E,R.startTime-L)}}var k=!1,T=-1,M=5,$=-1;function z(){return w?!0:!(e.unstable_now()-$L&&z());){var K=p.callback;if(typeof K=="function"){p.callback=null,g=p.priorityLevel;var te=K(p.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){p.callback=te,A(L),R=!0;break t}p===n(d)&&r(d),A(L)}else r(d);p=n(d)}if(p!==null)R=!0;else{var I=n(f);I!==null&&G(E,I.startTime-L),R=!1}}break e}finally{p=null,g=F,x=!1}R=void 0}}finally{R?U():k=!1}}}var U;if(typeof C=="function")U=function(){C(D)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,H=V.port2;V.port1.onmessage=D,U=function(){H.postMessage(null)}}else U=function(){N(D,0)};function G(L,R){T=N(function(){L(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125K?(L.sortIndex=F,t(f,L),n(d)===null&&L===n(f)&&(b?(O(T),T=-1):b=!0,G(E,F-K))):(L.sortIndex=te,t(d,L),j||x||(j=!0,k||(k=!0,U()))),L},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(L){var R=g;return function(){var F=g;g=R;try{return L.apply(this,arguments)}finally{g=F}}}})(S0)),S0}var Fk;function HV(){return Fk||(Fk=1,j0.exports=UV()),j0.exports}var _0={exports:{}},ir={};var Uk;function WV(){if(Uk)return ir;Uk=1;var e=bh();function t(d){var f="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),_0.exports=WV(),_0.exports}var Wk;function VV(){if(Wk)return Ud;Wk=1;var e=HV(),t=bh(),n=LL();function r(s){var c="https://react.dev/errors/"+s;if(1te||(s.current=K[te],K[te]=null,te--)}function Y(s,c){te++,K[te]=s.current,s.current=c}var ne=I(null),oe=I(null),xe=I(null),ee=I(null);function ae(s,c){switch(Y(xe,c),Y(oe,s),Y(ne,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?ok(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=ok(c),s=sk(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(ne),Y(ne,s)}function Z(){B(ne),B(oe),B(xe)}function pe(s){s.memoizedState!==null&&Y(ee,s);var c=ne.current,h=sk(c,s.type);c!==h&&(Y(oe,s),Y(ne,h))}function je(s){oe.current===s&&(B(ne),B(oe)),ee.current===s&&(B(ee),Ld._currentValue=F)}var le,Re;function _e(s){if(le===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);le=c&&c[1]||"",Re=-1)":-1S||X[v]!==se[S]){var ge=` `+X[v].replace(" at new "," at ");return s.displayName&&ge.includes("")&&(ge=ge.replace("",s.displayName)),ge}while(1<=v&&0<=S);break}}}finally{me=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?_e(h):""}function Le(s,c){switch(s.tag){case 26:case 27:case 5:return _e(s.type);case 16:return _e("Lazy");case 13:return s.child!==c&&c!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ve(s.type,!1);case 11:return ve(s.type.render,!1);case 1:return ve(s.type,!0);case 31:return _e("Activity");default:return""}}function Dt(s){try{var c="",h=null;do c+=Le(s,h),h=s,s=s.return;while(s);return c}catch(v){return` Error generating stack: `+v.message+` `+v.stack}}var On=Object.prototype.hasOwnProperty,vr=e.unstable_scheduleCallback,rr=e.unstable_cancelCallback,gr=e.unstable_shouldYield,lt=e.unstable_requestPaint,rt=e.unstable_now,$n=e.unstable_getCurrentPriorityLevel,ms=e.unstable_ImmediatePriority,am=e.unstable_UserBlockingPriority,Ml=e.unstable_NormalPriority,rx=e.unstable_LowPriority,im=e.unstable_IdlePriority,ax=e.log,ix=e.unstable_setDisableYieldValue,ps=null,yr=null;function Ya(s){if(typeof ax=="function"&&ix(s),yr&&typeof yr.setStrictMode=="function")try{yr.setStrictMode(ps,s)}catch{}}var ar=Math.clz32?Math.clz32:Lt,ox=Math.log,et=Math.LN2;function Lt(s){return s>>>=0,s===0?32:31-(ox(s)/et|0)|0}var He=256,gt=262144,In=4194304;function tt(s){var c=s&42;if(c!==0)return c;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Pl(s,c,h){var v=s.pendingLanes;if(v===0)return 0;var S=0,_=s.suspendedLanes,P=s.pingedLanes;s=s.warmLanes;var q=v&134217727;return q!==0?(v=q&~_,v!==0?S=tt(v):(P&=q,P!==0?S=tt(P):h||(h=q&~s,h!==0&&(S=tt(h))))):(q=v&~_,q!==0?S=tt(q):P!==0?S=tt(P):h||(h=v&~s,h!==0&&(S=tt(h)))),S===0?0:c!==0&&c!==S&&(c&_)===0&&(_=S&-S,h=c&-c,_>=h||_===32&&(h&4194048)!==0)?c:S}function vs(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function sx(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rl(){var s=In;return In<<=1,(In&62914560)===0&&(In=4194304),s}function gs(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Qu(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function CW(s,c,h,v,S,_){var P=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var q=s.entanglements,X=s.expirationTimes,se=s.hiddenUpdates;for(h=P&~h;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var PW=/[\n"\\]/g;function la(s){return s.replace(PW,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function hx(s,c,h,v,S,_,P,q){s.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.type=P:s.removeAttribute("type"),c!=null?P==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+sa(c)):s.value!==""+sa(c)&&(s.value=""+sa(c)):P!=="submit"&&P!=="reset"||s.removeAttribute("value"),c!=null?mx(s,P,sa(c)):h!=null?mx(s,P,sa(h)):v!=null&&s.removeAttribute("value"),S==null&&_!=null&&(s.defaultChecked=!!_),S!=null&&(s.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?s.name=""+sa(q):s.removeAttribute("name")}function eA(s,c,h,v,S,_,P,q){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),c!=null||h!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){fx(s);return}h=h!=null?""+sa(h):"",c=c!=null?""+sa(c):h,q||c===s.value||(s.value=c),s.defaultValue=c}v=v??S,v=typeof v!="function"&&typeof v!="symbol"&&!!v,s.checked=q?s.checked:!!v,s.defaultChecked=!!v,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(s.name=P),fx(s)}function mx(s,c,h){c==="number"&&lm(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function zl(s,c,h,v){if(s=s.options,c){c={};for(var S=0;S"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xx=!1;if(Ni)try{var nd={};Object.defineProperty(nd,"passive",{get:function(){xx=!0}}),window.addEventListener("test",nd,nd),window.removeEventListener("test",nd,nd)}catch{xx=!1}var po=null,bx=null,um=null;function sA(){if(um)return um;var s,c=bx,h=c.length,v,S="value"in po?po.value:po.textContent,_=S.length;for(s=0;s=id),hA=" ",mA=!1;function pA(s,c){switch(s){case"keyup":return s7.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vA(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Hl=!1;function c7(s,c){switch(s){case"compositionend":return vA(c);case"keypress":return c.which!==32?null:(mA=!0,hA);case"textInput":return s=c.data,s===hA&&mA?null:s;default:return null}}function u7(s,c){if(Hl)return s==="compositionend"||!Nx&&pA(s,c)?(s=sA(),um=bx=po=null,Hl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-s};s=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=_A(h)}}function OA(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?OA(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function CA(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=lm(s.document);c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=lm(s.document)}return c}function Ex(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var y7=Ni&&"documentMode"in document&&11>=document.documentMode,Wl=null,Ax=null,cd=null,Tx=!1;function EA(s,c,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Tx||Wl==null||Wl!==lm(v)||(v=Wl,"selectionStart"in v&&Ex(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),cd&&ld(cd,v)||(cd=v,v=rp(Ax,"onSelect"),0>=P,S-=P,Ka=1<<32-ar(c)+S|h<Qe?(ut=De,De=null):ut=De.sibling;var mt=ce(re,De,ie[Qe],be);if(mt===null){De===null&&(De=ut);break}s&&De&&mt.alternate===null&&c(re,De),Q=_(mt,Q,Qe),ht===null?Ie=mt:ht.sibling=mt,ht=mt,De=ut}if(Qe===ie.length)return h(re,De),ft&&Ci(re,Qe),Ie;if(De===null){for(;QeQe?(ut=De,De=null):ut=De.sibling;var Io=ce(re,De,mt.value,be);if(Io===null){De===null&&(De=ut);break}s&&De&&Io.alternate===null&&c(re,De),Q=_(Io,Q,Qe),ht===null?Ie=Io:ht.sibling=Io,ht=Io,De=ut}if(mt.done)return h(re,De),ft&&Ci(re,Qe),Ie;if(De===null){for(;!mt.done;Qe++,mt=ie.next())mt=we(re,mt.value,be),mt!==null&&(Q=_(mt,Q,Qe),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return ft&&Ci(re,Qe),Ie}for(De=v(De);!mt.done;Qe++,mt=ie.next())mt=he(De,re,Qe,mt.value,be),mt!==null&&(s&&mt.alternate!==null&&De.delete(mt.key===null?Qe:mt.key),Q=_(mt,Q,Qe),ht===null?Ie=mt:ht.sibling=mt,ht=mt);return s&&De.forEach(function(LV){return c(re,LV)}),ft&&Ci(re,Qe),Ie}function Mt(re,Q,ie,be){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:e:{for(var Ie=ie.key;Q!==null;){if(Q.key===Ie){if(Ie=ie.type,Ie===b){if(Q.tag===7){h(re,Q.sibling),be=S(Q,ie.props.children),be.return=re,re=be;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===M&&Es(Ie)===Q.type){h(re,Q.sibling),be=S(Q,ie.props),pd(be,ie),be.return=re,re=be;break e}h(re,Q);break}else c(re,Q);Q=Q.sibling}ie.type===b?(be=Ss(ie.props.children,re.mode,be,ie.key),be.return=re,re=be):(be=bm(ie.type,ie.key,ie.props,null,re.mode,be),pd(be,ie),be.return=re,re=be)}return P(re);case j:e:{for(Ie=ie.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===ie.containerInfo&&Q.stateNode.implementation===ie.implementation){h(re,Q.sibling),be=S(Q,ie.children||[]),be.return=re,re=be;break e}else{h(re,Q);break}else c(re,Q);Q=Q.sibling}be=Ix(ie,re.mode,be),be.return=re,re=be}return P(re);case M:return ie=Es(ie),Mt(re,Q,ie,be)}if(G(ie))return Ae(re,Q,ie,be);if(U(ie)){if(Ie=U(ie),typeof Ie!="function")throw Error(r(150));return ie=Ie.call(ie),ze(re,Q,ie,be)}if(typeof ie.then=="function")return Mt(re,Q,Cm(ie),be);if(ie.$$typeof===C)return Mt(re,Q,Sm(re,ie),be);Em(re,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Q!==null&&Q.tag===6?(h(re,Q.sibling),be=S(Q,ie),be.return=re,re=be):(h(re,Q),be=$x(ie,re.mode,be),be.return=re,re=be),P(re)):h(re,Q)}return function(re,Q,ie,be){try{md=0;var Ie=Mt(re,Q,ie,be);return nc=null,Ie}catch(De){if(De===tc||De===Nm)throw De;var ht=qr(29,De,null,re.mode);return ht.lanes=be,ht.return=re,ht}finally{}}}var Ts=ZA(!0),QA=ZA(!1),bo=!1;function Kx(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xx(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function wo(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function jo(s,c,h){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(yt&2)!==0){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,c=xm(s),DA(s,null,h),c}return ym(s,v,c,h),xm(s)}function vd(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var v=c.lanes;v&=s.pendingLanes,h|=v,c.lanes=h,UE(s,h)}}function Zx(s,c){var h=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var S=null,_=null;if(h=h.firstBaseUpdate,h!==null){do{var P={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};_===null?S=_=P:_=_.next=P,h=h.next}while(h!==null);_===null?S=_=c:_=_.next=c}else S=_=c;h={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:_,shared:v.shared,callbacks:v.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}var Qx=!1;function gd(){if(Qx){var s=ec;if(s!==null)throw s}}function yd(s,c,h,v){Qx=!1;var S=s.updateQueue;bo=!1;var _=S.firstBaseUpdate,P=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var X=q,se=X.next;X.next=null,P===null?_=se:P.next=se,P=X;var ge=s.alternate;ge!==null&&(ge=ge.updateQueue,q=ge.lastBaseUpdate,q!==P&&(q===null?ge.firstBaseUpdate=se:q.next=se,ge.lastBaseUpdate=X))}if(_!==null){var we=S.baseState;P=0,ge=se=X=null,q=_;do{var ce=q.lane&-536870913,he=ce!==q.lane;if(he?(ct&ce)===ce:(v&ce)===ce){ce!==0&&ce===Jl&&(Qx=!0),ge!==null&&(ge=ge.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ae=s,ze=q;ce=c;var Mt=h;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){we=Ae.call(Mt,we,ce);break e}we=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ce=typeof Ae=="function"?Ae.call(Mt,we,ce):Ae,ce==null)break e;we=p({},we,ce);break e;case 2:bo=!0}}ce=q.callback,ce!==null&&(s.flags|=64,he&&(s.flags|=8192),he=S.callbacks,he===null?S.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ge===null?(se=ge=he,X=we):ge=ge.next=he,P|=ce;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;he=q,q=he.next,he.next=null,S.lastBaseUpdate=he,S.shared.pending=null}}while(!0);ge===null&&(X=we),S.baseState=X,S.firstBaseUpdate=se,S.lastBaseUpdate=ge,_===null&&(S.shared.lanes=0),Co|=P,s.lanes=P,s.memoizedState=we}}function JA(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function eT(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s_?_:8;var P=L.T,q={};L.T=q,gb(s,!1,c,h);try{var X=S(),se=L.S;if(se!==null&&se(q,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=C7(X,v);wd(s,c,ge,Vr(s))}else wd(s,c,v,Vr(s))}catch(we){wd(s,c,{then:function(){},status:"rejected",reason:we},Vr())}finally{R.p=_,P!==null&&q.types!==null&&(P.types=q.types),L.T=P}}function P7(){}function pb(s,c,h,v){if(s.tag!==5)throw Error(r(476));var S=MT(s).queue;kT(s,S,c,F,h===null?P7:function(){return PT(s),h(v)})}function MT(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:F},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function PT(s){var c=MT(s);c.next===null&&(c=s.alternate.memoizedState),wd(s,c.next.queue,{},Vr())}function vb(){return Xn(Ld)}function RT(){return ln().memoizedState}function DT(){return ln().memoizedState}function R7(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=Vr();s=wo(h);var v=jo(c,s,h);v!==null&&(Tr(v,c,h),vd(v,c,h)),c={cache:Wx()},s.payload=c;return}c=c.return}}function D7(s,c,h){var v=Vr();h={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Lm(s)?IT(c,h):(h=Rx(s,c,h,v),h!==null&&(Tr(h,s,v),LT(h,c,v)))}function $T(s,c,h){var v=Vr();wd(s,c,h,v)}function wd(s,c,h,v){var S={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Lm(s))IT(c,S);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var P=c.lastRenderedState,q=_(P,h);if(S.hasEagerState=!0,S.eagerState=q,zr(q,P))return ym(s,c,S,0),$t===null&&gm(),!1}catch{}finally{}if(h=Rx(s,c,S,v),h!==null)return Tr(h,s,v),LT(h,c,v),!0}return!1}function gb(s,c,h,v){if(v={lane:2,revertLane:Kb(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Lm(s)){if(c)throw Error(r(479))}else c=Rx(s,h,v,2),c!==null&&Tr(c,s,2)}function Lm(s){var c=s.alternate;return s===Ke||c!==null&&c===Ke}function IT(s,c){ac=km=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function LT(s,c,h){if((h&4194048)!==0){var v=c.lanes;v&=s.pendingLanes,h|=v,c.lanes=h,UE(s,h)}}var jd={readContext:Xn,use:Rm,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useLayoutEffect:rn,useInsertionEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useSyncExternalStore:rn,useId:rn,useHostTransitionStatus:rn,useFormState:rn,useActionState:rn,useOptimistic:rn,useMemoCache:rn,useCacheRefresh:rn};jd.useEffectEvent=rn;var BT={readContext:Xn,use:Rm,useCallback:function(s,c){return xr().memoizedState=[s,c===void 0?null:c],s},useContext:Xn,useEffect:jT,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,$m(4194308,4,OT.bind(null,c,s),h)},useLayoutEffect:function(s,c){return $m(4194308,4,s,c)},useInsertionEffect:function(s,c){$m(4,2,s,c)},useMemo:function(s,c){var h=xr();c=c===void 0?null:c;var v=s();if(ks){Ya(!0);try{s()}finally{Ya(!1)}}return h.memoizedState=[v,c],v},useReducer:function(s,c,h){var v=xr();if(h!==void 0){var S=h(c);if(ks){Ya(!0);try{h(c)}finally{Ya(!1)}}}else S=c;return v.memoizedState=v.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},v.queue=s,s=s.dispatch=D7.bind(null,Ke,s),[v.memoizedState,s]},useRef:function(s){var c=xr();return s={current:s},c.memoizedState=s},useState:function(s){s=ub(s);var c=s.queue,h=$T.bind(null,Ke,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:hb,useDeferredValue:function(s,c){var h=xr();return mb(h,s,c)},useTransition:function(){var s=ub(!1);return s=kT.bind(null,Ke,s.queue,!0,!1),xr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var v=Ke,S=xr();if(ft){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),$t===null)throw Error(r(349));(ct&127)!==0||oT(v,c,h)}S.memoizedState=h;var _={value:h,getSnapshot:c};return S.queue=_,jT(lT.bind(null,v,_,s),[s]),v.flags|=2048,oc(9,{destroy:void 0},sT.bind(null,v,_,h,c),null),h},useId:function(){var s=xr(),c=$t.identifierPrefix;if(ft){var h=Xa,v=Ka;h=(v&~(1<<32-ar(v)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Mm++,0<\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof v.is=="string"?P.createElement("select",{is:v.is}):P.createElement("select"),v.multiple?_.multiple=!0:v.size&&(_.size=v.size);break;default:_=typeof v.is=="string"?P.createElement(S,{is:v.is}):P.createElement(S)}}_[Yn]=c,_[_r]=v;e:for(P=c.child;P!==null;){if(P.tag===5||P.tag===6)_.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===c)break e;for(;P.sibling===null;){if(P.return===null||P.return===c)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}c.stateNode=_;e:switch(Qn(_,S,v),S){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Pi(c)}}return Wt(c),kb(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==v&&Pi(c);else{if(typeof v!="string"&&c.stateNode===null)throw Error(r(166));if(s=xe.current,Zl(c)){if(s=c.stateNode,h=c.memoizedProps,v=null,S=Kn,S!==null)switch(S.tag){case 27:case 5:v=S.memoizedProps}s[Yn]=c,s=!!(s.nodeValue===h||v!==null&&v.suppressHydrationWarning===!0||ak(s.nodeValue,h)),s||yo(c,!0)}else s=ap(s).createTextNode(v),s[Yn]=c,c.stateNode=s}return Wt(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(v=Zl(c),h!==null){if(s===null){if(!v)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Yn]=c}else _s(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Wt(c),s=!1}else h=qx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(Ur(c),c):(Ur(c),null);if((c.flags&128)!==0)throw Error(r(558))}return Wt(c),null;case 13:if(v=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=Zl(c),v!==null&&v.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Yn]=c}else _s(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Wt(c),S=!1}else S=qx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=S),S=!0;if(!S)return c.flags&256?(Ur(c),c):(Ur(c),null)}return Ur(c),(c.flags&128)!==0?(c.lanes=h,c):(h=v!==null,s=s!==null&&s.memoizedState!==null,h&&(v=c.child,S=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(S=v.alternate.memoizedState.cachePool.pool),_=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(_=v.memoizedState.cachePool.pool),_!==S&&(v.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),Um(c,c.updateQueue),Wt(c),null);case 4:return Z(),s===null&&Jb(c.stateNode.containerInfo),Wt(c),null;case 10:return Ai(c.type),Wt(c),null;case 19:if(B(sn),v=c.memoizedState,v===null)return Wt(c),null;if(S=(c.flags&128)!==0,_=v.rendering,_===null)if(S)_d(v,!1);else{if(an!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(_=Tm(s),_!==null){for(c.flags|=128,_d(v,!1),s=_.updateQueue,c.updateQueue=s,Um(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)$A(h,s),h=h.sibling;return Y(sn,sn.current&1|2),ft&&Ci(c,v.treeForkCount),c.child}s=s.sibling}v.tail!==null&&rt()>Ym&&(c.flags|=128,S=!0,_d(v,!1),c.lanes=4194304)}else{if(!S)if(s=Tm(_),s!==null){if(c.flags|=128,S=!0,s=s.updateQueue,c.updateQueue=s,Um(c,s),_d(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!ft)return Wt(c),null}else 2*rt()-v.renderingStartTime>Ym&&h!==536870912&&(c.flags|=128,S=!0,_d(v,!1),c.lanes=4194304);v.isBackwards?(_.sibling=c.child,c.child=_):(s=v.last,s!==null?s.sibling=_:c.child=_,v.last=_)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=rt(),s.sibling=null,h=sn.current,Y(sn,S?h&1|2:h&1),ft&&Ci(c,v.treeForkCount),s):(Wt(c),null);case 22:case 23:return Ur(c),eb(),v=c.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(c.flags|=8192):v&&(c.flags|=8192),v?(h&536870912)!==0&&(c.flags&128)===0&&(Wt(c),c.subtreeFlags&6&&(c.flags|=8192)):Wt(c),h=c.updateQueue,h!==null&&Um(c,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==h&&(c.flags|=2048),s!==null&&B(Cs),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),Ai(dn),Wt(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function z7(s,c){switch(Bx(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ai(dn),Z(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return je(c),null;case 31:if(c.memoizedState!==null){if(Ur(c),c.alternate===null)throw Error(r(340));_s()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Ur(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));_s()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return B(sn),null;case 4:return Z(),null;case 10:return Ai(c.type),null;case 22:case 23:return Ur(c),eb(),s!==null&&B(Cs),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Ai(dn),null;case 25:return null;default:return null}}function c2(s,c){switch(Bx(c),c.tag){case 3:Ai(dn),Z();break;case 26:case 27:case 5:je(c);break;case 4:Z();break;case 31:c.memoizedState!==null&&Ur(c);break;case 13:Ur(c);break;case 19:B(sn);break;case 10:Ai(c.type);break;case 22:case 23:Ur(c),eb(),s!==null&&B(Cs);break;case 24:Ai(dn)}}function Nd(s,c){try{var h=c.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var S=v.next;h=S;do{if((h.tag&s)===s){v=void 0;var _=h.create,P=h.inst;v=_(),P.destroy=v}h=h.next}while(h!==S)}}catch(q){Nt(c,c.return,q)}}function No(s,c,h){try{var v=c.updateQueue,S=v!==null?v.lastEffect:null;if(S!==null){var _=S.next;v=_;do{if((v.tag&s)===s){var P=v.inst,q=P.destroy;if(q!==void 0){P.destroy=void 0,S=c;var X=h,se=q;try{se()}catch(ge){Nt(S,X,ge)}}}v=v.next}while(v!==_)}}catch(ge){Nt(c,c.return,ge)}}function u2(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{eT(c,h)}catch(v){Nt(s,s.return,v)}}}function d2(s,c,h){h.props=Ms(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(v){Nt(s,c,v)}}function Od(s,c){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var v=s.stateNode;break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof h=="function"?s.refCleanup=h(v):h.current=v}}catch(S){Nt(s,c,S)}}function Za(s,c){var h=s.ref,v=s.refCleanup;if(h!==null)if(typeof v=="function")try{v()}catch(S){Nt(s,c,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){Nt(s,c,S)}else h.current=null}function f2(s){var c=s.type,h=s.memoizedProps,v=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&v.focus();break e;case"img":h.src?v.src=h.src:h.srcSet&&(v.srcset=h.srcSet)}}catch(S){Nt(s,s.return,S)}}function Mb(s,c,h){try{var v=s.stateNode;lV(v,s.type,h,c),v[_r]=c}catch(S){Nt(s,s.return,S)}}function h2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Mo(s.type)||s.tag===4}function Pb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||h2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Mo(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Rb(s,c,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(s),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=_i));else if(v!==4&&(v===27&&Mo(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(Rb(s,c,h),s=s.sibling;s!==null;)Rb(s,c,h),s=s.sibling}function Hm(s,c,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(v!==4&&(v===27&&Mo(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Hm(s,c,h),s=s.sibling;s!==null;)Hm(s,c,h),s=s.sibling}function m2(s){var c=s.stateNode,h=s.memoizedProps;try{for(var v=s.type,S=c.attributes;S.length;)c.removeAttributeNode(S[0]);Qn(c,v,h),c[Yn]=s,c[_r]=h}catch(_){Nt(s,s.return,_)}}var Ri=!1,mn=!1,Db=!1,p2=typeof WeakSet=="function"?WeakSet:Set,Bn=null;function q7(s,c){if(s=s.containerInfo,n0=dp,s=CA(s),Ex(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var S=v.anchorOffset,_=v.focusNode;v=v.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var P=0,q=-1,X=-1,se=0,ge=0,we=s,ce=null;t:for(;;){for(var he;we!==h||S!==0&&we.nodeType!==3||(q=P+S),we!==_||v!==0&&we.nodeType!==3||(X=P+v),we.nodeType===3&&(P+=we.nodeValue.length),(he=we.firstChild)!==null;)ce=we,we=he;for(;;){if(we===s)break t;if(ce===h&&++se===S&&(q=P),ce===_&&++ge===v&&(X=P),(he=we.nextSibling)!==null)break;we=ce,ce=we.parentNode}we=he}h=q===-1||X===-1?null:{start:q,end:X}}else h=null}h=h||{start:0,end:0}}else h=null;for(r0={focusedElem:s,selectionRange:h},dp=!1,Bn=c;Bn!==null;)if(c=Bn,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Bn=s;else for(;Bn!==null;){switch(c=Bn,_=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h title"))),Qn(_,v,h),_[Yn]=s,Ln(_),v=_;break e;case"link":var P=wk("link","href",S).get(v+(h.href||""));if(P){for(var q=0;qMt&&(P=Mt,Mt=ze,ze=P);var re=NA(q,ze),Q=NA(q,Mt);if(re&&Q&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==Q.node||he.focusOffset!==Q.offset)){var ie=we.createRange();ie.setStart(re.node,re.offset),he.removeAllRanges(),ze>Mt?(he.addRange(ie),he.extend(Q.node,Q.offset)):(ie.setEnd(Q.node,Q.offset),he.addRange(ie))}}}}for(we=[],he=q;he=he.parentNode;)he.nodeType===1&&we.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;qh?32:h,L.T=null,h=Fb,Fb=null;var _=Ao,P=Bi;if(Cn=0,dc=Ao=null,Bi=0,(yt&6)!==0)throw Error(r(331));var q=yt;if(yt|=4,O2(_.current),S2(_,_.current,P,h),yt=q,Md(0,!1),yr&&typeof yr.onPostCommitFiberRoot=="function")try{yr.onPostCommitFiberRoot(ps,_)}catch{}return!0}finally{R.p=S,L.T=v,H2(s,c)}}function V2(s,c,h){c=ua(h,c),c=wb(s.stateNode,c,2),s=jo(s,c,2),s!==null&&(Qu(s,2),Qa(s))}function Nt(s,c,h){if(s.tag===3)V2(s,s,h);else for(;c!==null;){if(c.tag===3){V2(c,s,h);break}else if(c.tag===1){var v=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Eo===null||!Eo.has(v))){s=ua(h,s),h=GT(2),v=jo(c,h,2),v!==null&&(YT(h,v,c,s),Qu(v,2),Qa(v));break}}c=c.return}}function Vb(s,c,h){var v=s.pingCache;if(v===null){v=s.pingCache=new H7;var S=new Set;v.set(c,S)}else S=v.get(c),S===void 0&&(S=new Set,v.set(c,S));S.has(h)||(Lb=!0,S.add(h),s=K7.bind(null,s,c,h),c.then(s,s))}function K7(s,c,h){var v=s.pingCache;v!==null&&v.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,$t===s&&(ct&h)===h&&(an===4||an===3&&(ct&62914560)===ct&&300>rt()-Gm?(yt&2)===0&&fc(s,0):Bb|=h,uc===ct&&(uc=0)),Qa(s)}function G2(s,c){c===0&&(c=Rl()),s=js(s,c),s!==null&&(Qu(s,c),Qa(s))}function X7(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),G2(s,h)}function Z7(s,c){var h=0;switch(s.tag){case 31:case 13:var v=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(c),G2(s,h)}function Q7(s,c){return vr(s,c)}var ep=null,mc=null,Gb=!1,tp=!1,Yb=!1,ko=0;function Qa(s){s!==mc&&s.next===null&&(mc===null?ep=mc=s:mc=mc.next=s),tp=!0,Gb||(Gb=!0,eV())}function Md(s,c){if(!Yb&&tp){Yb=!0;do for(var h=!1,v=ep;v!==null;){if(s!==0){var S=v.pendingLanes;if(S===0)var _=0;else{var P=v.suspendedLanes,q=v.pingedLanes;_=(1<<31-ar(42|s)+1)-1,_&=S&~(P&~q),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(h=!0,Z2(v,_))}else _=ct,_=Pl(v,v===$t?_:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(_&3)===0||vs(v,_)||(h=!0,Z2(v,_));v=v.next}while(h);Yb=!1}}function J7(){Y2()}function Y2(){tp=Gb=!1;var s=0;ko!==0&&uV()&&(s=ko);for(var c=rt(),h=null,v=ep;v!==null;){var S=v.next,_=K2(v,c);_===0?(v.next=null,h===null?ep=S:h.next=S,S===null&&(mc=h)):(h=v,(s!==0||(_&3)!==0)&&(tp=!0)),v=S}Cn!==0&&Cn!==5||Md(s),ko!==0&&(ko=0)}function K2(s,c){for(var h=s.suspendedLanes,v=s.pingedLanes,S=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var P=31-ar(_),q=1<q)break;var ge=X.transferSize,we=X.initiatorType;ge&&ik(we)&&(X=X.responseEnd,P+=ge*(X"u"?null:document;function gk(s,c,h){var v=pc;if(v&&typeof c=="string"&&c){var S=la(c);S='link[rel="'+s+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),vk.has(S)||(vk.add(S),s={rel:s,crossOrigin:h,href:c},v.querySelector(S)===null&&(c=v.createElement("link"),Qn(c,"link",s),Ln(c),v.head.appendChild(c)))}}function xV(s){zi.D(s),gk("dns-prefetch",s,null)}function bV(s,c){zi.C(s,c),gk("preconnect",s,c)}function wV(s,c,h){zi.L(s,c,h);var v=pc;if(v&&s&&c){var S='link[rel="preload"][as="'+la(c)+'"]';c==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+la(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+la(h.imageSizes)+'"]')):S+='[href="'+la(s)+'"]';var _=S;switch(c){case"style":_=vc(s);break;case"script":_=gc(s)}va.has(_)||(s=p({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:s,as:c},h),va.set(_,s),v.querySelector(S)!==null||c==="style"&&v.querySelector($d(_))||c==="script"&&v.querySelector(Id(_))||(c=v.createElement("link"),Qn(c,"link",s),Ln(c),v.head.appendChild(c)))}}function jV(s,c){zi.m(s,c);var h=pc;if(h&&s){var v=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+la(v)+'"][href="'+la(s)+'"]',_=S;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=gc(s)}if(!va.has(_)&&(s=p({rel:"modulepreload",href:s},c),va.set(_,s),h.querySelector(S)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Id(_)))return}v=h.createElement("link"),Qn(v,"link",s),Ln(v),h.head.appendChild(v)}}}function SV(s,c,h){zi.S(s,c,h);var v=pc;if(v&&s){var S=Ll(v).hoistableStyles,_=vc(s);c=c||"default";var P=S.get(_);if(!P){var q={loading:0,preload:null};if(P=v.querySelector($d(_)))q.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":c},h),(h=va.get(_))&&u0(s,h);var X=P=v.createElement("link");Ln(X),Qn(X,"link",s),X._p=new Promise(function(se,ge){X.onload=se,X.onerror=ge}),X.addEventListener("load",function(){q.loading|=1}),X.addEventListener("error",function(){q.loading|=2}),q.loading|=4,op(P,c,v)}P={type:"stylesheet",instance:P,count:1,state:q},S.set(_,P)}}}function _V(s,c){zi.X(s,c);var h=pc;if(h&&s){var v=Ll(h).hoistableScripts,S=gc(s),_=v.get(S);_||(_=h.querySelector(Id(S)),_||(s=p({src:s,async:!0},c),(c=va.get(S))&&d0(s,c),_=h.createElement("script"),Ln(_),Qn(_,"link",s),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function NV(s,c){zi.M(s,c);var h=pc;if(h&&s){var v=Ll(h).hoistableScripts,S=gc(s),_=v.get(S);_||(_=h.querySelector(Id(S)),_||(s=p({src:s,async:!0,type:"module"},c),(c=va.get(S))&&d0(s,c),_=h.createElement("script"),Ln(_),Qn(_,"link",s),h.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},v.set(S,_))}}function yk(s,c,h,v){var S=(S=xe.current)?ip(S):null;if(!S)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=vc(h.href),h=Ll(S).hoistableStyles,v=h.get(c),v||(v={type:"style",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=vc(h.href);var _=Ll(S).hoistableStyles,P=_.get(s);if(P||(S=S.ownerDocument||S,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,P),(_=S.querySelector($d(s)))&&!_._p&&(P.instance=_,P.state.loading=5),va.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},va.set(s,h),_||OV(S,s,h,P.state))),c&&v===null)throw Error(r(528,""));return P}if(c&&v!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=gc(h),h=Ll(S).hoistableScripts,v=h.get(c),v||(v={type:"script",instance:null,count:0,state:null},h.set(c,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function vc(s){return'href="'+la(s)+'"'}function $d(s){return'link[rel="stylesheet"]['+s+"]"}function xk(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function OV(s,c,h,v){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?v.loading=1:(c=s.createElement("link"),v.preload=c,c.addEventListener("load",function(){return v.loading|=1}),c.addEventListener("error",function(){return v.loading|=2}),Qn(c,"link",h),Ln(c),s.head.appendChild(c))}function gc(s){return'[src="'+la(s)+'"]'}function Id(s){return"script[async]"+s}function bk(s,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var v=s.querySelector('style[data-href~="'+la(h.href)+'"]');if(v)return c.instance=v,Ln(v),v;var S=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return v=(s.ownerDocument||s).createElement("style"),Ln(v),Qn(v,"style",S),op(v,h.precedence,s),c.instance=v;case"stylesheet":S=vc(h.href);var _=s.querySelector($d(S));if(_)return c.state.loading|=4,c.instance=_,Ln(_),_;v=xk(h),(S=va.get(S))&&u0(v,S),_=(s.ownerDocument||s).createElement("link"),Ln(_);var P=_;return P._p=new Promise(function(q,X){P.onload=q,P.onerror=X}),Qn(_,"link",v),c.state.loading|=4,op(_,h.precedence,s),c.instance=_;case"script":return _=gc(h.src),(S=s.querySelector(Id(_)))?(c.instance=S,Ln(S),S):(v=h,(S=va.get(_))&&(v=p({},h),d0(v,S)),s=s.ownerDocument||s,S=s.createElement("script"),Ln(S),Qn(S,"link",v),s.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(v=c.instance,c.state.loading|=4,op(v,h.precedence,s));return c.instance}function op(s,c,h){for(var v=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=v.length?v[v.length-1]:null,_=S,P=0;P title"):null)}function CV(s,c,h){if(h===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function Sk(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function EV(s,c,h,v){if(h.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=vc(v.href),_=c.querySelector($d(S));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=lp.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=_,Ln(_);return}_=c.ownerDocument||c,v=xk(v),(S=va.get(S))&&u0(v,S),_=_.createElement("link"),Ln(_);var P=_;P._p=new Promise(function(q,X){P.onload=q,P.onerror=X}),Qn(_,"link",v),h.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=lp.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var f0=0;function AV(s,c){return s.stylesheets&&s.count===0&&up(s,s.stylesheets),0f0?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(v),clearTimeout(S)}}:null}function lp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var cp=null;function up(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,cp=new Map,c.forEach(TV,s),cp=null,lp.call(s))}function TV(s,c){if(!(c.state.loading&4)){var h=cp.get(s);if(h)var v=h.get(null);else{h=new Map,cp.set(s,h);for(var S=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),w0.exports=VV(),w0.exports}var YV=GV();const l_=new WeakMap,KV=new WeakMap,uv={current:[]};let N0=!1,vf=0;const sf=new Set,xp=new Map;function BL(e){for(const t of e){if(uv.current.includes(t))continue;uv.current.push(t),t.recompute();const n=KV.get(t);if(n)for(const r of n){const a=l_.get(r);a?.length&&BL(a)}}}function XV(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function ZV(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function zL(e){if(vf>0&&!xp.has(e)&&xp.set(e,e.prevState),sf.add(e),!(vf>0)&&!N0)try{for(N0=!0;sf.size>0;){const t=Array.from(sf);sf.clear();for(const n of t){const r=xp.get(n)??n.prevState;n.prevState=r,XV(n)}for(const n of t){const r=l_.get(n);r&&(uv.current.push(n),BL(r))}for(const n of t){const r=l_.get(n);if(r)for(const a of r)ZV(a)}}}finally{N0=!1,uv.current=[],xp.clear()}}function gf(e){vf++;try{e()}finally{if(vf--,vf===0){const t=sf.values().next().value;t&&zL(t)}}}function QV(e){return typeof e=="function"}class JV{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var a,o;this.listeners.add(r);const l=(o=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:o.call(a,r,this);return()=>{this.listeners.delete(r),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,a;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):QV(t)?this.state=t(this.prevState):this.state=t,(a=(r=this.options)==null?void 0:r.onUpdate)==null||a.call(r),zL(this)}}const Vo="__TSR_index",Gk="popstate",Yk="beforeunload";function eG(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},a=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},o=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const m=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&p)for(const g of m){const x=dv(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const f=t.state[Vo];u=Kk(f+1,u),o({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Vo];u=Kk(f,u),o({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{o({task:()=>{e.go(l),a({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{o({task:()=>{e.back(l?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{o({task:()=>{e.forward(l?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Vo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Kk(e,t){t||(t={});const n=xO();return{...t,key:n,__TSR_key:n,[Vo]:e}}function tG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let a=[];const o=()=>a,l=M=>a=M,u=(M=>M),d=(()=>dv(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const M=xO();t.history.replaceState({[Vo]:0,key:M,__TSR_key:M},"")}let f=d(),m,p=!1,g=!1,x=!1,j=!1;const b=()=>f;let w,N;const O=()=>{w&&(T._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),T._ignoreSubscribers=!1,w=void 0,N=void 0,m=void 0)},C=(M,$,z)=>{const D=u($);N||(m=f),f=dv($,z),w={href:D,state:z,isPush:w?.isPush||M==="push"},N||(N=Promise.resolve().then(()=>O()))},A=M=>{f=d(),T.notify({type:M})},E=async()=>{if(g){g=!1;return}const M=d(),$=M.state[Vo]-f.state[Vo],z=$===1,D=$===-1,U=!z&&!D||p;p=!1;const V=U?"GO":D?"BACK":"FORWARD",H=U?{type:"GO",index:$}:{type:D?"BACK":"FORWARD"};if(x)x=!1;else{const G=o();if(typeof document<"u"&&G.length){for(const L of G)if(await L.blockerFn({currentLocation:f,nextLocation:M,action:V})){g=!0,t.history.go(1),T.notify(H);return}}}f=d(),T.notify(H)},k=M=>{if(j){j=!1;return}let $=!1;const z=o();if(typeof document<"u"&&z.length)for(const D of z){const U=D.enableBeforeUnload??!0;if(U===!0){$=!0;break}if(typeof U=="function"&&U()===!0){$=!0;break}}if($)return M.preventDefault(),M.returnValue=""},T=eG({getLocation:b,getLength:()=>t.history.length,pushState:(M,$)=>C("push",M,$),replaceState:(M,$)=>C("replace",M,$),back:M=>(M&&(x=!0),j=!0,t.history.back()),forward:M=>{M&&(x=!0),j=!0,t.history.forward()},go:M=>{p=!0,t.history.go(M)},createHref:M=>u(M),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Yk,k,{capture:!0}),t.removeEventListener(Gk,E)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:o,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Yk,k,{capture:!0}),t.addEventListener(Gk,E),t.history.pushState=function(...M){const $=n.apply(t.history,M);return T._ignoreSubscribers||A("PUSH"),$},t.history.replaceState=function(...M){const $=r.apply(t.history,M);return T._ignoreSubscribers||A("REPLACE"),$},T}function dv(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),a=xO();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[Vo]:0,key:a,__TSR_key:a}}}function xO(){return(Math.random()+1).toString(36).substring(7)}function c_(e){return e[e.length-1]}function nG(e){return typeof e=="function"}function Ks(e,t){return nG(e)?e(t):e}const rG=Object.prototype.hasOwnProperty;function wa(e,t){if(e===t)return e;const n=t,r=Qk(e)&&Qk(n);if(!r&&!(fv(e)&&fv(n)))return n;const a=r?e:Xk(e);if(!a)return n;const o=r?n:Xk(n);if(!o)return n;const l=a.length,u=o.length,d=r?new Array(u):{};let f=0;for(let m=0;m"u")return!0;const n=t.prototype;return!(!Zk(n)||!n.hasOwnProperty("isPrototypeOf"))}function Zk(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xs(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,a=e.length;ra||!Xs(e[l],t[l],n)))return!1;return a===o}return!1}function Xc(e){let t,n;const r=new Promise((a,o)=>{t=a,n=o});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,t(a),e?.(a)},r.reject=a=>{r.status="rejected",n(a)},r}function Go(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const aG=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function Jk(e,t=aG){function n(a,o,l=0){for(let u=l;u{try{return decodeURI(u)}catch{return u}})}}if(e===""||!/%[0-9A-Fa-f]{2}/g.test(e))return e;const r=e.replaceAll(/%[0-9a-f]{2}/g,a=>a.toUpperCase());return n(r,t)}var iG="Invariant failed";function ur(e,t){if(!e)throw new Error(iG)}const ui=0,il=1,Zc=2,Qc=3;function Zi(e){return bO(e.filter(t=>t!==void 0).join("/"))}function bO(e){return e.replace(/\/{2,}/g,"/")}function wO(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Yo(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Zp(e){return Yo(wO(e))}function hv(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function oG(e,t,n){return hv(e,n)===hv(t,n)}function sG(e){const{type:t,value:n}=e;if(t===ui)return n;const{prefixSegment:r,suffixSegment:a}=e;if(t===il){const o=n.substring(1);if(r&&a)return`${r}{$${o}}${a}`;if(r)return`${r}{$${o}}`;if(a)return`{$${o}}${a}`}if(t===Qc){const o=n.substring(1);return r&&a?`${r}{-$${o}}${a}`:r?`${r}{-$${o}}`:a?`{-$${o}}${a}`:`{-$${o}}`}if(t===Zc){if(r&&a)return`${r}{$}${a}`;if(r)return`${r}{$}`;if(a)return`{$}${a}`}return n}function lG({base:e,to:t,trailingSlash:n="never",parseCache:r}){let a=Jc(e,r).slice();const o=Jc(t,r);a.length>1&&c_(a)?.value==="/"&&a.pop();for(let d=0,f=o.length;d1&&(c_(a).value==="/"?n==="never"&&a.pop():n==="always"&&a.push({type:ui,value:"/"}));const l=a.map(sG);return Zi(l)}const Jc=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const r=mG(e);return t?.set(e,r),r},cG=/^\$.{1,}$/,uG=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,dG=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,fG=/^\$$/,hG=/^(.*?)\{\$\}(.*)$/;function mG(e){e=bO(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:ui,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>{const a=r.match(hG);if(a){const u=a[1],d=a[2];return{type:Zc,value:"$",prefixSegment:u||void 0,suffixSegment:d||void 0}}const o=r.match(dG);if(o){const u=o[1],d=o[2],f=o[3];return{type:Qc,value:d,prefixSegment:u||void 0,suffixSegment:f||void 0}}const l=r.match(uG);if(l){const u=l[1],d=l[2],f=l[3];return{type:il,value:""+d,prefixSegment:u||void 0,suffixSegment:f||void 0}}if(cG.test(r)){const u=r.substring(1);return{type:il,value:"$"+u,prefixSegment:void 0,suffixSegment:void 0}}return fG.test(r)?{type:Zc,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:ui,value:r}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:ui,value:"/"})),t}function O0({path:e,params:t,decodeCharMap:n,parseCache:r}){const a=Jc(e,r);function o(f){const m=t[f],p=typeof m=="string";return f==="*"||f==="_splat"?p?encodeURI(m):m:p?pG(m,n):m}let l=!1;const u={},d=Zi(a.map(f=>{if(f.type===ui)return f.value;if(f.type===Zc){u._splat=t._splat,u["*"]=t._splat;const m=f.prefixSegment||"",p=f.suffixSegment||"";if(!t._splat)return l=!0,m||p?`${m}${p}`:void 0;const g=o("_splat");return`${m}${g}${p}`}if(f.type===il){const m=f.value.substring(1);!l&&!(m in t)&&(l=!0),u[m]=t[m];const p=f.prefixSegment||"",g=f.suffixSegment||"";return`${p}${o(m)??"undefined"}${g}`}if(f.type===Qc){const m=f.value.substring(1),p=f.prefixSegment||"",g=f.suffixSegment||"";return!(m in t)||t[m]==null?p||g?`${p}${g}`:void 0:(u[m]=t[m],`${p}${o(m)??""}${g}`)}return f.value}));return{usedParams:u,interpolatedPath:d,isMissingParams:l}}function pG(e,t){let n=encodeURIComponent(e);if(t)for(const[r,a]of t)n=n.replaceAll(r,a);return n}function u_(e,t,n){const r=vG(e,t,n);if(!(t.to&&!r))return r??{}}function vG(e,{to:t,fuzzy:n,caseSensitive:r},a){const o=t,l=Jc(e.startsWith("/")?e:`/${e}`,a),u=Jc(o.startsWith("/")?o:`/${o}`,a),d={};return gG(l,u,d,n,r)?d:void 0}function gG(e,t,n,r,a){let o=0,l=0;for(;ob.value)));p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),m=j}else m=decodeURI(Zi(f.map(p=>p.value)));return n["*"]=m,n._splat=m,!0}if(d.type===ui){if(d.value==="/"&&!u?.value){l++;continue}if(u){if(a){if(d.value!==u.value)return!1}else if(d.value.toLowerCase()!==u.value.toLowerCase())return!1;o++,l++;continue}else return!1}if(d.type===il){if(!u||u.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if(p&&!x.startsWith(p)||g&&!x.endsWith(g))return!1;let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}else f=decodeURIComponent(u.value),m=!0;m&&(n[d.value.substring(1)]=f,o++),l++;continue}if(d.type===Qc){if(!u){l++;continue}if(u.value==="/"){l++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const p=d.prefixSegment||"",g=d.suffixSegment||"",x=u.value;if((!p||x.startsWith(p))&&(!g||x.endsWith(g))){let j=x;p&&j.startsWith(p)&&(j=j.slice(p.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),f=decodeURIComponent(j),m=!0}}else{let p=!0;for(let g=l+1;g=t.length)return n["**"]=Zi(e.slice(o).map(f=>f.value)),!!r&&t[t.length-1]?.value!=="/";if(l=e.length){for(let f=l;f{if(r.isRoot||!r.path)return;const o=wO(r.fullPath);let l=Jc(o),u=0;for(;l.length>u+1&&l[u]?.value==="/";)u++;u>0&&(l=l.slice(u));let d=0,f=!1;const m=l.map((p,g)=>{if(p.value==="/")return yG;if(p.type===ui)return xG;let x;p.type===il?x=bG:p.type===Qc?(x=wG,d++):x=jG;for(let j=g+1;j{const o=Math.min(r.scores.length,a.scores.length);for(let l=0;la.parsed[l].value?1:-1;return r.index-a.index}).map((r,a)=>(r.child.rank=a,r.child))}function EG({routeTree:e,initRoute:t}){const n={},r={},a=l=>{l.forEach((u,d)=>{t?.(u,d);const f=n[u.id];if(ur(!f,`Duplicate routes found with id: ${String(u.id)}`),n[u.id]=u,!u.isRoot&&u.path){const p=Yo(u.fullPath);(!r[p]||u.fullPath.endsWith("/"))&&(r[p]=u)}const m=u.children;m?.length&&a(m)})};a([e]);const o=CG(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function Fa(e){return!!e?.isNotFound}function AG(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const mv="tsr-scroll-restoration-v1_3",TG=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function kG(){const e=AG();if(!e)return null;const t=e.getItem(mv);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=Ks(r,n)||n,e.setItem(mv,JSON.stringify(n)))}}const bp=kG(),d_=e=>e.state.__TSR_key||e.href;function MG(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let pv=!1;function qL({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:a,location:o}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];pv=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const p in d){const g=d[p];if(p==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(p){const x=document.querySelector(p);x&&(x.scrollLeft=g.scrollX,x.scrollTop=g.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const g=document.getElementById(f);g&&g.scrollIntoView(p)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),a)for(const p of a){if(p==="window")continue;const g=typeof p=="function"?p():document.querySelector(p);g&&g.scrollTo(m)}}pv=!1}function PG(e,t){if(!bp&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!bp))return;e.isScrollRestorationSetup=!0,pv=!1;const r=e.options.getScrollRestorationKey||d_;window.history.scrollRestoration="manual";const a=o=>{if(pv||!e.isScrollRestoring)return;let l="";if(o.target===document||o.target===window)l="window";else{const d=o.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=MG(o.target)}const u=r(e.state.location);bp.set(d=>{const f=d[u]||={},m=f[l]||={};if(l==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(l){const p=document.querySelector(l);p&&(m.scrollX=p.scrollLeft||0,m.scrollY=p.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",TG(a,100),!0),e.subscribe("onRendered",o=>{const l=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(qL({storageKey:mv,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&bp.set(u=>(u[l]||={},u)))})}function RG(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function DG(e,t=String){const n=new URLSearchParams;for(const r in e){const a=e[r];a!==void 0&&n.set(r,t(a))}return n.toString()}function C0(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function $G(e){const t=new URLSearchParams(e),n={};for(const[r,a]of t.entries()){const o=n[r];o==null?n[r]=C0(a):Array.isArray(o)?o.push(C0(a)):n[r]=[o,C0(a)]}return n}const IG=BG(JSON.parse),LG=zG(JSON.stringify,JSON.parse);function BG(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=$G(t);for(const r in n){const a=n[r];if(typeof a=="string")try{n[r]=e(a)}catch{}}return n}}function zG(e,t){const n=typeof t=="function";function r(a){if(typeof a=="object"&&a!==null)try{return e(a)}catch{}else if(n&&typeof a=="string")try{return t(a),e(a)}catch{}return a}return a=>{const o=DG(a,r);return o?`?${o}`:""}}const Zr="__root__";function FL(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ii(e){return e instanceof Response&&!!e.options}function qG(e){const t=new Map;let n,r;const a=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const l=t.get(o);if(l)return a(l),l.value},set(o,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(o);if(u)u.value=l,a(u);else{const d={key:o,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const Qp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Rg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),UL=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ur(n.options.notFoundComponent);const r=e.matches.find(a=>a.routeId===n.id);ur(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,a=>({...a,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,UL(e,t))},Uo=(e,t,n)=>{if(!(!ii(n)&&!Fa(n))){if(ii(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=ii(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:r,isFetching:!1,error:n})),Fa(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ii(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(UL(e,n),n)}},HL=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Hd=(e,t,n,r)=>{const{id:a,routeId:o}=e.matches[t],l=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Uo(e,e.router.getMatch(a),n);try{l.options.onError?.(n)}catch(u){n=u,Uo(e,e.router.getMatch(a),n)}e.updateMatch(a,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},FG=(e,t,n,r)=>{const a=e.router.getMatch(t),o=e.matches[n-1]?.id,l=o?e.router.getMatch(o):void 0;if(e.router.isShell()){a.ssr=r.id===Zr;return}if(l?.ssr===!1){a.ssr=!1;return}const u=x=>x===!0&&l?.ssr==="data-only"?"data-only":x,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=u(d);return}if(typeof r.options.ssr!="function"){a.ssr=u(r.options.ssr);return}const{search:f,params:m}=a,p={search:wp(f,a.searchError),params:wp(m,a.paramsError),location:e.location,matches:e.matches.map(x=>({index:x.index,pathname:x.pathname,fullPath:x.fullPath,staticData:x.staticData,id:x.id,routeId:x.routeId,search:wp(x.search,x.searchError),params:wp(x.params,x.paramsError),ssr:x.ssr}))},g=r.options.ssr(p);if(Go(g))return g.then(x=>{a.ssr=u(x??d)});a.ssr=u(g??d)},WL=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const a=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Rg(e,t)&&(n.options.loader||n.options.beforeLoad||YL(n))&&typeof a=="number"&&a!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{Qp(e)},a);r._nonReactive.pendingTimeout=l}},UG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;WL(e,t,n,r);const a=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Uo(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},HG=(e,t,n,r)=>{const a=e.router.getMatch(t),o=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Xc(()=>{o?.resolve()});const{paramsError:l,searchError:u}=a;l&&Hd(e,n,l,"PARSE_PARAMS"),u&&Hd(e,n,u,"VALIDATE_SEARCH"),WL(e,t,r,a);const d=new AbortController,f=e.matches[n-1]?.id,g={...(f?e.router.getMatch(f):void 0)?.context??e.router.options.context??void 0,...a.__routeContext};let x=!1;const j=()=>{x||(x=!0,e.updateMatch(t,T=>({...T,isFetching:"beforeLoad",fetchCount:T.fetchCount+1,abortController:d,context:g})))},b=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,T=>({...T,isFetching:!1}))};if(!r.options.beforeLoad){gf(()=>{j(),b()});return}a._nonReactive.beforeLoadPromise=Xc();const{search:w,params:N,cause:O}=a,C=Rg(e,t),A={search:w,abortController:d,params:N,preload:C,context:g,location:e.location,navigate:T=>e.router.navigate({...T,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":O,matches:e.matches,...e.router.options.additionalContext},E=T=>{if(T===void 0){gf(()=>{j(),b()});return}(ii(T)||Fa(T))&&(j(),Hd(e,n,T,"BEFORE_LOAD")),gf(()=>{j(),e.updateMatch(t,M=>({...M,__beforeLoadContext:T,context:{...M.context,...T}})),b()})};let k;try{if(k=r.options.beforeLoad(A),Go(k))return j(),k.catch(T=>{Hd(e,n,T,"BEFORE_LOAD")}).then(E)}catch(T){j(),Hd(e,n,T,"BEFORE_LOAD")}E(k)},WG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],a=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=FG(e,n,t,a);if(Go(d))return d.then(u)}return u()},l=()=>HG(e,n,t,a),u=()=>{if(HL(e,n))return;const d=UG(e,n,a);return Go(d)?d.then(l):l()};return o()},yf=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const a={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(a),n.options.scripts?.(a),n.options.headers?.(a)]).then(([o,l,u])=>{const d=o?.meta,f=o?.links,m=o?.scripts,p=o?.styles;return{meta:d,links:f,headScripts:m,headers:u,scripts:l,styles:p}})},VL=(e,t,n,r)=>{const a=e.matchPromises[n-1],{params:o,loaderDeps:l,abortController:u,cause:d}=e.router.getMatch(t);let f=e.router.options.context??{};for(let p=0;p<=n;p++){const g=e.matches[p];if(!g)continue;const x=e.router.getMatch(g.id);x&&(f={...f,...x.__routeContext??{},...x.__beforeLoadContext??{}})}const m=Rg(e,t);return{params:o,deps:l,preload:!!m,parentMatchPromise:a,abortController:u,context:f,location:e.location,navigate:p=>e.router.navigate({...p,_fromLocation:e.location}),cause:m?"preload":d,route:r,...e.router.options.additionalContext}},rM=async(e,t,n,r)=>{try{const a=e.router.getMatch(t);try{(!e.router.isServer||a.ssr===!0)&&GL(r);const o=r.options.loader?.(VL(e,t,n,r)),l=r.options.loader&&Go(o);if(!!(l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),r.options.loader){const p=l?await o:o;Uo(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}r._lazyPromise&&await r._lazyPromise;const d=yf(e,t,r),f=d?await d:void 0,m=a._nonReactive.minPendingPromise;m&&await m,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(o){let l=o;const u=a._nonReactive.minPendingPromise;u&&await u,Fa(o)&&await r.options.notFoundComponent?.preload?.(),Uo(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(m){l=m,Uo(e,e.router.getMatch(t),m)}const d=yf(e,t,r),f=d?await d:void 0;e.updateMatch(t,m=>({...m,error:l,status:"error",isFetching:!1,...f}))}}catch(a){const o=e.router.getMatch(t);if(o){const l=yf(e,t,r);if(l){const u=await l;e.updateMatch(t,d=>({...d,...u}))}o._nonReactive.loaderPromise=void 0}Uo(e,o,a)}},VG=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let a=!1,o=!1;const l=e.router.looseRoutesById[r];if(HL(e,n)){if(e.router.isServer){const f=yf(e,n,l);if(f){const m=await f;e.updateMatch(n,p=>({...p,...m}))}return e.router.getMatch(n)}}else{const f=e.router.getMatch(n);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const m=e.router.getMatch(n),p=m._nonReactive.error||m.error;p&&Uo(e,m,p)}else{const m=Date.now()-f.updatedAt,p=Rg(e,n),g=p?l.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.router.options.defaultStaleTime??0,x=l.options.shouldReload,j=typeof x=="function"?x(VL(e,n,t,l)):x,b=!!p&&!e.router.state.matches.some(C=>C.id===n),w=e.router.getMatch(n);w._nonReactive.loaderPromise=Xc(),b!==w.preload&&e.updateMatch(n,C=>({...C,preload:b}));const{status:N,invalid:O}=w;if(a=N==="success"&&(O||(j??m>g)),!(p&&l.options.preload===!1))if(a&&!e.sync)o=!0,(async()=>{try{await rM(e,n,t,l);const C=e.router.getMatch(n);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0}catch(C){ii(C)&&await e.router.navigate(C.options)}})();else if(N!=="success"||a&&e.sync)await rM(e,n,t,l);else{const C=yf(e,n,l);if(C){const A=await C;e.updateMatch(n,E=>({...E,...A}))}}}}const u=e.router.getMatch(n);o||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,o||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=o?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):u};async function aM(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&Qp(t);try{for(let a=0;a{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of KL){const a=e.options[r]?.preload;a&&n.push(a())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function wp(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function YL(e){for(const t of KL)if(e.options[t]?.preload)return!0;return!1}const KL=["component","errorComponent","pendingComponent","notFoundComponent"];function GG(e){return{input:({url:t})=>{for(const n of e)t=XL(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ZL(e[n],t);return t}}}function YG(e){const t=Zp(e.basepath),n=`/${t}`,r=`${n}/`,a=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===a?l.pathname="/":u.startsWith(o)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Zi(["/",t,l.pathname]),l)}}function XL(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ZL(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Zs(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,a=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:a,hashChanged:o}}class KG{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,a=this.basepath??r?.basepath??"/",o=this.basepath===void 0,l=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=tG())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new JV(ZG(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),PG(this));let u=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(o||a!==d||l!==f){this.basepath=d;const g=[];Zp(d)!==""&&g.push(YG({basepath:d})),f&&g.push(f),this.rewrite=g.length===0?void 0:g.length===1?g[0]:GG(g),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:a}=EG({routeTree:this.routeTree,initRoute:(l,u)=>{l.init({originalIndex:u})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=a;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)},this.subscribe=(n,r)=>{const a={eventType:n,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const a=({href:d,state:f})=>{const m=new URL(d,this.origin),p=XL(this.rewrite,m),g=this.options.parseSearch(p.search),x=this.options.stringifySearch(g);p.search=x;const j=p.href.replace(p.origin,""),{pathname:b,hash:w}=p;return{href:j,publicHref:d,url:p.href,pathname:Jk(b),searchStr:x,search:wa(r?.search,g),hash:w.split("#").reverse()[0]??"",state:wa(r?.state,f)}},o=a(n),{__tempLocation:l,__tempKey:u}=o.state;if(l&&(!u||u===this.tempLocationKey)){const d=a(l);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>lG({base:n,to:bO(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,a)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},a):this.matchRoutesInternal(n,r),this.parsePathnameCache=qG(1e3),this.getMatchedRoutes=(n,r)=>QG({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const r=(o={})=>{const l=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutes(l,{_buildLocation:!0}),d=c_(u);o.from;const f=o.unsafeRelative==="path"?l.pathname:o.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,g={...d.params},x=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),j=o.params===!1||o.params===null?{}:(o.params??!0)===!0?g:Object.assign(g,Ks(o.params,g)),b=O0({path:x,params:j,parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(b,void 0,{_buildLocation:!0}).map(z=>this.looseRoutesById[z.routeId]);if(Object.keys(j).length>0)for(const z of w){const D=z.options.params?.stringify??z.options.stringifyParams;D&&Object.assign(j,D(j))}const N=n.leaveParams?x:Jk(O0({path:x,params:j,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let O=p;if(n._includeValidateSearch&&this.options.search?.strict){const z={};w.forEach(D=>{if(D.options.validateSearch)try{Object.assign(z,f_(D.options.validateSearch,{...z,...O}))}catch{}}),O=z}O=JG({search:O,dest:o,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),O=wa(p,O);const C=this.options.stringifySearch(O),A=o.hash===!0?l.hash:o.hash?Ks(o.hash,l.hash):void 0,E=A?`#${A}`:"";let k=o.state===!0?l.state:o.state?Ks(o.state,l.state):{};k=wa(l.state,k);const T=`${N}${C}${E}`,M=new URL(T,this.origin),$=ZL(this.rewrite,M);return{publicHref:$.pathname+$.search+$.hash,href:T,url:$.href,pathname:N,search:O,searchStr:C,state:k,hash:A??"",unmaskOnReload:o.unmaskOnReload}},a=(o={},l)=>{const u=r(o);let d=l?r(l):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(p=>{const g=u_(u.pathname,{to:p.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return g?(f=g,!0):!1});if(m){const{from:p,...g}=m;l={from:n.from,...g,params:f},d=r(l)}}return d&&(u.maskedLocation=d),u};return n.mask?a(n,{from:n.from,...n.mask}):a(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...a})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(m=>{a.state[m]=this.latestLocation.state[m]});const f=Xs(a.state,this.latestLocation.state);return d.forEach(m=>{delete a.state[m]}),f},l=Yo(this.latestLocation.href)===Yo(a.href),u=this.commitLocationPromise;if(this.commitLocationPromise=Xc(()=>{u?.resolve()}),l&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...m}=a;d&&(m={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[a.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:a,viewTransition:o,ignoreBlocker:l,href:u,...d}={})=>{if(u){const p=this.history.location.state.__TSR_index,g=dv(u,{__TSR_index:n?p:p+1});d.to=g.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const m=this.commitLocation({...f,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=({to:n,reloadDocument:r,href:a,...o})=>{if(!r&&a)try{new URL(`${a}`),r=!0}catch{}return r?(a||(a=this.buildLocation({to:n,...o}).url),o.replace?window.location.replace(a):window.location.href=a,Promise.resolve()):this.buildAndCommitLocation({...o,href:a,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),a=o=>{try{return encodeURI(decodeURI(o))}catch{return o}};if(Zp(a(this.latestLocation.href))!==Zp(a(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),FL({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(a=>!n.some(o=>o.id===a.id))}))},this.load=async n=>{let r,a,o;for(o=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Zs({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Zs({resolvedLocation:f,location:d})}),await aM({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let m=[],p=[],g=[];gf(()=>{this.__store.setState(x=>{const j=x.matches,b=x.pendingMatches||x.matches;return m=j.filter(w=>!b.some(N=>N.id===w.id)),p=b.filter(w=>!j.some(N=>N.id===w.id)),g=b.filter(w=>j.some(N=>N.id===w.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...m.filter(w=>w.status!=="error")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[p,"onEnter"],[g,"onStay"]].forEach(([x,j])=>{x.forEach(b=>{this.looseRoutesById[b.routeId].options[j]?.(b)})})})})}})}catch(d){ii(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Fa(d)&&(a=d),this.__store.setState(f=>({...f,statusCode:r?r.status:a?404:f.matches.some(m=>m.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,l=this.state.resolvedLocation,u=typeof r.types=="function"?r.types(Zs({resolvedLocation:l,location:o})):r.types;if(u===!1){n();return}a={update:n,types:u}}else a=n;document.startViewTransition(a)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";a&&this.__store.setState(o=>({...o,[a]:o[a]?.map(l=>l.id===n?r(l):l)}))})},this.getMatch=n=>{const r=a=>a.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=a=>n?.filter?.(a)??!0?{...a,invalid:!0,...n?.forcePending||a.status==="error"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(r),cachedMatches:a.cachedMatches.map(r),pendingMatches:a.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let a=r.url;this.origin&&a.startsWith(this.origin)&&(a=a.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",a)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(o=>!r(o))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const a=this.looseRoutesById[r.routeId];if(!a.options.loader)return!0;const o=(r.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=GL,this.preloadRoute=async n=>{const r=this.buildLocation(n);let a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...o,...this.state.cachedMatches.map(u=>u.id)]);gf(()=>{a.forEach(u=>{l.has(u.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,u]}))})});try{return a=await aM({router:this,matches:a,location:r,preload:!0,updateMatch:(u,d)=>{o.has(u)?a=a.map(f=>f.id===u?d(f):f):this.updateMatch(u,d)}}),a}catch(u){if(ii(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});Fa(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const a={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(a);if(r?.pending&&this.state.status!=="pending")return!1;const u=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=u_(u.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!Xs(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?Xs(u.search,o.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??LG,parseSearch:t.parseSearch??IG}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:a,routeParams:o}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let l=!1;(r?r.path!=="/"&&o["**"]:Yo(t.pathname))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):l=!0);const u=(()=>{if(l){if(this.options.notFoundMode!=="root")for(let m=a.length-1;m>=0;m--){const p=a[m];if(p.children)return p.id}return Zr}})(),d=[],f=m=>m?.id?m.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((m,p)=>{const g=d[p-1],[x,j,b]=(()=>{const U=g?.search??t.search,V=g?._strictSearch??void 0;try{const H=f_(m.options.validateSearch,{...U})??void 0;return[{...U,...H},{...V,...H},void 0]}catch(H){let G=H;if(H instanceof vv||(G=new vv(H.message,{cause:H})),n?.throwOnError)throw G;return[U,{},G]}})(),w=m.options.loaderDeps?.({search:x})??"",N=w?JSON.stringify(w):"",{interpolatedPath:O,usedParams:C}=O0({path:m.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),A=m.id+O+N,E=this.getMatch(A),k=this.state.matches.find(U=>U.routeId===m.id),T=E?._strictParams??C;let M;if(!E){const U=m.options.params?.parse??m.options.parseParams;if(U)try{Object.assign(T,U(T))}catch(V){if(M=new XG(V.message,{cause:V}),n?.throwOnError)throw M}}Object.assign(o,T);const $=k?"stay":"enter";let z;if(E)z={...E,cause:$,params:k?wa(k.params,o):o,_strictParams:T,search:wa(k?k.search:E.search,x),_strictSearch:j};else{const U=m.options.loader||m.options.beforeLoad||m.lazyFn||YL(m)?"pending":"success";z={id:A,index:p,routeId:m.id,params:k?wa(k.params,o):o,_strictParams:T,pathname:O,updatedAt:Date.now(),search:k?wa(k.search,x):x,_strictSearch:j,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:Xc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:$,loaderDeps:k?wa(k.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(z.globalNotFound=u===m.id),z.searchError=b;const D=f(g);z.context={...D,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((m,p)=>{const g=this.looseRoutesById[m.routeId];if(!this.getMatch(m.id)&&n?._buildLocation!==!0){const j=d[p-1],b=f(j);if(g.options.context){const w={deps:m.loaderDeps,params:m.params,context:b??{},location:t,navigate:N=>this.navigate({...N,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d};m.__routeContext=g.options.context(w)??void 0}m.context={...b,...m.__routeContext,...m.__beforeLoadContext}}}),d}}class vv extends Error{}class XG extends Error{}function ZG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function f_(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new vv("Async validation not supported");if(n.issues)throw new vv(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function QG({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:a,flatRoutes:o,parseCache:l}){let u={};const d=Yo(e),f=x=>u_(d,{to:x.fullPath,caseSensitive:x.options?.caseSensitive??n,fuzzy:!0},l);let m=t!==void 0?r[t]:void 0;if(m)u=f(m);else{let x;for(const j of o){const b=f(j);if(b)if(j.path!=="/"&&b["**"])x||(x={foundRoute:j,routeParams:b});else{m=j,u=b;break}}!m&&x&&(m=x.foundRoute,u=x.routeParams)}let p=m||a[Zr];const g=[p];for(;p.parentRoute;)p=p.parentRoute,g.push(p);return g.reverse(),{matchedRoutes:g,routeParams:u,foundRoute:m}}function JG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const a=n.reduce((u,d)=>{const f=[];if("search"in d.options)d.options.search?.middlewares&&f.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const m=({search:p,next:g})=>{let x=p;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(x=d.options.preSearchFilters.reduce((b,w)=>w(b),p));const j=g(x);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((b,w)=>w(b),j):j};f.push(m)}if(r&&d.options.validateSearch){const m=({search:p,next:g})=>{const x=g(p);try{return{...x,...f_(d.options.validateSearch,x)??void 0}}catch{return x}};f.push(m)}return u.concat(f)},[])??[],o=({search:u})=>t.search?t.search===!0?u:Ks(t.search,u):{};a.push(o);const l=(u,d)=>{if(u>=a.length)return d;const f=a[u];return f({search:d,next:p=>l(u+1,p)})};return l(0,e)}const eY="Error preloading route! ☝️";class QL{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Zr:this.parentRoute||ur(!1);let o=a?Zr:r?.path;o&&o!=="/"&&(o=wO(o));const l=r?.id||o;let u=a?Zr:Zi([this.parentRoute.id===Zr?"":this.parentRoute.id,l]);o===Zr&&(o="/"),u!==Zr&&(u=Zi(["/",u]));const d=u===Zr?"/":Zi([this.parentRoute.fullPath,o]);this._path=o,this._id=u,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class tY extends QL{constructor(t){super(t)}}function jO(e){const t=e.errorComponent??Dg;return i.jsx(nY,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}class nY extends y.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Dg({error:e}){const[t,n]=y.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function rY({children:e,fallback:t=null}){return aY()?i.jsx(W.Fragment,{children:e}):i.jsx(W.Fragment,{children:t})}function aY(){return W.useSyncExternalStore(iY,()=>!0,()=>!1)}function iY(){return()=>{}}var E0={exports:{}},A0={},T0={exports:{}},k0={};var iM;function oY(){if(iM)return k0;iM=1;var e=bh();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(p,g){var x=g(),j=r({inst:{value:x,getSnapshot:g}}),b=j[0].inst,w=j[1];return o(function(){b.value=x,b.getSnapshot=g,d(b)&&w({inst:b})},[p,x,g]),a(function(){return d(b)&&w({inst:b}),p(function(){d(b)&&w({inst:b})})},[p]),l(x),x}function d(p){var g=p.getSnapshot;p=p.value;try{var x=g();return!n(p,x)}catch{return!0}}function f(p,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return k0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,k0}var oM;function sY(){return oM||(oM=1,T0.exports=oY()),T0.exports}var sM;function lY(){if(sM)return A0;sM=1;var e=bh(),t=sY();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return A0.useSyncExternalStoreWithSelector=function(f,m,p,g,x){var j=o(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function N(k){if(!O){if(O=!0,C=k,k=g(k),x!==void 0&&b.hasValue){var T=b.value;if(x(T,k))return A=T}return A=k}if(T=A,r(C,k))return T;var M=g(k);return x!==void 0&&x(T,M)?(C=k,T):(C=k,A=M)}var O=!1,C,A,E=p===void 0?null:p;return[function(){return N(m())},E===null?void 0:function(){return N(E())}]},[m,p,g,x]);var w=a(f,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},A0}var lM;function cY(){return lM||(lM=1,E0.exports=lY()),E0.exports}var uY=cY();function dY(e,t=r=>r,n={}){const r=n.equal??fY;return uY.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function fY(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!t.has(r)||!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=cM(e);if(n.length!==cM(t).length)return!1;for(let r=0;r"u"?M0:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=M0,M0)}function Ir(e){const t=y.useContext(JL());return e?.warn,t}function Sr(e){const t=Ir({warn:e?.router===void 0}),n=e?.router||t,r=y.useRef(void 0);return dY(n.__store,a=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=wa(r.current,e.select(a));return r.current=o,o}return e.select(a)}return a})}const $g=y.createContext(void 0),hY=y.createContext(void 0);function mi(e){const t=y.useContext(e.from?hY:$g);return Sr({select:r=>{const a=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(ur(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function SO(e){return mi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function _O(e){const{select:t,...n}=e;return mi({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function NO(e){return mi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function OO(e){return mi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function oa(e){const t=Ir();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var yl=LL();const mY=St(yl),jp=typeof window<"u"?y.useLayoutEffect:y.useEffect;function P0(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function pY(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([o])=>{t(o)},n);return a.observe(e.current),()=>{a.disconnect()}},[t,n,r.disabled,e])}function vY(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}function gY(e,t){const n=Ir(),[r,a]=y.useState(!1),o=y.useRef(!1),l=vY(t),{activeProps:u,inactiveProps:d,activeOptions:f,to:m,preload:p,preloadDelay:g,hashScrollIntoView:x,replace:j,startTransition:b,resetScroll:w,viewTransition:N,children:O,target:C,disabled:A,style:E,className:k,onClick:T,onFocus:M,onMouseEnter:$,onMouseLeave:z,onTouchStart:D,ignoreBlocker:U,params:V,search:H,hash:G,state:L,mask:R,reloadDocument:F,unsafeRelative:K,from:te,_fromLocation:I,...B}=e,Y=Sr({select:lt=>lt.location.search,structuralSharing:!0}),ne=e.from,oe=y.useMemo(()=>({...e,from:ne}),[n,Y,ne,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),xe=y.useMemo(()=>n.buildLocation({...oe}),[n,oe]),ee=y.useMemo(()=>{if(A)return;let lt=xe.maskedLocation?xe.maskedLocation.url:xe.url,rt=!1;return n.origin&&(lt.startsWith(n.origin)?lt=n.history.createHref(lt.replace(n.origin,""))||"/":rt=!0),{href:lt,external:rt}},[A,xe.maskedLocation,xe.url,n.origin,n.history]),ae=y.useMemo(()=>{if(ee?.external)return ee.href;try{return new URL(m),m}catch{}},[m,ee]),Z=e.reloadDocument||ae?!1:p??n.options.defaultPreload,pe=g??n.options.defaultPreloadDelay??0,je=Sr({select:lt=>{if(ae)return!1;if(f?.exact){if(!oG(lt.location.pathname,xe.pathname,n.basepath))return!1}else{const rt=hv(lt.location.pathname,n.basepath),$n=hv(xe.pathname,n.basepath);if(!(rt.startsWith($n)&&(rt.length===$n.length||rt[$n.length]==="/")))return!1}return(f?.includeSearch??!0)&&!Xs(lt.location.search,xe.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?lt.location.hash===xe.hash:!0}}),le=y.useCallback(()=>{n.preloadRoute({...oe}).catch(lt=>{console.warn(lt),console.warn(eY)})},[n,oe]),Re=y.useCallback(lt=>{lt?.isIntersecting&&le()},[le]);pY(l,Re,jY,{disabled:!!A||Z!=="viewport"}),y.useEffect(()=>{o.current||!A&&Z==="render"&&(le(),o.current=!0)},[A,le,Z]);const _e=lt=>{const rt=lt.currentTarget.getAttribute("target"),$n=C!==void 0?C:rt;if(!A&&!SY(lt)&&!lt.defaultPrevented&&(!$n||$n==="_self")&<.button===0){lt.preventDefault(),yl.flushSync(()=>{a(!0)});const ms=n.subscribe("onResolved",()=>{ms(),a(!1)});n.navigate({...oe,replace:j,resetScroll:w,hashScrollIntoView:x,startTransition:b,viewTransition:N,ignoreBlocker:U})}};if(ae)return{...B,ref:l,href:ae,...O&&{children:O},...C&&{target:C},...A&&{disabled:A},...E&&{style:E},...k&&{className:k},...T&&{onClick:T},...M&&{onFocus:M},...$&&{onMouseEnter:$},...z&&{onMouseLeave:z},...D&&{onTouchStart:D}};const me=lt=>{A||Z&&le()},ve=me,Le=lt=>{if(!(A||!Z))if(!pe)le();else{const rt=lt.target;if(Wd.has(rt))return;const $n=setTimeout(()=>{Wd.delete(rt),le()},pe);Wd.set(rt,$n)}},Dt=lt=>{if(A||!Z||!pe)return;const rt=lt.target,$n=Wd.get(rt);$n&&(clearTimeout($n),Wd.delete(rt))},On=je?Ks(u,{})??yY:R0,vr=je?R0:Ks(d,{})??R0,rr=[k,On.className,vr.className].filter(Boolean).join(" "),gr=(E||On.style||vr.style)&&{...E,...On.style,...vr.style};return{...B,...On,...vr,href:ee?.href,ref:l,onClick:Vd([T,_e]),onFocus:Vd([M,me]),onMouseEnter:Vd([$,Le]),onMouseLeave:Vd([z,Dt]),onTouchStart:Vd([D,ve]),disabled:!!A,target:C,...gr&&{style:gr},...rr&&{className:rr},...A&&xY,...je&&bY,...r&&wY}}const R0={},yY={className:"active"},xY={role:"link","aria-disabled":!0},bY={"data-status":"active","aria-current":"page"},wY={"data-transitioning":"transitioning"},Wd=new WeakMap,jY={rootMargin:"100px"},Vd=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},CO=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:a,ref:o,...l}=gY(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;return n===void 0&&delete l.disabled,y.createElement(n||"a",{...l,ref:o},u)});function SY(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class _Y extends QL{constructor(t){super(t),this.useMatch=n=>mi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>mi({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>OO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>_O({...n,from:this.id}),this.useLoaderData=n=>SO({...n,from:this.id}),this.useNavigate=()=>oa({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>i.jsx(CO,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function fr(e){return new _Y(e)}class NY extends tY{constructor(t){super(t),this.useMatch=n=>mi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>mi({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>OO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>_O({...n,from:this.id}),this.useLoaderData=n=>SO({...n,from:this.id}),this.useNavigate=()=>oa({from:this.fullPath}),this.Link=W.forwardRef((n,r)=>i.jsx(CO,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function OY(e){return new NY(e)}function uM(e){return typeof e=="object"?new dM(e,{silent:!0}).createRoute(e):new dM(e,{silent:!0}).createRoute}class dM{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const a=fr(r);return a.isRoot=!1,a},this.silent=n?.silent}}class fM{constructor(t){this.useMatch=n=>mi({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>mi({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>OO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>NO({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>_O({...n,from:this.options.id}),this.useLoaderData=n=>SO({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ir();return oa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function hM(e){return typeof e=="object"?new fM(e):t=>new fM({id:e,...t})}function CY(){const e=Ir(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),{hasPendingMatches:a,isLoading:o}=Sr({select:p=>({isLoading:p.isLoading,hasPendingMatches:p.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=P0(o),u=o||n||a,d=P0(u),f=o||a,m=P0(f);return e.startTransition=p=>{r(!0),y.startTransition(()=>{p(),r(!1)})},y.useEffect(()=>{const p=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Yo(e.latestLocation.href)!==Yo(g.href)&&e.commitLocation({...g,replace:!0}),()=>{p()}},[e,e.history]),jp(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),jp(()=>{l&&!o&&e.emit({type:"onLoad",...Zs(e.state)})},[l,e,o]),jp(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...Zs(e.state)})},[f,m,e]),jp(()=>{d&&!u&&(e.emit({type:"onResolved",...Zs(e.state)}),e.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),RG(e))},[u,d,e]),null}function EY(e){const t=Sr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return i.jsx(jO,{getResetKey:()=>t,onCatch:(n,r)=>{if(Fa(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Fa(n))return e.fallback?.(n);throw n},children:e.children})}function AY(){return i.jsx("p",{children:"Not Found"})}function Ac(e){return i.jsx(i.Fragment,{children:e.children})}function e5(e,t,n){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{data:n}):i.jsx(AY,{})}function TY({children:e}){const t=Ir();return t.isServer?i.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(` `)+";$_TSR.c()"}}):null}function kY(){const e=Ir();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||d_)(e.latestLocation),r=n!==d_(e.latestLocation)?n:void 0,a={storageKey:mv,shouldScrollRestoration:!0};return r&&(a.key=r),i.jsx(TY,{children:`(${qL.toString()})(${JSON.stringify(a)})`})}const t5=y.memo(function({matchId:t}){const n=Ir(),r=Sr({select:N=>{const O=N.matches.find(C=>C.id===t);return ur(O),{routeId:O.routeId,ssr:O.ssr,_displayPending:O._displayPending}},structuralSharing:!0}),a=n.routesById[r.routeId],o=a.options.pendingComponent??n.options.defaultPendingComponent,l=o?i.jsx(o,{}):null,u=a.options.errorComponent??n.options.defaultErrorComponent,d=a.options.onCatch??n.options.defaultOnCatch,f=a.isRoot?a.options.notFoundComponent??n.options.notFoundRoute?.options.component:a.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!a.isRoot||a.options.wrapInSuspense||m)&&(a.options.wrapInSuspense??o??(a.options.errorComponent?.preload||m))?y.Suspense:Ac,g=u?jO:Ac,x=f?EY:Ac,j=Sr({select:N=>N.loadedAt}),b=Sr({select:N=>{const O=N.matches.findIndex(C=>C.id===t);return N.matches[O-1]?.routeId}}),w=a.isRoot?a.options.shellComponent??Ac:Ac;return i.jsxs(w,{children:[i.jsx($g.Provider,{value:t,children:i.jsx(p,{fallback:l,children:i.jsx(g,{getResetKey:()=>j,errorComponent:u||Dg,onCatch:(N,O)=>{if(Fa(N))throw N;d?.(N,O)},children:i.jsx(x,{fallback:N=>{if(!f||N.routeId&&N.routeId!==r.routeId||!N.routeId&&!a.isRoot)throw N;return y.createElement(f,N)},children:m||r._displayPending?i.jsx(rY,{fallback:l,children:i.jsx(mM,{matchId:t})}):i.jsx(mM,{matchId:t})})})})}),b===Zr&&n.options.scrollRestoration?i.jsxs(i.Fragment,{children:[i.jsx(MY,{}),i.jsx(kY,{})]}):null]})});function MY(){const e=Ir(),t=y.useRef(void 0);return i.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Zs(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const mM=y.memo(function({matchId:t}){const n=Ir(),{match:r,key:a,routeId:o}=Sr({select:d=>{const f=d.matches.find(j=>j.id===t),m=f.routeId,g=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[o],u=y.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?i.jsx(d,{},a):i.jsx(EO,{})},[a,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!n.isServer){const m=Xc();f._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return ur(Fa(r.error)),e5(n,l,r.error);if(r.status==="redirected")throw ur(ii(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(l.options.errorComponent??n.options.defaultErrorComponent)||Dg;return i.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return u}),EO=y.memo(function(){const t=Ir(),n=y.useContext($g),r=Sr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),a=t.routesById[r],o=Sr({select:f=>{const p=f.matches.find(g=>g.id===n);return ur(p),p.globalNotFound}}),l=Sr({select:f=>{const m=f.matches,p=m.findIndex(g=>g.id===n);return m[p+1]?.id}}),u=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(o)return e5(t,a,void 0);if(!l)return null;const d=i.jsx(t5,{matchId:l});return r===Zr?i.jsx(y.Suspense,{fallback:u,children:d}):d});function PY(){const e=Ir(),n=e.routesById[Zr].options.pendingComponent??e.options.defaultPendingComponent,r=n?i.jsx(n,{}):null,a=e.isServer||typeof document<"u"&&e.ssr?Ac:y.Suspense,o=i.jsxs(a,{fallback:r,children:[!e.isServer&&i.jsx(CY,{}),i.jsx(RY,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:o}):o}function RY(){const e=Ir(),t=Sr({select:a=>a.matches[0]?.id}),n=Sr({select:a=>a.loadedAt}),r=t?i.jsx(t5,{matchId:t}):null;return i.jsx($g.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:i.jsx(jO,{getResetKey:()=>n,errorComponent:Dg,onCatch:a=>{a.message||a.toString()},children:r})})}function DY(){const e=Ir();return Sr({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),y.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o,...l}=t;return e.matchRoute(l,{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o})},[e])}const $Y=e=>new IY(e);class IY extends KG{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=uM,globalThis.createLazyFileRoute=hM):typeof window<"u"&&(window.createFileRoute=uM,window.createLazyFileRoute=hM);function LY({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=JL(),a=i.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:a}):a}function BY({router:e,...t}){return i.jsx(LY,{router:e,...t,children:i.jsx(PY,{})})}function n5(e,t){return function(){return e.apply(t,arguments)}}const{toString:zY}=Object.prototype,{getPrototypeOf:AO}=Object,{iterator:Ig,toStringTag:r5}=Symbol,Lg=(e=>t=>{const n=zY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Wa=e=>(e=e.toLowerCase(),t=>Lg(t)===e),Bg=e=>t=>typeof t===e,{isArray:Pu}=Array,eu=Bg("undefined");function wh(e){return e!==null&&!eu(e)&&e.constructor!==null&&!eu(e.constructor)&&Mr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const a5=Wa("ArrayBuffer");function qY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&a5(e.buffer),t}const FY=Bg("string"),Mr=Bg("function"),i5=Bg("number"),jh=e=>e!==null&&typeof e=="object",UY=e=>e===!0||e===!1,Jp=e=>{if(Lg(e)!=="object")return!1;const t=AO(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(r5 in e)&&!(Ig in e)},HY=e=>{if(!jh(e)||wh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},WY=Wa("Date"),VY=Wa("File"),GY=Wa("Blob"),YY=Wa("FileList"),KY=e=>jh(e)&&Mr(e.pipe),XY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Mr(e.append)&&((t=Lg(e))==="formdata"||t==="object"&&Mr(e.toString)&&e.toString()==="[object FormData]"))},ZY=Wa("URLSearchParams"),[QY,JY,eK,tK]=["ReadableStream","Request","Response","Headers"].map(Wa),nK=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Pu(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Us=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,s5=e=>!eu(e)&&e!==Us;function h_(){const{caseless:e,skipUndefined:t}=s5(this)&&this||{},n={},r=(a,o)=>{const l=e&&o5(n,o)||o;Jp(n[l])&&Jp(a)?n[l]=h_(n[l],a):Jp(a)?n[l]=h_({},a):Pu(a)?n[l]=a.slice():(!t||!eu(a))&&(n[l]=a)};for(let a=0,o=arguments.length;a(Sh(t,(a,o)=>{n&&Mr(a)?e[o]=n5(a,n):e[o]=a},{allOwnKeys:r}),e),aK=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),iK=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},oK=(e,t,n,r)=>{let a,o,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)l=a[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&AO(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},sK=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},lK=e=>{if(!e)return null;if(Pu(e))return e;let t=e.length;if(!i5(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},cK=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&AO(Uint8Array)),uK=(e,t)=>{const r=(e&&e[Ig]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},dK=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fK=Wa("HTMLFormElement"),hK=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),pM=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),mK=Wa("RegExp"),l5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Sh(n,(a,o)=>{let l;(l=t(a,o,e))!==!1&&(r[o]=l||a)}),Object.defineProperties(e,r)},pK=e=>{l5(e,(t,n)=>{if(Mr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Mr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},vK=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return Pu(e)?r(e):r(String(e).split(t)),n},gK=()=>{},yK=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function xK(e){return!!(e&&Mr(e.append)&&e[r5]==="FormData"&&e[Ig])}const bK=e=>{const t=new Array(10),n=(r,a)=>{if(jh(r)){if(t.indexOf(r)>=0)return;if(wh(r))return r;if(!("toJSON"in r)){t[a]=r;const o=Pu(r)?[]:{};return Sh(r,(l,u)=>{const d=n(l,a+1);!eu(d)&&(o[u]=d)}),t[a]=void 0,o}}return r};return n(e,0)},wK=Wa("AsyncFunction"),jK=e=>e&&(jh(e)||Mr(e))&&Mr(e.then)&&Mr(e.catch),c5=((e,t)=>e?setImmediate:t?((n,r)=>(Us.addEventListener("message",({source:a,data:o})=>{a===Us&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Us.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Mr(Us.postMessage)),SK=typeof queueMicrotask<"u"?queueMicrotask.bind(Us):typeof process<"u"&&process.nextTick||c5,_K=e=>e!=null&&Mr(e[Ig]),de={isArray:Pu,isArrayBuffer:a5,isBuffer:wh,isFormData:XY,isArrayBufferView:qY,isString:FY,isNumber:i5,isBoolean:UY,isObject:jh,isPlainObject:Jp,isEmptyObject:HY,isReadableStream:QY,isRequest:JY,isResponse:eK,isHeaders:tK,isUndefined:eu,isDate:WY,isFile:VY,isBlob:GY,isRegExp:mK,isFunction:Mr,isStream:KY,isURLSearchParams:ZY,isTypedArray:cK,isFileList:YY,forEach:Sh,merge:h_,extend:rK,trim:nK,stripBOM:aK,inherits:iK,toFlatObject:oK,kindOf:Lg,kindOfTest:Wa,endsWith:sK,toArray:lK,forEachEntry:uK,matchAll:dK,isHTMLForm:fK,hasOwnProperty:pM,hasOwnProp:pM,reduceDescriptors:l5,freezeMethods:pK,toObjectSet:vK,toCamelCase:hK,noop:gK,toFiniteNumber:yK,findKey:o5,global:Us,isContextDefined:s5,isSpecCompliantForm:xK,toJSONObject:bK,isAsyncFn:wK,isThenable:jK,setImmediate:c5,asap:SK,isIterable:_K};function Xe(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}de.inherits(Xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.status}}});const u5=Xe.prototype,d5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{d5[e]={value:e}});Object.defineProperties(Xe,d5);Object.defineProperty(u5,"isAxiosError",{value:!0});Xe.from=(e,t,n,r,a,o)=>{const l=Object.create(u5);de.toFlatObject(e,l,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Xe.call(l,u,d,n,r,a),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",o&&Object.assign(l,o),l};const NK=null;function m_(e){return de.isPlainObject(e)||de.isArray(e)}function f5(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function vM(e,t,n){return e?e.concat(t).map(function(a,o){return a=f5(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function OK(e){return de.isArray(e)&&!e.some(m_)}const CK=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function zg(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!de.isUndefined(w[b])});const r=n.metaTokens,a=n.visitor||m,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(a))throw new TypeError("visitor must be a function");function f(j){if(j===null)return"";if(de.isDate(j))return j.toISOString();if(de.isBoolean(j))return j.toString();if(!d&&de.isBlob(j))throw new Xe("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(j)||de.isTypedArray(j)?d&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function m(j,b,w){let N=j;if(j&&!w&&typeof j=="object"){if(de.endsWith(b,"{}"))b=r?b:b.slice(0,-2),j=JSON.stringify(j);else if(de.isArray(j)&&OK(j)||(de.isFileList(j)||de.endsWith(b,"[]"))&&(N=de.toArray(j)))return b=f5(b),N.forEach(function(C,A){!(de.isUndefined(C)||C===null)&&t.append(l===!0?vM([b],A,o):l===null?b:b+"[]",f(C))}),!1}return m_(j)?!0:(t.append(vM(w,b,o),f(j)),!1)}const p=[],g=Object.assign(CK,{defaultVisitor:m,convertValue:f,isVisitable:m_});function x(j,b){if(!de.isUndefined(j)){if(p.indexOf(j)!==-1)throw Error("Circular reference detected in "+b.join("."));p.push(j),de.forEach(j,function(N,O){(!(de.isUndefined(N)||N===null)&&a.call(t,N,de.isString(O)?O.trim():O,b,g))===!0&&x(N,b?b.concat(O):[O])}),p.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return x(e),t}function gM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function TO(e,t){this._pairs=[],e&&zg(e,this,t)}const h5=TO.prototype;h5.append=function(t,n){this._pairs.push([t,n])};h5.toString=function(t){const n=t?function(r){return t.call(this,r,gM)}:gM;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function EK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function m5(e,t,n){if(!t)return e;const r=n&&n.encode||EK;de.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(a?o=a(t,n):o=de.isURLSearchParams(t)?t.toString():new TO(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class yM{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(r){r!==null&&t(r)})}}const p5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AK=typeof URLSearchParams<"u"?URLSearchParams:TO,TK=typeof FormData<"u"?FormData:null,kK=typeof Blob<"u"?Blob:null,MK={isBrowser:!0,classes:{URLSearchParams:AK,FormData:TK,Blob:kK},protocols:["http","https","file","blob","url","data"]},kO=typeof window<"u"&&typeof document<"u",p_=typeof navigator=="object"&&navigator||void 0,PK=kO&&(!p_||["ReactNative","NativeScript","NS"].indexOf(p_.product)<0),RK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",DK=kO&&window.location.href||"http://localhost",$K=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:kO,hasStandardBrowserEnv:PK,hasStandardBrowserWebWorkerEnv:RK,navigator:p_,origin:DK},Symbol.toStringTag,{value:"Module"})),cr={...$K,...MK};function IK(e,t){return zg(e,new cr.classes.URLSearchParams,{visitor:function(n,r,a,o){return cr.isNode&&de.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function LK(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function BK(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r=n.length;return l=!l&&de.isArray(a)?a.length:l,d?(de.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!de.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],o)&&de.isArray(a[l])&&(a[l]=BK(a[l])),!u)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(r,a)=>{t(LK(r),a,n,0)}),n}return null}function zK(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const _h={transitional:p5,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=de.isObject(t);if(o&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return a?JSON.stringify(v5(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return IK(t,this.formSerializer).toString();if((u=de.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return zg(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),zK(t)):t}],transformResponse:[function(t){const n=this.transitional||_h.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Xe.from(u,Xe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cr.classes.FormData,Blob:cr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{_h.headers[e]={}});const qK=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),FK=e=>{const t={};let n,r,a;return e&&e.split(` `).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&qK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},xM=Symbol("internals");function Gd(e){return e&&String(e).trim().toLowerCase()}function ev(e){return e===!1||e==null?e:de.isArray(e)?e.map(ev):String(e)}function UK(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const HK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function D0(e,t,n,r,a){if(de.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!de.isString(t)){if(de.isString(r))return t.indexOf(r)!==-1;if(de.isRegExp(r))return r.test(t)}}function WK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function VK(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,o,l){return this[r].call(this,t,a,o,l)},configurable:!0})})}let Pr=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(u,d,f){const m=Gd(d);if(!m)throw new Error("header name must be a non-empty string");const p=de.findKey(a,m);(!p||a[p]===void 0||f===!0||f===void 0&&a[p]!==!1)&&(a[p||d]=ev(u))}const l=(u,d)=>de.forEach(u,(f,m)=>o(f,m,d));if(de.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(de.isString(t)&&(t=t.trim())&&!HK(t))l(FK(t),n);else if(de.isObject(t)&&de.isIterable(t)){let u={},d,f;for(const m of t){if(!de.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[f=m[0]]=(d=u[f])?de.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}l(u,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Gd(t),t){const r=de.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return UK(a);if(de.isFunction(n))return n.call(this,a,r);if(de.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Gd(t),t){const r=de.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||D0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(l){if(l=Gd(l),l){const u=de.findKey(r,l);u&&(!n||D0(r,r[u],u,n))&&(delete r[u],a=!0)}}return de.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||D0(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return de.forEach(this,(a,o)=>{const l=de.findKey(r,o);if(l){n[l]=ev(a),delete n[o];return}const u=t?WK(o):String(o).trim();u!==o&&delete n[o],n[u]=ev(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return de.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&de.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[xM]=this[xM]={accessors:{}}).accessors,a=this.prototype;function o(l){const u=Gd(l);r[u]||(VK(a,l),r[u]=!0)}return de.isArray(t)?t.forEach(o):o(t),this}};Pr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(Pr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});de.freezeMethods(Pr);function $0(e,t){const n=this||_h,r=t||n,a=Pr.from(r.headers);let o=r.data;return de.forEach(e,function(u){o=u.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function g5(e){return!!(e&&e.__CANCEL__)}function Ru(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(Ru,Xe,{__CANCEL__:!0});function y5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function GK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function YK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[o];l||(l=f),n[a]=d,r[a]=f;let p=o,g=0;for(;p!==a;)g+=n[p++],p=p%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-l{n=m,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-n;p>=r?l(f,m):(a=f,o||(o=setTimeout(()=>{o=null,l(a)},r-p)))},()=>a&&l(a)]}const gv=(e,t,n=3)=>{let r=0;const a=YK(50,250);return KK(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=a(d),m=l<=u;r=l;const p={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&m?(u-l)/f:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(p)},n)},bM=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wM=e=>(...t)=>de.asap(()=>e(...t)),XK=cr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,cr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(cr.origin),cr.navigator&&/(msie|trident)/i.test(cr.navigator.userAgent)):()=>!0,ZK=cr.hasStandardBrowserEnv?{write(e,t,n,r,a,o,l){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),de.isString(r)&&u.push(`path=${r}`),de.isString(a)&&u.push(`domain=${a}`),o===!0&&u.push("secure"),de.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function QK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function JK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function x5(e,t,n){let r=!QK(t);return e&&(r||n==!1)?JK(e,t):t}const jM=e=>e instanceof Pr?{...e}:e;function ol(e,t){t=t||{};const n={};function r(f,m,p,g){return de.isPlainObject(f)&&de.isPlainObject(m)?de.merge.call({caseless:g},f,m):de.isPlainObject(m)?de.merge({},m):de.isArray(m)?m.slice():m}function a(f,m,p,g){if(de.isUndefined(m)){if(!de.isUndefined(f))return r(void 0,f,p,g)}else return r(f,m,p,g)}function o(f,m){if(!de.isUndefined(m))return r(void 0,m)}function l(f,m){if(de.isUndefined(m)){if(!de.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function u(f,m,p){if(p in t)return r(f,m);if(p in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,m,p)=>a(jM(f),jM(m),p,!0)};return de.forEach(Object.keys({...e,...t}),function(m){const p=d[m]||a,g=p(e[m],t[m],m);de.isUndefined(g)&&p!==u||(n[m]=g)}),n}const b5=e=>{const t=ol({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=Pr.from(l),t.url=m5(x5(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),de.isFormData(n)){if(cr.hasStandardBrowserEnv||cr.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(de.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,p])=>{f.includes(m.toLowerCase())&&l.set(m,p)})}}if(cr.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(t)),r||r!==!1&&XK(t.url))){const d=a&&o&&ZK.read(o);d&&l.set(a,d)}return t},eX=typeof XMLHttpRequest<"u",tX=eX&&function(e){return new Promise(function(n,r){const a=b5(e);let o=a.data;const l=Pr.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=a,m,p,g,x,j;function b(){x&&x(),j&&j(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function N(){if(!w)return;const C=Pr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),E={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:C,config:e,request:w};y5(function(T){n(T),b()},function(T){r(T),b()},E),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(N)},w.onabort=function(){w&&(r(new Xe("Request aborted",Xe.ECONNABORTED,e,w)),w=null)},w.onerror=function(A){const E=A&&A.message?A.message:"Network Error",k=new Xe(E,Xe.ERR_NETWORK,e,w);k.event=A||null,r(k),w=null},w.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const E=a.transitional||p5;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),r(new Xe(A,E.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,w)),w=null},o===void 0&&l.setContentType(null),"setRequestHeader"in w&&de.forEach(l.toJSON(),function(A,E){w.setRequestHeader(E,A)}),de.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),u&&u!=="json"&&(w.responseType=a.responseType),f&&([g,j]=gv(f,!0),w.addEventListener("progress",g)),d&&w.upload&&([p,x]=gv(d),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",x)),(a.cancelToken||a.signal)&&(m=C=>{w&&(r(!C||C.type?new Ru(null,e,w):C),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const O=GK(a.url);if(O&&cr.protocols.indexOf(O)===-1){r(new Xe("Unsupported protocol "+O+":",Xe.ERR_BAD_REQUEST,e));return}w.send(o||null)})},nX=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(f){if(!a){a=!0,u();const m=f instanceof Error?f:this.reason;r.abort(m instanceof Xe?m:new Ru(m instanceof Error?m.message:m))}};let l=t&&setTimeout(()=>{l=null,o(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>de.asap(u),d}},rX=function*(e,t){let n=e.byteLength;if(n{const a=aX(e,t);let o=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await a.next();if(f){u(),d.close();return}let p=m.byteLength;if(n){let g=o+=p;n(g)}d.enqueue(new Uint8Array(m))}catch(f){throw u(f),f}},cancel(d){return u(d),a.return()}},{highWaterMark:2})},_M=64*1024,{isFunction:Sp}=de,oX=(({Request:e,Response:t})=>({Request:e,Response:t}))(de.global),{ReadableStream:NM,TextEncoder:OM}=de.global,CM=(e,...t)=>{try{return!!e(...t)}catch{return!1}},sX=e=>{e=de.merge.call({skipUndefined:!0},oX,e);const{fetch:t,Request:n,Response:r}=e,a=t?Sp(t):typeof fetch=="function",o=Sp(n),l=Sp(r);if(!a)return!1;const u=a&&Sp(NM),d=a&&(typeof OM=="function"?(j=>b=>j.encode(b))(new OM):async j=>new Uint8Array(await new n(j).arrayBuffer())),f=o&&u&&CM(()=>{let j=!1;const b=new n(cr.origin,{body:new NM,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!b}),m=l&&u&&CM(()=>de.isReadableStream(new r("").body)),p={stream:m&&(j=>j.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!p[j]&&(p[j]=(b,w)=>{let N=b&&b[j];if(N)return N.call(b);throw new Xe(`Response type '${j}' is not supported`,Xe.ERR_NOT_SUPPORT,w)})});const g=async j=>{if(j==null)return 0;if(de.isBlob(j))return j.size;if(de.isSpecCompliantForm(j))return(await new n(cr.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(de.isArrayBufferView(j)||de.isArrayBuffer(j))return j.byteLength;if(de.isURLSearchParams(j)&&(j=j+""),de.isString(j))return(await d(j)).byteLength},x=async(j,b)=>{const w=de.toFiniteNumber(j.getContentLength());return w??g(b)};return async j=>{let{url:b,method:w,data:N,signal:O,cancelToken:C,timeout:A,onDownloadProgress:E,onUploadProgress:k,responseType:T,headers:M,withCredentials:$="same-origin",fetchOptions:z}=b5(j),D=t||fetch;T=T?(T+"").toLowerCase():"text";let U=nX([O,C&&C.toAbortSignal()],A),V=null;const H=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let G;try{if(k&&f&&w!=="get"&&w!=="head"&&(G=await x(M,N))!==0){let I=new n(b,{method:"POST",body:N,duplex:"half"}),B;if(de.isFormData(N)&&(B=I.headers.get("content-type"))&&M.setContentType(B),I.body){const[Y,ne]=bM(G,gv(wM(k)));N=SM(I.body,_M,Y,ne)}}de.isString($)||($=$?"include":"omit");const L=o&&"credentials"in n.prototype,R={...z,signal:U,method:w.toUpperCase(),headers:M.normalize().toJSON(),body:N,duplex:"half",credentials:L?$:void 0};V=o&&new n(b,R);let F=await(o?D(V,z):D(b,R));const K=m&&(T==="stream"||T==="response");if(m&&(E||K&&H)){const I={};["status","statusText","headers"].forEach(oe=>{I[oe]=F[oe]});const B=de.toFiniteNumber(F.headers.get("content-length")),[Y,ne]=E&&bM(B,gv(wM(E),!0))||[];F=new r(SM(F.body,_M,Y,()=>{ne&&ne(),H&&H()}),I)}T=T||"text";let te=await p[de.findKey(p,T)||"text"](F,j);return!K&&H&&H(),await new Promise((I,B)=>{y5(I,B,{data:te,headers:Pr.from(F.headers),status:F.status,statusText:F.statusText,config:j,request:V})})}catch(L){throw H&&H(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,j,V),{cause:L.cause||L}):Xe.from(L,L&&L.code,j,V)}}},lX=new Map,w5=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let l=o.length,u=l,d,f,m=lX;for(;u--;)d=o[u],f=m.get(d),f===void 0&&m.set(d,f=u?new Map:sX(t)),m=f;return f};w5();const MO={http:NK,xhr:tX,fetch:{get:w5}};de.forEach(MO,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const EM=e=>`- ${e}`,cX=e=>de.isFunction(e)||e===null||e===!1;function uX(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let l=0;l`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since : `+l.map(EM).join(` `):" "+EM(l[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a}const j5={getAdapter:uX,adapters:MO};function I0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ru(null,e)}function AM(e){return I0(e),e.headers=Pr.from(e.headers),e.data=$0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),j5.getAdapter(e.adapter||_h.adapter,e)(e).then(function(r){return I0(e),r.data=$0.call(e,e.transformResponse,r),r.headers=Pr.from(r.headers),r},function(r){return g5(r)||(I0(e),r&&r.response&&(r.response.data=$0.call(e,e.transformResponse,r.response),r.response.headers=Pr.from(r.response.headers))),Promise.reject(r)})}const S5="1.13.2",qg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const TM={};qg.transitional=function(t,n,r){function a(o,l){return"[Axios v"+S5+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new Xe(a(l," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!TM[l]&&(TM[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};qg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function dX(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new Xe("option "+o+" must be "+d,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+o,Xe.ERR_BAD_OPTION)}}const tv={assertOptions:dX,validators:qg},Ja=tv.validators;let Qs=class{constructor(t){this.defaults=t||{},this.interceptors={request:new yM,response:new yM}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ol(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&tv.assertOptions(r,{silentJSONParsing:Ja.transitional(Ja.boolean),forcedJSONParsing:Ja.transitional(Ja.boolean),clarifyTimeoutError:Ja.transitional(Ja.boolean)},!1),a!=null&&(de.isFunction(a)?n.paramsSerializer={serialize:a}:tv.assertOptions(a,{encode:Ja.function,serialize:Ja.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),tv.assertOptions(n,{baseUrl:Ja.spelling("baseURL"),withXsrfToken:Ja.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&de.merge(o.common,o[n.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],j=>{delete o[j]}),n.headers=Pr.concat(l,o);const u=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const f=[];this.interceptors.response.forEach(function(b){f.push(b.fulfilled,b.rejected)});let m,p=0,g;if(!d){const j=[AM.bind(this),void 0];for(j.unshift(...u),j.push(...f),g=j.length,m=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(a);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new Ru(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _5(function(a){t=a}),cancel:t}}};function hX(e){return function(n){return e.apply(null,n)}}function mX(e){return de.isObject(e)&&e.isAxiosError===!0}const v_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(v_).forEach(([e,t])=>{v_[t]=e});function N5(e){const t=new Qs(e),n=n5(Qs.prototype.request,t);return de.extend(n,Qs.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return N5(ol(e,a))},n}const un=N5(_h);un.Axios=Qs;un.CanceledError=Ru;un.CancelToken=fX;un.isCancel=g5;un.VERSION=S5;un.toFormData=zg;un.AxiosError=Xe;un.Cancel=un.CanceledError;un.all=function(t){return Promise.all(t)};un.spread=hX;un.isAxiosError=mX;un.mergeConfig=ol;un.AxiosHeaders=Pr;un.formToJSON=e=>v5(de.isHTMLForm(e)?new FormData(e):e);un.getAdapter=j5.getAdapter;un.HttpStatusCode=v_;un.default=un;const{Axios:dAe,AxiosError:fAe,CanceledError:hAe,isCancel:mAe,CancelToken:pAe,VERSION:vAe,all:gAe,Cancel:yAe,isAxiosError:xAe,spread:bAe,toFormData:wAe,AxiosHeaders:jAe,HttpStatusCode:SAe,formToJSON:_Ae,getAdapter:NAe,mergeConfig:OAe}=un;function O5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),C5=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yv="-",kM=[],gX="arbitrary..",yX=e=>{const t=bX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return xX(l);const u=l.split(yv),d=u[0]===""&&u.length>1?1:0;return E5(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?pX(f,d):d:f||kM}return n[l]||kM}}},E5=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const f=E5(e,t+1,o);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(yv):e.slice(t).join(yv),d=l.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?gX+r:void 0})(),bX=e=>{const{theme:t,classGroups:n}=e;return wX(n,t)},wX=(e,t)=>{const n=C5();for(const r in e){const a=e[r];PO(a,n,r,t)}return n},PO=(e,t,n,r)=>{const a=e.length;for(let o=0;o{if(typeof e=="string"){SX(e,t,n);return}if(typeof e=="function"){_X(e,t,n,r);return}NX(e,t,n,r)},SX=(e,t,n)=>{const r=e===""?t:A5(t,e);r.classGroupId=n},_X=(e,t,n,r)=>{if(OX(e)){PO(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vX(n,e))},NX=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l{let n=e;const r=t.split(yv),a=r.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,CX=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},g_="!",MM=":",EX=[],PM=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),AX=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,u=0,d=0,f;const m=a.length;for(let b=0;bd?f-d:void 0;return PM(o,x,g,j)};if(t){const a=t+MM,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):PM(EX,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},TX=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},kX=e=>({cache:CX(e.cacheSize),parseClassName:AX(e),sortModifiers:TX(e),...yX(e)}),MX=/\s+/,PX=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],u=e.trim().split(MX);let d="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:p,modifiers:g,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let w=!!b,N=r(w?j.substring(0,b):j);if(!N){if(!w){d=m+(d.length>0?" "+d:d);continue}if(N=r(j),!N){d=m+(d.length>0?" "+d:d);continue}w=!1}const O=g.length===0?"":g.length===1?g[0]:o(g).join(":"),C=x?O+g_:O,A=C+N;if(l.indexOf(A)>-1)continue;l.push(A);const E=a(N,w);for(let k=0;k0?" "+d:d)}return d},RX=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,o;const l=d=>{const f=t.reduce((m,p)=>p(m),e());return n=kX(f),r=n.cache.get,a=n.cache.set,o=u,u(d)},u=d=>{const f=r(d);if(f)return f;const m=PX(d,n);return a(d,m),m};return o=l,(...d)=>o(RX(...d))},$X=[],En=e=>{const t=n=>n[e]||$X;return t.isThemeGetter=!0,t},k5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IX=/^\d+\/\d+$/,LX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BX=/\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$/,zX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xc=e=>IX.test(e),nt=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>!!e&&Number.isInteger(Number(e)),L0=e=>e.endsWith("%")&&nt(e.slice(0,-1)),qi=e=>LX.test(e),UX=()=>!0,HX=e=>BX.test(e)&&!zX.test(e),P5=()=>!1,WX=e=>qX.test(e),VX=e=>FX.test(e),GX=e=>!Te(e)&&!ke(e),YX=e=>Du(e,$5,P5),Te=e=>k5.test(e),Ds=e=>Du(e,I5,HX),B0=e=>Du(e,JX,nt),RM=e=>Du(e,R5,P5),KX=e=>Du(e,D5,VX),_p=e=>Du(e,L5,WX),ke=e=>M5.test(e),Yd=e=>$u(e,I5),XX=e=>$u(e,eZ),DM=e=>$u(e,R5),ZX=e=>$u(e,$5),QX=e=>$u(e,D5),Np=e=>$u(e,L5,!0),Du=(e,t,n)=>{const r=k5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$u=(e,t,n=!1)=>{const r=M5.exec(e);return r?r[1]?t(r[1]):n:!1},R5=e=>e==="position"||e==="percentage",D5=e=>e==="image"||e==="url",$5=e=>e==="length"||e==="size"||e==="bg-size",I5=e=>e==="length",JX=e=>e==="number",eZ=e=>e==="family-name",L5=e=>e==="shadow",tZ=()=>{const e=En("color"),t=En("font"),n=En("text"),r=En("font-weight"),a=En("tracking"),o=En("leading"),l=En("breakpoint"),u=En("container"),d=En("spacing"),f=En("radius"),m=En("shadow"),p=En("inset-shadow"),g=En("text-shadow"),x=En("drop-shadow"),j=En("blur"),b=En("perspective"),w=En("aspect"),N=En("ease"),O=En("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...A(),ke,Te],k=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[ke,Te,d],$=()=>[xc,"full","auto",...M()],z=()=>[Lo,"none","subgrid",ke,Te],D=()=>["auto",{span:["full",Lo,ke,Te]},Lo,ke,Te],U=()=>[Lo,"auto",ke,Te],V=()=>["auto","min","max","fr",ke,Te],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...M()],R=()=>[xc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],F=()=>[e,ke,Te],K=()=>[...A(),DM,RM,{position:[ke,Te]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",ZX,YX,{size:[ke,Te]}],B=()=>[L0,Yd,Ds],Y=()=>["","none","full",f,ke,Te],ne=()=>["",nt,Yd,Ds],oe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[nt,L0,DM,RM],ae=()=>["","none",j,ke,Te],Z=()=>["none",nt,ke,Te],pe=()=>["none",nt,ke,Te],je=()=>[nt,ke,Te],le=()=>[xc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qi],breakpoint:[qi],color:[UX],container:[qi],"drop-shadow":[qi],ease:["in","out","in-out"],font:[GX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qi],shadow:[qi],spacing:["px",nt],text:[qi],"text-shadow":[qi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xc,Te,ke,w]}],container:["container"],columns:[{columns:[nt,Te,ke,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:E()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Lo,"auto",ke,Te]}],basis:[{basis:[xc,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,xc,"auto","initial","none",Te]}],grow:[{grow:["",nt,ke,Te]}],shrink:[{shrink:["",nt,ke,Te]}],order:[{order:[Lo,"first","last","none",ke,Te]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[u,"screen",...R()]}],"min-w":[{"min-w":[u,"screen","none",...R()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",n,Yd,Ds]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,B0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",L0,Te]}],"font-family":[{font:[XX,Te,t]}],"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:[a,ke,Te]}],"line-clamp":[{"line-clamp":[nt,"none",ke,B0]}],leading:[{leading:[o,...M()]}],"list-image":[{"list-image":["none",ke,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",ke,Ds]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[nt,"auto",ke,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Te]}],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",ke,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Lo,ke,Te],radial:["",ke,Te],conic:[Lo,ke,Te]},QX,KX]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,ke,Te]}],"outline-w":[{outline:["",nt,Yd,Ds]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",m,Np,_p]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",p,Np,_p]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[nt,Ds]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",g,Np,_p]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[nt,ke,Te]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ke,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Te]}],filter:[{filter:["","none",ke,Te]}],blur:[{blur:ae()}],brightness:[{brightness:[nt,ke,Te]}],contrast:[{contrast:[nt,ke,Te]}],"drop-shadow":[{"drop-shadow":["","none",x,Np,_p]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",nt,ke,Te]}],"hue-rotate":[{"hue-rotate":[nt,ke,Te]}],invert:[{invert:["",nt,ke,Te]}],saturate:[{saturate:[nt,ke,Te]}],sepia:[{sepia:["",nt,ke,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Te]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[nt,ke,Te]}],"backdrop-contrast":[{"backdrop-contrast":[nt,ke,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,ke,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,ke,Te]}],"backdrop-invert":[{"backdrop-invert":["",nt,ke,Te]}],"backdrop-opacity":[{"backdrop-opacity":[nt,ke,Te]}],"backdrop-saturate":[{"backdrop-saturate":[nt,ke,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,ke,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",ke,Te]}],ease:[{ease:["linear","initial",N,ke,Te]}],delay:[{delay:[nt,ke,Te]}],animate:[{animate:["none",O,ke,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,Te]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[ke,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",ke,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",ke,Te]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[nt,Yd,Ds,B0]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nZ=DX(tZ);function ue(...e){return nZ(Ye(e))}const dt=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ue("rounded-xl border bg-card text-card-foreground shadow",e),...t}));dt.displayName="Card";const Vt=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));Vt.displayName="CardHeader";const Gt=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ue("font-semibold leading-none tracking-tight",e),...t}));Gt.displayName="CardTitle";const er=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));er.displayName="CardDescription";const cn=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));cn.displayName="CardContent";const B5=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));B5.displayName="CardFooter";function Se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function rZ(e,t){const n=y.createContext(t),r=o=>{const{children:l,...u}=o,d=y.useMemo(()=>u,Object.values(u));return i.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(o){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function hr(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l),d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return i.jsx(b.Provider,{value:w,children:x})};f.displayName=o+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{const o=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,aZ(a,...t)]}function aZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function $M(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rr(...e){return t=>{let n=!1;const r=e.map(a=>{const o=$M(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(sZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function iZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=cZ(a),u=lZ(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oZ=Symbol("radix.slottable");function sZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oZ}function lZ(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function cZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Nh(e){const t=e+"CollectionProvider",[n,r]=hr(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:N}=b,O=W.useRef(null),C=W.useRef(new Map).current;return i.jsx(a,{scope:w,itemMap:C,collectionRef:O,children:N})};l.displayName=t;const u=e+"CollectionSlot",d=IM(u),f=W.forwardRef((b,w)=>{const{scope:N,children:O}=b,C=o(u,N),A=qe(w,C.collectionRef);return i.jsx(d,{ref:A,children:O})});f.displayName=u;const m=e+"CollectionItemSlot",p="data-radix-collection-item",g=IM(m),x=W.forwardRef((b,w)=>{const{scope:N,children:O,...C}=b,A=W.useRef(null),E=qe(w,A),k=o(m,N);return W.useEffect(()=>(k.itemMap.set(A,{ref:A,...C}),()=>void k.itemMap.delete(A))),i.jsx(g,{[p]:"",ref:E,children:O})});x.displayName=m;function j(b){const w=o(e+"CollectionConsumer",b);return W.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const C=Array.from(O.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((k,T)=>C.indexOf(k.ref.current)-C.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},j,r]}var Un=globalThis?.document?y.useLayoutEffect:()=>{},uZ=yO[" useId ".trim().toString()]||(()=>{}),dZ=0;function Fn(e){const[t,n]=y.useState(uZ());return Un(()=>{n(r=>r??String(dZ++))},[e]),t?`radix-${t}`:""}function fZ(e){const t=hZ(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(pZ);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function hZ(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=gZ(a),u=vZ(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mZ=Symbol("radix.slottable");function pZ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mZ}function vZ(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function gZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=yZ.reduce((e,t)=>{const n=fZ(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function RO(e,t){e&&yl.flushSync(()=>e.dispatchEvent(t))}function nn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var xZ=yO[" useInsertionEffect ".trim().toString()]||Un;function Na({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,l]=bZ({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,r])}const f=y.useCallback(m=>{if(u){const p=wZ(m)?m(e):m;p!==e&&l.current?.(p)}else o(m)},[u,e,o,l]);return[d,f]}function bZ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),o=y.useRef(t);return xZ(()=>{o.current=t},[t]),y.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function wZ(e){return typeof e=="function"}var jZ=y.createContext(void 0);function Iu(e){const t=y.useContext(jZ);return e||t||"ltr"}var z0="rovingFocusGroup.onEntryFocus",SZ={bubbles:!1,cancelable:!0},Oh="RovingFocusGroup",[y_,z5,_Z]=Nh(Oh),[NZ,Fg]=hr(Oh,[_Z]),[OZ,CZ]=NZ(Oh),q5=y.forwardRef((e,t)=>i.jsx(y_.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(y_.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(EZ,{...e,ref:t})})}));q5.displayName=Oh;var EZ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=e,g=y.useRef(null),x=qe(t,g),j=Iu(o),[b,w]=Na({prop:l,defaultProp:u??null,onChange:d,caller:Oh}),[N,O]=y.useState(!1),C=nn(f),A=z5(n),E=y.useRef(!1),[k,T]=y.useState(0);return y.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(z0,C),()=>M.removeEventListener(z0,C)},[C]),i.jsx(OZ,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:y.useCallback(M=>w(M),[w]),onItemShiftTab:y.useCallback(()=>O(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:y.useCallback(()=>T(M=>M-1),[]),children:i.jsx(Pe.div,{tabIndex:N||k===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,M=>{const $=!E.current;if(M.target===M.currentTarget&&$&&!N){const z=new CustomEvent(z0,SZ);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const D=A().filter(L=>L.focusable),U=D.find(L=>L.active),V=D.find(L=>L.id===b),G=[U,V,...D].filter(Boolean).map(L=>L.ref.current);H5(G,m)}}E.current=!1}),onBlur:Se(e.onBlur,()=>O(!1))})})}),F5="RovingFocusGroupItem",U5=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:l,...u}=e,d=Fn(),f=o||d,m=CZ(F5,n),p=m.currentTabStopId===f,g=z5(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=m;return y.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),i.jsx(y_.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:i.jsx(Pe.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Se(e.onMouseDown,w=>{r?m.onItemFocus(f):w.preventDefault()}),onFocus:Se(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Se(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){m.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=kZ(w,m.orientation,m.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=g().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")C.reverse();else if(N==="prev"||N==="next"){N==="prev"&&C.reverse();const A=C.indexOf(w.currentTarget);C=m.loop?MZ(C,A+1):C.slice(A+1)}setTimeout(()=>H5(C))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:b!=null}):l})})});U5.displayName=F5;var AZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function TZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kZ(e,t,n){const r=TZ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return AZ[r]}function H5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function MZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var W5=q5,V5=U5;function PZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Rn=e=>{const{present:t,children:n}=e,r=RZ(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=qe(r.ref,DZ(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:o}):null};Rn.displayName="Presence";function RZ(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=PZ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Op(r.current);o.current=u==="mounted"?f:"none"},[u]),Un(()=>{const f=r.current,m=a.current;if(m!==e){const g=o.current,x=Op(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Un(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=x=>{const b=Op(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=x=>{x.target===t&&(o.current=Op(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Op(e){return e?.animationName||"none"}function DZ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ug="Tabs",[$Z]=hr(Ug,[Fg]),G5=Fg(),[IZ,DO]=$Z(Ug),Y5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,m=Iu(u),[p,g]=Na({prop:r,onChange:a,defaultProp:o??"",caller:Ug});return i.jsx(IZ,{scope:n,baseId:Fn(),value:p,onValueChange:g,orientation:l,dir:m,activationMode:d,children:i.jsx(Pe.div,{dir:m,"data-orientation":l,...f,ref:t})})});Y5.displayName=Ug;var K5="TabsList",X5=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=DO(K5,n),l=G5(n);return i.jsx(W5,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:i.jsx(Pe.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});X5.displayName=K5;var Z5="TabsTrigger",Q5=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,l=DO(Z5,n),u=G5(n),d=tB(l.baseId,r),f=nB(l.baseId,r),m=r===l.value;return i.jsx(V5,{asChild:!0,...u,focusable:!a,active:m,children:i.jsx(Pe.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...o,ref:t,onMouseDown:Se(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:Se(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:Se(e.onFocus,()=>{const p=l.activationMode!=="manual";!m&&!a&&p&&l.onValueChange(r)})})})});Q5.displayName=Z5;var J5="TabsContent",eB=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...l}=e,u=DO(J5,n),d=tB(u.baseId,r),f=nB(u.baseId,r),m=r===u.value,p=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),i.jsx(Rn,{present:a||m,children:({present:g})=>i.jsx(Pe.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});eB.displayName=J5;function tB(e,t){return`${e}-trigger-${t}`}function nB(e,t){return`${e}-content-${t}`}var LZ=Y5,rB=X5,aB=Q5,iB=eB;const sl=LZ,Zo=y.forwardRef(({className:e,...t},n)=>i.jsx(rB,{ref:n,className:ue("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Zo.displayName=rB.displayName;const Ct=y.forwardRef(({className:e,...t},n)=>i.jsx(aB,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Ct.displayName=aB.displayName;const Jt=y.forwardRef(({className:e,...t},n)=>i.jsx(iB,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));Jt.displayName=iB.displayName;function Cf(e,[t,n]){return Math.min(n,Math.max(t,e))}function BZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var $O="ScrollArea",[oB]=hr($O),[zZ,Ca]=oB($O),sB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...l}=e,[u,d]=y.useState(null),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,O]=y.useState(0),[C,A]=y.useState(0),[E,k]=y.useState(!1),[T,M]=y.useState(!1),$=qe(t,D=>d(D)),z=Iu(a);return i.jsx(zZ,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:u,viewport:f,onViewportChange:m,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:E,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:M,onCornerWidthChange:O,onCornerHeightChange:A,children:i.jsx(Pe.div,{dir:z,...l,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});sB.displayName=$O;var lB="ScrollAreaViewport",cB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,l=Ca(lB,n),u=y.useRef(null),d=qe(t,u,l.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),i.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});cB.displayName=lB;var yi="ScrollAreaScrollbar",IO=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ca(yi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),a.type==="hover"?i.jsx(qZ,{...r,ref:t,forceMount:n}):a.type==="scroll"?i.jsx(FZ,{...r,ref:t,forceMount:n}):a.type==="auto"?i.jsx(uB,{...r,ref:t,forceMount:n}):a.type==="always"?i.jsx(LO,{...r,ref:t}):null});IO.displayName=yi;var qZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ca(yi,e.__scopeScrollArea),[o,l]=y.useState(!1);return y.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},m=()=>{d=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),i.jsx(Rn,{present:n||o,children:i.jsx(uB,{"data-state":o?"visible":"hidden",...r,ref:t})})}),FZ=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Ca(yi,e.__scopeScrollArea),o=e.orientation==="horizontal",l=Wg(()=>d("SCROLL_END"),100),[u,d]=BZ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,a.scrollHideDelay,d]),y.useEffect(()=>{const f=a.viewport,m=o?"scrollLeft":"scrollTop";if(f){let p=f[m];const g=()=>{const x=f[m];p!==x&&(d("SCROLL"),l()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,o,d,l]),i.jsx(Rn,{present:n||u!=="hidden",children:i.jsx(LO,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Se(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Se(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),uB=y.forwardRef((e,t)=>{const n=Ca(yi,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,l]=y.useState(!1),u=e.orientation==="horizontal",d=Wg(()=>{if(n.viewport){const f=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Ca(yi,e.__scopeScrollArea),o=y.useRef(null),l=y.useRef(0),[u,d]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=pB(u.viewport,u.content),m={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function p(g,x){return YZ(g,l.current,u,x)}return n==="horizontal"?i.jsx(UZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollLeft,x=LM(g,u,a.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?i.jsx(HZ,{...m,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollTop,x=LM(g,u);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),UZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Ca(yi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,o.onScrollbarXChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(fB,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Hg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(o.viewport){const g=o.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),gB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:bv(l.paddingLeft),paddingEnd:bv(l.paddingRight)}})}})}),HZ=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Ca(yi,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=qe(t,d,o.onScrollbarYChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(fB,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Hg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(o.viewport){const g=o.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),gB(g,p)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:bv(l.paddingTop),paddingEnd:bv(l.paddingBottom)}})}})}),[WZ,dB]=oB(yi),fB=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:p,...g}=e,x=Ca(yi,n),[j,b]=y.useState(null),w=qe(t,$=>b($)),N=y.useRef(null),O=y.useRef(""),C=x.viewport,A=r.content-r.viewport,E=nn(m),k=nn(d),T=Wg(p,10);function M($){if(N.current){const z=$.clientX-N.current.left,D=$.clientY-N.current.top;f({x:z,y:D})}}return y.useEffect(()=>{const $=z=>{const D=z.target;j?.contains(D)&&E(z,A)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[C,j,A,E]),y.useEffect(k,[r,k]),tu(j,T),tu(x.content,T),i.jsx(WZ,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:nn(o),onThumbPointerUp:nn(l),onThumbPositionChange:k,onThumbPointerDown:nn(u),children:i.jsx(Pe.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Se(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),N.current=j.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),M($))}),onPointerMove:Se(e.onPointerMove,M),onPointerUp:Se(e.onPointerUp,$=>{const z=$.target;z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=O.current,x.viewport&&(x.viewport.style.scrollBehavior=""),N.current=null})})})}),xv="ScrollAreaThumb",hB=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=dB(xv,e.__scopeScrollArea);return i.jsx(Rn,{present:n||a.hasThumb,children:i.jsx(VZ,{ref:t,...r})})}),VZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Ca(xv,n),l=dB(xv,n),{onThumbPositionChange:u}=l,d=qe(t,p=>l.onThumbChange(p)),f=y.useRef(void 0),m=Wg(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const p=o.viewport;if(p){const g=()=>{if(m(),!f.current){const x=KZ(p,u);f.current=x,u()}};return u(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,m,u]),i.jsx(Pe.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Se(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;l.onThumbPointerDown({x:j,y:b})}),onPointerUp:Se(e.onPointerUp,l.onThumbPointerUp)})});hB.displayName=xv;var BO="ScrollAreaCorner",mB=y.forwardRef((e,t)=>{const n=Ca(BO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(GZ,{...e,ref:t}):null});mB.displayName=BO;var GZ=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Ca(BO,n),[o,l]=y.useState(0),[u,d]=y.useState(0),f=!!(o&&u);return tu(a.scrollbarX,()=>{const m=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(m),d(m)}),tu(a.scrollbarY,()=>{const m=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(m),l(m)}),f?i.jsx(Pe.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function bv(e){return e?parseInt(e,10):0}function pB(e,t){const n=e/t;return isNaN(n)?0:n}function Hg(e){const t=pB(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function YZ(e,t,n,r="ltr"){const a=Hg(n),o=a/2,l=t||o,u=a-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return vB([d,f],p)(e)}function LM(e,t,n="ltr"){const r=Hg(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,l=t.content-t.viewport,u=o-r,d=n==="ltr"?[0,l]:[l*-1,0],f=Cf(e,d);return vB([0,l],[0,u])(f)}function vB(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function gB(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Wg(e,t){const n=nn(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function tu(e,t){const n=nn(t);Un(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var yB=sB,XZ=cB,ZZ=mB;const Kt=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(yB,{ref:r,className:ue("relative overflow-hidden",e),...n,children:[i.jsx(XZ,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(xB,{}),i.jsx(ZZ,{})]}));Kt.displayName=yB.displayName;const xB=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(IO,{ref:r,orientation:t,className:ue("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(hB,{className:"relative flex-1 rounded-full bg-border"})}));xB.displayName=IO.displayName;var q0,BM;function Lr(){if(BM)return q0;BM=1;var e=Array.isArray;return q0=e,q0}var F0,zM;function bB(){if(zM)return F0;zM=1;var e=typeof yp=="object"&&yp&&yp.Object===Object&&yp;return F0=e,F0}var U0,qM;function xi(){if(qM)return U0;qM=1;var e=bB(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return U0=n,U0}var H0,FM;function Ch(){if(FM)return H0;FM=1;var e=xi(),t=e.Symbol;return H0=t,H0}var W0,UM;function QZ(){if(UM)return W0;UM=1;var e=Ch(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function o(l){var u=n.call(l,a),d=l[a];try{l[a]=void 0;var f=!0}catch{}var m=r.call(l);return f&&(u?l[a]=d:delete l[a]),m}return W0=o,W0}var V0,HM;function JZ(){if(HM)return V0;HM=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return V0=n,V0}var G0,WM;function lo(){if(WM)return G0;WM=1;var e=Ch(),t=QZ(),n=JZ(),r="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:r:o&&o in Object(u)?t(u):n(u)}return G0=l,G0}var Y0,VM;function co(){if(VM)return Y0;VM=1;function e(t){return t!=null&&typeof t=="object"}return Y0=e,Y0}var K0,GM;function Lu(){if(GM)return K0;GM=1;var e=lo(),t=co(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return K0=r,K0}var X0,YM;function zO(){if(YM)return X0;YM=1;var e=Lr(),t=Lu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return X0=a,X0}var Z0,KM;function as(){if(KM)return Z0;KM=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Z0=e,Z0}var Q0,XM;function qO(){if(XM)return Q0;XM=1;var e=lo(),t=as(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==a||d==n||d==o}return Q0=l,Q0}var J0,ZM;function eQ(){if(ZM)return J0;ZM=1;var e=xi(),t=e["__core-js_shared__"];return J0=t,J0}var ew,QM;function tQ(){if(QM)return ew;QM=1;var e=eQ(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return ew=n,ew}var tw,JM;function wB(){if(JM)return tw;JM=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return tw=n,tw}var nw,eP;function nQ(){if(eP)return nw;eP=1;var e=qO(),t=tQ(),n=as(),r=wB(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,f=u.hasOwnProperty,m=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var x=e(g)?m:o;return x.test(r(g))}return nw=p,nw}var rw,tP;function rQ(){if(tP)return rw;tP=1;function e(t,n){return t?.[n]}return rw=e,rw}var aw,nP;function xl(){if(nP)return aw;nP=1;var e=nQ(),t=rQ();function n(r,a){var o=t(r,a);return e(o)?o:void 0}return aw=n,aw}var iw,rP;function Vg(){if(rP)return iw;rP=1;var e=xl(),t=e(Object,"create");return iw=t,iw}var ow,aP;function aQ(){if(aP)return ow;aP=1;var e=Vg();function t(){this.__data__=e?e(null):{},this.size=0}return ow=t,ow}var sw,iP;function iQ(){if(iP)return sw;iP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return sw=e,sw}var lw,oP;function oQ(){if(oP)return lw;oP=1;var e=Vg(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(o){var l=this.__data__;if(e){var u=l[o];return u===t?void 0:u}return r.call(l,o)?l[o]:void 0}return lw=a,lw}var cw,sP;function sQ(){if(sP)return cw;sP=1;var e=Vg(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var o=this.__data__;return e?o[a]!==void 0:n.call(o,a)}return cw=r,cw}var uw,lP;function lQ(){if(lP)return uw;lP=1;var e=Vg(),t="__lodash_hash_undefined__";function n(r,a){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&a===void 0?t:a,this}return uw=n,uw}var dw,cP;function cQ(){if(cP)return dw;cP=1;var e=aQ(),t=iQ(),n=oQ(),r=sQ(),a=lQ();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u-1}return gw=t,gw}var yw,vP;function mQ(){if(vP)return yw;vP=1;var e=Gg();function t(n,r){var a=this.__data__,o=e(a,n);return o<0?(++this.size,a.push([n,r])):a[o][1]=r,this}return yw=t,yw}var xw,gP;function Yg(){if(gP)return xw;gP=1;var e=uQ(),t=dQ(),n=fQ(),r=hQ(),a=mQ();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u0?1:-1},Hs=function(t){return ll(t)&&t.indexOf("%")===t.length-1},Oe=function(t){return IQ(t)&&!Eh(t)},LQ=function(t){return Ge(t)},Mn=function(t){return Oe(t)||ll(t)},BQ=0,zu=function(t){var n=++BQ;return"".concat(t||"").concat(n)},wr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&!ll(t))return r;var o;if(Hs(t)){var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return Eh(o)&&(o=r),a&&o>n&&(o=n),o},Fo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},zQ=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function b_(e){"@babel/helpers - typeof";return b_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b_(e)}var WP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Qi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},VP=null,Ww=null,YO=function e(t){if(t===VP&&Array.isArray(Ww))return Ww;var n=[];return y.Children.forEach(t,function(r){Ge(r)||(PQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Ww=n,VP=t,n};function na(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Qi(a)}):r=[Qi(t)],YO(e).forEach(function(a){var o=ta(a,"type.displayName")||ta(a,"type.name");r.indexOf(o)!==-1&&n.push(a)}),n}function Kr(e,t){var n=na(e,t);return n&&n[0]}var GP=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Oe(r)||r<=0||!Oe(a)||a<=0)},YQ=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],KQ=function(t){return t&&t.type&&ll(t.type)&&YQ.indexOf(t.type)>=0},XQ=function(t){return t&&b_(t)==="object"&&"clipDot"in t},ZQ=function(t,n,r,a){var o,l=(o=Hw?.[a])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!We(t)&&(a&&l.includes(n)||UQ.includes(n))||r&&GO.includes(n)},Be=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(y.isValidElement(t)&&(a=t.props),!Bu(a))return null;var o={};return Object.keys(a).forEach(function(l){var u;ZQ((u=a)===null||u===void 0?void 0:u[l],l,n,r)&&(o[l]=a[l])}),o},w_=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return YP(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function S_(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,d=e.desc,f=tJ(e,eJ),m=a||{width:n,height:r,x:0,y:0},p=Ye("recharts-surface",o);return W.createElement("svg",j_({},Be(f,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),W.createElement("title",null,u),W.createElement("desc",null,d),t)}var rJ=["children","className"];function __(){return __=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var pt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=aJ(e,rJ),o=Ye("recharts-layer",r);return W.createElement("g",__({className:o},Be(a,!0),{ref:t}),n)}),qa=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;oo?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(o);++a=o?n:e(n,r,a)}return Gw=t,Gw}var Yw,QP;function CB(){if(QP)return Yw;QP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+o+"]");function d(f){return u.test(f)}return Yw=d,Yw}var Kw,JP;function lJ(){if(JP)return Kw;JP=1;function e(t){return t.split("")}return Kw=e,Kw}var Xw,eR;function cJ(){if(eR)return Xw;eR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+d+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+o+"]?",w="(?:"+x+"(?:"+[m,p,g].join("|")+")"+b+j+")*",N=b+j+w,O="(?:"+[m+u+"?",u,p,g,l].join("|")+")",C=RegExp(d+"(?="+d+")|"+O+N,"g");function A(E){return E.match(C)||[]}return Xw=A,Xw}var Zw,tR;function uJ(){if(tR)return Zw;tR=1;var e=lJ(),t=CB(),n=cJ();function r(a){return t(a)?n(a):e(a)}return Zw=r,Zw}var Qw,nR;function dJ(){if(nR)return Qw;nR=1;var e=sJ(),t=CB(),n=uJ(),r=SB();function a(o){return function(l){l=r(l);var u=t(l)?n(l):void 0,d=u?u[0]:l.charAt(0),f=u?e(u,1).join(""):l.slice(1);return d[o]()+f}}return Qw=a,Qw}var Jw,rR;function fJ(){if(rR)return Jw;rR=1;var e=dJ(),t=e("toUpperCase");return Jw=t,Jw}var hJ=fJ();const Zg=St(hJ);function zt(e){return function(){return e}}const EB=Math.cos,Sv=Math.sin,Va=Math.sqrt,_v=Math.PI,Qg=2*_v,N_=Math.PI,O_=2*N_,Bs=1e-6,mJ=O_-Bs;function AB(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return AB;const n=10**t;return function(r){this._+=r[0];for(let a=1,o=r.length;aBs)if(!(Math.abs(p*d-f*m)>Bs)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,j=a-u,b=d*d+f*f,w=x*x+j*j,N=Math.sqrt(b),O=Math.sqrt(g),C=o*Math.tan((N_-Math.acos((b+g-w)/(2*N*O)))/2),A=C/O,E=C/N;Math.abs(A-1)>Bs&&this._append`L${t+A*m},${n+A*p}`,this._append`A${o},${o},0,0,${+(p*x>m*j)},${this._x1=t+E*d},${this._y1=n+E*f}`}}arc(t,n,r,a,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(a),d=r*Math.sin(a),f=t+u,m=n+d,p=1^l,g=l?a-o:o-a;this._x1===null?this._append`M${f},${m}`:(Math.abs(this._x1-f)>Bs||Math.abs(this._y1-m)>Bs)&&this._append`L${f},${m}`,r&&(g<0&&(g=g%O_+O_),g>mJ?this._append`A${r},${r},0,1,${p},${t-u},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=m}`:g>Bs&&this._append`A${r},${r},0,${+(g>=N_)},${p},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function KO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new vJ(t)}function XO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TB(e){this._context=e}TB.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 Jg(e){return new TB(e)}function kB(e){return e[0]}function MB(e){return e[1]}function PB(e,t){var n=zt(!0),r=null,a=Jg,o=null,l=KO(u);e=typeof e=="function"?e:e===void 0?kB:zt(e),t=typeof t=="function"?t:t===void 0?MB:zt(t);function u(d){var f,m=(d=XO(d)).length,p,g=!1,x;for(r==null&&(o=a(x=l())),f=0;f<=m;++f)!(f=x;--j)u.point(C[j],A[j]);u.lineEnd(),u.areaEnd()}N&&(C[g]=+e(w,g,p),A[g]=+t(w,g,p),u.point(r?+r(w,g,p):C[g],n?+n(w,g,p):A[g]))}if(O)return u=null,O+""||null}function m(){return PB().defined(a).curve(l).context(o)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:zt(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:zt(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:zt(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:zt(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:zt(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:zt(+p),f):n},f.lineX0=f.lineY0=function(){return m().x(e).y(t)},f.lineY1=function(){return m().x(e).y(n)},f.lineX1=function(){return m().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:zt(!!p),f):a},f.curve=function(p){return arguments.length?(l=p,o!=null&&(u=l(o)),f):l},f.context=function(p){return arguments.length?(p==null?o=u=null:u=l(o=p),f):o},f}class RB{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function gJ(e){return new RB(e,!0)}function yJ(e){return new RB(e,!1)}const ZO={draw(e,t){const n=Va(t/_v);e.moveTo(n,0),e.arc(0,0,n,0,Qg)}},xJ={draw(e,t){const n=Va(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},DB=Va(1/3),bJ=DB*2,wJ={draw(e,t){const n=Va(t/bJ),r=n*DB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},jJ={draw(e,t){const n=Va(t),r=-n/2;e.rect(r,r,n,n)}},SJ=.8908130915292852,$B=Sv(_v/10)/Sv(7*_v/10),_J=Sv(Qg/10)*$B,NJ=-EB(Qg/10)*$B,OJ={draw(e,t){const n=Va(t*SJ),r=_J*n,a=NJ*n;e.moveTo(0,-n),e.lineTo(r,a);for(let o=1;o<5;++o){const l=Qg*o/5,u=EB(l),d=Sv(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*a,d*r+u*a)}e.closePath()}},ej=Va(3),CJ={draw(e,t){const n=-Va(t/(ej*3));e.moveTo(0,n*2),e.lineTo(-ej*n,-n),e.lineTo(ej*n,-n),e.closePath()}},ga=-.5,ya=Va(3)/2,C_=1/Va(12),EJ=(C_/2+1)*3,AJ={draw(e,t){const n=Va(t/EJ),r=n/2,a=n*C_,o=r,l=n*C_+n,u=-o,d=l;e.moveTo(r,a),e.lineTo(o,l),e.lineTo(u,d),e.lineTo(ga*r-ya*a,ya*r+ga*a),e.lineTo(ga*o-ya*l,ya*o+ga*l),e.lineTo(ga*u-ya*d,ya*u+ga*d),e.lineTo(ga*r+ya*a,ga*a-ya*r),e.lineTo(ga*o+ya*l,ga*l-ya*o),e.lineTo(ga*u+ya*d,ga*d-ya*u),e.closePath()}};function TJ(e,t){let n=null,r=KO(a);e=typeof e=="function"?e:zt(e||ZO),t=typeof t=="function"?t:zt(t===void 0?64:+t);function a(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return a.type=function(o){return arguments.length?(e=typeof o=="function"?o:zt(o),a):e},a.size=function(o){return arguments.length?(t=typeof o=="function"?o:zt(+o),a):t},a.context=function(o){return arguments.length?(n=o??null,a):n},a}function Nv(){}function Ov(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 IB(e){this._context=e}IB.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:Ov(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:Ov(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kJ(e){return new IB(e)}function LB(e){this._context=e}LB.prototype={areaStart:Nv,areaEnd:Nv,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:Ov(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MJ(e){return new LB(e)}function BB(e){this._context=e}BB.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:Ov(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PJ(e){return new BB(e)}function zB(e){this._context=e}zB.prototype={areaStart:Nv,areaEnd:Nv,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 RJ(e){return new zB(e)}function aR(e){return e<0?-1:1}function iR(e,t,n){var r=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(r||a<0&&-0),l=(n-e._y1)/(a||r<0&&-0),u=(o*a+l*r)/(r+a);return(aR(o)+aR(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function oR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tj(e,t,n){var r=e._x0,a=e._y0,o=e._x1,l=e._y1,u=(o-r)/3;e._context.bezierCurveTo(r+u,a+u*t,o-u,l-u*n,o,l)}function Cv(e){this._context=e}Cv.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:tj(this,this._t0,oR(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,tj(this,oR(this,n=iR(this,e,t)),n);break;default:tj(this,this._t0,n=iR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function qB(e){this._context=new FB(e)}(qB.prototype=Object.create(Cv.prototype)).point=function(e,t){Cv.prototype.point.call(this,t,e)};function FB(e){this._context=e}FB.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,a,o){this._context.bezierCurveTo(t,e,r,n,o,a)}};function DJ(e){return new Cv(e)}function $J(e){return new qB(e)}function UB(e){this._context=e}UB.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=sR(e),a=sR(t),o=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/o[t];for(o[n-1]=(e[n]+a[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var 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 LJ(e){return new ey(e,.5)}function BJ(e){return new ey(e,0)}function zJ(e){return new ey(e,1)}function nu(e,t){if((l=e.length)>1)for(var n=1,r,a,o=e[t[0]],l,u=o.length;n=0;)n[t]=t;return n}function qJ(e,t){return e[t]}function FJ(e){const t=[];return t.key=e,t}function UJ(){var e=zt([]),t=E_,n=nu,r=qJ;function a(o){var l=Array.from(e.apply(this,arguments),FJ),u,d=l.length,f=-1,m;for(const p of o)for(u=0,++f;u0){for(var n,r,a=0,o=e[0].length,l;a0){for(var n=0,r=e[t[0]],a,o=r.length;n0)||!((o=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,o,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var HB={symbolCircle:ZO,symbolCross:xJ,symbolDiamond:wJ,symbolSquare:jJ,symbolStar:OJ,symbolTriangle:CJ,symbolWye:AJ},JJ=Math.PI/180,eee=function(t){var n="symbol".concat(Zg(t));return HB[n]||ZO},tee=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*JJ;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},nee=function(t,n){HB["symbol".concat(Zg(t))]=n},QO=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,o=a===void 0?64:a,l=t.sizeType,u=l===void 0?"area":l,d=ZJ(t,GJ),f=cR(cR({},d),{},{type:r,size:o,sizeType:u}),m=function(){var w=eee(r),N=TJ().type(w).size(tee(o,u,r));return N()},p=f.className,g=f.cx,x=f.cy,j=Be(f,!0);return g===+g&&x===+x&&o===+o?W.createElement("path",A_({},j,{className:Ye("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:m()})):null};QO.registerSymbol=nee;function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function T_(){return T_=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=x.inactive?f:x.color;return W.createElement("li",T_({className:w,style:p,key:"legend-item-".concat(j)},cl(r.props,x,j)),W.createElement(S_,{width:l,height:l,viewBox:m,style:g},r.renderIcon(x)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},b?b(N,x,j):N))})}},{key:"render",value:function(){var r=this.props,a=r.payload,o=r.layout,l=r.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?l:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(y.PureComponent);Af(JO,"displayName","Legend");Af(JO,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var nj,dR;function fee(){if(dR)return nj;dR=1;var e=Yg();function t(){this.__data__=new e,this.size=0}return nj=t,nj}var rj,fR;function hee(){if(fR)return rj;fR=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return rj=e,rj}var aj,hR;function mee(){if(hR)return aj;hR=1;function e(t){return this.__data__.get(t)}return aj=e,aj}var ij,mR;function pee(){if(mR)return ij;mR=1;function e(t){return this.__data__.has(t)}return ij=e,ij}var oj,pR;function vee(){if(pR)return oj;pR=1;var e=Yg(),t=UO(),n=HO(),r=200;function a(o,l){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthx))return!1;var b=p.get(l),w=p.get(u);if(b&&w)return b==u&&w==l;var N=-1,O=!0,C=d&a?new e:void 0;for(p.set(l,u),p.set(u,l);++N-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Ej=t,Ej}var Aj,BR;function Aee(){if(BR)return Aj;BR=1;var e=lo(),t=rC(),n=co(),r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object RegExp]",x="[object Set]",j="[object String]",b="[object WeakMap]",w="[object ArrayBuffer]",N="[object DataView]",O="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",M="[object Uint8ClampedArray]",$="[object Uint16Array]",z="[object Uint32Array]",D={};D[O]=D[C]=D[A]=D[E]=D[k]=D[T]=D[M]=D[$]=D[z]=!0,D[r]=D[a]=D[w]=D[o]=D[N]=D[l]=D[u]=D[d]=D[f]=D[m]=D[p]=D[g]=D[x]=D[j]=D[b]=!1;function U(V){return n(V)&&t(V.length)&&!!D[e(V)]}return Aj=U,Aj}var Tj,zR;function ez(){if(zR)return Tj;zR=1;function e(t){return function(n){return t(n)}}return Tj=e,Tj}var cf={exports:{}};cf.exports;var qR;function Tee(){return qR||(qR=1,(function(e,t){var n=bB(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,l=o&&n.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(cf,cf.exports)),cf.exports}var kj,FR;function tz(){if(FR)return kj;FR=1;var e=Aee(),t=ez(),n=Tee(),r=n&&n.isTypedArray,a=r?t(r):e;return kj=a,kj}var Mj,UR;function kee(){if(UR)return Mj;UR=1;var e=Oee(),t=tC(),n=Lr(),r=JB(),a=nC(),o=tz(),l=Object.prototype,u=l.hasOwnProperty;function d(f,m){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&o(f),b=p||g||x||j,w=b?e(f.length,String):[],N=w.length;for(var O in f)(m||u.call(f,O))&&!(b&&(O=="length"||x&&(O=="offset"||O=="parent")||j&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||a(O,N)))&&w.push(O);return w}return Mj=d,Mj}var Pj,HR;function Mee(){if(HR)return Pj;HR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Pj=t,Pj}var Rj,WR;function nz(){if(WR)return Rj;WR=1;function e(t,n){return function(r){return t(n(r))}}return Rj=e,Rj}var Dj,VR;function Pee(){if(VR)return Dj;VR=1;var e=nz(),t=e(Object.keys,Object);return Dj=t,Dj}var $j,GR;function Ree(){if(GR)return $j;GR=1;var e=Mee(),t=Pee(),n=Object.prototype,r=n.hasOwnProperty;function a(o){if(!e(o))return t(o);var l=[];for(var u in Object(o))r.call(o,u)&&u!="constructor"&&l.push(u);return l}return $j=a,$j}var Ij,YR;function Ah(){if(YR)return Ij;YR=1;var e=qO(),t=rC();function n(r){return r!=null&&t(r.length)&&!e(r)}return Ij=n,Ij}var Lj,KR;function ty(){if(KR)return Lj;KR=1;var e=kee(),t=Ree(),n=Ah();function r(a){return n(a)?e(a):t(a)}return Lj=r,Lj}var Bj,XR;function Dee(){if(XR)return Bj;XR=1;var e=jee(),t=Nee(),n=ty();function r(a){return e(a,n,t)}return Bj=r,Bj}var zj,ZR;function $ee(){if(ZR)return zj;ZR=1;var e=Dee(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(o,l,u,d,f,m){var p=u&t,g=e(o),x=g.length,j=e(l),b=j.length;if(x!=b&&!p)return!1;for(var w=x;w--;){var N=g[w];if(!(p?N in l:r.call(l,N)))return!1}var O=m.get(o),C=m.get(l);if(O&&C)return O==l&&C==o;var A=!0;m.set(o,l),m.set(l,o);for(var E=p;++w-1}return f1=t,f1}var h1,_D;function nte(){if(_D)return h1;_D=1;function e(t,n,r){for(var a=-1,o=t==null?0:t.length;++a=l){var N=f?null:a(d);if(N)return o(N);j=!1,g=r,w=new e}else w=f?[]:b;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yte(e){return e.value}function xte(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=vte(t,lte);return W.createElement(JO,n)}var MD=1,Js=(function(e){function t(){var n;cte(this,t);for(var r=arguments.length,a=new Array(r),o=0;oMD||Math.abs(a.height-this.lastBoundingBox.height)>MD)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Fi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,o=a.layout,l=a.align,u=a.verticalAlign,d=a.margin,f=a.chartWidth,m=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&o==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(u==="middle"){var j=this.getBBoxSnapshot();g={top:((m||0)-j.height)/2}}else g=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Fi(Fi({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,o=a.content,l=a.width,u=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,m=a.payload,p=Fi(Fi({position:"absolute",width:l||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},xte(o,Fi(Fi({},this.props),{},{payload:sz(m,f,yte)})))}}],[{key:"getWithHeight",value:function(r,a){var o=Fi(Fi({},this.defaultProps),r.props),l=o.layout;return l==="vertical"&&Oe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||a}:null}}])})(y.PureComponent);ny(Js,"displayName","Legend");ny(Js,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var y1,PD;function bte(){if(PD)return y1;PD=1;var e=Ch(),t=tC(),n=Lr(),r=e?e.isConcatSpreadable:void 0;function a(o){return n(o)||t(o)||!!(r&&o&&o[r])}return y1=a,y1}var x1,RD;function uz(){if(RD)return x1;RD=1;var e=QB(),t=bte();function n(r,a,o,l,u){var d=-1,f=r.length;for(o||(o=t),u||(u=[]);++d0&&o(m)?a>1?n(m,a-1,o,l,u):e(u,m):l||(u[u.length]=m)}return u}return x1=n,x1}var b1,DD;function wte(){if(DD)return b1;DD=1;function e(t){return function(n,r,a){for(var o=-1,l=Object(n),u=a(n),d=u.length;d--;){var f=u[t?d:++o];if(r(l[f],f,l)===!1)break}return n}}return b1=e,b1}var w1,$D;function jte(){if($D)return w1;$D=1;var e=wte(),t=e();return w1=t,w1}var j1,ID;function dz(){if(ID)return j1;ID=1;var e=jte(),t=ty();function n(r,a){return r&&e(r,a,t)}return j1=n,j1}var S1,LD;function Ste(){if(LD)return S1;LD=1;var e=Ah();function t(n,r){return function(a,o){if(a==null)return a;if(!e(a))return n(a,o);for(var l=a.length,u=r?l:-1,d=Object(a);(r?u--:++ur||u&&d&&m&&!f&&!p||o&&d&&m||!a&&m||!l)return 1;if(!o&&!u&&!p&&n=f)return m;var p=a[o];return m*(p=="desc"?-1:1)}}return n.index-r.index}return E1=t,E1}var A1,HD;function Cte(){if(HD)return A1;HD=1;var e=WO(),t=VO(),n=bi(),r=fz(),a=_te(),o=ez(),l=Ote(),u=qu(),d=Lr();function f(m,p,g){p.length?p=e(p,function(b){return d(b)?function(w){return t(w,b.length===1?b[0]:b)}:b}):p=[u];var x=-1;p=e(p,o(n));var j=r(m,function(b,w,N){var O=e(p,function(C){return C(b)});return{criteria:O,index:++x,value:b}});return a(j,function(b,w){return l(b,w,g)})}return A1=f,A1}var T1,WD;function Ete(){if(WD)return T1;WD=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return T1=e,T1}var k1,VD;function Ate(){if(VD)return k1;VD=1;var e=Ete(),t=Math.max;function n(r,a,o){return a=t(a===void 0?r.length-1:a,0),function(){for(var l=arguments,u=-1,d=t(l.length-a,0),f=Array(d);++u0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return D1=r,D1}var $1,ZD;function Pte(){if(ZD)return $1;ZD=1;var e=kte(),t=Mte(),n=t(e);return $1=n,$1}var I1,QD;function Rte(){if(QD)return I1;QD=1;var e=qu(),t=Ate(),n=Pte();function r(a,o){return n(t(a,o,e),a+"")}return I1=r,I1}var L1,JD;function ry(){if(JD)return L1;JD=1;var e=FO(),t=Ah(),n=nC(),r=as();function a(o,l,u){if(!r(u))return!1;var d=typeof l;return(d=="number"?t(u)&&n(l,u.length):d=="string"&&l in u)?e(u[l],o):!1}return L1=a,L1}var B1,e4;function Dte(){if(e4)return B1;e4=1;var e=uz(),t=Cte(),n=Rte(),r=ry(),a=n(function(o,l){if(o==null)return[];var u=l.length;return u>1&&r(o,l[0],l[1])?l=[]:u>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(o,e(l,1),[])});return B1=a,B1}var $te=Dte();const oC=St($te);function Tf(e){"@babel/helpers - typeof";return Tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tf(e)}function P_(){return P_=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Kd,"-left"),Oe(n)&&t&&Oe(t.x)&&n=t.y),"".concat(Kd,"-top"),Oe(r)&&t&&Oe(t.y)&&rb?Math.max(m,d[r]):Math.max(p,d[r])}function Zte(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Qte(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,f,m,p;return l.height>0&&l.width>0&&n?(m=r4({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),p=r4({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),f=Zte({translateX:m,translateY:p,useTranslate3d:u})):f=Kte,{cssProperties:f,cssClasses:Xte({translateX:m,translateY:p,coordinate:n})}}function iu(e){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iu(e)}function a4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function i4(e){for(var t=1;to4||Math.abs(r.height-this.state.lastBoundingBox.height)>o4)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,o=a.active,l=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,f=a.children,m=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,x=a.offset,j=a.position,b=a.reverseDirection,w=a.useTranslate3d,N=a.viewBox,O=a.wrapperStyle,C=Qte({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:N}),A=C.cssClasses,E=C.cssProperties,k=i4(i4({transition:g&&o?"transform ".concat(u,"ms ").concat(d):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return W.createElement("div",{tabIndex:-1,className:A,style:k,ref:function(M){r.wrapperNode=M}},f)}}])})(y.PureComponent),lne=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},bl={isSsr:lne()};function ou(e){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(e)}function s4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function l4(e){for(var t=1;t0;return W.createElement(sne,{allowEscapeViewBox:l,animationDuration:u,animationEasing:d,isAnimationActive:g,active:o,coordinate:m,hasPayload:k,offset:x,position:w,reverseDirection:N,useTranslate3d:O,viewBox:C,wrapperStyle:A},yne(f,l4(l4({},this.props),{},{payload:E})))}}])})(y.PureComponent);sC(ti,"displayName","Tooltip");sC(ti,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!bl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var q1,c4;function xne(){if(c4)return q1;c4=1;var e=xi(),t=function(){return e.Date.now()};return q1=t,q1}var F1,u4;function bne(){if(u4)return F1;u4=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return F1=t,F1}var U1,d4;function wne(){if(d4)return U1;d4=1;var e=bne(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return U1=n,U1}var H1,f4;function yz(){if(f4)return H1;f4=1;var e=wne(),t=as(),n=Lu(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var m=typeof f.valueOf=="function"?f.valueOf():f;f=t(m)?m+"":m}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=o.test(f);return p||l.test(f)?u(f.slice(2),p?2:8):a.test(f)?r:+f}return H1=d,H1}var W1,h4;function jne(){if(h4)return W1;h4=1;var e=as(),t=xne(),n=yz(),r="Expected a function",a=Math.max,o=Math.min;function l(u,d,f){var m,p,g,x,j,b,w=0,N=!1,O=!1,C=!0;if(typeof u!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(N=!!f.leading,O="maxWait"in f,g=O?a(n(f.maxWait)||0,d):g,C="trailing"in f?!!f.trailing:C);function A(V){var H=m,G=p;return m=p=void 0,w=V,x=u.apply(G,H),x}function E(V){return w=V,j=setTimeout(M,d),N?A(V):x}function k(V){var H=V-b,G=V-w,L=d-H;return O?o(L,g-G):L}function T(V){var H=V-b,G=V-w;return b===void 0||H>=d||H<0||O&&G>=g}function M(){var V=t();if(T(V))return $(V);j=setTimeout(M,k(V))}function $(V){return j=void 0,C&&m?A(V):(m=p=void 0,x)}function z(){j!==void 0&&clearTimeout(j),w=0,m=b=p=j=void 0}function D(){return j===void 0?x:$(t())}function U(){var V=t(),H=T(V);if(m=arguments,p=this,b=V,H){if(j===void 0)return E(b);if(O)return clearTimeout(j),j=setTimeout(M,d),A(b)}return j===void 0&&(j=setTimeout(M,d)),x}return U.cancel=z,U.flush=D,U}return W1=l,W1}var V1,m4;function Sne(){if(m4)return V1;m4=1;var e=jne(),t=as(),n="Expected a function";function r(a,o,l){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(l)&&(u="leading"in l?!!l.leading:u,d="trailing"in l?!!l.trailing:d),e(a,o,{leading:u,maxWait:o,trailing:d})}return V1=r,V1}var _ne=Sne();const xz=St(_ne);function Mf(e){"@babel/helpers - typeof";return Mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mf(e)}function p4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ap(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(V=xz(V,b,{trailing:!0,leading:!1}));var H=new ResizeObserver(V),G=E.current.getBoundingClientRect(),L=G.width,R=G.height;return D(L,R),H.observe(E.current),function(){H.disconnect()}},[D,b]);var U=y.useMemo(function(){var V=$.containerWidth,H=$.containerHeight;if(V<0||H<0)return null;qa(Hs(l)||Hs(d),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,l,d),qa(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=Hs(l)?V:l,L=Hs(d)?H:d;n&&n>0&&(G?L=G/n:L&&(G=L*n),g&&L>g&&(L=g)),qa(G>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,G,L,l,d,m,p,n);var R=!Array.isArray(x)&&Qi(x.type).endsWith("Chart");return W.Children.map(x,function(F){return W.isValidElement(F)?y.cloneElement(F,Ap({width:G,height:L},R?{style:Ap({height:"100%",width:"100%",maxHeight:L,maxWidth:G},F.props.style)}:{})):F})},[n,x,d,g,p,m,$,l]);return W.createElement("div",{id:w?"".concat(w):void 0,className:Ye("recharts-responsive-container",N),style:Ap(Ap({},A),{},{width:l,height:d,minWidth:m,minHeight:p,maxHeight:g}),ref:E},U)}),ay=function(t){return null};ay.displayName="Cell";function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function g4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function I_(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||bl.isSsr)return{width:0,height:0};var r=Bne(n),a=JSON.stringify({text:t,copyStyle:r});if(bc.widthCache[a])return bc.widthCache[a];try{var o=document.getElementById(y4);o||(o=document.createElement("span"),o.setAttribute("id",y4),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var l=I_(I_({},Lne),r);Object.assign(o.style,l),o.textContent="".concat(t);var u=o.getBoundingClientRect(),d={width:u.width,height:u.height};return bc.widthCache[a]=d,++bc.cacheCount>Ine&&(bc.cacheCount=0,bc.widthCache={}),d}catch{return{width:0,height:0}}},zne=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function Mv(e,t){return Hne(e)||Une(e,t)||Fne(e,t)||qne()}function qne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fne(e,t){if(e){if(typeof e=="string")return x4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x4(e,t)}}function x4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function are(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function N4(e,t){return lre(e)||sre(e,t)||ore(e,t)||ire()}function ire(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ore(e,t){if(e){if(typeof e=="string")return O4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O4(e,t)}}function O4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(L,R){var F=R.word,K=R.width,te=L[L.length-1];if(te&&(a==null||o||te.width+K+rR.width?L:R})};if(!m)return x;for(var b="…",w=function(G){var L=p.slice(0,G),R=Sz({breakAll:f,style:d,children:L+b}).wordsWithComputedWidth,F=g(R),K=F.length>l||j(F).width>Number(a);return[K,F]},N=0,O=p.length-1,C=0,A;N<=O&&C<=p.length-1;){var E=Math.floor((N+O)/2),k=E-1,T=w(k),M=N4(T,2),$=M[0],z=M[1],D=w(E),U=N4(D,1),V=U[0];if(!$&&!V&&(N=E+1),$&&V&&(O=E-1),!$&&V){A=z;break}C++}return A||x},C4=function(t){var n=Ge(t)?[]:t.toString().split(jz);return[{words:n}]},ure=function(t){var n=t.width,r=t.scaleToFit,a=t.children,o=t.style,l=t.breakAll,u=t.maxLines;if((n||r)&&!bl.isSsr){var d,f,m=Sz({breakAll:l,children:a,style:o});if(m){var p=m.wordsWithComputedWidth,g=m.spaceWidth;d=p,f=g}else return C4(a);return cre({breakAll:l,children:a,maxLines:u,style:o},d,f,n,r)}return C4(a)},E4="#808080",ul=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,l=t.lineHeight,u=l===void 0?"1em":l,d=t.capHeight,f=d===void 0?"0.71em":d,m=t.scaleToFit,p=m===void 0?!1:m,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,w=t.fill,N=w===void 0?E4:w,O=_4(t,nre),C=y.useMemo(function(){return ure({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),A=O.dx,E=O.dy,k=O.angle,T=O.className,M=O.breakAll,$=_4(O,rre);if(!Mn(r)||!Mn(o))return null;var z=r+(Oe(A)?A:0),D=o+(Oe(E)?E:0),U;switch(b){case"start":U=G1("calc(".concat(f,")"));break;case"middle":U=G1("calc(".concat((C.length-1)/2," * -").concat(u," + (").concat(f," / 2))"));break;default:U=G1("calc(".concat(C.length-1," * -").concat(u,")"));break}var V=[];if(p){var H=C[0].width,G=O.width;V.push("scale(".concat((Oe(G)?G/H:1)/H,")"))}return k&&V.push("rotate(".concat(k,", ").concat(z,", ").concat(D,")")),V.length&&($.transform=V.join(" ")),W.createElement("text",L_({},Be($,!0),{x:z,y:D,className:Ye("recharts-text",T),textAnchor:x,fill:N.includes("url")?E4:N}),C.map(function(L,R){var F=L.words.join(M?"":" ");return W.createElement("tspan",{x:z,dy:R===0?U:u,key:"".concat(F,"-").concat(R)},F)}))};function Ko(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function dre(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function lC(e){let t,n,r;e.length!==2?(t=Ko,n=(u,d)=>Ko(e(u),d),r=(u,d)=>e(u)-d):(t=e===Ko||e===dre?e:fre,n=e,r=e);function a(u,d,f=0,m=u.length){if(f>>1;n(u[p],d)<0?f=p+1:m=p}while(f>>1;n(u[p],d)<=0?f=p+1:m=p}while(ff&&r(u[p-1],d)>-r(u[p],d)?p-1:p}return{left:a,center:l,right:o}}function fre(){return 0}function _z(e){return e===null?NaN:+e}function*hre(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const mre=lC(Ko),Th=mre.right;lC(_z).center;class A4 extends Map{constructor(t,n=gre){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(T4(this,t))}has(t){return super.has(T4(this,t))}set(t,n){return super.set(pre(this,t),n)}delete(t){return super.delete(vre(this,t))}}function T4({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function pre({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function vre({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function gre(e){return e!==null&&typeof e=="object"?e.valueOf():e}function yre(e=Ko){if(e===Ko)return Nz;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Nz(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const xre=Math.sqrt(50),bre=Math.sqrt(10),wre=Math.sqrt(2);function Pv(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),o=r/Math.pow(10,a),l=o>=xre?10:o>=bre?5:o>=wre?2:1;let u,d,f;return a<0?(f=Math.pow(10,-a)/l,u=Math.round(e*f),d=Math.round(t*f),u/ft&&--d,f=-f):(f=Math.pow(10,a)*l,u=Math.round(e/f),d=Math.round(t/f),u*ft&&--d),d0))return[];if(e===t)return[e];const r=t=a))return[];const u=o-a+1,d=new Array(u);if(r)if(l<0)for(let f=0;f=r)&&(n=r);return n}function M4(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Oz(e,t,n=0,r=1/0,a){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(a=a===void 0?Nz:yre(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,m=Math.log(d),p=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));Oz(e,t,x,j,a)}const o=e[t];let l=n,u=r;for(Xd(e,n,t),a(e[r],o)>0&&Xd(e,n,r);l0;)--u}a(e[n],o)===0?Xd(e,n,u):(++u,Xd(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Xd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function jre(e,t,n){if(e=Float64Array.from(hre(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return M4(e);if(t>=1)return k4(e);var r,a=(r-1)*t,o=Math.floor(a),l=k4(Oz(e,o).subarray(0,o+1)),u=M4(e.subarray(o+1));return l+(u-l)*(a-o)}}function Sre(e,t,n=_z){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,a=(r-1)*t,o=Math.floor(a),l=+n(e[o],o,e),u=+n(e[o+1],o+1,e);return l+(u-l)*(a-o)}}function _re(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(a);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?kp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?kp(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=Ore.exec(e))?new kr(t[1],t[2],t[3],1):(t=Cre.exec(e))?new kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ere.exec(e))?kp(t[1],t[2],t[3],t[4]):(t=Are.exec(e))?kp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Tre.exec(e))?B4(t[1],t[2]/100,t[3]/100,1):(t=kre.exec(e))?B4(t[1],t[2]/100,t[3]/100,t[4]):P4.hasOwnProperty(e)?$4(P4[e]):e==="transparent"?new kr(NaN,NaN,NaN,0):null}function $4(e){return new kr(e>>16&255,e>>8&255,e&255,1)}function kp(e,t,n,r){return r<=0&&(e=t=n=NaN),new kr(e,t,n,r)}function Rre(e){return e instanceof kh||(e=Lf(e)),e?(e=e.rgb(),new kr(e.r,e.g,e.b,e.opacity)):new kr}function U_(e,t,n,r){return arguments.length===1?Rre(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}uC(kr,U_,Ez(kh,{brighter(e){return e=e==null?Rv:Math.pow(Rv,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kr(el(this.r),el(this.g),el(this.b),Dv(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:I4,formatHex:I4,formatHex8:Dre,formatRgb:L4,toString:L4}));function I4(){return`#${Ws(this.r)}${Ws(this.g)}${Ws(this.b)}`}function Dre(){return`#${Ws(this.r)}${Ws(this.g)}${Ws(this.b)}${Ws((isNaN(this.opacity)?1:this.opacity)*255)}`}function L4(){const e=Dv(this.opacity);return`${e===1?"rgb(":"rgba("}${el(this.r)}, ${el(this.g)}, ${el(this.b)}${e===1?")":`, ${e})`}`}function Dv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function el(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ws(e){return e=el(e),(e<16?"0":"")+e.toString(16)}function B4(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,r)}function Az(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof kh||(e=Lf(e)),!e)return new Ba;if(e instanceof Ba)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-a,d=(o+a)/2;return u?(t===o?l=(n-r)/u+(n0&&d<1?0:l,new Ba(l,u,d,e.opacity)}function $re(e,t,n,r){return arguments.length===1?Az(e):new Ba(e,t,n,r??1)}function Ba(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}uC(Ba,$re,Ez(kh,{brighter(e){return e=e==null?Rv:Math.pow(Rv,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new Ba(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,a=2*n-r;return new kr(Y1(e>=240?e-240:e+120,a,r),Y1(e,a,r),Y1(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Ba(z4(this.h),Mp(this.s),Mp(this.l),Dv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Dv(this.opacity);return`${e===1?"hsl(":"hsla("}${z4(this.h)}, ${Mp(this.s)*100}%, ${Mp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function z4(e){return e=(e||0)%360,e<0?e+360:e}function Mp(e){return Math.max(0,Math.min(1,e||0))}function Y1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const dC=e=>()=>e;function Ire(e,t){return function(n){return e+n*t}}function Lre(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Bre(e){return(e=+e)==1?Tz:function(t,n){return n-t?Lre(t,n,e):dC(isNaN(t)?n:t)}}function Tz(e,t){var n=t-e;return n?Ire(e,n):dC(isNaN(e)?t:e)}const q4=(function e(t){var n=Bre(t);function r(a,o){var l=n((a=U_(a)).r,(o=U_(o)).r),u=n(a.g,o.g),d=n(a.b,o.b),f=Tz(a.opacity,o.opacity);return function(m){return a.r=l(m),a.g=u(m),a.b=d(m),a.opacity=f(m),a+""}}return r.gamma=e,r})(1);function zre(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(o){for(a=0;an&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:$v(r,a)})),n=K1.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Zre(e,t,n){var r=e[0],a=e[1],o=t[0],l=t[1];return a2?Qre:Zre,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?o:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return p.invert=function(g){return l(a((f||(f=u(t,e.map(r),$v)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Iv),m()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),m()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=fC,m()},p.clamp=function(g){return arguments.length?(l=g?!0:jr,m()):l!==jr},p.interpolate=function(g){return arguments.length?(n=g,m()):n},p.unknown=function(g){return arguments.length?(o=g,p):o},function(g,x){return r=g,a=x,m()}}function hC(){return iy()(jr,jr)}function Jre(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Lv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function su(e){return e=Lv(Math.abs(e)),e?e[1]:NaN}function eae(e,t){return function(n,r){for(var a=n.length,o=[],l=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),o.push(n.substring(a-=u,a+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}function tae(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nae=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bf(e){if(!(t=nae.exec(e)))throw new Error("invalid format: "+e);var t;return new mC({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]})}Bf.prototype=mC.prototype;function mC(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+""}mC.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 rae(e){e:for(var t=e.length,n=1,r=-1,a;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var kz;function aae(e,t){var n=Lv(e,t);if(!n)return e+"";var r=n[0],a=n[1],o=a-(kz=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Lv(e,Math.max(0,t+o-1))[0]}function U4(e,t){var n=Lv(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const H4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Jre,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)=>U4(e*100,t),r:U4,s:aae,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function W4(e){return e}var V4=Array.prototype.map,G4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iae(e){var t=e.grouping===void 0||e.thousands===void 0?W4:eae(V4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?W4:tae(V4.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p){p=Bf(p);var g=p.fill,x=p.align,j=p.sign,b=p.symbol,w=p.zero,N=p.width,O=p.comma,C=p.precision,A=p.trim,E=p.type;E==="n"?(O=!0,E="g"):H4[E]||(C===void 0&&(C=12),A=!0,E="g"),(w||g==="0"&&x==="=")&&(w=!0,g="0",x="=");var k=b==="$"?n:b==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",T=b==="$"?r:/[%p]/.test(E)?l:"",M=H4[E],$=/[defgprs%]/.test(E);C=C===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function z(D){var U=k,V=T,H,G,L;if(E==="c")V=M(D)+V,D="";else{D=+D;var R=D<0||1/D<0;if(D=isNaN(D)?d:M(Math.abs(D),C),A&&(D=rae(D)),R&&+D==0&&j!=="+"&&(R=!1),U=(R?j==="("?j:u:j==="-"||j==="("?"":j)+U,V=(E==="s"?G4[8+kz/3]:"")+V+(R&&j==="("?")":""),$){for(H=-1,G=D.length;++HL||L>57){V=(L===46?a+D.slice(H+1):D.slice(H))+V,D=D.slice(0,H);break}}}O&&!w&&(D=t(D,1/0));var F=U.length+D.length+V.length,K=F>1)+U+D+V+K.slice(F);break;default:D=K+U+D+V;break}return o(D)}return z.toString=function(){return p+""},z}function m(p,g){var x=f((p=Bf(p),p.type="f",p)),j=Math.max(-8,Math.min(8,Math.floor(su(g)/3)))*3,b=Math.pow(10,-j),w=G4[8+j/3];return function(N){return x(b*N)+w}}return{format:f,formatPrefix:m}}var Pp,pC,Mz;oae({thousands:",",grouping:[3],currency:["$",""]});function oae(e){return Pp=iae(e),pC=Pp.format,Mz=Pp.formatPrefix,Pp}function sae(e){return Math.max(0,-su(Math.abs(e)))}function lae(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(su(t)/3)))*3-su(Math.abs(e)))}function cae(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,su(t)-su(e))+1}function Pz(e,t,n,r){var a=q_(e,t,n),o;switch(r=Bf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=lae(a,l))&&(r.precision=o),Mz(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=cae(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=sae(a))&&(r.precision=o-(r.type==="%")*2);break}}return pC(r)}function is(e){var t=e.domain;return e.ticks=function(n){var r=t();return B_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return Pz(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,o=r.length-1,l=r[a],u=r[o],d,f,m=10;for(u0;){if(f=z_(l,u,n),f===d)return r[a]=l,r[o]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function Bv(){var e=hC();return e.copy=function(){return Mh(e,Bv())},Ea.apply(e,arguments),is(e)}function Rz(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Iv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Rz(e).unknown(t)},e=arguments.length?Array.from(e,Iv):[0,1],is(n)}function Dz(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],o=e[r],l;return oMath.pow(e,t)}function mae(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 X4(e){return(t,n)=>-e(-t,n)}function vC(e){const t=e(Y4,K4),n=t.domain;let r=10,a,o;function l(){return a=mae(r),o=hae(r),n()[0]<0?(a=X4(a),o=X4(o),e(uae,dae)):e(Y4,K4),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],m=d[d.length-1];const p=m0){for(;g<=x;++g)for(j=1;jm)break;N.push(b)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/o(-g):j*o(g),!(bm)break;N.push(b)}N.length*2{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Bf(d)).precision==null&&(d.trim=!0),d=pC(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return m=>{let p=m/o(Math.round(a(m)));return p*rn(Dz(n(),{floor:u=>o(Math.floor(a(u))),ceil:u=>o(Math.ceil(a(u)))})),t}function $z(){const e=vC(iy()).domain([1,10]);return e.copy=()=>Mh(e,$z()).base(e.base()),Ea.apply(e,arguments),e}function Z4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Q4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function gC(e){var t=1,n=e(Z4(t),Q4(t));return n.constant=function(r){return arguments.length?e(Z4(t=+r),Q4(t)):t},is(n)}function Iz(){var e=gC(iy());return e.copy=function(){return Mh(e,Iz()).constant(e.constant())},Ea.apply(e,arguments)}function J4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function pae(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function vae(e){return e<0?-e*e:e*e}function yC(e){var t=e(jr,jr),n=1;function r(){return n===1?e(jr,jr):n===.5?e(pae,vae):e(J4(n),J4(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},is(t)}function xC(){var e=yC(iy());return e.copy=function(){return Mh(e,xC()).exponent(e.exponent())},Ea.apply(e,arguments),e}function gae(){return xC.apply(null,arguments).exponent(.5)}function e$(e){return Math.sign(e)*e*e}function yae(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Lz(){var e=hC(),t=[0,1],n=!1,r;function a(o){var l=yae(e(o));return isNaN(l)?r:n?Math.round(l):l}return a.invert=function(o){return e.invert(e$(o))},a.domain=function(o){return arguments.length?(e.domain(o),a):e.domain()},a.range=function(o){return arguments.length?(e.range((t=Array.from(o,Iv)).map(e$)),a):t.slice()},a.rangeRound=function(o){return a.range(o).round(!0)},a.round=function(o){return arguments.length?(n=!!o,a):n},a.clamp=function(o){return arguments.length?(e.clamp(o),a):e.clamp()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return Lz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ea.apply(a,arguments),is(a)}function Bz(){var e=[],t=[],n=[],r;function a(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l0?n[u-1]:e[0],u=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(o=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return zz().domain([e,t]).range(a).unknown(o)},Ea.apply(is(l),arguments)}function qz(){var e=[.5],t=[0,1],n,r=1;function a(o){return o!=null&&o<=o?t[Th(e,o,0,r)]:n}return a.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return qz().domain(e).range(t).unknown(n)},Ea.apply(a,arguments)}const X1=new Date,Z1=new Date;function Dn(e,t,n,r){function a(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return a.floor=o=>(e(o=new Date(+o)),o),a.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),a.round=o=>{const l=a(o),u=a.ceil(o);return o-l(t(o=new Date(+o),l==null?1:Math.floor(l)),o),a.range=(o,l,u)=>{const d=[];if(o=a.ceil(o),u=u==null?1:Math.floor(u),!(o0))return d;let f;do d.push(f=new Date(+o)),t(o,u),e(o);while(fDn(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),n&&(a.count=(o,l)=>(X1.setTime(+o),Z1.setTime(+l),e(X1),e(Z1),Math.floor(n(X1,Z1))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(r?l=>r(l)%o===0:l=>a.count(0,l)%o===0):a)),a}const zv=Dn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);zv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Dn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):zv);zv.range;const Vi=1e3,Sa=Vi*60,Gi=Sa*60,to=Gi*24,bC=to*7,t$=to*30,Q1=to*365,Vs=Dn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCSeconds());Vs.range;const wC=Dn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vi)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getMinutes());wC.range;const jC=Dn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Sa)},(e,t)=>(t-e)/Sa,e=>e.getUTCMinutes());jC.range;const SC=Dn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Vi-e.getMinutes()*Sa)},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getHours());SC.range;const _C=Dn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getUTCHours());_C.range;const Ph=Dn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Sa)/to,e=>e.getDate()-1);Ph.range;const oy=Dn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/to,e=>e.getUTCDate()-1);oy.range;const Fz=Dn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/to,e=>Math.floor(e/to));Fz.range;function wl(e){return Dn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Sa)/bC)}const sy=wl(0),qv=wl(1),xae=wl(2),bae=wl(3),lu=wl(4),wae=wl(5),jae=wl(6);sy.range;qv.range;xae.range;bae.range;lu.range;wae.range;jae.range;function jl(e){return Dn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/bC)}const ly=jl(0),Fv=jl(1),Sae=jl(2),_ae=jl(3),cu=jl(4),Nae=jl(5),Oae=jl(6);ly.range;Fv.range;Sae.range;_ae.range;cu.range;Nae.range;Oae.range;const NC=Dn(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());NC.range;const OC=Dn(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());OC.range;const no=Dn(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());no.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dn(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)});no.range;const ro=Dn(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());ro.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Dn(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)});ro.range;function Uz(e,t,n,r,a,o){const l=[[Vs,1,Vi],[Vs,5,5*Vi],[Vs,15,15*Vi],[Vs,30,30*Vi],[o,1,Sa],[o,5,5*Sa],[o,15,15*Sa],[o,30,30*Sa],[a,1,Gi],[a,3,3*Gi],[a,6,6*Gi],[a,12,12*Gi],[r,1,to],[r,2,2*to],[n,1,bC],[t,1,t$],[t,3,3*t$],[e,1,Q1]];function u(f,m,p){const g=mw).right(l,g);if(x===l.length)return e.every(q_(f/Q1,m/Q1,p));if(x===0)return zv.every(Math.max(q_(f,m,p),1));const[j,b]=l[g/l[x-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(_e=eS(Zd(le.y,0,1)),me=_e.getUTCDay(),_e=me>4||me===0?Fv.ceil(_e):Fv(_e),_e=oy.offset(_e,(le.V-1)*7),le.y=_e.getUTCFullYear(),le.m=_e.getUTCMonth(),le.d=_e.getUTCDate()+(le.w+6)%7):(_e=J1(Zd(le.y,0,1)),me=_e.getDay(),_e=me>4||me===0?qv.ceil(_e):qv(_e),_e=Ph.offset(_e,(le.V-1)*7),le.y=_e.getFullYear(),le.m=_e.getMonth(),le.d=_e.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),me="Z"in le?eS(Zd(le.y,0,1)).getUTCDay():J1(Zd(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(me+5)%7:le.w+le.U*7-(me+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,eS(le)):J1(le)}}function M(Z,pe,je,le){for(var Re=0,_e=pe.length,me=je.length,ve,Le;Re<_e;){if(le>=me)return-1;if(ve=pe.charCodeAt(Re++),ve===37){if(ve=pe.charAt(Re++),Le=E[ve in n$?pe.charAt(Re++):ve],!Le||(le=Le(Z,je,le))<0)return-1}else if(ve!=je.charCodeAt(le++))return-1}return le}function $(Z,pe,je){var le=f.exec(pe.slice(je));return le?(Z.p=m.get(le[0].toLowerCase()),je+le[0].length):-1}function z(Z,pe,je){var le=x.exec(pe.slice(je));return le?(Z.w=j.get(le[0].toLowerCase()),je+le[0].length):-1}function D(Z,pe,je){var le=p.exec(pe.slice(je));return le?(Z.w=g.get(le[0].toLowerCase()),je+le[0].length):-1}function U(Z,pe,je){var le=N.exec(pe.slice(je));return le?(Z.m=O.get(le[0].toLowerCase()),je+le[0].length):-1}function V(Z,pe,je){var le=b.exec(pe.slice(je));return le?(Z.m=w.get(le[0].toLowerCase()),je+le[0].length):-1}function H(Z,pe,je){return M(Z,t,pe,je)}function G(Z,pe,je){return M(Z,n,pe,je)}function L(Z,pe,je){return M(Z,r,pe,je)}function R(Z){return l[Z.getDay()]}function F(Z){return o[Z.getDay()]}function K(Z){return d[Z.getMonth()]}function te(Z){return u[Z.getMonth()]}function I(Z){return a[+(Z.getHours()>=12)]}function B(Z){return 1+~~(Z.getMonth()/3)}function Y(Z){return l[Z.getUTCDay()]}function ne(Z){return o[Z.getUTCDay()]}function oe(Z){return d[Z.getUTCMonth()]}function xe(Z){return u[Z.getUTCMonth()]}function ee(Z){return a[+(Z.getUTCHours()>=12)]}function ae(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var pe=k(Z+="",C);return pe.toString=function(){return Z},pe},parse:function(Z){var pe=T(Z+="",!1);return pe.toString=function(){return Z},pe},utcFormat:function(Z){var pe=k(Z+="",A);return pe.toString=function(){return Z},pe},utcParse:function(Z){var pe=T(Z+="",!0);return pe.toString=function(){return Z},pe}}}var n$={"-":"",_:" ",0:"0"},Gn=/^\s*\d+/,Mae=/^%/,Pae=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",o=a.length;return r+(o[t.toLowerCase(),n]))}function Dae(e,t,n){var r=Gn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $ae(e,t,n){var r=Gn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Iae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Lae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Bae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function r$(e,t,n){var r=Gn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function a$(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function zae(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 qae(e,t,n){var r=Gn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Fae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function i$(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Uae(e,t,n){var r=Gn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function o$(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Hae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Wae(e,t,n){var r=Gn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Vae(e,t,n){var r=Gn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Gae(e,t,n){var r=Gn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Yae(e,t,n){var r=Mae.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Kae(e,t,n){var r=Gn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Xae(e,t,n){var r=Gn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function s$(e,t){return vt(e.getDate(),t,2)}function Zae(e,t){return vt(e.getHours(),t,2)}function Qae(e,t){return vt(e.getHours()%12||12,t,2)}function Jae(e,t){return vt(1+Ph.count(no(e),e),t,3)}function Hz(e,t){return vt(e.getMilliseconds(),t,3)}function eie(e,t){return Hz(e,t)+"000"}function tie(e,t){return vt(e.getMonth()+1,t,2)}function nie(e,t){return vt(e.getMinutes(),t,2)}function rie(e,t){return vt(e.getSeconds(),t,2)}function aie(e){var t=e.getDay();return t===0?7:t}function iie(e,t){return vt(sy.count(no(e)-1,e),t,2)}function Wz(e){var t=e.getDay();return t>=4||t===0?lu(e):lu.ceil(e)}function oie(e,t){return e=Wz(e),vt(lu.count(no(e),e)+(no(e).getDay()===4),t,2)}function sie(e){return e.getDay()}function lie(e,t){return vt(qv.count(no(e)-1,e),t,2)}function cie(e,t){return vt(e.getFullYear()%100,t,2)}function uie(e,t){return e=Wz(e),vt(e.getFullYear()%100,t,2)}function die(e,t){return vt(e.getFullYear()%1e4,t,4)}function fie(e,t){var n=e.getDay();return e=n>=4||n===0?lu(e):lu.ceil(e),vt(e.getFullYear()%1e4,t,4)}function hie(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function l$(e,t){return vt(e.getUTCDate(),t,2)}function mie(e,t){return vt(e.getUTCHours(),t,2)}function pie(e,t){return vt(e.getUTCHours()%12||12,t,2)}function vie(e,t){return vt(1+oy.count(ro(e),e),t,3)}function Vz(e,t){return vt(e.getUTCMilliseconds(),t,3)}function gie(e,t){return Vz(e,t)+"000"}function yie(e,t){return vt(e.getUTCMonth()+1,t,2)}function xie(e,t){return vt(e.getUTCMinutes(),t,2)}function bie(e,t){return vt(e.getUTCSeconds(),t,2)}function wie(e){var t=e.getUTCDay();return t===0?7:t}function jie(e,t){return vt(ly.count(ro(e)-1,e),t,2)}function Gz(e){var t=e.getUTCDay();return t>=4||t===0?cu(e):cu.ceil(e)}function Sie(e,t){return e=Gz(e),vt(cu.count(ro(e),e)+(ro(e).getUTCDay()===4),t,2)}function _ie(e){return e.getUTCDay()}function Nie(e,t){return vt(Fv.count(ro(e)-1,e),t,2)}function Oie(e,t){return vt(e.getUTCFullYear()%100,t,2)}function Cie(e,t){return e=Gz(e),vt(e.getUTCFullYear()%100,t,2)}function Eie(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function Aie(e,t){var n=e.getUTCDay();return e=n>=4||n===0?cu(e):cu.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function Tie(){return"+0000"}function c$(){return"%"}function u$(e){return+e}function d$(e){return Math.floor(+e/1e3)}var wc,Yz,Kz;kie({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 kie(e){return wc=kae(e),Yz=wc.format,wc.parse,Kz=wc.utcFormat,wc.utcParse,wc}function Mie(e){return new Date(e)}function Pie(e){return e instanceof Date?+e:+new Date(+e)}function CC(e,t,n,r,a,o,l,u,d,f){var m=hC(),p=m.invert,g=m.domain,x=f(".%L"),j=f(":%S"),b=f("%I:%M"),w=f("%I %p"),N=f("%a %d"),O=f("%b %d"),C=f("%B"),A=f("%Y");function E(k){return(d(k)t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,o)=>jre(e,o/r))},n.copy=function(){return Jz(t).domain(e)},uo.apply(n,arguments)}function uy(){var e=0,t=.5,n=1,r=1,a,o,l,u,d,f=jr,m,p=!1,g;function x(b){return isNaN(b=+b)?g:(b=.5+((b=+m(b))-o)*(r*bn}return nS=e,nS}var rS,p$;function Lie(){if(p$)return rS;p$=1;var e=dy(),t=r6(),n=qu();function r(a){return a&&a.length?e(a,n,t):void 0}return rS=r,rS}var Bie=Lie();const fy=St(Bie);var aS,v$;function a6(){if(v$)return aS;v$=1;function e(t,n){return te.e^o.s<0?1:-1;for(r=o.d.length,a=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===a?0:r>a^o.s<0?1:-1};Ee.decimalPlaces=Ee.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Yt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ee.dividedBy=Ee.div=function(e){return Ji(this,new this.constructor(e))};Ee.dividedToIntegerBy=Ee.idiv=function(e){var t=this,n=t.constructor;return It(Ji(t,new n(e),0,1),n.precision)};Ee.equals=Ee.eq=function(e){return!this.cmp(e)};Ee.exponent=function(){return gn(this)};Ee.greaterThan=Ee.gt=function(e){return this.cmp(e)>0};Ee.greaterThanOrEqualTo=Ee.gte=function(e){return this.cmp(e)>=0};Ee.isInteger=Ee.isint=function(){return this.e>this.d.length-2};Ee.isNegative=Ee.isneg=function(){return this.s<0};Ee.isPositive=Ee.ispos=function(){return this.s>0};Ee.isZero=function(){return this.s===0};Ee.lessThan=Ee.lt=function(e){return this.cmp(e)<0};Ee.lessThanOrEqualTo=Ee.lte=function(e){return this.cmp(e)<1};Ee.logarithm=Ee.log=function(e){var t,n=this,r=n.constructor,a=r.precision,o=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ea))throw Error(Oa+"NaN");if(n.s<1)throw Error(Oa+(n.s?"NaN":"-Infinity"));return n.eq(ea)?new r(0):(Zt=!1,t=Ji(zf(n,o),zf(e,o),o),Zt=!0,It(t,a))};Ee.minus=Ee.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?l6(t,e):o6(t,(e.s=-e.s,e))};Ee.modulo=Ee.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Oa+"NaN");return n.s?(Zt=!1,t=Ji(n,e,0,1).times(e),Zt=!0,n.minus(t)):It(new r(n),a)};Ee.naturalExponential=Ee.exp=function(){return s6(this)};Ee.naturalLogarithm=Ee.ln=function(){return zf(this)};Ee.negated=Ee.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ee.plus=Ee.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?o6(t,e):l6(t,(e.s=-e.s,e))};Ee.precision=Ee.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(tl+e);if(t=gn(a)+1,r=a.d.length-1,n=r*Yt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ee.squareRoot=Ee.sqrt=function(){var e,t,n,r,a,o,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Oa+"NaN")}for(e=gn(u),Zt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=oi(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Hu((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=l=n+3;;)if(o=r,r=o.plus(Ji(u,o,l+2)).times(.5),oi(o.d).slice(0,l)===(t=oi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(It(o,n+1,0),o.times(o).eq(u)){r=o;break}}else if(t!="9999")break;l+=4}return Zt=!0,It(r,n)};Ee.times=Ee.mul=function(e){var t,n,r,a,o,l,u,d,f,m=this,p=m.constructor,g=m.d,x=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,d=g.length,f=x.length,d=0;){for(t=0,a=d+r;a>r;)u=o[a]+x[r]*g[a-r-1]+t,o[a--]=u%zn|0,t=u/zn|0;o[a]=(o[a]+t)%zn|0}for(;!o[--l];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Zt?It(e,p.precision):e};Ee.toDecimalPlaces=Ee.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(pi(e,0,Uu),t===void 0?t=r.rounding:pi(t,0,8),It(n,e+gn(n)+1,t))};Ee.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=dl(r,!0):(pi(e,0,Uu),t===void 0?t=a.rounding:pi(t,0,8),r=It(new a(r),e+1,t),n=dl(r,!0,e+1)),n};Ee.toFixed=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?dl(a):(pi(e,0,Uu),t===void 0?t=o.rounding:pi(t,0,8),r=It(new o(a),e+gn(a)+1,t),n=dl(r.abs(),!1,e+gn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ee.toInteger=Ee.toint=function(){var e=this,t=e.constructor;return It(new t(e),gn(e)+1,t.rounding)};Ee.toNumber=function(){return+this};Ee.toPower=Ee.pow=function(e){var t,n,r,a,o,l,u=this,d=u.constructor,f=12,m=+(e=new d(e));if(!e.s)return new d(ea);if(u=new d(u),!u.s){if(e.s<1)throw Error(Oa+"Infinity");return u}if(u.eq(ea))return u;if(r=d.precision,e.eq(ea))return It(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,o=u.s,l){if((n=m<0?-m:m)<=i6){for(a=new d(ea),t=Math.ceil(r/Yt+4),Zt=!1;n%2&&(a=a.times(u),j$(a.d,t)),n=Hu(n/2),n!==0;)u=u.times(u),j$(u.d,t);return Zt=!0,e.s<0?new d(ea).div(a):It(a,r)}}else if(o<0)throw Error(Oa+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,Zt=!1,a=e.times(zf(u,r+f)),Zt=!0,a=s6(a),a.s=o,a};Ee.toPrecision=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?(n=gn(a),r=dl(a,n<=o.toExpNeg||n>=o.toExpPos)):(pi(e,1,Uu),t===void 0?t=o.rounding:pi(t,0,8),a=It(new o(a),e,t),n=gn(a),r=dl(a,e<=n||n<=o.toExpNeg,e)),r};Ee.toSignificantDigits=Ee.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(pi(e,1,Uu),t===void 0?t=r.rounding:pi(t,0,8)),It(new r(n),e,t)};Ee.toString=Ee.valueOf=Ee.val=Ee.toJSON=Ee[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=gn(e),n=e.constructor;return dl(e,t<=n.toExpNeg||t>=n.toExpPos)};function o6(e,t){var n,r,a,o,l,u,d,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),Zt?It(t,p):t;if(d=e.d,f=t.d,l=e.e,a=t.e,d=d.slice(),o=l-a,o){for(o<0?(r=d,o=-o,u=f.length):(r=f,a=l,u=d.length),l=Math.ceil(p/Yt),u=l>u?l+1:u+1,o>u&&(o=u,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(u=d.length,o=f.length,u-o<0&&(o=u,r=f,f=d,d=r),n=0;o;)n=(d[--o]=d[o]+f[o]+n)/zn|0,d[o]%=zn;for(n&&(d.unshift(n),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Zt?It(t,p):t}function pi(e,t,n){if(e!==~~e||en)throw Error(tl+e)}function oi(e){var t,n,r,a=e.length-1,o="",l=e[0];if(a>0){for(o+=l,t=1;tl?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function n(r,a,o){for(var l=0;o--;)r[o]-=l,l=r[o]1;)r.shift()}return function(r,a,o,l){var u,d,f,m,p,g,x,j,b,w,N,O,C,A,E,k,T,M,$=r.constructor,z=r.s==a.s?1:-1,D=r.d,U=a.d;if(!r.s)return new $(r);if(!a.s)throw Error(Oa+"Division by zero");for(d=r.e-a.e,T=U.length,E=D.length,x=new $(z),j=x.d=[],f=0;U[f]==(D[f]||0);)++f;if(U[f]>(D[f]||0)&&--d,o==null?O=o=$.precision:l?O=o+(gn(r)-gn(a))+1:O=o,O<0)return new $(0);if(O=O/Yt+2|0,f=0,T==1)for(m=0,U=U[0],O++;(f1&&(U=e(U,m),D=e(D,m),T=U.length,E=D.length),A=T,b=D.slice(0,T),w=b.length;w=zn/2&&++k;do m=0,u=t(U,b,T,w),u<0?(N=b[0],T!=w&&(N=N*zn+(b[1]||0)),m=N/k|0,m>1?(m>=zn&&(m=zn-1),p=e(U,m),g=p.length,w=b.length,u=t(p,b,g,w),u==1&&(m--,n(p,T16)throw Error(TC+gn(e));if(!e.s)return new m(ea);for(Zt=!1,u=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(zs(2,f))/Math.LN10*2+5|0,u+=r,n=a=o=new m(ea),m.precision=u;;){if(a=It(a.times(e),u),n=n.times(++d),l=o.plus(Ji(a,n,u)),oi(l.d).slice(0,u)===oi(o.d).slice(0,u)){for(;f--;)o=It(o.times(o),u);return m.precision=p,t==null?(Zt=!0,It(o,p)):o}o=l}}function gn(e){for(var t=e.e*Yt,n=e.d[0];n>=10;n/=10)t++;return t}function cS(e,t,n){if(t>e.LN10.sd())throw Zt=!0,n&&(e.precision=n),Error(Oa+"LN10 precision limit exceeded");return It(new e(e.LN10),t)}function qo(e){for(var t="";e--;)t+="0";return t}function zf(e,t){var n,r,a,o,l,u,d,f,m,p=1,g=10,x=e,j=x.d,b=x.constructor,w=b.precision;if(x.s<1)throw Error(Oa+(x.s?"NaN":"-Infinity"));if(x.eq(ea))return new b(0);if(t==null?(Zt=!1,f=w):f=t,x.eq(10))return t==null&&(Zt=!0),cS(b,f);if(f+=g,b.precision=f,n=oi(j),r=n.charAt(0),o=gn(x),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=oi(x.d),r=n.charAt(0),p++;o=gn(x),r>1?(x=new b("0."+n),o++):x=new b(r+"."+n.slice(1))}else return d=cS(b,f+2,w).times(o+""),x=zf(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=w,t==null?(Zt=!0,It(x,w)):x;for(u=l=x=Ji(x.minus(ea),x.plus(ea),f),m=It(x.times(x),f),a=3;;){if(l=It(l.times(m),f),d=u.plus(Ji(l,new b(a),f)),oi(d.d).slice(0,f)===oi(u.d).slice(0,f))return u=u.times(2),o!==0&&(u=u.plus(cS(b,f+2,w).times(o+""))),u=Ji(u,new b(p),f),b.precision=w,t==null?(Zt=!0,It(u,w)):u;u=d,a+=2}}function w$(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=Hu(n/Yt),e.d=[],r=(n+1)%Yt,n<0&&(r+=Yt),rUv||e.e<-Uv))throw Error(TC+n)}else e.s=0,e.e=0,e.d=[0];return e}function It(e,t,n){var r,a,o,l,u,d,f,m,p=e.d;for(l=1,o=p[0];o>=10;o/=10)l++;if(r=t-l,r<0)r+=Yt,a=t,f=p[m=0];else{if(m=Math.ceil((r+1)/Yt),o=p.length,m>=o)return e;for(f=o=p[m],l=1;o>=10;o/=10)l++;r%=Yt,a=r-Yt+l}if(n!==void 0&&(o=zs(10,l-a-1),u=f/o%10|0,d=t<0||p[m+1]!==void 0||f%o,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?a>0?f/zs(10,l-a):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=gn(e),p.length=1,t=t-o-1,p[0]=zs(10,(Yt-t%Yt)%Yt),e.e=Hu(-t/Yt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,o=1,m--):(p.length=m+1,o=zs(10,Yt-r),p[m]=a>0?(f/zs(10,l-a)%zs(10,a)|0)*o:0),d)for(;;)if(m==0){(p[0]+=o)==zn&&(p[0]=1,++e.e);break}else{if(p[m]+=o,p[m]!=zn)break;p[m--]=0,o=1}for(r=p.length;p[--r]===0;)p.pop();if(Zt&&(e.e>Uv||e.e<-Uv))throw Error(TC+gn(e));return e}function l6(e,t){var n,r,a,o,l,u,d,f,m,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Zt?It(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(m=l<0,m?(n=d,l=-l,u=p.length):(n=p,r=f,u=d.length),a=Math.max(Math.ceil(x/Yt),u)+2,l>a&&(l=a,n.length=1),n.reverse(),a=l;a--;)n.push(0);n.reverse()}else{for(a=d.length,u=p.length,m=a0;--a)d[u++]=0;for(a=p.length;a>l;){if(d[--a]0?o=o.charAt(0)+"."+o.slice(1)+qo(r):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+qo(-a-1)+o,n&&(r=n-l)>0&&(o+=qo(r))):a>=l?(o+=qo(a+1-l),n&&(r=n-a-1)>0&&(o=o+"."+qo(r))):((r=a+1)0&&(a+1===l&&(o+="."),o+=qo(r))),e.s<0?"-"+o:o}function j$(e,t){if(e.length>t)return e.length=t,!0}function c6(e){var t,n,r;function a(o){var l=this;if(!(l instanceof a))return new a(o);if(l.constructor=a,o instanceof a){l.s=o.s,l.e=o.e,l.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(tl+o);if(o>0)l.s=1;else if(o<0)o=-o,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(o===~~o&&o<1e7){l.e=0,l.d=[o];return}return w$(l,o.toString())}else if(typeof o!="string")throw Error(tl+o);if(o.charCodeAt(0)===45?(o=o.slice(1),l.s=-1):l.s=1,Kie.test(o))w$(l,o);else throw Error(tl+o)}if(a.prototype=Ee,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=c6,a.config=a.set=Xie,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(tl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(tl+n+": "+r);return this}var kC=c6(Yie);ea=new kC(1);const Pt=kC;function Zie(e){return toe(e)||eoe(e)||Jie(e)||Qie()}function Qie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jie(e,t){if(e){if(typeof e=="string")return V_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V_(e,t)}}function eoe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function toe(e){if(Array.isArray(e))return V_(e)}function V_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,a):e(t-l,S$(function(){for(var u=arguments.length,d=new Array(u),f=0;fe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,o=void 0;try{for(var l=e[Symbol.iterator](),u;!(r=(u=l.next()).done)&&(n.push(u.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,o=d}finally{try{!r&&l.return!=null&&l.return()}finally{if(a)throw o}}return n}}function voe(e){if(Array.isArray(e))return e}function m6(e){var t=qf(e,2),n=t[0],r=t[1],a=n,o=r;return n>r&&(a=r,o=n),[a,o]}function p6(e,t,n){if(e.lte(0))return new Pt(0);var r=py.getDigitCount(e.toNumber()),a=new Pt(10).pow(r),o=e.div(a),l=r!==1?.05:.1,u=new Pt(Math.ceil(o.div(l).toNumber())).add(n).mul(l),d=u.mul(a);return t?d:new Pt(Math.ceil(d))}function goe(e,t,n){var r=1,a=new Pt(e);if(!a.isint()&&n){var o=Math.abs(e);o<1?(r=new Pt(10).pow(py.getDigitCount(e)-1),a=new Pt(Math.floor(a.div(r).toNumber())).mul(r)):o>1&&(a=new Pt(Math.floor(e)))}else e===0?a=new Pt(Math.floor((t-1)/2)):n||(a=new Pt(Math.floor(e)));var l=Math.floor((t-1)/2),u=ioe(aoe(function(d){return a.add(new Pt(d-l).mul(r)).toNumber()}),G_);return u(0,t)}function v6(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Pt(0),tickMin:new Pt(0),tickMax:new Pt(0)};var o=p6(new Pt(t).sub(e).div(n-1),r,a),l;e<=0&&t>=0?l=new Pt(0):(l=new Pt(e).add(t).div(2),l=l.sub(new Pt(l).mod(o)));var u=Math.ceil(l.sub(e).div(o).toNumber()),d=Math.ceil(new Pt(t).sub(l).div(o).toNumber()),f=u+d+1;return f>n?v6(e,t,n,r,a+1):(f0?d+(n-f):d,u=t>0?u:u+(n-f)),{step:o,tickMin:l.sub(new Pt(u).mul(o)),tickMax:l.add(new Pt(d).mul(o))})}function yoe(e){var t=qf(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),u=m6([n,r]),d=qf(u,2),f=d[0],m=d[1];if(f===-1/0||m===1/0){var p=m===1/0?[f].concat(K_(G_(0,a-1).map(function(){return 1/0}))):[].concat(K_(G_(0,a-1).map(function(){return-1/0})),[m]);return n>r?Y_(p):p}if(f===m)return goe(f,a,o);var g=v6(f,m,l,o),x=g.step,j=g.tickMin,b=g.tickMax,w=py.rangeStep(j,b.add(new Pt(.1).mul(x)),x);return n>r?Y_(w):w}function xoe(e,t){var n=qf(e,2),r=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=m6([r,a]),u=qf(l,2),d=u[0],f=u[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var m=Math.max(t,2),p=p6(new Pt(f).sub(d).div(m-1),o,0),g=[].concat(K_(py.rangeStep(new Pt(d),new Pt(f).sub(new Pt(.99).mul(p)),p)),[f]);return r>a?Y_(g):g}var boe=f6(yoe),woe=f6(xoe),joe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uu(e){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(e)}function Hv(){return Hv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Aoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function koe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,l=-1,u=(n=r?.length)!==null&&n!==void 0?n:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var d=o.range,f=0;f0?a[f-1].coordinate:a[u-1].coordinate,p=a[f].coordinate,g=f>=u-1?a[0].coordinate:a[f+1].coordinate,x=void 0;if(br(p-m)!==br(g-p)){var j=[];if(br(g-p)===br(d[1]-d[0])){x=g;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+m)/2),j[1]=Math.max(b,(b+m)/2)}else{x=m;var w=g+d[1]-d[0];j[0]=Math.min(p,(w+p)/2),j[1]=Math.max(p,(w+p)/2)}var N=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>N[0]&&t<=N[1]||t>=j[0]&&t<=j[1]){l=a[f].index;break}}else{var O=Math.min(m,g),C=Math.max(m,g);if(t>(O+p)/2&&t<=(C+p)/2){l=a[f].index;break}}}else for(var A=0;A0&&A(r[A].coordinate+r[A-1].coordinate)/2&&t<=(r[A].coordinate+r[A+1].coordinate)/2||A===u-1&&t>(r[A].coordinate+r[A-1].coordinate)/2){l=r[A].index;break}return l},MC=function(t){var n,r=t,a=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?on(on({},t.type.defaultProps),t.props):t.props,l=o.stroke,u=o.fill,d;switch(a){case"Line":d=l;break;case"Area":case"Radar":d=l&&l!=="none"?l:u;break;default:d=u;break}return d},Yoe=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,o=a===void 0?{}:a;if(!o)return{};for(var l={},u=Object.keys(o),d=0,f=u.length;d=0});if(N&&N.length){var O=N[0].type.defaultProps,C=O!==void 0?on(on({},O),N[0].props):N[0].props,A=C.barSize,E=C[w];l[E]||(l[E]=[]);var k=Ge(A)?n:A;l[E].push({item:N[0],stackList:N.slice(1),barSize:Ge(k)?void 0:wr(k,r,0)})}}return l},Koe=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,o=t.sizeList,l=o===void 0?[]:o,u=t.maxBarSize,d=l.length;if(d<1)return null;var f=wr(n,a,0,!0),m,p=[];if(l[0].barSize===+l[0].barSize){var g=!1,x=a/d,j=l.reduce(function(A,E){return A+E.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&x>0&&(g=!0,x*=.9,j=d*x);var b=(a-j)/2>>0,w={offset:b-f,size:0};m=l.reduce(function(A,E){var k={item:E.item,position:{offset:w.offset+w.size+f,size:g?x:E.barSize}},T=[].concat(O$(A),[k]);return w=T[T.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(M){T.push({item:M,position:w})}),T},p)}else{var N=wr(r,a,0,!0);a-2*N-(d-1)*f<=0&&(f=0);var O=(a-2*N-(d-1)*f)/d;O>1&&(O>>=0);var C=u===+u?Math.min(O,u):O;m=l.reduce(function(A,E,k){var T=[].concat(O$(A),[{item:E.item,position:{offset:N+(O+f)*k+(O-C)/2,size:C}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(M){T.push({item:M,position:T[T.length-1].position})}),T},p)}return m},Xoe=function(t,n,r,a){var o=r.children,l=r.width,u=r.margin,d=l-(u.left||0)-(u.right||0),f=b6({children:o,legendWidth:d});if(f){var m=a||{},p=m.width,g=m.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&Oe(t[x]))return on(on({},t),{},Uc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&Oe(t[j]))return on(on({},t),{},Uc({},j,t[j]+(g||0)))}return t},Zoe=function(t,n,r){return Ge(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},w6=function(t,n,r,a,o){var l=n.props.children,u=na(l,Dh).filter(function(f){return Zoe(a,o,f.props.direction)});if(u&&u.length){var d=u.map(function(f){return f.props.dataKey});return t.reduce(function(f,m){var p=kn(m,r);if(Ge(p))return f;var g=Array.isArray(p)?[hy(p),fy(p)]:[p,p],x=d.reduce(function(j,b){var w=kn(m,b,0),N=g[0]-Math.abs(Array.isArray(w)?w[0]:w),O=g[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(N,j[0]),Math.max(O,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},Qoe=function(t,n,r,a,o){var l=n.map(function(u){return w6(t,u,r,o,a)}).filter(function(u){return!Ge(u)});return l&&l.length?l.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},j6=function(t,n,r,a,o){var l=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&w6(t,d,f,a)||wf(t,f,r,o)});if(r==="number")return l.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var u={};return l.reduce(function(d,f){for(var m=0,p=f.length;m=2?br(u[0]-u[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var m=(t.ticks||t.niceTicks).map(function(p){var g=o?o.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return m.filter(function(p){return!Eh(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:o?o[p]:p,index:g,offset:f}})},uS=new WeakMap,Rp=function(t,n){if(typeof n!="function")return t;uS.has(t)||uS.set(t,new WeakMap);var r=uS.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},N6=function(t,n,r){var a=t.scale,o=t.type,l=t.layout,u=t.axisType;if(a==="auto")return l==="radial"&&u==="radiusAxis"?{scale:Df(),realScaleType:"band"}:l==="radial"&&u==="angleAxis"?{scale:Bv(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:bf(),realScaleType:"point"}:o==="category"?{scale:Df(),realScaleType:"band"}:{scale:Bv(),realScaleType:"linear"};if(ll(a)){var d="scale".concat(Zg(a));return{scale:(f$[d]||bf)(),realScaleType:f$[d]?d:"point"}}return We(a)?{scale:a}:{scale:bf(),realScaleType:"point"}},E$=1e-4,O6=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),o=Math.min(a[0],a[1])-E$,l=Math.max(a[0],a[1])+E$,u=t(n[0]),d=t(n[r-1]);(ul||dl)&&t.domain([n[0],n[r-1]])}},Joe=function(t,n){if(!t)return null;for(var r=0,a=t.length;ra)&&(o[1]=a),o[0]>a&&(o[0]=a),o[1]=0?(t[u][r][0]=o,t[u][r][1]=o+d,o=t[u][r][1]):(t[u][r][0]=l,t[u][r][1]=l+d,l=t[u][r][1])}},nse=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r=0?(t[l][r][0]=o,t[l][r][1]=o+u,o=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},rse={sign:tse,expand:HJ,none:nu,silhouette:WJ,wiggle:VJ,positive:nse},ase=function(t,n,r){var a=n.map(function(u){return u.props.dataKey}),o=rse[r],l=UJ().keys(a).value(function(u,d){return+kn(u,d,0)}).order(E_).offset(o);return l(t)},ise=function(t,n,r,a,o,l){if(!t)return null;var u=l?n.reverse():n,d={},f=u.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?on(on({},g.type.defaultProps),g.props):g.props,b=j.stackId,w=j.hide;if(w)return p;var N=j[r],O=p[N]||{hasStack:!1,stackGroups:{}};if(Mn(b)){var C=O.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};C.items.push(g),O.hasStack=!0,O.stackGroups[b]=C}else O.stackGroups[zu("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return on(on({},p),{},Uc({},N,O))},d),m={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,w){var N=x.stackGroups[w];return on(on({},b),{},Uc({},w,{numericAxisId:r,cateAxisId:a,items:N.items,stackedData:ase(t,N.items,o)}))},j)}return on(on({},p),{},Uc({},g,x))},m)},C6=function(t,n){var r=n.realScaleType,a=n.type,o=n.tickCount,l=n.originalDomain,u=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(o&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var f=t.domain();if(!f.length)return null;var m=boe(f,o,u);return t.domain([hy(m),fy(m)]),{niceTicks:m}}if(o&&a==="number"){var p=t.domain(),g=woe(p,o,u);return{niceTicks:g}}return null};function A$(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,o=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(a[t.dataKey])){var u=wv(n,"value",a[t.dataKey]);if(u)return u.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var d=kn(a,Ge(l)?t.dataKey:l);return Ge(d)?null:t.scale(d)}var T$=function(t){var n=t.axis,r=t.ticks,a=t.offset,o=t.bandSize,l=t.entry,u=t.index;if(n.type==="category")return r[u]?r[u].coordinate+a:null;var d=kn(l,n.dataKey,n.domain[u]);return Ge(d)?null:n.scale(d)-o/2+a},ose=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return a<=0&&o>=0?0:o<0?o:a}return r[0]},sse=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?on(on({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(Mn(o)){var l=n[o];if(l){var u=l.items.indexOf(t);return u>=0?l.stackedData[u]:null}}return null},lse=function(t){return t.reduce(function(n,r){return[hy(r.concat([n[0]]).filter(Oe)),fy(r.concat([n[1]]).filter(Oe))]},[1/0,-1/0])},E6=function(t,n,r){return Object.keys(t).reduce(function(a,o){var l=t[o],u=l.stackedData,d=u.reduce(function(f,m){var p=lse(m.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},k$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,M$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,J_=function(t,n,r){if(We(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Oe(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(k$.test(t[0])){var o=+k$.exec(t[0])[1];a[0]=n[0]-o}else We(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Oe(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(M$.test(t[1])){var l=+M$.exec(t[1])[1];a[1]=n[1]+l}else We(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Vv=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var o=oC(n,function(p){return p.coordinate}),l=1/0,u=1,d=o.length;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},gse=function(t,n,r,a,o){var l=t.width,u=t.height,d=t.startAngle,f=t.endAngle,m=wr(t.cx,l,l/2),p=wr(t.cy,u,u/2),g=k6(l,u,r),x=wr(t.innerRadius,g,0),j=wr(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(w,N){var O=n[N],C=O.domain,A=O.reversed,E;if(Ge(O.range))a==="angleAxis"?E=[d,f]:a==="radiusAxis"&&(E=[x,j]),A&&(E=[E[1],E[0]]);else{E=O.range;var k=E,T=dse(k,2);d=T[0],f=T[1]}var M=N6(O,o),$=M.realScaleType,z=M.scale;z.domain(C).range(E),O6(z);var D=C6(z,Hi(Hi({},O),{},{realScaleType:$})),U=Hi(Hi(Hi({},O),D),{},{range:E,radius:j,realScaleType:$,scale:z,cx:m,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return Hi(Hi({},w),{},T6({},N,U))},{})},yse=function(t,n){var r=t.x,a=t.y,o=n.x,l=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(a-l,2))},xse=function(t,n){var r=t.x,a=t.y,o=n.cx,l=n.cy,u=yse({x:r,y:a},{x:o,y:l});if(u<=0)return{radius:u};var d=(r-o)/u,f=Math.acos(d);return a>l&&(f=2*Math.PI-f),{radius:u,angle:vse(f),angleInRadian:f}},bse=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),o=Math.floor(r/360),l=Math.min(a,o);return{startAngle:n-l*360,endAngle:r-l*360}},wse=function(t,n){var r=n.startAngle,a=n.endAngle,o=Math.floor(r/360),l=Math.floor(a/360),u=Math.min(o,l);return t+u*360},$$=function(t,n){var r=t.x,a=t.y,o=xse({x:r,y:a},n),l=o.radius,u=o.angle,d=n.innerRadius,f=n.outerRadius;if(lf)return!1;if(l===0)return!0;var m=bse(n),p=m.startAngle,g=m.endAngle,x=u,j;if(p<=g){for(;x>g;)x-=360;for(;x=p&&x<=g}else{for(;x>p;)x-=360;for(;x=g&&x<=p}return j?Hi(Hi({},n),{},{radius:l,angle:wse(x,n)}):null},M6=function(t){return!y.isValidElement(t)&&!We(t)&&typeof t!="boolean"?t.className:""};function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}var jse=["offset"];function Sse(e){return Cse(e)||Ose(e)||Nse(e)||_se()}function _se(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nse(e,t){if(e){if(typeof e=="string")return eN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eN(e,t)}}function Ose(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cse(e){if(Array.isArray(e))return eN(e)}function eN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ase(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function I$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t=0?1:-1,C,A;a==="insideStart"?(C=x+O*l,A=b):a==="insideEnd"?(C=j-O*l,A=!b):a==="end"&&(C=j+O*l,A=b),A=N<=0?A:!A;var E=Ft(f,m,w,C),k=Ft(f,m,w,C+(A?1:-1)*359),T="M".concat(E.x,",").concat(E.y,` A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`, `).concat(k.x,",").concat(k.y),M=Ge(t.id)?zu("recharts-radial-line-"):t.id;return W.createElement("text",Vf({},r,{dominantBaseline:"central",className:Ye("recharts-radial-bar-label",u)}),W.createElement("defs",null,W.createElement("path",{id:M,d:T})),W.createElement("textPath",{xlinkHref:"#".concat(M)},n))},$se=function(t){var n=t.viewBox,r=t.offset,a=t.position,o=n,l=o.cx,u=o.cy,d=o.innerRadius,f=o.outerRadius,m=o.startAngle,p=o.endAngle,g=(m+p)/2;if(a==="outside"){var x=Ft(l,u,f+r,g),j=x.x,b=x.y;return{x:j,y:b,textAnchor:j>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(d+f)/2,N=Ft(l,u,w,g),O=N.x,C=N.y;return{x:O,y:C,textAnchor:"middle",verticalAnchor:"middle"}},Ise=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,o=t.position,l=n,u=l.x,d=l.y,f=l.width,m=l.height,p=m>=0?1:-1,g=p*a,x=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,w=b*a,N=b>0?"end":"start",O=b>0?"start":"end";if(o==="top"){var C={x:u+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:x};return Tn(Tn({},C),r?{height:Math.max(d-r.y,0),width:f}:{})}if(o==="bottom"){var A={x:u+f/2,y:d+m+g,textAnchor:"middle",verticalAnchor:j};return Tn(Tn({},A),r?{height:Math.max(r.y+r.height-(d+m),0),width:f}:{})}if(o==="left"){var E={x:u-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"};return Tn(Tn({},E),r?{width:Math.max(E.x-r.x,0),height:m}:{})}if(o==="right"){var k={x:u+f+w,y:d+m/2,textAnchor:O,verticalAnchor:"middle"};return Tn(Tn({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:m}:{})}var T=r?{width:f,height:m}:{};return o==="insideLeft"?Tn({x:u+w,y:d+m/2,textAnchor:O,verticalAnchor:"middle"},T):o==="insideRight"?Tn({x:u+f-w,y:d+m/2,textAnchor:N,verticalAnchor:"middle"},T):o==="insideTop"?Tn({x:u+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},T):o==="insideBottom"?Tn({x:u+f/2,y:d+m-g,textAnchor:"middle",verticalAnchor:x},T):o==="insideTopLeft"?Tn({x:u+w,y:d+g,textAnchor:O,verticalAnchor:j},T):o==="insideTopRight"?Tn({x:u+f-w,y:d+g,textAnchor:N,verticalAnchor:j},T):o==="insideBottomLeft"?Tn({x:u+w,y:d+m-g,textAnchor:O,verticalAnchor:x},T):o==="insideBottomRight"?Tn({x:u+f-w,y:d+m-g,textAnchor:N,verticalAnchor:x},T):Bu(o)&&(Oe(o.x)||Hs(o.x))&&(Oe(o.y)||Hs(o.y))?Tn({x:u+wr(o.x,f),y:d+wr(o.y,m),textAnchor:"end",verticalAnchor:"end"},T):Tn({x:u+f/2,y:d+m/2,textAnchor:"middle",verticalAnchor:"middle"},T)},Lse=function(t){return"cx"in t&&Oe(t.cx)};function qn(e){var t=e.offset,n=t===void 0?5:t,r=Ese(e,jse),a=Tn({offset:n},r),o=a.viewBox,l=a.position,u=a.value,d=a.children,f=a.content,m=a.className,p=m===void 0?"":m,g=a.textBreakAll;if(!o||Ge(u)&&Ge(d)&&!y.isValidElement(f)&&!We(f))return null;if(y.isValidElement(f))return y.cloneElement(f,a);var x;if(We(f)){if(x=y.createElement(f,a),y.isValidElement(x))return x}else x=Pse(a);var j=Lse(o),b=Be(a,!0);if(j&&(l==="insideStart"||l==="insideEnd"||l==="end"))return Dse(a,x,b);var w=j?$se(a):Ise(a);return W.createElement(ul,Vf({className:Ye("recharts-label",p)},b,w,{breakAll:g}),x)}qn.displayName="Label";var P6=function(t){var n=t.cx,r=t.cy,a=t.angle,o=t.startAngle,l=t.endAngle,u=t.r,d=t.radius,f=t.innerRadius,m=t.outerRadius,p=t.x,g=t.y,x=t.top,j=t.left,b=t.width,w=t.height,N=t.clockWise,O=t.labelViewBox;if(O)return O;if(Oe(b)&&Oe(w)){if(Oe(p)&&Oe(g))return{x:p,y:g,width:b,height:w};if(Oe(x)&&Oe(j))return{x,y:j,width:b,height:w}}return Oe(p)&&Oe(g)?{x:p,y:g,width:0,height:0}:Oe(n)&&Oe(r)?{cx:n,cy:r,startAngle:o||a||0,endAngle:l||a||0,innerRadius:f||0,outerRadius:m||d||u||0,clockWise:N}:t.viewBox?t.viewBox:{}},Bse=function(t,n){return t?t===!0?W.createElement(qn,{key:"label-implicit",viewBox:n}):Mn(t)?W.createElement(qn,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===qn?y.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(qn,{key:"label-implicit",content:t,viewBox:n}):We(t)?W.createElement(qn,{key:"label-implicit",content:t,viewBox:n}):Bu(t)?W.createElement(qn,Vf({viewBox:n},t,{key:"label-implicit"})):null:null},zse=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,o=P6(t),l=na(a,qn).map(function(d,f){return y.cloneElement(d,{viewBox:n||o,key:"label-".concat(f)})});if(!r)return l;var u=Bse(t.label,n||o);return[u].concat(Sse(l))};qn.parseViewBox=P6;qn.renderCallByParent=zse;var dS,L$;function qse(){if(L$)return dS;L$=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return dS=e,dS}var Fse=qse();const Use=St(Fse);function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}var Hse=["valueAccessor"],Wse=["data","dataKey","clockWise","id","textBreakAll"];function Vse(e){return Xse(e)||Kse(e)||Yse(e)||Gse()}function Gse(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yse(e,t){if(e){if(typeof e=="string")return tN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tN(e,t)}}function Kse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xse(e){if(Array.isArray(e))return tN(e)}function tN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ele(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var tle=function(t){return Array.isArray(t.value)?Use(t.value):t.value};function eo(e){var t=e.valueAccessor,n=t===void 0?tle:t,r=q$(e,Hse),a=r.data,o=r.dataKey,l=r.clockWise,u=r.id,d=r.textBreakAll,f=q$(r,Wse);return!a||!a.length?null:W.createElement(pt,{className:"recharts-label-list"},a.map(function(m,p){var g=Ge(o)?n(m,p):kn(m&&m.payload,o),x=Ge(u)?{}:{id:"".concat(u,"-").concat(p)};return W.createElement(qn,Yv({},Be(m,!0),f,x,{parentViewBox:m.parentViewBox,value:g,textBreakAll:d,viewBox:qn.parseViewBox(Ge(l)?m:z$(z$({},m),{},{clockWise:l})),key:"label-".concat(p),index:p}))}))}eo.displayName="LabelList";function nle(e,t){return e?e===!0?W.createElement(eo,{key:"labelList-implicit",data:t}):W.isValidElement(e)||We(e)?W.createElement(eo,{key:"labelList-implicit",data:t,content:e}):Bu(e)?W.createElement(eo,Yv({data:t},e,{key:"labelList-implicit"})):null:null}function rle(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=na(r,eo).map(function(l,u){return y.cloneElement(l,{data:t,key:"labelList-".concat(u)})});if(!n)return a;var o=nle(e.label,t);return[o].concat(Vse(a))}eo.renderCallByParent=rle;function Yf(e){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(e)}function nN(){return nN=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>f),`, `).concat(p.x,",").concat(p.y,` `);if(a>0){var x=Ft(n,r,a,l),j=Ft(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,` A `).concat(a,",").concat(a,`,0, `).concat(+(Math.abs(d)>180),",").concat(+(l<=f),`, `).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},lle=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,l=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,m=t.endAngle,p=br(m-f),g=Dp({cx:n,cy:r,radius:o,angle:f,sign:p,cornerRadius:l,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,b=g.theta,w=Dp({cx:n,cy:r,radius:o,angle:m,sign:-p,cornerRadius:l,cornerIsExternal:d}),N=w.circleTangency,O=w.lineTangency,C=w.theta,A=d?Math.abs(f-m):Math.abs(f-m)-b-C;if(A<0)return u?"M ".concat(j.x,",").concat(j.y,` a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 `):R6({cx:n,cy:r,innerRadius:a,outerRadius:o,startAngle:f,endAngle:m});var E="M ".concat(j.x,",").concat(j.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,` A`).concat(o,",").concat(o,",0,").concat(+(A>180),",").concat(+(p<0),",").concat(N.x,",").concat(N.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` `);if(a>0){var k=Dp({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),T=k.circleTangency,M=k.lineTangency,$=k.theta,z=Dp({cx:n,cy:r,radius:a,angle:m,sign:-p,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),D=z.circleTangency,U=z.lineTangency,V=z.theta,H=d?Math.abs(f-m):Math.abs(f-m)-$-V;if(H<0&&l===0)return"".concat(E,"L").concat(n,",").concat(r,"Z");E+="L".concat(U.x,",").concat(U.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(D.x,",").concat(D.y,` A`).concat(a,",").concat(a,",0,").concat(+(H>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(p<0),",").concat(M.x,",").concat(M.y,"Z")}else E+="L".concat(n,",").concat(r,"Z");return E},cle={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},D6=function(t){var n=U$(U$({},cle),t),r=n.cx,a=n.cy,o=n.innerRadius,l=n.outerRadius,u=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,m=n.startAngle,p=n.endAngle,g=n.className;if(l0&&Math.abs(m-p)<360?w=lle({cx:r,cy:a,innerRadius:o,outerRadius:l,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:m,endAngle:p}):w=R6({cx:r,cy:a,innerRadius:o,outerRadius:l,startAngle:m,endAngle:p}),W.createElement("path",nN({},Be(n,!0),{className:x,d:w,role:"img"}))};function Kf(e){"@babel/helpers - typeof";return Kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kf(e)}function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Ele(e,t){return Sl(e.getTime(),t.getTime())}function Ale(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Tle(e,t){return e===t}function eI(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),o=e.entries(),l,u,d=0;(l=o.next())&&!l.done;){for(var f=t.entries(),m=!1,p=0;(u=f.next())&&!u.done;){if(a[p]){p++;continue}var g=l.value,x=u.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){m=a[p]=!0;break}p++}if(!m)return!1;d++}return!0}var kle=Sl;function Mle(e,t,n){var r=J$(e),a=r.length;if(J$(t).length!==a)return!1;for(;a-- >0;)if(!$6(e,t,n,r[a]))return!1;return!0}function nf(e,t,n){var r=Z$(e),a=r.length;if(Z$(t).length!==a)return!1;for(var o,l,u;a-- >0;)if(o=r[a],!$6(e,t,n,o)||(l=Q$(e,o),u=Q$(t,o),(l||u)&&(!l||!u||l.configurable!==u.configurable||l.enumerable!==u.enumerable||l.writable!==u.writable)))return!1;return!0}function Ple(e,t){return Sl(e.valueOf(),t.valueOf())}function Rle(e,t){return e.source===t.source&&e.flags===t.flags}function tI(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),o=e.values(),l,u;(l=o.next())&&!l.done;){for(var d=t.values(),f=!1,m=0;(u=d.next())&&!u.done;){if(!a[m]&&n.equals(l.value,u.value,l.value,u.value,e,t,n)){f=a[m]=!0;break}m++}if(!f)return!1}return!0}function Dle(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function $le(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function $6(e,t,n,r){return(r===Ole||r===Nle||r===_le)&&(e.$$typeof||t.$$typeof)?!0:Sle(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Ile="[object Arguments]",Lle="[object Boolean]",Ble="[object Date]",zle="[object Error]",qle="[object Map]",Fle="[object Number]",Ule="[object Object]",Hle="[object RegExp]",Wle="[object Set]",Vle="[object String]",Gle="[object URL]",Yle=Array.isArray,nI=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,rI=Object.assign,Kle=Object.prototype.toString.call.bind(Object.prototype.toString);function Xle(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,o=e.areMapsEqual,l=e.areNumbersEqual,u=e.areObjectsEqual,d=e.arePrimitiveWrappersEqual,f=e.areRegExpsEqual,m=e.areSetsEqual,p=e.areTypedArraysEqual,g=e.areUrlsEqual,x=e.unknownTagComparators;return function(b,w,N){if(b===w)return!0;if(b==null||w==null)return!1;var O=typeof b;if(O!==typeof w)return!1;if(O!=="object")return O==="number"?l(b,w,N):O==="function"?a(b,w,N):!1;var C=b.constructor;if(C!==w.constructor)return!1;if(C===Object)return u(b,w,N);if(Yle(b))return t(b,w,N);if(nI!=null&&nI(b))return p(b,w,N);if(C===Date)return n(b,w,N);if(C===RegExp)return f(b,w,N);if(C===Map)return o(b,w,N);if(C===Set)return m(b,w,N);var A=Kle(b);if(A===Ble)return n(b,w,N);if(A===Hle)return f(b,w,N);if(A===qle)return o(b,w,N);if(A===Wle)return m(b,w,N);if(A===Ule)return typeof b.then!="function"&&typeof w.then!="function"&&u(b,w,N);if(A===Gle)return g(b,w,N);if(A===zle)return r(b,w,N);if(A===Ile)return u(b,w,N);if(A===Lle||A===Fle||A===Vle)return d(b,w,N);if(x){var E=x[A];if(!E){var k=jle(b);k&&(E=x[k])}if(E)return E(b,w,N)}return!1}}function Zle(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?nf:Cle,areDatesEqual:Ele,areErrorsEqual:Ale,areFunctionsEqual:Tle,areMapsEqual:r?X$(eI,nf):eI,areNumbersEqual:kle,areObjectsEqual:r?nf:Mle,arePrimitiveWrappersEqual:Ple,areRegExpsEqual:Rle,areSetsEqual:r?X$(tI,nf):tI,areTypedArraysEqual:r?nf:Dle,areUrlsEqual:$le,unknownTagComparators:void 0};if(n&&(a=rI({},a,n(a))),t){var o=Ip(a.areArraysEqual),l=Ip(a.areMapsEqual),u=Ip(a.areObjectsEqual),d=Ip(a.areSetsEqual);a=rI({},a,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:u,areSetsEqual:d})}return a}function Qle(e){return function(t,n,r,a,o,l,u){return e(t,n,u)}}function Jle(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,o=e.strict;if(r)return function(d,f){var m=r(),p=m.cache,g=p===void 0?t?new WeakMap:void 0:p,x=m.meta;return n(d,f,{cache:g,equals:a,meta:x,strict:o})};if(t)return function(d,f){return n(d,f,{cache:new WeakMap,equals:a,meta:void 0,strict:o})};var l={cache:void 0,equals:a,meta:void 0,strict:o};return function(d,f){return n(d,f,l)}}var ece=ss();ss({strict:!0});ss({circular:!0});ss({circular:!0,strict:!0});ss({createInternalComparator:function(){return Sl}});ss({strict:!0,createInternalComparator:function(){return Sl}});ss({circular:!0,createInternalComparator:function(){return Sl}});ss({circular:!0,createInternalComparator:function(){return Sl},strict:!0});function ss(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,o=e.strict,l=o===void 0?!1:o,u=Zle(e),d=Xle(u),f=r?r(d):Qle(d);return Jle({circular:n,comparator:d,createState:a,equals:f,strict:l})}function tce(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function aI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(o){n<0&&(n=o),o-n>t?(e(o),n=-1):tce(a)};requestAnimationFrame(r)}function aN(e){"@babel/helpers - typeof";return aN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aN(e)}function nce(e){return oce(e)||ice(e)||ace(e)||rce()}function rce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ace(e,t){if(e){if(typeof e=="string")return iI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iI(e,t)}}function iI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:N<0?0:N},b=function(N){for(var O=N>1?1:N,C=O,A=0;A<8;++A){var E=p(C)-O,k=x(C);if(Math.abs(E-O)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,o=a===void 0?8:a,l=t.dt,u=l===void 0?17:l,d=function(m,p,g){var x=-(m-p)*r,j=g*o,b=g+(x-j)*u/1e3,w=g*u/1e3+m;return Math.abs(w-p)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ice(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}function pS(e){return qce(e)||zce(e)||Bce(e)||Lce()}function Lce(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bce(e,t){if(e){if(typeof e=="string")return cN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cN(e,t)}}function zce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qce(e){if(Array.isArray(e))return cN(e)}function cN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qv(e){return Qv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qv(e)}var vi=(function(e){Vce(n,e);var t=Gce(n);function n(r,a){var o;Fce(this,n),o=t.call(this,r,a);var l=o.props,u=l.isActive,d=l.attributeName,f=l.from,m=l.to,p=l.steps,g=l.children,x=l.duration;if(o.handleStyleChange=o.handleStyleChange.bind(fN(o)),o.changeStyle=o.changeStyle.bind(fN(o)),!u||x<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:m}),dN(o);if(p&&p.length)o.state={style:p[0].style};else if(f){if(typeof g=="function")return o.state={style:f},dN(o);o.state={style:d?uf({},d,f):f}}else o.state={style:{}};return o}return Hce(n,[{key:"componentDidMount",value:function(){var a=this.props,o=a.isActive,l=a.canBegin;this.mounted=!0,!(!o||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var o=this.props,l=o.isActive,u=o.canBegin,d=o.attributeName,f=o.shouldReAnimate,m=o.to,p=o.from,g=this.state.style;if(u){if(!l){var x={style:d?uf({},d,m):m};this.state&&g&&(d&&g[d]!==m||!d&&g!==m)&&this.setState(x);return}if(!(ece(a.to,m)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&g){var w={style:d?uf({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(w)}this.runAnimation(Pa(Pa({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var o=this,l=a.from,u=a.to,d=a.duration,f=a.easing,m=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,x=Rce(l,u,Sce(f),d,this.changeStyle),j=function(){o.stopJSAnimation=x()};this.manager.start([g,m,j,d,p])}},{key:"runStepAnimation",value:function(a){var o=this,l=a.steps,u=a.begin,d=a.onAnimationStart,f=l[0],m=f.style,p=f.duration,g=p===void 0?0:p,x=function(b,w,N){if(N===0)return b;var O=w.duration,C=w.easing,A=C===void 0?"ease":C,E=w.style,k=w.properties,T=w.onAnimationEnd,M=N>0?l[N-1]:w,$=k||Object.keys(E);if(typeof A=="function"||A==="spring")return[].concat(pS(b),[o.runJSAnimation.bind(o,{from:M.style,to:E,duration:O,easing:A}),O]);var z=lI($,O,A),D=Pa(Pa(Pa({},M.style),E),{},{transition:z});return[].concat(pS(b),[D,O,T]).filter(dce)};return this.manager.start([d].concat(pS(l.reduce(x,[m,Math.max(g,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=sce());var o=a.begin,l=a.duration,u=a.attributeName,d=a.to,f=a.easing,m=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,x=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var b=u?uf({},u,d):d,w=lI(Object.keys(b),l,f);j.start([m,o,Pa(Pa({},b),{},{transition:w}),l,p])}},{key:"render",value:function(){var a=this.props,o=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=$ce(a,Dce),f=y.Children.count(o),m=this.state.style;if(typeof o=="function")return o(m);if(!u||f===0||l<=0)return o;var p=function(x){var j=x.props,b=j.style,w=b===void 0?{}:b,N=j.className,O=y.cloneElement(x,Pa(Pa({},d),{},{style:Pa(Pa({},w),m),className:N}));return O};return f===1?p(y.Children.only(o)):W.createElement("div",null,y.Children.map(o,function(g){return p(g)}))}}]),n})(y.PureComponent);vi.displayName="Animate";vi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};vi.propTypes={from:bt.oneOfType([bt.object,bt.string]),to:bt.oneOfType([bt.object,bt.string]),attributeName:bt.string,duration:bt.number,begin:bt.number,easing:bt.oneOfType([bt.string,bt.func]),steps:bt.arrayOf(bt.shape({duration:bt.number.isRequired,style:bt.object.isRequired,easing:bt.oneOfType([bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),bt.func]),properties:bt.arrayOf("string"),onAnimationEnd:bt.func})),children:bt.oneOfType([bt.node,bt.func]),isActive:bt.bool,canBegin:bt.bool,onAnimationEnd:bt.func,shouldReAnimate:bt.bool,onAnimationStart:bt.func,onAnimationReStart:bt.func};function Qf(e){"@babel/helpers - typeof";return Qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qf(e)}function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,m;if(l>0&&o instanceof Array){for(var p=[0,0,0,0],g=0,x=4;gl?l:o[g];m="M".concat(t,",").concat(n+u*p[0]),p[0]>0&&(m+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),m+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(m+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`, `).concat(t+r,",").concat(n+u*p[1])),m+="L ".concat(t+r,",").concat(n+a-u*p[2]),p[2]>0&&(m+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`, `).concat(t+r-d*p[2],",").concat(n+a)),m+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(m+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`, `).concat(t,",").concat(n+a-u*p[3])),m+="Z"}else if(l>0&&o===+o&&o>0){var j=Math.min(l,o);m="M ".concat(t,",").concat(n+u*j,` A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,` L `).concat(t+r-d*j,",").concat(n,` A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+u*j,` L `).concat(t+r,",").concat(n+a-u*j,` A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,` L `).concat(t+d*j,",").concat(n+a,` A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-u*j," Z")}else m="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return m},rue=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,o=n.x,l=n.y,u=n.width,d=n.height;if(Math.abs(u)>0&&Math.abs(d)>0){var f=Math.min(o,o+u),m=Math.max(o,o+u),p=Math.min(l,l+d),g=Math.max(l,l+d);return r>=f&&r<=m&&a>=p&&a<=g}return!1},aue={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PC=function(t){var n=vI(vI({},aue),t),r=y.useRef(),a=y.useState(-1),o=Kce(a,2),l=o[0],u=o[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&u(A)}catch{}},[]);var d=n.x,f=n.y,m=n.width,p=n.height,g=n.radius,x=n.className,j=n.animationEasing,b=n.animationDuration,w=n.animationBegin,N=n.isAnimationActive,O=n.isUpdateAnimationActive;if(d!==+d||f!==+f||m!==+m||p!==+p||m===0||p===0)return null;var C=Ye("recharts-rectangle",x);return O?W.createElement(vi,{canBegin:l>0,from:{width:m,height:p,x:d,y:f},to:{width:m,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:O},function(A){var E=A.width,k=A.height,T=A.x,M=A.y;return W.createElement(vi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,isActive:N,easing:j},W.createElement("path",Jv({},Be(n,!0),{className:C,d:gI(T,M,E,k,g),ref:r})))}):W.createElement("path",Jv({},Be(n,!0),{className:C,d:gI(d,f,m,p,g)}))},iue=["points","className","baseLinePoints","connectNulls"];function Ic(){return Ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yI(e){return due(e)||uue(e)||cue(e)||lue()}function lue(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cue(e,t){if(e){if(typeof e=="string")return hN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hN(e,t)}}function uue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function due(e){if(Array.isArray(e))return hN(e)}function hN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){xI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),xI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Sf=function(t,n){var r=fue(t);n&&(r=[r.reduce(function(o,l){return[].concat(yI(o),yI(l))},[])]);var a=r.map(function(o){return o.reduce(function(l,u,d){return"".concat(l).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},hue=function(t,n,r){var a=Sf(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Sf(n.reverse(),r).slice(1))},mue=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,o=t.connectNulls,l=oue(t,iue);if(!n||!n.length)return null;var u=Ye("recharts-polygon",r);if(a&&a.length){var d=l.stroke&&l.stroke!=="none",f=hue(n,a,o);return W.createElement("g",{className:u},W.createElement("path",Ic({},Be(l,!0),{fill:f.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:f})),d?W.createElement("path",Ic({},Be(l,!0),{fill:"none",d:Sf(n,o)})):null,d?W.createElement("path",Ic({},Be(l,!0),{fill:"none",d:Sf(a,o)})):null)}var m=Sf(n,o);return W.createElement("path",Ic({},Be(l,!0),{fill:m.slice(-1)==="Z"?l.fill:"none",className:u,d:m}))};function mN(){return mN=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var jue=function(t,n,r,a,o,l){return"M".concat(t,",").concat(o,"v").concat(a,"M").concat(l,",").concat(n,"h").concat(r)},Sue=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,l=t.top,u=l===void 0?0:l,d=t.left,f=d===void 0?0:d,m=t.width,p=m===void 0?0:m,g=t.height,x=g===void 0?0:g,j=t.className,b=bue(t,pue),w=vue({x:r,y:o,top:u,left:f,width:p,height:x},b);return!Oe(r)||!Oe(o)||!Oe(p)||!Oe(x)||!Oe(u)||!Oe(f)?null:W.createElement("path",pN({},Be(w,!0),{className:Ye("recharts-cross",j),d:jue(r,o,p,x,u,f)}))},vS,wI;function _ue(){if(wI)return vS;wI=1;var e=dy(),t=r6(),n=bi();function r(a,o){return a&&a.length?e(a,n(o,2),t):void 0}return vS=r,vS}var Nue=_ue();const Oue=St(Nue);var gS,jI;function Cue(){if(jI)return gS;jI=1;var e=dy(),t=bi(),n=a6();function r(a,o){return a&&a.length?e(a,t(o,2),n):void 0}return gS=r,gS}var Eue=Cue();const Aue=St(Eue);var Tue=["cx","cy","angle","ticks","axisLine"],kue=["ticks","tick","angle","tickFormatter","stroke"];function fu(e){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fu(e)}function _f(){return _f=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NI(e,t){for(var n=0;nEI?l=a==="outer"?"start":"end":o<-EI?l=a==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,o=r.cy,l=r.radius,u=r.axisLine,d=r.axisLineType,f=Ls(Ls({},Be(this.props,!1)),{},{fill:"none"},Be(u,!1));if(d==="circle")return W.createElement(vy,Fs({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:o,r:l}));var m=this.props.ticks,p=m.map(function(g){return Ft(a,o,l,g.coordinate)});return W.createElement(mue,Fs({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,o=a.ticks,l=a.tick,u=a.tickLine,d=a.tickFormatter,f=a.stroke,m=Be(this.props,!1),p=Be(l,!1),g=Ls(Ls({},m),{},{fill:"none"},Be(u,!1)),x=o.map(function(j,b){var w=r.getTickLineCoord(j),N=r.getTickTextAnchor(j),O=Ls(Ls(Ls({textAnchor:N},m),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:w.x2,y:w.y2});return W.createElement(pt,Fs({className:Ye("recharts-polar-angle-axis-tick",M6(l)),key:"tick-".concat(j.coordinate)},cl(r.props,j,b)),u&&W.createElement("line",Fs({className:"recharts-polar-angle-axis-tick-line"},g,w)),l&&t.renderTickItem(l,O,d?d(j.value,b):j.value))});return W.createElement(pt,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,a=r.ticks,o=r.radius,l=r.axisLine;return o<=0||!a||!a.length?null:W.createElement(pt,{className:Ye("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,o){var l;return W.isValidElement(r)?l=W.cloneElement(r,a):We(r)?l=r(a):l=W.createElement(ul,Fs({},a,{className:"recharts-polar-angle-axis-tick-value"}),o),l}}])})(y.PureComponent);xy(by,"displayName","PolarAngleAxis");xy(by,"axisType","angleAxis");xy(by,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var yS,AI;function Yue(){if(AI)return yS;AI=1;var e=nz(),t=e(Object.getPrototypeOf,Object);return yS=t,yS}var xS,TI;function Kue(){if(TI)return xS;TI=1;var e=lo(),t=Yue(),n=co(),r="[object Object]",a=Function.prototype,o=Object.prototype,l=a.toString,u=o.hasOwnProperty,d=l.call(Object);function f(m){if(!n(m)||e(m)!=r)return!1;var p=t(m);if(p===null)return!0;var g=u.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==d}return xS=f,xS}var Xue=Kue();const Zue=St(Xue);var bS,kI;function Que(){if(kI)return bS;kI=1;var e=lo(),t=co(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return bS=r,bS}var Jue=Que();const ede=St(Jue);function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}function ng(){return ng=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:m,lowerWidth:p,height:g,x:d,y:f},duration:b,animationEasing:j,isActive:N},function(C){var A=C.upperWidth,E=C.lowerWidth,k=C.height,T=C.x,M=C.y;return W.createElement(vi,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,easing:j},W.createElement("path",ng({},Be(n,!0),{className:O,d:DI(T,M,A,E,k),ref:r})))}):W.createElement("g",null,W.createElement("path",ng({},Be(n,!0),{className:O,d:DI(d,f,m,p,g)})))},dde=["option","shapeType","propTransformer","activeClassName","isActive"];function th(e){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(e)}function fde(e,t){if(e==null)return{};var n=hde(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rg(e){for(var t=1;t0?ta(C,"paddingAngle",0):0;if(E){var T=Qr(E.endAngle-E.startAngle,C.endAngle-C.startAngle),M=Bt(Bt({},C),{},{startAngle:O+k,endAngle:O+T(b)+k});w.push(M),O=M.endAngle}else{var $=C.endAngle,z=C.startAngle,D=Qr(0,$-z),U=D(b),V=Bt(Bt({},C),{},{startAngle:O+k,endAngle:O+U+k});w.push(V),O=V.endAngle}}),W.createElement(pt,null,r.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var l=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,o=r.isAnimationActive,l=this.state.prevSectors;return o&&a&&a.length&&(!l||!Rh(l,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,o=a.hide,l=a.sectors,u=a.className,d=a.label,f=a.cx,m=a.cy,p=a.innerRadius,g=a.outerRadius,x=a.isAnimationActive,j=this.state.isAnimationFinished;if(o||!l||!l.length||!Oe(f)||!Oe(m)||!Oe(p)||!Oe(g))return null;var b=Ye("recharts-pie",u);return W.createElement(pt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(N){r.pieRef=N}},this.renderSectors(),d&&this.renderLabels(l),qn.renderCallByParent(this.props,null,!1),(!x||j)&&eo.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?O:O-1)*d,A=w-O*x-C,E=a.reduce(function(M,$){var z=kn($,N,0);return M+(Oe(z)?z:0)},0),k;if(E>0){var T;k=a.map(function(M,$){var z=kn(M,N,0),D=kn(M,m,$),U=(Oe(z)?z:0)/E,V;$?V=T.endAngle+br(b)*d*(z!==0?1:0):V=l;var H=V+br(b)*((z!==0?x:0)+U*A),G=(V+H)/2,L=(j.innerRadius+j.outerRadius)/2,R=[{name:D,value:z,payload:M,dataKey:N,type:g}],F=Ft(j.cx,j.cy,L,G);return T=Bt(Bt(Bt({percent:U,cornerRadius:o,name:D,tooltipPayload:R,midAngle:G,middleRadius:L,tooltipPosition:F},M),j),{},{value:kn(M,N),startAngle:V,endAngle:H,payload:M,paddingAngle:br(b)*d}),T})}return Bt(Bt({},j),{},{sectors:k,data:a})});var wS,zI;function Rde(){if(zI)return wS;zI=1;var e=Math.ceil,t=Math.max;function n(r,a,o,l){for(var u=-1,d=t(e((a-r)/(o||1)),0),f=Array(d);d--;)f[l?d:++u]=r,r+=o;return f}return wS=n,wS}var jS,qI;function X6(){if(qI)return jS;qI=1;var e=yz(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var o=a<0?-1:1;return o*n}return a===a?a:0}return jS=r,jS}var SS,FI;function Dde(){if(FI)return SS;FI=1;var e=Rde(),t=ry(),n=X6();function r(a){return function(o,l,u){return u&&typeof u!="number"&&t(o,l,u)&&(l=u=void 0),o=n(o),l===void 0?(l=o,o=0):l=n(l),u=u===void 0?o0&&r.handleDrag(a.changedTouches[0])}),Yr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,o=a.endIndex,l=a.onDragEnd,u=a.startIndex;l?.({endIndex:o,startIndex:u})}),r.detachDragEndListener()}),Yr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Yr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Yr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Yr(r,"handleSlideDragStart",function(a){var o=YI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Gde(t,e),Ude(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,o=r.endX,l=this.state.scaleValues,u=this.props,d=u.gap,f=u.data,m=f.length-1,p=Math.min(a,o),g=Math.max(a,o),x=t.getIndexInRange(l,p),j=t.getIndexInRange(l,g);return{startIndex:x-x%d,endIndex:j===m?m:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,o=a.data,l=a.tickFormatter,u=a.dataKey,d=kn(o[r],u,r);return We(l)?l(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,o=a.slideMoveStartX,l=a.startX,u=a.endX,d=this.props,f=d.x,m=d.width,p=d.travellerWidth,g=d.startIndex,x=d.endIndex,j=d.onChange,b=r.pageX-o;b>0?b=Math.min(b,f+m-p-u,f+m-p-l):b<0&&(b=Math.max(b,f-l,f-u));var w=this.getIndex({startX:l+b,endX:u+b});(w.startIndex!==g||w.endIndex!==x)&&j&&j(w),this.setState({startX:l+b,endX:u+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var o=YI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,o=a.brushMoveStartX,l=a.movingTravellerId,u=a.endX,d=a.startX,f=this.state[l],m=this.props,p=m.x,g=m.width,x=m.travellerWidth,j=m.onChange,b=m.gap,w=m.data,N={startX:this.state.startX,endX:this.state.endX},O=r.pageX-o;O>0?O=Math.min(O,p+g-x-f):O<0&&(O=Math.max(O,p-f)),N[l]=f+O;var C=this.getIndex(N),A=C.startIndex,E=C.endIndex,k=function(){var M=w.length-1;return l==="startX"&&(u>d?A%b===0:E%b===0)||ud?E%b===0:A%b===0)||u>d&&E===M};this.setState(Yr(Yr({},l,f+O),"brushMoveStartX",r.pageX),function(){j&&k()&&j(C)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var o=this,l=this.state,u=l.scaleValues,d=l.startX,f=l.endX,m=this.state[a],p=u.indexOf(m);if(p!==-1){var g=p+r;if(!(g===-1||g>=u.length)){var x=u[g];a==="startX"&&x>=f||a==="endX"&&x<=d||this.setState(Yr({},a,x),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,o=r.y,l=r.width,u=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:o,width:l,height:u})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,o=r.y,l=r.width,u=r.height,d=r.data,f=r.children,m=r.padding,p=y.Children.only(f);return p?W.cloneElement(p,{x:a,y:o,width:l,height:u,margin:m,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var o,l,u=this,d=this.props,f=d.y,m=d.travellerWidth,p=d.height,g=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,w=d.endIndex,N=Math.max(r,this.props.x),O=NS(NS({},Be(this.props,!1)),{},{x:N,y:f,width:m,height:p}),C=x||"Min value: ".concat((o=j[b])===null||o===void 0?void 0:o.name,", Max value: ").concat((l=j[w])===null||l===void 0?void 0:l.name);return W.createElement(pt,{tabIndex:0,role:"slider","aria-label":C,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),u.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,O))}},{key:"renderSlide",value:function(r,a){var o=this.props,l=o.y,u=o.height,d=o.stroke,f=o.travellerWidth,m=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:m,y:l,width:p,height:u})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,o=r.endIndex,l=r.y,u=r.height,d=r.travellerWidth,f=r.stroke,m=this.state,p=m.startX,g=m.endX,x=5,j={pointerEvents:"none",fill:f};return W.createElement(pt,{className:"recharts-brush-texts"},W.createElement(ul,og({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:l+u/2},j),this.getTextOfTick(a)),W.createElement(ul,og({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,y:l+u/2},j),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,a=r.data,o=r.className,l=r.children,u=r.x,d=r.y,f=r.width,m=r.height,p=r.alwaysShowText,g=this.state,x=g.startX,j=g.endX,b=g.isTextActive,w=g.isSlideMoving,N=g.isTravellerMoving,O=g.isTravellerFocused;if(!a||!a.length||!Oe(u)||!Oe(d)||!Oe(f)||!Oe(m)||f<=0||m<=0)return null;var C=Ye("recharts-brush",o),A=W.Children.count(l)===1,E=qde("userSelect","none");return W.createElement(pt,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(b||w||N||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,o=r.y,l=r.width,u=r.height,d=r.stroke,f=Math.floor(o+u/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:o,width:l,height:u,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+l-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+l-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):We(r)?o=r(a):o=t.renderDefaultTraveller(a),o}},{key:"getDerivedStateFromProps",value:function(r,a){var o=r.data,l=r.width,u=r.x,d=r.travellerWidth,f=r.updateId,m=r.startIndex,p=r.endIndex;if(o!==a.prevData||f!==a.prevUpdateId)return NS({prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l},o&&o.length?Kde({data:o,width:l,x:u,travellerWidth:d,startIndex:m,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+l-d]);var g=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:u,prevWidth:l,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var o=r.length,l=0,u=o-1;u-l>1;){var d=Math.floor((l+u)/2);r[d]>a?u=d:l=d}return a>=r[u]?u:l}}])})(y.PureComponent);Yr(vu,"displayName","Brush");Yr(vu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var OS,KI;function Xde(){if(KI)return OS;KI=1;var e=iC();function t(n,r){var a;return e(n,function(o,l,u){return a=r(o,l,u),!a}),!!a}return OS=t,OS}var CS,XI;function Zde(){if(XI)return CS;XI=1;var e=KB(),t=bi(),n=Xde(),r=Lr(),a=ry();function o(l,u,d){var f=r(l)?e:n;return d&&a(l,u,d)&&(u=void 0),f(l,t(u,3))}return CS=o,CS}var Qde=Zde();const Jde=St(Qde);var fi=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},ES,ZI;function efe(){if(ZI)return ES;ZI=1;var e=hz();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return ES=t,ES}var AS,QI;function tfe(){if(QI)return AS;QI=1;var e=efe(),t=dz(),n=bi();function r(a,o){var l={};return o=n(o,3),t(a,function(u,d,f){e(l,d,o(u,d,f))}),l}return AS=r,AS}var nfe=tfe();const rfe=St(nfe);var TS,JI;function afe(){if(JI)return TS;JI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mfe(e,t){var n=e.x,r=e.y,a=ffe(e,lfe),o="".concat(n),l=parseInt(o,10),u="".concat(r),d=parseInt(u,10),f="".concat(t.height||a.height),m=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return rf(rf(rf(rf(rf({},t),a),l?{x:l}:{}),d?{y:d}:{}),{},{height:m,width:g,name:t.name,radius:t.radius})}function r3(e){return W.createElement(G6,bN({shapeType:"rectangle",propTransformer:mfe,activeClassName:"recharts-active-bar"},e))}var pfe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var o=Oe(r)||LQ(r);return o?t(r,a):(o||ur(!1),n)}},vfe=["value","background"],tq;function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}function gfe(e,t){if(e==null)return{};var n=yfe(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(H)0&&(V=Math.min((ne||0)-(H[oe-1]||0),V))}),Number.isFinite(V)){var G=V/U,L=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(T=G*L/2),b.padding==="no-gap"){var R=wr(t.barCategoryGap,G*L),F=G*L/2;T=F-R-(F-R)/L*R}}}a==="xAxis"?M=[r.left+(C.left||0)+(T||0),r.left+r.width-(C.right||0)-(T||0)]:a==="yAxis"?M=d==="horizontal"?[r.top+r.height-(C.bottom||0),r.top+(C.top||0)]:[r.top+(C.top||0)+(T||0),r.top+r.height-(C.bottom||0)-(T||0)]:M=b.range,E&&(M=[M[1],M[0]]);var K=N6(b,o,g),te=K.scale,I=K.realScaleType;te.domain(N).range(M),O6(te);var B=C6(te,Ia(Ia({},b),{},{realScaleType:I}));a==="xAxis"?(D=w==="top"&&!A||w==="bottom"&&A,$=r.left,z=p[k]-D*b.height):a==="yAxis"&&(D=w==="left"&&!A||w==="right"&&A,$=p[k]-D*b.width,z=r.top);var Y=Ia(Ia(Ia({},b),B),{},{realScaleType:I,x:$,y:z,scale:te,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return Y.bandSize=Vv(Y,B),!b.hide&&a==="xAxis"?p[k]+=(D?-1:1)*Y.height:b.hide||(p[k]+=(D?-1:1)*Y.width),Ia(Ia({},x),{},Sy({},j,Y))},{})},oq=function(t,n){var r=t.x,a=t.y,o=n.x,l=n.y;return{x:Math.min(r,o),y:Math.min(a,l),width:Math.abs(o-r),height:Math.abs(l-a)}},Afe=function(t){var n=t.x1,r=t.y1,a=t.x2,o=t.y2;return oq({x:n,y:r},{x:a,y:o})},sq=(function(){function e(t){Ofe(this,e),this.scale=t}return Cfe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(n)+u}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],o=r[r.length-1];return a<=o?n>=a&&n<=o:n>=o&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Sy(sq,"EPS",1e-4);var RC=function(t){var n=Object.keys(t).reduce(function(r,a){return Ia(Ia({},r),{},Sy({},a,sq.create(t[a])))},{});return Ia(Ia({},n),{},{apply:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.bandAware,u=o.position;return rfe(a,function(d,f){return n[f].apply(d,{bandAware:l,position:u})})},isInRange:function(a){return eq(a,function(o,l){return n[l].isInRange(o)})}})};function Tfe(e){return(e%180+180)%180}var kfe=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Tfe(a),l=o*Math.PI/180,u=Math.atan(r/n),d=l>u&&l-1?d[f?o[m]:m]:void 0}}return PS=r,PS}var RS,c3;function Pfe(){if(c3)return RS;c3=1;var e=X6();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return RS=t,RS}var DS,u3;function Rfe(){if(u3)return DS;u3=1;var e=oz(),t=bi(),n=Pfe(),r=Math.max;function a(o,l,u){var d=o==null?0:o.length;if(!d)return-1;var f=u==null?0:n(u);return f<0&&(f=r(d+f,0)),e(o,t(l,3),f)}return DS=a,DS}var $S,d3;function Dfe(){if(d3)return $S;d3=1;var e=Mfe(),t=Rfe(),n=e(t);return $S=n,$S}var $fe=Dfe();const Ife=St($fe);var Lfe=jB();const Bfe=St(Lfe);var zfe=Bfe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),DC=y.createContext(void 0),$C=y.createContext(void 0),lq=y.createContext(void 0),cq=y.createContext({}),uq=y.createContext(void 0),dq=y.createContext(0),fq=y.createContext(0),f3=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,o=n.offset,l=t.clipPathId,u=t.children,d=t.width,f=t.height,m=zfe(o);return W.createElement(DC.Provider,{value:r},W.createElement($C.Provider,{value:a},W.createElement(cq.Provider,{value:o},W.createElement(lq.Provider,{value:m},W.createElement(uq.Provider,{value:l},W.createElement(dq.Provider,{value:f},W.createElement(fq.Provider,{value:d},u)))))))},qfe=function(){return y.useContext(uq)},hq=function(t){var n=y.useContext(DC);n==null&&ur(!1);var r=n[t];return r==null&&ur(!1),r},Ffe=function(){var t=y.useContext(DC);return Fo(t)},Ufe=function(){var t=y.useContext($C),n=Ife(t,function(r){return eq(r.domain,Number.isFinite)});return n||Fo(t)},mq=function(t){var n=y.useContext($C);n==null&&ur(!1);var r=n[t];return r==null&&ur(!1),r},Hfe=function(){var t=y.useContext(lq);return t},Wfe=function(){return y.useContext(cq)},IC=function(){return y.useContext(fq)},LC=function(){return y.useContext(dq)};function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function Vfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gfe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-a)<=0}function Ehe(e,t){return wq(e,t+1)}function Ahe(e,t,n,r,a){for(var o=(r||[]).slice(),l=t.start,u=t.end,d=0,f=1,m=l,p=function(){var j=r?.[d];if(j===void 0)return{v:wq(r,f)};var b=d,w,N=function(){return w===void 0&&(w=n(j,b)),w},O=j.coordinate,C=d===0||hg(e,O,N,m,u);C||(d=0,m=l,f+=1),C&&(m=O+e*(N()/2+a),d+=f)},g;f<=o.length;)if(g=p(),g)return g.v;return[]}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function b3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function or(e){for(var t=1;t0?x.coordinate-w*e:x.coordinate})}else o[g]=x=or(or({},x),{},{tickCoord:x.coordinate});var N=hg(e,x.tickCoord,b,u,d);N&&(d=x.tickCoord-e*(b()/2+a),o[g]=or(or({},x),{},{isShow:!0}))},m=l-1;m>=0;m--)f(m);return o}function Rhe(e,t,n,r,a,o){var l=(r||[]).slice(),u=l.length,d=t.start,f=t.end;if(o){var m=r[u-1],p=n(m,u-1),g=e*(m.coordinate+e*p/2-f);l[u-1]=m=or(or({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate});var x=hg(e,m.tickCoord,function(){return p},d,f);x&&(f=m.tickCoord-e*(p/2+a),l[u-1]=or(or({},m),{},{isShow:!0}))}for(var j=o?u-1:u,b=function(O){var C=l[O],A,E=function(){return A===void 0&&(A=n(C,O)),A};if(O===0){var k=e*(C.coordinate-e*E()/2-d);l[O]=C=or(or({},C),{},{tickCoord:k<0?C.coordinate-k*e:C.coordinate})}else l[O]=C=or(or({},C),{},{tickCoord:C.coordinate});var T=hg(e,C.tickCoord,E,d,f);T&&(d=C.tickCoord+e*(E()/2+a),l[O]=or(or({},C),{},{isShow:!0}))},w=0;w=2?br(a[1].coordinate-a[0].coordinate):1,N=Che(o,w,x);return d==="equidistantPreserveStart"?Ahe(w,N,b,a,l):(d==="preserveStart"||d==="preserveStartEnd"?g=Rhe(w,N,b,a,l,d==="preserveStartEnd"):g=Phe(w,N,b,a,l),g.filter(function(O){return O.isShow}))}var Dhe=["viewBox"],$he=["viewBox"],Ihe=["ticks"];function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function Bc(){return Bc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lhe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j3(e,t){for(var n=0;n0?d(this.props):d(x)),l<=0||u<=0||!j||!j.length?null:W.createElement(pt,{className:Ye("recharts-cartesian-axis",f),ref:function(w){r.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),qn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,o){var l,u=Ye(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?l=W.cloneElement(r,An(An({},a),{},{className:u})):We(r)?l=r(An(An({},a),{},{className:u})):l=W.createElement(ul,Bc({},a,{className:"recharts-cartesian-axis-tick-value"}),o),l}}])})(y.Component);FC(Wu,"displayName","CartesianAxis");FC(Wu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Vhe=["x1","y1","x2","y2","key"],Ghe=["offset"];function fl(e){"@babel/helpers - typeof";return fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fl(e)}function S3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zhe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Qhe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,o=t.y,l=t.width,u=t.height,d=t.ry;return W.createElement("rect",{x:a,y:o,ry:d,width:l,height:u,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function _q(e,t){var n;if(W.isValidElement(e))n=W.cloneElement(e,t);else if(We(e))n=e(t);else{var r=t.x1,a=t.y1,o=t.x2,l=t.y2,u=t.key,d=_3(t,Vhe),f=Be(d,!1);f.offset;var m=_3(f,Ghe);n=W.createElement("line",Gs({},m,{x1:r,y1:a,x2:o,y2:l,fill:"none",key:u}))}return n}function Jhe(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,o=e.horizontalPoints;if(!a||!o||!o.length)return null;var l=o.map(function(u,d){var f=lr(lr({},e),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return _q(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function eme(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,o=e.verticalPoints;if(!a||!o||!o.length)return null;var l=o.map(function(u,d){var f=lr(lr({},e),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return _q(a,f)});return W.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function tme(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,o=e.width,l=e.height,u=e.horizontalPoints,d=e.horizontal,f=d===void 0?!0:d;if(!f||!t||!t.length)return null;var m=u.map(function(g){return Math.round(g+a-a)}).sort(function(g,x){return g-x});a!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?a+l-g:m[x+1]-g;if(b<=0)return null;var w=x%t.length;return W.createElement("rect",{key:"react-".concat(x),y:g,x:r,height:b,width:o,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function nme(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,o=e.x,l=e.y,u=e.width,d=e.height,f=e.verticalPoints;if(!n||!r||!r.length)return null;var m=f.map(function(g){return Math.round(g+o-o)}).sort(function(g,x){return g-x});o!==m[0]&&m.unshift(0);var p=m.map(function(g,x){var j=!m[x+1],b=j?o+u-g:m[x+1]-g;if(b<=0)return null;var w=x%r.length;return W.createElement("rect",{key:"react-".concat(x),x:g,y:l,width:b,height:d,stroke:"none",fill:r[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return W.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var rme=function(t,n){var r=t.xAxis,a=t.width,o=t.height,l=t.offset;return _6(qC(lr(lr(lr({},Wu.defaultProps),r),{},{ticks:Yi(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),l.left,l.left+l.width,n)},ame=function(t,n){var r=t.yAxis,a=t.width,o=t.height,l=t.offset;return _6(qC(lr(lr(lr({},Wu.defaultProps),r),{},{ticks:Yi(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),l.top,l.top+l.height,n)},jc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function df(e){var t,n,r,a,o,l,u=IC(),d=LC(),f=Wfe(),m=lr(lr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:jc.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:jc.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:jc.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:jc.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:jc.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:jc.verticalFill,x:Oe(e.x)?e.x:f.left,y:Oe(e.y)?e.y:f.top,width:Oe(e.width)?e.width:f.width,height:Oe(e.height)?e.height:f.height}),p=m.x,g=m.y,x=m.width,j=m.height,b=m.syncWithTicks,w=m.horizontalValues,N=m.verticalValues,O=Ffe(),C=Ufe();if(!Oe(x)||x<=0||!Oe(j)||j<=0||!Oe(p)||p!==+p||!Oe(g)||g!==+g)return null;var A=m.verticalCoordinatesGenerator||rme,E=m.horizontalCoordinatesGenerator||ame,k=m.horizontalPoints,T=m.verticalPoints;if((!k||!k.length)&&We(E)){var M=w&&w.length,$=E({yAxis:C?lr(lr({},C),{},{ticks:M?w:C.ticks}):void 0,width:u,height:d,offset:f},M?!0:b);qa(Array.isArray($),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(fl($),"]")),Array.isArray($)&&(k=$)}if((!T||!T.length)&&We(A)){var z=N&&N.length,D=A({xAxis:O?lr(lr({},O),{},{ticks:z?N:O.ticks}):void 0,width:u,height:d,offset:f},z?!0:b);qa(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(fl(D),"]")),Array.isArray(D)&&(T=D)}return W.createElement("g",{className:"recharts-cartesian-grid"},W.createElement(Qhe,{fill:m.fill,fillOpacity:m.fillOpacity,x:m.x,y:m.y,width:m.width,height:m.height,ry:m.ry}),W.createElement(Jhe,Gs({},m,{offset:f,horizontalPoints:k,xAxis:O,yAxis:C})),W.createElement(eme,Gs({},m,{offset:f,verticalPoints:T,xAxis:O,yAxis:C})),W.createElement(tme,Gs({},m,{horizontalPoints:k})),W.createElement(nme,Gs({},m,{verticalPoints:T})))}df.displayName="CartesianGrid";var ime=["type","layout","connectNulls","ref"],ome=["key"];function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function N3(e,t){if(e==null)return{};var n=sme(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sme(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);np){x=[].concat(Sc(d.slice(0,j)),[p-b]);break}var w=x.length%2===0?[0,g]:[g];return[].concat(Sc(t.repeat(d,m)),Sc(x),w).map(function(N){return"".concat(N,"px")}).join(", ")}),La(n,"id",zu("recharts-line-")),La(n,"pathRef",function(l){n.mainCurve=l}),La(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),La(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return gme(t,e),hme(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.points,u=o.xAxis,d=o.yAxis,f=o.layout,m=o.children,p=na(m,Dh);if(!p)return null;var g=function(b,w){return{x:b.x,y:b.y,value:b.value,errorVal:kn(b.payload,w)}},x={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(pt,x,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:l,xAxis:u,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,o){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,f=u.points,m=u.dataKey,p=Be(this.props,!1),g=Be(d,!0),x=f.map(function(b,w){var N=Gr(Gr(Gr({key:"dot-".concat(w),r:3},p),g),{},{index:w,cx:b.x,cy:b.y,value:b.value,dataKey:m,payload:b.payload,points:f});return t.renderDotItem(d,N)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(o,")"):null};return W.createElement(pt,Nf({className:"recharts-line-dots",key:"dots"},j),x)}},{key:"renderCurveStatically",value:function(r,a,o,l){var u=this.props,d=u.type,f=u.layout,m=u.connectNulls;u.ref;var p=N3(u,ime),g=Gr(Gr(Gr({},Be(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(o,")"):null,points:r},l),{},{type:d,layout:f,connectNulls:m});return W.createElement(Kv,Nf({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var o=this,l=this.props,u=l.points,d=l.strokeDasharray,f=l.isAnimationActive,m=l.animationBegin,p=l.animationDuration,g=l.animationEasing,x=l.animationId,j=l.animateNewValues,b=l.width,w=l.height,N=this.state,O=N.prevPoints,C=N.totalLength;return W.createElement(vi,{begin:m,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var E=A.t;if(O){var k=O.length/u.length,T=u.map(function(U,V){var H=Math.floor(V*k);if(O[H]){var G=O[H],L=Qr(G.x,U.x),R=Qr(G.y,U.y);return Gr(Gr({},U),{},{x:L(E),y:R(E)})}if(j){var F=Qr(b*2,U.x),K=Qr(w/2,U.y);return Gr(Gr({},U),{},{x:F(E),y:K(E)})}return Gr(Gr({},U),{},{x:U.x,y:U.y})});return o.renderCurveStatically(T,r,a)}var M=Qr(0,C),$=M(E),z;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function(U){return parseFloat(U)});z=o.getStrokeDasharray($,C,D)}else z=o.generateSimpleStrokeDasharray(C,$);return o.renderCurveStatically(u,r,a,{strokeDasharray:z})})}},{key:"renderCurve",value:function(r,a){var o=this.props,l=o.points,u=o.isAnimationActive,d=this.state,f=d.prevPoints,m=d.totalLength;return u&&l&&l.length&&(!f&&m>0||!Rh(f,l))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(l,r,a)}},{key:"render",value:function(){var r,a=this.props,o=a.hide,l=a.dot,u=a.points,d=a.className,f=a.xAxis,m=a.yAxis,p=a.top,g=a.left,x=a.width,j=a.height,b=a.isAnimationActive,w=a.id;if(o||!u||!u.length)return null;var N=this.state.isAnimationFinished,O=u.length===1,C=Ye("recharts-line",d),A=f&&f.allowDataOverflow,E=m&&m.allowDataOverflow,k=A||E,T=Ge(w)?this.id:w,M=(r=Be(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=M.r,z=$===void 0?3:$,D=M.strokeWidth,U=D===void 0?2:D,V=XQ(l)?l:{},H=V.clipDot,G=H===void 0?!0:H,L=z*2+U;return W.createElement(pt,{className:C},A||E?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(T)},W.createElement("rect",{x:A?g:g-x/2,y:E?p:p-j/2,width:A?x:x*2,height:E?j:j*2})),!G&&W.createElement("clipPath",{id:"clipPath-dots-".concat(T)},W.createElement("rect",{x:g-L/2,y:p-L/2,width:x+L,height:j+L}))):null,!O&&this.renderCurve(k,T),this.renderErrorBar(k,T),(O||l)&&this.renderDots(k,G,T),(!b||N)&&eo.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var o=r.length%2!==0?[].concat(Sc(r),[0]):r,l=[],u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function spe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cpe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&Oe(a)&&Oe(o)?t.slice(a,o+1):[]};function Bq(e){return e==="number"?[0,"auto"]:void 0}var BN=function(t,n,r,a){var o=t.graphicalItems,l=t.tooltipAxis,u=Ey(n,t);return r<0||!o||!o.length||r>=u.length?null:o.reduce(function(d,f){var m,p=(m=f.props.data)!==null&&m!==void 0?m:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var x=p===void 0?u:p;g=wv(x,l.dataKey,a)}else g=p&&p[r]||u[r];return g?[].concat(Ou(d),[A6(f,g)]):d},[])},R3=function(t,n,r,a){var o=a||{x:t.chartX,y:t.chartY},l=wpe(o,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,m=Goe(l,u,f,d);if(m>=0&&f){var p=f[m]&&f[m].value,g=BN(t,n,m,p),x=jpe(r,u,m,o);return{activeTooltipIndex:m,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},Spe=function(t,n){var r=n.axes,a=n.graphicalItems,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=t.stackOffset,x=S6(m,o);return r.reduce(function(j,b){var w,N=b.type.defaultProps!==void 0?ye(ye({},b.type.defaultProps),b.props):b.props,O=N.type,C=N.dataKey,A=N.allowDataOverflow,E=N.allowDuplicatedCategory,k=N.scale,T=N.ticks,M=N.includeHidden,$=N[l];if(j[$])return j;var z=Ey(t.data,{graphicalItems:a.filter(function(B){var Y,ne=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l];return ne===$}),dataStartIndex:d,dataEndIndex:f}),D=z.length,U,V,H;Kme(N.domain,A,O)&&(U=J_(N.domain,null,A),x&&(O==="number"||k!=="auto")&&(H=wf(z,C,"category")));var G=Bq(O);if(!U||U.length===0){var L,R=(L=N.domain)!==null&&L!==void 0?L:G;if(C){if(U=wf(z,C,O),O==="category"&&x){var F=zQ(U);E&&F?(V=U,U=ig(0,D)):E||(U=P$(R,U,b).reduce(function(B,Y){return B.indexOf(Y)>=0?B:[].concat(Ou(B),[Y])},[]))}else if(O==="category")E?U=U.filter(function(B){return B!==""&&!Ge(B)}):U=P$(R,U,b).reduce(function(B,Y){return B.indexOf(Y)>=0||Y===""||Ge(Y)?B:[].concat(Ou(B),[Y])},[]);else if(O==="number"){var K=Qoe(z,a.filter(function(B){var Y,ne,oe=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l],xe="hide"in B.props?B.props.hide:(ne=B.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return oe===$&&(M||!xe)}),C,o,m);K&&(U=K)}x&&(O==="number"||k!=="auto")&&(H=wf(z,C,"category"))}else x?U=ig(0,D):u&&u[$]&&u[$].hasStack&&O==="number"?U=g==="expand"?[0,1]:E6(u[$].stackGroups,d,f):U=j6(z,a.filter(function(B){var Y=l in B.props?B.props[l]:B.type.defaultProps[l],ne="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Y===$&&(M||!ne)}),O,m,!0);if(O==="number")U=$N(p,U,$,o,T),R&&(U=J_(R,U,A));else if(O==="category"&&R){var te=R,I=U.every(function(B){return te.indexOf(B)>=0});I&&(U=te)}}return ye(ye({},j),{},Fe({},$,ye(ye({},N),{},{axisType:o,domain:U,categoricalDomain:H,duplicateDomain:V,originalDomain:(w=N.domain)!==null&&w!==void 0?w:G,isCategorical:x,layout:m})))},{})},_pe=function(t,n){var r=n.graphicalItems,a=n.Axis,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.layout,p=t.children,g=Ey(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=S6(m,o),b=-1;return r.reduce(function(w,N){var O=N.type.defaultProps!==void 0?ye(ye({},N.type.defaultProps),N.props):N.props,C=O[l],A=Bq("number");if(!w[C]){b++;var E;return j?E=ig(0,x):u&&u[C]&&u[C].hasStack?(E=E6(u[C].stackGroups,d,f),E=$N(p,E,C,o)):(E=J_(A,j6(g,r.filter(function(k){var T,M,$=l in k.props?k.props[l]:(T=k.type.defaultProps)===null||T===void 0?void 0:T[l],z="hide"in k.props?k.props.hide:(M=k.type.defaultProps)===null||M===void 0?void 0:M.hide;return $===C&&!z}),"number",m),a.defaultProps.allowDataOverflow),E=$N(p,E,C,o)),ye(ye({},w),{},Fe({},C,ye(ye({axisType:o},a.defaultProps),{},{hide:!0,orientation:ta(xpe,"".concat(o,".").concat(b%2),null),domain:E,originalDomain:A,isCategorical:j,layout:m})))}return w},{})},Npe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,o=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,m=t.children,p="".concat(a,"Id"),g=na(m,o),x={};return g&&g.length?x=Spe(t,{axes:g,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f}):l&&l.length&&(x=_pe(t,{Axis:o,graphicalItems:l,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:f})),x},Ope=function(t){var n=Fo(t),r=Yi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:oC(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Vv(n,r)}},D3=function(t){var n=t.children,r=t.defaultShowTooltip,a=Kr(n,vu),o=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(o=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},Cpe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Qi(n&&n.type);return r&&r.indexOf("Bar")>=0})},$3=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Epe=function(t,n){var r=t.props,a=t.graphicalItems,o=t.xAxisMap,l=o===void 0?{}:o,u=t.yAxisMap,d=u===void 0?{}:u,f=r.width,m=r.height,p=r.children,g=r.margin||{},x=Kr(p,vu),j=Kr(p,Js),b=Object.keys(d).reduce(function(E,k){var T=d[k],M=T.orientation;return!T.mirror&&!T.hide?ye(ye({},E),{},Fe({},M,E[M]+T.width)):E},{left:g.left||0,right:g.right||0}),w=Object.keys(l).reduce(function(E,k){var T=l[k],M=T.orientation;return!T.mirror&&!T.hide?ye(ye({},E),{},Fe({},M,ta(E,"".concat(M))+T.height)):E},{top:g.top||0,bottom:g.bottom||0}),N=ye(ye({},w),b),O=N.bottom;x&&(N.bottom+=x.props.height||vu.defaultProps.height),j&&n&&(N=Xoe(N,a,r,n));var C=f-N.left-N.right,A=m-N.top-N.bottom;return ye(ye({brushBottom:O},N),{},{width:Math.max(C,0),height:Math.max(A,0)})},Ape=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},UC=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,o=a===void 0?"axis":a,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,f=t.legendContent,m=t.formatAxisMap,p=t.defaultProps,g=function(N,O){var C=O.graphicalItems,A=O.stackGroups,E=O.offset,k=O.updateId,T=O.dataStartIndex,M=O.dataEndIndex,$=N.barSize,z=N.layout,D=N.barGap,U=N.barCategoryGap,V=N.maxBarSize,H=$3(z),G=H.numericAxisName,L=H.cateAxisName,R=Cpe(C),F=[];return C.forEach(function(K,te){var I=Ey(N.data,{graphicalItems:[K],dataStartIndex:T,dataEndIndex:M}),B=K.type.defaultProps!==void 0?ye(ye({},K.type.defaultProps),K.props):K.props,Y=B.dataKey,ne=B.maxBarSize,oe=B["".concat(G,"Id")],xe=B["".concat(L,"Id")],ee={},ae=d.reduce(function(rr,gr){var lt=O["".concat(gr.axisType,"Map")],rt=B["".concat(gr.axisType,"Id")];lt&<[rt]||gr.axisType==="zAxis"||ur(!1);var $n=lt[rt];return ye(ye({},rr),{},Fe(Fe({},gr.axisType,$n),"".concat(gr.axisType,"Ticks"),Yi($n)))},ee),Z=ae[L],pe=ae["".concat(L,"Ticks")],je=A&&A[oe]&&A[oe].hasStack&&sse(K,A[oe].stackGroups),le=Qi(K.type).indexOf("Bar")>=0,Re=Vv(Z,pe),_e=[],me=R&&Yoe({barSize:$,stackGroups:A,totalSize:Ape(ae,L)});if(le){var ve,Le,Dt=Ge(ne)?V:ne,On=(ve=(Le=Vv(Z,pe,!0))!==null&&Le!==void 0?Le:Dt)!==null&&ve!==void 0?ve:0;_e=Koe({barGap:D,barCategoryGap:U,bandSize:On!==Re?On:Re,sizeList:me[xe],maxBarSize:Dt}),On!==Re&&(_e=_e.map(function(rr){return ye(ye({},rr),{},{position:ye(ye({},rr.position),{},{offset:rr.position.offset-On/2})})}))}var vr=K&&K.type&&K.type.getComposedData;vr&&F.push({props:ye(ye({},vr(ye(ye({},ae),{},{displayedData:I,props:N,dataKey:Y,item:K,bandSize:Re,barPosition:_e,offset:E,stackedData:je,layout:z,dataStartIndex:T,dataEndIndex:M}))),{},Fe(Fe(Fe({key:K.key||"item-".concat(te)},G,ae[G]),L,ae[L]),"animationId",k)),childIndex:JQ(K,N.children),item:K})}),F},x=function(N,O){var C=N.props,A=N.dataStartIndex,E=N.dataEndIndex,k=N.updateId;if(!GP({props:C}))return null;var T=C.children,M=C.layout,$=C.stackOffset,z=C.data,D=C.reverseStackOrder,U=$3(M),V=U.numericAxisName,H=U.cateAxisName,G=na(T,r),L=ise(z,G,"".concat(V,"Id"),"".concat(H,"Id"),$,D),R=d.reduce(function(B,Y){var ne="".concat(Y.axisType,"Map");return ye(ye({},B),{},Fe({},ne,Npe(C,ye(ye({},Y),{},{graphicalItems:G,stackGroups:Y.axisType===V&&L,dataStartIndex:A,dataEndIndex:E}))))},{}),F=Epe(ye(ye({},R),{},{props:C,graphicalItems:G}),O?.legendBBox);Object.keys(R).forEach(function(B){R[B]=m(C,R[B],F,B.replace("Map",""),n)});var K=R["".concat(H,"Map")],te=Ope(K),I=g(C,ye(ye({},R),{},{dataStartIndex:A,dataEndIndex:E,updateId:k,graphicalItems:G,stackGroups:L,offset:F}));return ye(ye({formattedGraphicalItems:I,graphicalItems:G,offset:F,stackGroups:L},te),R)},j=(function(w){function N(O){var C,A,E;return lpe(this,N),E=dpe(this,N,[O]),Fe(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(E,"accessibilityManager",new Yme),Fe(E,"handleLegendBBoxUpdate",function(k){if(k){var T=E.state,M=T.dataStartIndex,$=T.dataEndIndex,z=T.updateId;E.setState(ye({legendBBox:k},x({props:E.props,dataStartIndex:M,dataEndIndex:$,updateId:z},ye(ye({},E.state),{},{legendBBox:k}))))}}),Fe(E,"handleReceiveSyncEvent",function(k,T,M){if(E.props.syncId===k){if(M===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(T)}}),Fe(E,"handleBrushChange",function(k){var T=k.startIndex,M=k.endIndex;if(T!==E.state.dataStartIndex||M!==E.state.dataEndIndex){var $=E.state.updateId;E.setState(function(){return ye({dataStartIndex:T,dataEndIndex:M},x({props:E.props,dataStartIndex:T,dataEndIndex:M,updateId:$},E.state))}),E.triggerSyncEvent({dataStartIndex:T,dataEndIndex:M})}}),Fe(E,"handleMouseEnter",function(k){var T=E.getMouseInfo(k);if(T){var M=ye(ye({},T),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var $=E.props.onMouseEnter;We($)&&$(M,k)}}),Fe(E,"triggeredAfterMouseMove",function(k){var T=E.getMouseInfo(k),M=T?ye(ye({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(M),E.triggerSyncEvent(M);var $=E.props.onMouseMove;We($)&&$(M,k)}),Fe(E,"handleItemMouseEnter",function(k){E.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),Fe(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Fe(E,"handleMouseMove",function(k){k.persist(),E.throttleTriggeredAfterMouseMove(k)}),Fe(E,"handleMouseLeave",function(k){E.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};E.setState(T),E.triggerSyncEvent(T);var M=E.props.onMouseLeave;We(M)&&M(T,k)}),Fe(E,"handleOuterEvent",function(k){var T=QQ(k),M=ta(E.props,"".concat(T));if(T&&We(M)){var $,z;/.*touch.*/i.test(T)?z=E.getMouseInfo(k.changedTouches[0]):z=E.getMouseInfo(k),M(($=z)!==null&&$!==void 0?$:{},k)}}),Fe(E,"handleClick",function(k){var T=E.getMouseInfo(k);if(T){var M=ye(ye({},T),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var $=E.props.onClick;We($)&&$(M,k)}}),Fe(E,"handleMouseDown",function(k){var T=E.props.onMouseDown;if(We(T)){var M=E.getMouseInfo(k);T(M,k)}}),Fe(E,"handleMouseUp",function(k){var T=E.props.onMouseUp;if(We(T)){var M=E.getMouseInfo(k);T(M,k)}}),Fe(E,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),Fe(E,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.handleMouseDown(k.changedTouches[0])}),Fe(E,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&E.handleMouseUp(k.changedTouches[0])}),Fe(E,"handleDoubleClick",function(k){var T=E.props.onDoubleClick;if(We(T)){var M=E.getMouseInfo(k);T(M,k)}}),Fe(E,"handleContextMenu",function(k){var T=E.props.onContextMenu;if(We(T)){var M=E.getMouseInfo(k);T(M,k)}}),Fe(E,"triggerSyncEvent",function(k){E.props.syncId!==void 0&&BS.emit(zS,E.props.syncId,k,E.eventEmitterSymbol)}),Fe(E,"applySyncEvent",function(k){var T=E.props,M=T.layout,$=T.syncMethod,z=E.state.updateId,D=k.dataStartIndex,U=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)E.setState(ye({dataStartIndex:D,dataEndIndex:U},x({props:E.props,dataStartIndex:D,dataEndIndex:U,updateId:z},E.state)));else if(k.activeTooltipIndex!==void 0){var V=k.chartX,H=k.chartY,G=k.activeTooltipIndex,L=E.state,R=L.offset,F=L.tooltipTicks;if(!R)return;if(typeof $=="function")G=$(F,k);else if($==="value"){G=-1;for(var K=0;K=0){var je,le;if(V.dataKey&&!V.allowDuplicatedCategory){var Re=typeof V.dataKey=="function"?pe:"payload.".concat(V.dataKey.toString());je=wv(K,Re,G),le=te&&I&&wv(I,Re,G)}else je=K?.[H],le=te&&I&&I[H];if(xe||oe){var _e=k.props.activeIndex!==void 0?k.props.activeIndex:H;return[y.cloneElement(k,ye(ye(ye({},$.props),ae),{},{activeIndex:_e})),null,null]}if(!Ge(je))return[Z].concat(Ou(E.renderActivePoints({item:$,activePoint:je,basePoint:le,childIndex:H,isRange:te})))}else{var me,ve=(me=E.getItemByXY(E.state.activeCoordinate))!==null&&me!==void 0?me:{graphicalItem:Z},Le=ve.graphicalItem,Dt=Le.item,On=Dt===void 0?k:Dt,vr=Le.childIndex,rr=ye(ye(ye({},$.props),ae),{},{activeIndex:vr});return[y.cloneElement(On,rr),null,null]}return te?[Z,null,null]:[Z,null]}),Fe(E,"renderCustomized",function(k,T,M){return y.cloneElement(k,ye(ye({key:"recharts-customized-".concat(M)},E.props),E.state))}),Fe(E,"renderMap",{CartesianGrid:{handler:Bp,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Bp},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Bp},YAxis:{handler:Bp},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((C=O.id)!==null&&C!==void 0?C:zu("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=xz(E.triggeredAfterMouseMove,(A=O.throttleDelay)!==null&&A!==void 0?A:1e3/60),E.state={},E}return mpe(N,w),upe(N,[{key:"componentDidMount",value:function(){var C,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var C=this.props,A=C.children,E=C.data,k=C.height,T=C.layout,M=Kr(A,ti);if(M){var $=M.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,D=BN(this.state,E,$,z),U=this.state.tooltipTicks[$].coordinate,V=(this.state.offset.top+k)/2,H=T==="horizontal",G=H?{x:U,y:V}:{y:U,x:V},L=this.state.formattedGraphicalItems.find(function(F){var K=F.item;return K.type.name==="Scatter"});L&&(G=ye(ye({},G),L.props.points[$].tooltipPosition),D=L.props.points[$].tooltipPayload);var R={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:z,activePayload:D,activeCoordinate:G};this.setState(R),this.renderCursor(M),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(C,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==C.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==C.margin){var E,k;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(C){w_([Kr(C.children,ti)],[Kr(this.props.children,ti)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var C=Kr(this.props.children,ti);if(C&&typeof C.props.shared=="boolean"){var A=C.props.shared?"axis":"item";return u.indexOf(A)>=0?A:o}return o}},{key:"getMouseInfo",value:function(C){if(!this.container)return null;var A=this.container,E=A.getBoundingClientRect(),k=zne(E),T={chartX:Math.round(C.pageX-k.left),chartY:Math.round(C.pageY-k.top)},M=E.width/A.offsetWidth||1,$=this.inRange(T.chartX,T.chartY,M);if(!$)return null;var z=this.state,D=z.xAxisMap,U=z.yAxisMap,V=this.getTooltipEventType(),H=R3(this.state,this.props.data,this.props.layout,$);if(V!=="axis"&&D&&U){var G=Fo(D).scale,L=Fo(U).scale,R=G&&G.invert?G.invert(T.chartX):null,F=L&&L.invert?L.invert(T.chartY):null;return ye(ye({},T),{},{xValue:R,yValue:F},H)}return H?ye(ye({},T),H):null}},{key:"inRange",value:function(C,A){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,T=C/E,M=A/E;if(k==="horizontal"||k==="vertical"){var $=this.state.offset,z=T>=$.left&&T<=$.left+$.width&&M>=$.top&&M<=$.top+$.height;return z?{x:T,y:M}:null}var D=this.state,U=D.angleAxisMap,V=D.radiusAxisMap;if(U&&V){var H=Fo(U);return $$({x:T,y:M},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var C=this.props.children,A=this.getTooltipEventType(),E=Kr(C,ti),k={};E&&A==="axis"&&(E.props.trigger==="click"?k={onClick:this.handleClick}:k={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=jv(this.props,this.handleOuterEvent);return ye(ye({},T),k)}},{key:"addListener",value:function(){BS.on(zS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){BS.removeListener(zS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(C,A,E){for(var k=this.state.formattedGraphicalItems,T=0,M=k.length;T");return e}const Tc=y.forwardRef(({id:e,className:t,children:n,config:r,...a},o)=>{const l=y.useId(),u=`chart-${e||l.replace(/:/g,"")}`;return i.jsx(zq.Provider,{value:{config:r},children:i.jsxs("div",{"data-chart":u,ref:o,className:ue("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[i.jsx(Ppe,{id:u,config:r}),i.jsx(Pne,{children:n})]})})});Tc.displayName="Chart";const Ppe=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?i.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Mpe).map(([r,a])=>` ${a} [data-chart=${e}] { ${n.map(([o,l])=>{const u=l.theme?.[r]||l.color;return u?` --color-${o}: ${u};`:null}).join(` `)} } `).join(` `)}}):null},af=ti,kc=y.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:o=!1,label:l,labelFormatter:u,labelClassName:d,formatter:f,color:m,nameKey:p,labelKey:g},x)=>{const{config:j}=qq(),b=y.useMemo(()=>{if(a||!t?.length)return null;const[N]=t,O=`${g||N?.dataKey||N?.name||"value"}`,C=zN(j,N,O),A=!g&&typeof l=="string"?j[l]?.label||l:C?.label;return u?i.jsx("div",{className:ue("font-medium",d),children:u(A,t)}):A?i.jsx("div",{className:ue("font-medium",d),children:A}):null},[l,u,t,a,d,j,g]);if(!e||!t?.length)return null;const w=t.length===1&&r!=="dot";return i.jsxs("div",{ref:x,className:ue("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:[w?null:b,i.jsx("div",{className:"grid gap-1.5",children:t.filter(N=>N.type!=="none").map((N,O)=>{const C=`${p||N.name||N.dataKey||"value"}`,A=zN(j,N,C),E=m||N.payload.fill||N.color;return i.jsx("div",{className:ue("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:f&&N?.value!==void 0&&N.name?f(N.value,N.name,N,O,N.payload):i.jsxs(i.Fragment,{children:[A?.icon?i.jsx(A.icon,{}):!o&&i.jsx("div",{className:ue("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":w&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),i.jsxs("div",{className:ue("flex flex-1 justify-between leading-none",w?"items-end":"items-center"),children:[i.jsxs("div",{className:"grid gap-1.5",children:[w?b:null,i.jsx("span",{className:"text-muted-foreground",children:A?.label||N.name})]}),N.value&&i.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:N.value.toLocaleString()})]})]})},N.dataKey)})})]})});kc.displayName="ChartTooltip";const Rpe=Js,Fq=y.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:a},o)=>{const{config:l}=qq();return n?.length?i.jsx("div",{ref:o,className:ue("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.filter(u=>u.type!=="none").map(u=>{const d=`${a||u.dataKey||"value"}`,f=zN(l,u,d);return i.jsxs("div",{className:ue("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?i.jsx(f.icon,{}):i.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:u.color}}),f?.label]},u.value)})}):null});Fq.displayName="ChartLegend";function zN(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let a=n;return n in t&&typeof t[n]=="string"?a=t[n]:r&&n in r&&typeof r[n]=="string"&&(a=r[n]),a in e?e[a]:e[n]}const Dpe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$pe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),I3=e=>{const t=$pe(e);return t.charAt(0).toUpperCase()+t.slice(1)},Uq=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ipe=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Lpe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Bpe=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...Lpe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Uq("lucide",a),...!o&&!Ipe(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,m])=>y.createElement(f,m)),...Array.isArray(o)?o:[o]]));const Ce=(e,t)=>{const n=y.forwardRef(({className:r,...a},o)=>y.createElement(Bpe,{ref:o,iconNode:t,className:Uq(`lucide-${Dpe(I3(e))}`,`lucide-${e}`,r),...a}));return n.displayName=I3(e),n};const zpe=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],qpe=Ce("activity",zpe);const Fpe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Hq=Ce("arrow-left",Fpe);const Upe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Hpe=Ce("arrow-right",Upe);const Wpe=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Vpe=Ce("ban",Wpe);const Gpe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ype=Ce("book-open",Gpe);const Kpe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Xpe=Ce("bot",Kpe);const Zpe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Wq=Ce("boxes",Zpe);const Qpe=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],L3=Ce("calendar",Qpe);const Jpe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],eve=Ce("chart-column",Jpe);const tve=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],nl=Ce("check",tve);const nve=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ch=Ce("chevron-down",nve);const rve=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],HC=Ce("chevron-left",rve);const ave=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],WC=Ce("chevron-right",ave);const ive=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qN=Ce("chevron-up",ive);const ove=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],sve=Ce("chevrons-up-down",ove);const lve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],xg=Ce("circle-alert",lve);const cve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cu=Ce("circle-check",cve);const uve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],dve=Ce("circle-question-mark",uve);const fve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Vq=Ce("circle-user",fve);const hve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Gq=Ce("circle-x",hve);const mve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pve=Ce("circle",mve);const vve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],rl=Ce("clock",vve);const gve=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],FN=Ce("copy",gve);const yve=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],xve=Ce("database",yve);const bve=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],wve=Ce("dollar-sign",bve);const jve=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],UN=Ce("download",jve);const Sve=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],rv=Ce("external-link",Sve);const _ve=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],HN=Ce("eye-off",_ve);const Nve=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ao=Ce("eye",Nve);const Ove=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],bg=Ce("file-search",Ove);const Cve=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],VC=Ce("file-text",Cve);const Eve=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],WN=Ce("funnel",Eve);const Ave=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],wg=Ce("hash",Ave);const Tve=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],jg=Ce("house",Tve);const kve=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Mve=Ce("image",kve);const Pve=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yq=Ce("info",Pve);const Rve=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Dve=Ce("key",Rve);const $ve=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],VN=Ce("loader-circle",$ve);const Ive=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],B3=Ce("lock",Ive);const Lve=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],z3=Ce("log-out",Lve);const Bve=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],zve=Ce("menu",Bve);const qve=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ih=Ce("message-square",qve);const Fve=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],GN=Ce("moon",Fve);const Uve=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Kq=Ce("package",Uve);const Hve=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Xq=Ce("palette",Hve);const Wve=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Vve=Ce("pause",Wve);const Gve=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Eu=Ce("pencil",Gve);const Yve=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Kve=Ce("play",Yve);const Xve=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tr=Ce("plus",Xve);const Zve=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],al=Ce("refresh-cw",Zve);const Qve=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Jve=Ce("rotate-ccw",Qve);const ege=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],tge=Ce("rotate-cw",ege);const nge=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],GC=Ce("save",nge);const rge=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dr=Ce("search",rge);const age=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Zq=Ce("server",age);const ige=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],oge=Ce("settings-2",ige);const sge=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Hc=Ce("settings",sge);const lge=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],cge=Ce("shield",lge);const uge=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],dge=Ce("skip-forward",uge);const fge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],YC=Ce("smile",fge);const hge=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],mge=Ce("sparkles",hge);const pge=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],KC=Ce("square-pen",pge);const vge=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],q3=Ce("star",vge);const gge=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],YN=Ce("sun",gge);const yge=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xge=Ce("terminal",yge);const bge=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ut=Ce("trash-2",bge);const wge=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],jge=Ce("trending-up",wge);const Sge=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wc=Ce("triangle-alert",Sge);const _ge=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Qq=Ce("user",_ge);const Nge=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Oge=Ce("users",Nge);const Cge=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Lh=Ce("x",Cge);const Ege=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],uh=Ce("zap",Ege);var Age=Symbol.for("react.lazy"),Sg=yO[" use ".trim().toString()];function Tge(e){return typeof e=="object"&&e!==null&&"then"in e}function Jq(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Age&&"_payload"in e&&Tge(e._payload)}function Bh(e){const t=Mge(e),n=y.forwardRef((r,a)=>{let{children:o,...l}=r;Jq(o)&&typeof Sg=="function"&&(o=Sg(o._payload));const u=y.Children.toArray(o),d=u.find(Rge);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var kge=Bh("Slot");function Mge(e){const t=y.forwardRef((n,r)=>{let{children:a,...o}=n;if(Jq(a)&&typeof Sg=="function"&&(a=Sg(a._payload)),y.isValidElement(a)){const l=$ge(a),u=Dge(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pge=Symbol("radix.slottable");function Rge(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pge}function Dge(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function $ge(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const F3=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,U3=Ye,zh=(e,t)=>n=>{var r;if(t?.variants==null)return U3(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(f=>{const m=n?.[f],p=o?.[f];if(m===null)return null;const g=F3(m)||F3(p);return a[f][g]}),u=n&&Object.entries(n).reduce((f,m)=>{let[p,g]=m;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:g,...x}=m;return Object.entries(x).every(j=>{let[b,w]=j;return Array.isArray(w)?w.includes({...o,...u}[b]):{...o,...u}[b]===w})?[...f,p,g]:f},[]);return U3(e,l,d,n?.class,n?.className)},dh=zh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),fe=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const l=r?kge:"button";return i.jsx(l,{className:ue(dh({variant:t,size:n,className:e})),ref:o,...a})});fe.displayName="Button";function Ige(){const[e,t]=y.useState(null),[n,r]=y.useState(!0),[a,o]=y.useState(24),[l,u]=y.useState(!0),d=y.useCallback(async()=>{try{const O=localStorage.getItem("token"),C=await un.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${O}`}});t(C.data),r(!1)}catch(O){console.error("Failed to fetch dashboard data:",O),r(!1)}},[a]);if(y.useEffect(()=>{d()},[d]),y.useEffect(()=>{if(!l)return;const O=setInterval(()=>{d()},3e4);return()=>clearInterval(O)},[l,d]),n||!e)return i.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:i.jsxs("div",{className:"text-center space-y-4",children:[i.jsx(al,{className:"h-12 w-12 animate-spin mx-auto text-muted-foreground"}),i.jsx("p",{className:"text-muted-foreground",children:"加载统计数据中..."})]})});const{summary:f,model_stats:m,hourly_data:p,daily_data:g,recent_activity:x}=e,j=O=>{const C=Math.floor(O/3600),A=Math.floor(O%3600/60);return`${C}小时${A}分钟`},b=O=>new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),w=m.slice(0,6).map(O=>({name:O.model_name,value:O.request_count,fill:`hsl(var(--chart-${m.indexOf(O)%5+1}))`})),N={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return i.jsx(Kt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(sl,{value:a.toString(),onValueChange:O=>o(Number(O)),children:i.jsxs(Zo,{className:"grid grid-cols-3 w-full sm:w-auto",children:[i.jsx(Ct,{value:"24",children:"24小时"}),i.jsx(Ct,{value:"168",children:"7天"}),i.jsx(Ct,{value:"720",children:"30天"})]})}),i.jsxs(fe,{variant:l?"default":"outline",size:"sm",onClick:()=>u(!l),className:"gap-2",children:[i.jsx(al,{className:`h-4 w-4 ${l?"animate-spin":""}`}),i.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),i.jsx(fe,{variant:"outline",size:"sm",onClick:d,children:i.jsx(al,{className:"h-4 w-4"})})]})]}),i.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"总请求数"}),i.jsx(qpe,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(cn,{children:[i.jsx("div",{className:"text-2xl font-bold",children:f.total_requests.toLocaleString()}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"总花费"}),i.jsx(wve,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(cn,{children:[i.jsxs("div",{className:"text-2xl font-bold",children:["¥",f.total_cost.toFixed(2)]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.cost_per_hour>0?`¥${f.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"Token消耗"}),i.jsx(xve,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(cn,{children:[i.jsxs("div",{className:"text-2xl font-bold",children:[(f.total_tokens/1e3).toFixed(1),"K"]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:f.tokens_per_hour>0?`${(f.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"平均响应"}),i.jsx(uh,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(cn,{children:[i.jsxs("div",{className:"text-2xl font-bold",children:[f.avg_response_time.toFixed(2),"s"]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),i.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"在线时长"}),i.jsx(rl,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsx(cn,{children:i.jsx("div",{className:"text-xl font-bold",children:j(f.online_time)})})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"消息处理"}),i.jsx(Ih,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(cn,{children:[i.jsx("div",{className:"text-xl font-bold",children:f.total_messages.toLocaleString()}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",f.total_replies.toLocaleString()," 条"]})]})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(Gt,{className:"text-sm font-medium",children:"成本效率"}),i.jsx(jge,{className:"h-4 w-4 text-muted-foreground"})]}),i.jsxs(cn,{children:[i.jsx("div",{className:"text-xl font-bold",children:f.total_messages>0?`¥${(f.total_cost/f.total_messages*100).toFixed(2)}`:"¥0.00"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),i.jsxs(sl,{defaultValue:"trends",className:"space-y-4",children:[i.jsxs(Zo,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[i.jsx(Ct,{value:"trends",children:"趋势"}),i.jsx(Ct,{value:"models",children:"模型"}),i.jsx(Ct,{value:"activity",children:"活动"}),i.jsx(Ct,{value:"daily",children:"日统计"})]}),i.jsxs(Jt,{value:"trends",className:"space-y-4",children:[i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"请求趋势"}),i.jsxs(er,{children:["最近",a,"小时的请求量变化"]})]}),i.jsx(cn,{children:i.jsx(Tc,{config:N,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:i.jsxs(Tpe,{data:p,children:[i.jsx(df,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Wi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(af,{content:i.jsx(kc,{labelFormatter:O=>b(O)})}),i.jsx($h,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),i.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"花费趋势"}),i.jsx(er,{children:"API调用成本变化"})]}),i.jsx(cn,{children:i.jsx(Tc,{config:N,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:i.jsxs(FS,{data:p,children:[i.jsx(df,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Wi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(af,{content:i.jsx(kc,{labelFormatter:O=>b(O)})}),i.jsx(si,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"Token消耗"}),i.jsx(er,{children:"Token使用量变化"})]}),i.jsx(cn,{children:i.jsx(Tc,{config:N,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:i.jsxs(FS,{data:p,children:[i.jsx(df,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Wi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(af,{content:i.jsx(kc,{labelFormatter:O=>b(O)})}),i.jsx(si,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),i.jsx(Jt,{value:"models",className:"space-y-4",children:i.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"模型请求分布"}),i.jsx(er,{children:"各模型使用占比"})]}),i.jsx(cn,{children:i.jsx(Tc,{config:Object.fromEntries(m.slice(0,6).map((O,C)=>[O.model_name,{label:O.model_name,color:`hsl(var(--chart-${C%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:i.jsxs(kpe,{children:[i.jsx(af,{content:i.jsx(kc,{})}),i.jsx(fo,{data:w,cx:"50%",cy:"50%",labelLine:!1,label:({name:O,percent:C})=>`${O} ${C?(C*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:w.map((O,C)=>i.jsx(ay,{fill:O.fill},`cell-${C}`))})]})})})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"模型详细统计"}),i.jsx(er,{children:"请求数、花费和性能"})]}),i.jsx(cn,{children:i.jsx(Kt,{className:"h-[300px] sm:h-[400px]",children:i.jsx("div",{className:"space-y-3",children:m.map((O,C)=>i.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:O.model_name}),i.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${C%5+1}))`}})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),i.jsx("span",{className:"ml-1 font-medium",children:O.request_count.toLocaleString()})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"花费:"}),i.jsxs("span",{className:"ml-1 font-medium",children:["¥",O.total_cost.toFixed(2)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),i.jsxs("span",{className:"ml-1 font-medium",children:[(O.total_tokens/1e3).toFixed(1),"K"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),i.jsxs("span",{className:"ml-1 font-medium",children:[O.avg_response_time.toFixed(2),"s"]})]})]})]},C))})})})]})]})}),i.jsx(Jt,{value:"activity",children:i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"最近活动"}),i.jsx(er,{children:"最新的API调用记录"})]}),i.jsx(cn,{children:i.jsx(Kt,{className:"h-[400px] sm:h-[500px]",children:i.jsx("div",{className:"space-y-2",children:x.map((O,C)=>i.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm truncate",children:O.model}),i.jsx("div",{className:"text-xs text-muted-foreground",children:O.request_type})]}),i.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:b(O.timestamp)})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),i.jsx("span",{className:"ml-1",children:O.tokens})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"花费:"}),i.jsxs("span",{className:"ml-1",children:["¥",O.cost.toFixed(4)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),i.jsxs("span",{className:"ml-1",children:[O.time_cost.toFixed(2),"s"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground",children:"状态:"}),i.jsx("span",{className:`ml-1 ${O.status==="success"?"text-green-600":"text-red-600"}`,children:O.status})]})]})]},C))})})})]})}),i.jsx(Jt,{value:"daily",children:i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"每日统计"}),i.jsx(er,{children:"最近7天的数据汇总"})]}),i.jsx(cn,{children:i.jsx(Tc,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:i.jsxs(FS,{data:g,children:[i.jsx(df,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),i.jsx(Wo,{dataKey:"timestamp",tickFormatter:O=>{const C=new Date(O);return`${C.getMonth()+1}/${C.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Wi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(Wi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),i.jsx(af,{content:i.jsx(kc,{labelFormatter:O=>new Date(O).toLocaleDateString("zh-CN")})}),i.jsx(Rpe,{content:i.jsx(Fq,{})}),i.jsx(si,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),i.jsx(si,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})})}const Lge={theme:"system",setTheme:()=>null},eF=y.createContext(Lge),XC=()=>{const e=y.useContext(eF);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Bge=(e,t,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){t(e);return}const a=n.clientX,o=n.clientY,l=Math.hypot(Math.max(a,innerWidth-a),Math.max(o,innerHeight-o));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${o}px)`,`circle(${l}px at ${a}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},tF=y.createContext(void 0),nF=()=>{const e=y.useContext(tF);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};function Ay(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ty(e){const[t,n]=y.useState(void 0);return Un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ky="Switch",[zge]=hr(ky),[qge,Fge]=zge(ky),rF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:f,form:m,...p}=e,[g,x]=y.useState(null),j=qe(t,C=>x(C)),b=y.useRef(!1),w=g?m||!!g.closest("form"):!0,[N,O]=Na({prop:a,defaultProp:o??!1,onChange:f,caller:ky});return i.jsxs(qge,{scope:n,checked:N,disabled:u,children:[i.jsx(Pe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":l,"data-state":sF(N),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:j,onClick:Se(e.onClick,C=>{O(A=>!A),w&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})}),w&&i.jsx(oF,{control:g,bubbles:!b.current,name:r,value:d,checked:N,required:l,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});rF.displayName=ky;var aF="SwitchThumb",iF=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Fge(aF,n);return i.jsx(Pe.span,{"data-state":sF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});iF.displayName=aF;var Uge="SwitchBubbleInput",oF=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const l=y.useRef(null),u=qe(l,o),d=Ay(n),f=Ty(t);return y.useEffect(()=>{const m=l.current;if(!m)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(m,n),m.dispatchEvent(j)}},[d,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});oF.displayName=Uge;function sF(e){return e?"checked":"unchecked"}var lF=rF,Hge=iF;const at=y.forwardRef(({className:e,...t},n)=>i.jsx(lF,{className:ue("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:i.jsx(Hge,{className:ue("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));at.displayName=lF.displayName;var Wge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vge=Wge.reduce((e,t)=>{const n=Bh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Gge="Label",cF=y.forwardRef((e,t)=>i.jsx(Vge.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));cF.displayName=Gge;var uF=cF;const Yge=zh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),J=y.forwardRef(({className:e,...t},n)=>i.jsx(uF,{ref:n,className:ue(Yge(),e),...t}));J.displayName=uF.displayName;const Ne=y.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:ue("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ne.displayName="Input";const Kge=1,Xge=1e6;let US=0;function Zge(){return US=(US+1)%Number.MAX_SAFE_INTEGER,US.toString()}const HS=new Map,H3=e=>{if(HS.has(e))return;const t=setTimeout(()=>{HS.delete(e),Of({type:"REMOVE_TOAST",toastId:e})},Xge);HS.set(e,t)},Qge=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Kge)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?H3(n):e.toasts.forEach(r=>{H3(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},av=[];let iv={toasts:[]};function Of(e){iv=Qge(iv,e),av.forEach(t=>{t(iv)})}function Jge({...e}){const t=Zge(),n=a=>Of({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Of({type:"DISMISS_TOAST",toastId:t});return Of({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function mr(){const[e,t]=y.useState(iv);return y.useEffect(()=>(av.push(t),()=>{const n=av.indexOf(t);n>-1&&av.splice(n,1)}),[e]),{...e,toast:Jge,dismiss:n=>Of({type:"DISMISS_TOAST",toastId:n})}}const eye=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function tye(e){const t=eye.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(e)}));return{isValid:t.every(r=>r.passed),rules:t}}const ZC="0.11.4",QC="MaiBot Dashboard",nye=`${QC} v${ZC}`,rye=(e="v")=>`${e}${ZC}`;function aye(e,t=globalThis?.document){const n=nn(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var iye="DismissableLayer",KN="dismissableLayer.update",oye="dismissableLayer.pointerDownOutside",sye="dismissableLayer.focusOutside",W3,dF=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_l=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(dF),[m,p]=y.useState(null),g=m?.ownerDocument??globalThis?.document,[,x]=y.useState({}),j=qe(t,T=>p(T)),b=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(w),O=m?b.indexOf(m):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=O>=N,E=cye(T=>{const M=T.target,$=[...f.branches].some(z=>z.contains(M));!A||$||(a?.(T),l?.(T),T.defaultPrevented||u?.())},g),k=uye(T=>{const M=T.target;[...f.branches].some(z=>z.contains(M))||(o?.(T),l?.(T),T.defaultPrevented||u?.())},g);return aye(T=>{O===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},g),y.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(W3=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),V3(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=W3)}},[m,g,n,f]),y.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),V3())},[m,f]),y.useEffect(()=>{const T=()=>x({});return document.addEventListener(KN,T),()=>document.removeEventListener(KN,T)},[]),i.jsx(Pe.div,{...d,ref:j,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,E.onPointerDownCapture)})});_l.displayName=iye;var lye="DismissableLayerBranch",fF=y.forwardRef((e,t)=>{const n=y.useContext(dF),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(Pe.div,{...e,ref:a})});fF.displayName=lye;function cye(e,t=globalThis?.document){const n=nn(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){hF(oye,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function uye(e,t=globalThis?.document){const n=nn(e),r=y.useRef(!1);return y.useEffect(()=>{const a=o=>{o.target&&!r.current&&hF(sye,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function V3(){const e=new CustomEvent(KN);document.dispatchEvent(e)}function hF(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?RO(a,o):a.dispatchEvent(o)}var dye=_l,fye=fF,WS="focusScope.autoFocusOnMount",VS="focusScope.autoFocusOnUnmount",G3={bubbles:!1,cancelable:!0},hye="FocusScope",qh=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[u,d]=y.useState(null),f=nn(a),m=nn(o),p=y.useRef(null),g=qe(t,b=>d(b)),x=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let b=function(C){if(x.paused||!u)return;const A=C.target;u.contains(A)?p.current=A:zo(p.current,{select:!0})},w=function(C){if(x.paused||!u)return;const A=C.relatedTarget;A!==null&&(u.contains(A)||zo(p.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&zo(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const O=new MutationObserver(N);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),O.disconnect()}}},[r,u,x.paused]),y.useEffect(()=>{if(u){K3.add(x);const b=document.activeElement;if(!u.contains(b)){const N=new CustomEvent(WS,G3);u.addEventListener(WS,f),u.dispatchEvent(N),N.defaultPrevented||(mye(xye(mF(u)),{select:!0}),document.activeElement===b&&zo(u))}return()=>{u.removeEventListener(WS,f),setTimeout(()=>{const N=new CustomEvent(VS,G3);u.addEventListener(VS,m),u.dispatchEvent(N),N.defaultPrevented||zo(b??document.body,{select:!0}),u.removeEventListener(VS,m),K3.remove(x)},0)}}},[u,f,m,x]);const j=y.useCallback(b=>{if(!n&&!r||x.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(w&&N){const O=b.currentTarget,[C,A]=pye(O);C&&A?!b.shiftKey&&N===A?(b.preventDefault(),n&&zo(C,{select:!0})):b.shiftKey&&N===C&&(b.preventDefault(),n&&zo(A,{select:!0})):N===O&&b.preventDefault()}},[n,r,x.paused]);return i.jsx(Pe.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});qh.displayName=hye;function mye(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zo(r,{select:t}),document.activeElement!==n)return}function pye(e){const t=mF(e),n=Y3(t,e),r=Y3(t.reverse(),e);return[n,r]}function mF(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y3(e,t){for(const n of e)if(!vye(n,{upTo:t}))return n}function vye(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gye(e){return e instanceof HTMLInputElement&&"select"in e}function zo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gye(e)&&t&&e.select()}}var K3=yye();function yye(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=X3(e,t),e.unshift(t)},remove(t){e=X3(e,t),e[0]?.resume()}}}function X3(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xye(e){return e.filter(t=>t.tagName!=="A")}var bye="Portal",Nl=y.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=y.useState(!1);Un(()=>o(!0),[]);const l=n||a&&globalThis?.document?.body;return l?mY.createPortal(i.jsx(Pe.div,{...r,ref:t}),l):null});Nl.displayName=bye;var GS=0;function My(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Z3()),document.body.insertAdjacentElement("beforeend",e[1]??Z3()),GS++,()=>{GS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),GS--}},[])}function Z3(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ni=function(){return ni=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return Iye;var t=Lye(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},zye=yF(),Vc="data-scroll-locked",qye=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` .`.concat(jye,` { overflow: hidden `).concat(r,`; padding-right: `).concat(u,"px ").concat(r,`; } body[`).concat(Vc,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(a,`px; padding-top: `).concat(o,`px; padding-right: `).concat(l,`px; margin-left:0; margin-top:0; margin-right: `).concat(u,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(ov,` { right: `).concat(u,"px ").concat(r,`; } .`).concat(sv,` { margin-right: `).concat(u,"px ").concat(r,`; } .`).concat(ov," .").concat(ov,` { right: 0 `).concat(r,`; } .`).concat(sv," .").concat(sv,` { margin-right: 0 `).concat(r,`; } body[`).concat(Vc,`] { `).concat(Sye,": ").concat(u,`px; } `)},J3=function(){var e=parseInt(document.body.getAttribute(Vc)||"0",10);return isFinite(e)?e:0},Fye=function(){y.useEffect(function(){return document.body.setAttribute(Vc,(J3()+1).toString()),function(){var e=J3()-1;e<=0?document.body.removeAttribute(Vc):document.body.setAttribute(Vc,e.toString())}},[])},Uye=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Fye();var o=y.useMemo(function(){return Bye(a)},[a]);return y.createElement(zye,{styles:qye(o,!t,a,n?"":"!important")})},XN=!1;if(typeof window<"u")try{var zp=Object.defineProperty({},"passive",{get:function(){return XN=!0,!0}});window.addEventListener("test",zp,zp),window.removeEventListener("test",zp,zp)}catch{XN=!1}var _c=XN?{passive:!1}:!1,Hye=function(e){return e.tagName==="TEXTAREA"},xF=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Hye(e)&&n[t]==="visible")},Wye=function(e){return xF(e,"overflowY")},Vye=function(e){return xF(e,"overflowX")},eL=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=bF(e,r);if(a){var o=wF(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gye=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Yye=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bF=function(e,t){return e==="v"?Wye(t):Vye(t)},wF=function(e,t){return e==="v"?Gye(t):Yye(t)},Kye=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xye=function(e,t,n,r,a){var o=Kye(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),f=!1,m=l>0,p=0,g=0;do{if(!u)break;var x=wF(e,u),j=x[0],b=x[1],w=x[2],N=b-w-o*j;(j||N)&&bF(e,u)&&(p+=N,g+=j);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(g)<1)&&(f=!0),f},qp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tL=function(e){return[e.deltaX,e.deltaY]},nL=function(e){return e&&"current"in e?e.current:e},Zye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qye=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Jye=0,Nc=[];function exe(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(Jye++)[0],o=y.useState(yF)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=wye([e.lockRef.current],(e.shards||[]).map(nL),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var N=qp(b),O=n.current,C="deltaX"in b?b.deltaX:O[0]-N[0],A="deltaY"in b?b.deltaY:O[1]-N[1],E,k=b.target,T=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var M=eL(T,k);if(!M)return!0;if(M?E=T:(E=T==="v"?"h":"v",M=eL(T,k)),!M)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=E),!E)return!0;var $=r.current||E;return Xye($,w,b,$==="h"?C:A)},[]),d=y.useCallback(function(b){var w=b;if(!(!Nc.length||Nc[Nc.length-1]!==o)){var N="deltaY"in w?tL(w):qp(w),O=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Zye(E.delta,N)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var C=(l.current.shards||[]).map(nL).filter(Boolean).filter(function(E){return E.contains(w.target)}),A=C.length>0?u(w,C[0]):!l.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),f=y.useCallback(function(b,w,N,O){var C={name:b,delta:w,target:N,should:O,shadowParent:txe(N)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),m=y.useCallback(function(b){n.current=qp(b),r.current=void 0},[]),p=y.useCallback(function(b){f(b.type,tL(b),b.target,u(b,e.lockRef.current))},[]),g=y.useCallback(function(b){f(b.type,qp(b),b.target,u(b,e.lockRef.current))},[]);y.useEffect(function(){return Nc.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,_c),document.addEventListener("touchmove",d,_c),document.addEventListener("touchstart",m,_c),function(){Nc=Nc.filter(function(b){return b!==o}),document.removeEventListener("wheel",d,_c),document.removeEventListener("touchmove",d,_c),document.removeEventListener("touchstart",m,_c)}},[]);var x=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(o,{styles:Qye(a)}):null,x?y.createElement(Uye,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function txe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nxe=Tye(gF,exe);var Fh=y.forwardRef(function(e,t){return y.createElement(Py,ni({},e,{ref:t,sideCar:nxe}))});Fh.classNames=Py.classNames;var rxe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oc=new WeakMap,Fp=new WeakMap,Up={},ZS=0,jF=function(e){return e&&(e.host||jF(e.parentNode))},axe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=jF(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ixe=function(e,t,n,r){var a=axe(t,Array.isArray(e)?e:[e]);Up[n]||(Up[n]=new WeakMap);var o=Up[n],l=[],u=new Set,d=new Set(a),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};a.forEach(f);var m=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(u.has(g))m(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",b=(Oc.get(g)||0)+1,w=(o.get(g)||0)+1;Oc.set(g,b),o.set(g,w),l.push(g),b===1&&j&&Fp.set(g,!0),w===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",g,N)}})};return m(t),u.clear(),ZS++,function(){l.forEach(function(p){var g=Oc.get(p)-1,x=o.get(p)-1;Oc.set(p,g),o.set(p,x),g||(Fp.has(p)||p.removeAttribute(r),Fp.delete(p)),x||p.removeAttribute(n)}),ZS--,ZS||(Oc=new WeakMap,Oc=new WeakMap,Fp=new WeakMap,Up={})}},Ry=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=rxe(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),ixe(r,a,n,"aria-hidden")):function(){return null}};function oxe(e){const t=sxe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(cxe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function sxe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=dxe(a),u=uxe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lxe=Symbol("radix.slottable");function cxe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lxe}function uxe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function dxe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dy="Dialog",[SF,_F]=hr(Dy),[fxe,Ga]=SF(Dy),NF=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,u=y.useRef(null),d=y.useRef(null),[f,m]=Na({prop:r,defaultProp:a??!1,onChange:o,caller:Dy});return i.jsx(fxe,{scope:t,triggerRef:u,contentRef:d,contentId:Fn(),titleId:Fn(),descriptionId:Fn(),open:f,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(p=>!p),[m]),modal:l,children:n})};NF.displayName=Dy;var OF="DialogTrigger",CF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ga(OF,n),o=qe(t,a.triggerRef);return i.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":tE(a.open),...r,ref:o,onClick:Se(e.onClick,a.onOpenToggle)})});CF.displayName=OF;var JC="DialogPortal",[hxe,EF]=SF(JC,{forceMount:void 0}),AF=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=Ga(JC,t);return i.jsx(hxe,{scope:t,forceMount:n,children:y.Children.map(r,l=>i.jsx(Rn,{present:n||o.open,children:i.jsx(Nl,{asChild:!0,container:a,children:l})}))})};AF.displayName=JC;var _g="DialogOverlay",TF=y.forwardRef((e,t)=>{const n=EF(_g,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Ga(_g,e.__scopeDialog);return o.modal?i.jsx(Rn,{present:r||o.open,children:i.jsx(pxe,{...a,ref:t})}):null});TF.displayName=_g;var mxe=oxe("DialogOverlay.RemoveScroll"),pxe=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ga(_g,n);return i.jsx(Fh,{as:mxe,allowPinchZoom:!0,shards:[a.contentRef],children:i.jsx(Pe.div,{"data-state":tE(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),hl="DialogContent",kF=y.forwardRef((e,t)=>{const n=EF(hl,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=Ga(hl,e.__scopeDialog);return i.jsx(Rn,{present:r||o.open,children:o.modal?i.jsx(vxe,{...a,ref:t}):i.jsx(gxe,{...a,ref:t})})});kF.displayName=hl;var vxe=y.forwardRef((e,t)=>{const n=Ga(hl,e.__scopeDialog),r=y.useRef(null),a=qe(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return Ry(o)},[]),i.jsx(MF,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault())})}),gxe=y.forwardRef((e,t)=>{const n=Ga(hl,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return i.jsx(MF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),MF=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,u=Ga(hl,n),d=y.useRef(null),f=qe(t,d);return My(),i.jsxs(i.Fragment,{children:[i.jsx(qh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:i.jsx(_l,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":tE(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(xxe,{titleId:u.titleId}),i.jsx(wxe,{contentRef:d,descriptionId:u.descriptionId})]})]})}),eE="DialogTitle",PF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ga(eE,n);return i.jsx(Pe.h2,{id:a.titleId,...r,ref:t})});PF.displayName=eE;var RF="DialogDescription",DF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ga(RF,n);return i.jsx(Pe.p,{id:a.descriptionId,...r,ref:t})});DF.displayName=RF;var $F="DialogClose",IF=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ga($F,n);return i.jsx(Pe.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});IF.displayName=$F;function tE(e){return e?"open":"closed"}var LF="DialogTitleWarning",[yxe,BF]=rZ(LF,{contentName:hl,titleName:eE,docsSlug:"dialog"}),xxe=({titleId:e})=>{const t=BF(LF),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bxe="DialogDescriptionWarning",wxe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${BF(bxe).contentName}}.`;return y.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},nE=NF,zF=CF,rE=AF,$y=TF,Iy=kF,aE=PF,iE=DF,oE=IF;const nr=nE,qF=zF,jxe=rE,FF=y.forwardRef(({className:e,...t},n)=>i.jsx($y,{ref:n,className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));FF.displayName=$y.displayName;const Hn=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(jxe,{children:[i.jsx(FF,{}),i.jsxs(Iy,{ref:r,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,i.jsxs(oE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(Lh,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Hn.displayName=Iy.displayName;const Wn=({className:e,...t})=>i.jsx("div",{className:ue("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wn.displayName="DialogHeader";const $r=({className:e,...t})=>i.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$r.displayName="DialogFooter";const Vn=y.forwardRef(({className:e,...t},n)=>i.jsx(aE,{ref:n,className:ue("text-lg font-semibold leading-none tracking-tight",e),...t}));Vn.displayName=aE.displayName;const dr=y.forwardRef(({className:e,...t},n)=>i.jsx(iE,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));dr.displayName=iE.displayName;var Sxe=Symbol("radix.slottable");function _xe(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Sxe,t}var UF="AlertDialog",[Nxe]=hr(UF,[_F]),ho=_F(),HF=e=>{const{__scopeAlertDialog:t,...n}=e,r=ho(t);return i.jsx(nE,{...r,...n,modal:!0})};HF.displayName=UF;var Oxe="AlertDialogTrigger",WF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(zF,{...a,...r,ref:t})});WF.displayName=Oxe;var Cxe="AlertDialogPortal",VF=e=>{const{__scopeAlertDialog:t,...n}=e,r=ho(t);return i.jsx(rE,{...r,...n})};VF.displayName=Cxe;var Exe="AlertDialogOverlay",GF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx($y,{...a,...r,ref:t})});GF.displayName=Exe;var Gc="AlertDialogContent",[Axe,Txe]=Nxe(Gc),kxe=_xe("AlertDialogContent"),YF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=ho(n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return i.jsx(yxe,{contentName:Gc,titleName:KF,docsSlug:"alert-dialog",children:i.jsx(Axe,{scope:n,cancelRef:d,children:i.jsxs(Iy,{role:"alertdialog",...o,...a,ref:u,onOpenAutoFocus:Se(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[i.jsx(kxe,{children:r}),i.jsx(Pxe,{contentRef:l})]})})})});YF.displayName=Gc;var KF="AlertDialogTitle",XF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(aE,{...a,...r,ref:t})});XF.displayName=KF;var ZF="AlertDialogDescription",QF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(iE,{...a,...r,ref:t})});QF.displayName=ZF;var Mxe="AlertDialogAction",JF=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ho(n);return i.jsx(oE,{...a,...r,ref:t})});JF.displayName=Mxe;var e8="AlertDialogCancel",t8=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Txe(e8,n),o=ho(n),l=qe(t,a);return i.jsx(oE,{...o,...r,ref:l})});t8.displayName=e8;var Pxe=({contentRef:e})=>{const t=`\`${Gc}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Gc}\` by passing a \`${ZF}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Gc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rxe=HF,Dxe=WF,$xe=VF,n8=GF,r8=YF,a8=JF,i8=t8,o8=XF,s8=QF;const Pn=Rxe,ra=Dxe,Ixe=$xe,l8=y.forwardRef(({className:e,...t},n)=>i.jsx(n8,{className:ue("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));l8.displayName=n8.displayName;const yn=y.forwardRef(({className:e,...t},n)=>i.jsxs(Ixe,{children:[i.jsx(l8,{}),i.jsx(r8,{ref:n,className:ue("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));yn.displayName=r8.displayName;const xn=({className:e,...t})=>i.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});xn.displayName="AlertDialogHeader";const bn=({className:e,...t})=>i.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});bn.displayName="AlertDialogFooter";const wn=y.forwardRef(({className:e,...t},n)=>i.jsx(o8,{ref:n,className:ue("text-lg font-semibold",e),...t}));wn.displayName=o8.displayName;const jn=y.forwardRef(({className:e,...t},n)=>i.jsx(s8,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));jn.displayName=s8.displayName;const Sn=y.forwardRef(({className:e,...t},n)=>i.jsx(a8,{ref:n,className:ue(dh(),e),...t}));Sn.displayName=a8.displayName;const _n=y.forwardRef(({className:e,...t},n)=>i.jsx(i8,{ref:n,className:ue(dh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));_n.displayName=i8.displayName;function Lxe(){return i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),i.jsxs(sl,{defaultValue:"appearance",className:"w-full",children:[i.jsxs(Zo,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[i.jsxs(Ct,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(Xq,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"外观"})]}),i.jsxs(Ct,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(cge,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"安全"})]}),i.jsxs(Ct,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(Hc,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"其他"})]}),i.jsxs(Ct,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[i.jsx(Yq,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),i.jsx("span",{children:"关于"})]})]}),i.jsxs(Kt,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[i.jsx(Jt,{value:"appearance",className:"mt-0",children:i.jsx(Bxe,{})}),i.jsx(Jt,{value:"security",className:"mt-0",children:i.jsx(zxe,{})}),i.jsx(Jt,{value:"other",className:"mt-0",children:i.jsx(qxe,{})}),i.jsx(Jt,{value:"about",className:"mt-0",children:i.jsx(Fxe,{})})]})]})]})}function rL(e){const t=document.documentElement,r={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(r)t.style.setProperty("--primary",r.hsl),r.gradient?(t.style.setProperty("--primary-gradient",r.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const a=o=>{o=o.replace("#","");const l=parseInt(o.substring(0,2),16)/255,u=parseInt(o.substring(2,4),16)/255,d=parseInt(o.substring(4,6),16)/255,f=Math.max(l,u,d),m=Math.min(l,u,d);let p=0,g=0;const x=(f+m)/2;if(f!==m){const j=f-m;switch(g=x>.5?j/(2-f-m):j/(f+m),f){case l:p=((u-d)/j+(ulocalStorage.getItem("accent-color")||"blue");y.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";rL(f)},[]);const d=f=>{u(f),localStorage.setItem("accent-color",f),rL(f)};return i.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[i.jsx(QS,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),i.jsx(QS,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),i.jsx(QS,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),i.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),i.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[i.jsx(ba,{value:"blue",current:l,onChange:d,label:"蓝色",colorClass:"bg-blue-500"}),i.jsx(ba,{value:"purple",current:l,onChange:d,label:"紫色",colorClass:"bg-purple-500"}),i.jsx(ba,{value:"green",current:l,onChange:d,label:"绿色",colorClass:"bg-green-500"}),i.jsx(ba,{value:"orange",current:l,onChange:d,label:"橙色",colorClass:"bg-orange-500"}),i.jsx(ba,{value:"pink",current:l,onChange:d,label:"粉色",colorClass:"bg-pink-500"}),i.jsx(ba,{value:"red",current:l,onChange:d,label:"红色",colorClass:"bg-red-500"})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),i.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[i.jsx(ba,{value:"gradient-sunset",current:l,onChange:d,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),i.jsx(ba,{value:"gradient-ocean",current:l,onChange:d,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),i.jsx(ba,{value:"gradient-forest",current:l,onChange:d,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),i.jsx(ba,{value:"gradient-aurora",current:l,onChange:d,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),i.jsx(ba,{value:"gradient-fire",current:l,onChange:d,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),i.jsx(ba,{value:"gradient-twilight",current:l,onChange:d,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[i.jsx("div",{className:"flex-1",children:i.jsx("input",{type:"color",value:l.startsWith("#")?l:"#3b82f6",onChange:f=>d(f.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),i.jsx("div",{className:"flex-1",children:i.jsx(Ne,{type:"text",value:l,onChange:f=>d(f.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),i.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),i.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[i.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5 flex-1",children:[i.jsx(J,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),i.jsx(at,{id:"animations",checked:n,onCheckedChange:r})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5 flex-1",children:[i.jsx(J,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),i.jsx(at,{id:"waves-background",checked:a,onCheckedChange:o})]})})]})]})]})}function zxe(){const e=oa(),[t,n]=y.useState(""),[r,a]=y.useState(""),[o,l]=y.useState(!1),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[p,g]=y.useState(!1),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,O]=y.useState(""),[C,A]=y.useState(!1),{toast:E}=mr(),k=y.useMemo(()=>tye(r),[r]),T=()=>localStorage.getItem("access-token")||"",M=async H=>{try{await navigator.clipboard.writeText(H),j(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>j(!1),2e3)}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},$=async()=>{if(!r.trim()){E({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!k.isValid){const H=k.rules.filter(G=>!G.passed).map(G=>G.label).join(", ");E({title:"格式错误",description:`Token 不符合要求: ${H}`,variant:"destructive"});return}m(!0);try{const H=T(),G=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`},body:JSON.stringify({new_token:r.trim()})}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",r.trim()),a(""),t&&n(r.trim()),E({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):E({title:"更新失败",description:L.message||"无法更新 Token",variant:"destructive"})}catch(H){console.error("更新 Token 错误:",H),E({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},z=async()=>{g(!0);try{const H=T(),G=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${H}`}}),L=await G.json();G.ok&&L.success?(localStorage.setItem("access-token",L.token),n(L.token),O(L.token),w(!0),A(!1),E({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):E({title:"生成失败",description:L.message||"无法生成新 Token",variant:"destructive"})}catch(H){console.error("生成 Token 错误:",H),E({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},D=async()=>{try{await navigator.clipboard.writeText(N),A(!0),E({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{E({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=()=>{w(!1),setTimeout(()=>{O(""),A(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},V=H=>{H||U()};return i.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[i.jsx(nr,{open:b,onOpenChange:V,children:i.jsxs(Hn,{className:"sm:max-w-md",children:[i.jsxs(Wn,{children:[i.jsxs(Vn,{className:"flex items-center gap-2",children:[i.jsx(Wc,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),i.jsx(dr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[i.jsx(J,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),i.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:N})]}),i.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Wc,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[i.jsx("p",{className:"font-semibold",children:"重要提示"}),i.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[i.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),i.jsx("li",{children:"请立即复制并保存到安全的位置"}),i.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),i.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),i.jsxs($r,{className:"gap-2 sm:gap-0",children:[i.jsx(fe,{variant:"outline",onClick:D,className:"gap-2",children:C?i.jsxs(i.Fragment,{children:[i.jsx(nl,{className:"h-4 w-4 text-green-500"}),"已复制"]}):i.jsxs(i.Fragment,{children:[i.jsx(FN,{className:"h-4 w-4"}),"复制 Token"]})}),i.jsx(fe,{onClick:U,children:"我已保存,关闭"})]})]})}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),i.jsx("div",{className:"space-y-3 sm:space-y-4",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Ne,{id:"current-token",type:o?"text":"password",value:t||T(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),i.jsx("button",{onClick:()=>{t||n(T()),l(!o)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:o?"隐藏":"显示",children:o?i.jsx(HN,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(ao,{className:"h-4 w-4 text-muted-foreground"})})]}),i.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[i.jsx(fe,{variant:"outline",size:"icon",onClick:()=>M(T()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?i.jsx(nl,{className:"h-4 w-4 text-green-500"}):i.jsx(FN,{className:"h-4 w-4"})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsxs(fe,{variant:"outline",disabled:p,className:"gap-2 flex-1 sm:flex-none",children:[i.jsx(al,{className:ue("h-4 w-4",p&&"animate-spin")}),i.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),i.jsx("span",{className:"sm:hidden",children:"生成"})]})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认重新生成 Token"}),i.jsx(jn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:z,children:"确认生成"})]})]})]})]})]}),i.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),i.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),i.jsxs("div",{className:"relative",children:[i.jsx(Ne,{id:"new-token",type:u?"text":"password",value:r,onChange:H=>a(H.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),i.jsx("button",{onClick:()=>d(!u),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:u?"隐藏":"显示",children:u?i.jsx(HN,{className:"h-4 w-4 text-muted-foreground"}):i.jsx(ao,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&i.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),i.jsx("div",{className:"space-y-1.5",children:k.rules.map(H=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[H.passed?i.jsx(Cu,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):i.jsx(Gq,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),i.jsx("span",{className:ue(H.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:H.label})]},H.id))}),k.isValid&&i.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:i.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[i.jsx(nl,{className:"h-4 w-4"}),i.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),i.jsx(fe,{onClick:$,disabled:f||!k.isValid||!r,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),i.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[i.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),i.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),i.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),i.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),i.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),i.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),i.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function qxe(){const e=oa(),{toast:t}=mr(),[n,r]=y.useState(!1),a=async()=>{r(!0);try{const o=localStorage.getItem("access-token"),l=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${o}`}}),u=await l.json();l.ok&&u.success?(t({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{e({to:"/setup"})},1e3)):t({title:"重置失败",description:u.message||"无法重置配置状态",variant:"destructive"})}catch(o){console.error("重置配置状态错误:",o),t({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return i.jsx("div",{className:"space-y-4 sm:space-y-6",children:i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),i.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[i.jsx("div",{className:"space-y-2",children:i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsxs(fe,{variant:"outline",disabled:n,className:"gap-2",children:[i.jsx(Jve,{className:ue("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认重新配置"}),i.jsx(jn,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:a,children:"确认重置"})]})]})]})]})]})})}function Fxe(){return i.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",QC]}),i.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[i.jsxs("p",{children:["版本: ",ZC]}),i.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",i.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"React 19.2.0"}),i.jsx("li",{children:"TypeScript 5.7.2"}),i.jsx("li",{children:"Vite 6.0.7"}),i.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"shadcn/ui"}),i.jsx("li",{children:"Radix UI"}),i.jsx("li",{children:"Tailwind CSS 3.4.17"}),i.jsx("li",{children:"Lucide Icons"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"后端"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"Python 3.12+"}),i.jsx("li",{children:"FastAPI"}),i.jsx("li",{children:"Uvicorn"}),i.jsx("li",{children:"WebSocket"})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),i.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[i.jsx("li",{children:"Bun / npm"}),i.jsx("li",{children:"ESLint 9.17.0"}),i.jsx("li",{children:"PostCSS"})]})]})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),i.jsx(Kt,{className:"h-[300px] sm:h-[400px]",children:i.jsxs("div",{className:"space-y-4 pr-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"React",description:"用户界面构建库",license:"MIT"}),i.jsx(Qt,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),i.jsx(Qt,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),i.jsx(Qt,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),i.jsx(Qt,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),i.jsx(Qt,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),i.jsx(Qt,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),i.jsx(Qt,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),i.jsx(Qt,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),i.jsx(Qt,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),i.jsx(Qt,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),i.jsx(Qt,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),i.jsx(Qt,{name:"Pydantic",description:"数据验证库",license:"MIT"}),i.jsx(Qt,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),i.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[i.jsx(Qt,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),i.jsx(Qt,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),i.jsx(Qt,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),i.jsx(Qt,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[i.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:i.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[i.jsx("div",{className:"flex-shrink-0 mt-0.5",children:i.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:i.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Qt({name:e,description:t,license:n}){return i.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-foreground truncate",children:e}),i.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:t})]}),i.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:n})]})}function QS({value:e,current:t,onChange:n,label:r,description:a}){const o=t===e;return i.jsxs("button",{onClick:()=>n(e),className:ue("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&i.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),i.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:a})]}),i.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[e==="light"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),i.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function ba({value:e,current:t,onChange:n,label:r,colorClass:a}){const o=t===e;return i.jsxs("button",{onClick:()=>n(e),className:ue("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&i.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),i.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[i.jsx("div",{className:ue("h-8 w-8 sm:h-10 sm:w-10 rounded-full",a)}),i.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class Uxe{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,r){return t[0]*n+t[1]*r}mix(t,n,r){return(1-r)*t+r*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const r=Math.floor(t)&255,a=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const o=this.fade(t),l=this.fade(n),u=this.perm[r]+a,d=this.perm[u],f=this.perm[u+1],m=this.perm[r+1]+a,p=this.perm[m],g=this.perm[m+1];return this.mix(this.mix(this.dot(this.grad3[d%12],t,n),this.dot(this.grad3[p%12],t-1,n),o),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[g%12],t-1,n-1),o),l)}}function Hxe(){const e=y.useRef(null),t=y.useRef(null),n=y.useRef(void 0),r=y.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new Uxe(Math.random()),bounding:null});return y.useEffect(()=>{const a=t.current,o=e.current;if(!a||!o)return;const l=r.current,u=()=>{const b=a.getBoundingClientRect();l.bounding=b,o.style.width=`${b.width}px`,o.style.height=`${b.height}px`},d=()=>{if(!l.bounding)return;const{width:b,height:w}=l.bounding;l.lines=[],l.paths.forEach($=>$.remove()),l.paths=[];const N=10,O=32,C=b+200,A=w+30,E=Math.ceil(C/N),k=Math.ceil(A/O),T=(b-N*E)/2,M=(w-O*k)/2;for(let $=0;$<=E;$++){const z=[];for(let U=0;U<=k;U++){const V={x:T+N*$,y:M+O*U,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};z.push(V)}const D=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild(D),l.paths.push(D),l.lines.push(z)}},f=b=>{const{lines:w,mouse:N,noise:O}=l;w.forEach(C=>{C.forEach(A=>{const E=O.perlin2((A.x+b*.0125)*.002,(A.y+b*.005)*.0015)*12;A.wave.x=Math.cos(E)*32,A.wave.y=Math.sin(E)*16;const k=A.x-N.sx,T=A.y-N.sy,M=Math.hypot(k,T),$=Math.max(175,N.vs);if(M<$){const z=1-M/$,D=Math.cos(M*.001)*z;A.cursor.vx+=Math.cos(N.a)*D*$*N.vs*65e-5,A.cursor.vy+=Math.sin(N.a)*D*$*N.vs*65e-5}A.cursor.vx+=(0-A.cursor.x)*.005,A.cursor.vy+=(0-A.cursor.y)*.005,A.cursor.vx*=.925,A.cursor.vy*=.925,A.cursor.x+=A.cursor.vx*2,A.cursor.y+=A.cursor.vy*2,A.cursor.x=Math.min(100,Math.max(-100,A.cursor.x)),A.cursor.y=Math.min(100,Math.max(-100,A.cursor.y))})})},m=(b,w=!0)=>{const N={x:b.x+b.wave.x+(w?b.cursor.x:0),y:b.y+b.wave.y+(w?b.cursor.y:0)};return N.x=Math.round(N.x*10)/10,N.y=Math.round(N.y*10)/10,N},p=()=>{const{lines:b,paths:w}=l;b.forEach((N,O)=>{let C=m(N[0],!1),A=`M ${C.x} ${C.y}`;N.forEach((E,k)=>{const T=k===N.length-1;C=m(E,!T),A+=`L ${C.x} ${C.y}`}),w[O].setAttribute("d",A)})},g=b=>{const{mouse:w}=l;w.sx+=(w.x-w.sx)*.1,w.sy+=(w.y-w.sy)*.1;const N=w.x-w.lx,O=w.y-w.ly,C=Math.hypot(N,O);w.v=C,w.vs+=(C-w.vs)*.1,w.vs=Math.min(100,w.vs),w.lx=w.x,w.ly=w.y,w.a=Math.atan2(O,N),a&&(a.style.setProperty("--x",`${w.sx}px`),a.style.setProperty("--y",`${w.sy}px`)),f(b),p(),n.current=requestAnimationFrame(g)},x=b=>{if(!l.bounding)return;const{mouse:w}=l;w.x=b.pageX-l.bounding.left,w.y=b.pageY-l.bounding.top+window.scrollY,w.set||(w.sx=w.x,w.sy=w.y,w.lx=w.x,w.ly=w.y,w.set=!0)},j=()=>{u(),d()};return u(),d(),window.addEventListener("resize",j),window.addEventListener("mousemove",x),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",x),n.current&&cancelAnimationFrame(n.current)}},[]),i.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[i.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),i.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:i.jsx("style",{children:` path { fill: none; stroke: hsl(var(--primary) / 0.20); stroke-width: 1px; } `})})]})}function Wxe(){const e=oa();y.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function c8(){return!!localStorage.getItem("access-token")}function Vxe(){const[e,t]=y.useState(""),[n,r]=y.useState(!1),[a,o]=y.useState(""),l=oa(),{enableWavesBackground:u,setEnableWavesBackground:d}=nF(),{theme:f,setTheme:m}=XC();y.useEffect(()=>{c8()&&l({to:"/"})},[l]);const g=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,x=()=>{m(g==="dark"?"light":"dark")},j=async b=>{if(b.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}r(!0);try{const w=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),N=await w.json();if(w.ok&&N.valid){localStorage.setItem("access-token",e.trim());const O=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${e.trim()}`}}),C=await O.json();O.ok&&C.is_first_setup?l({to:"/setup"}):l({to:"/"})}else o(N.message||"Token 验证失败,请检查后重试")}catch(w){console.error("Token 验证错误:",w),o("连接服务器失败,请检查网络连接")}finally{r(!1)}};return i.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[u&&i.jsx(Hxe,{}),i.jsxs(dt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[i.jsx("button",{onClick:x,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?i.jsx(YN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):i.jsx(GN,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),i.jsxs(Vt,{className:"space-y-4 text-center",children:[i.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:i.jsx(B3,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Gt,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),i.jsx(er,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),i.jsx(cn,{children:i.jsxs("form",{onSubmit:j,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),i.jsxs("div",{className:"relative",children:[i.jsx(Dve,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),i.jsx(Ne,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:b=>t(b.target.value),className:ue("pl-10",a&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),a&&i.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[i.jsx(xg,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),i.jsx("span",{children:a})]}),i.jsx(fe,{type:"submit",className:"w-full",disabled:n,children:n?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),i.jsxs(nr,{children:[i.jsx(qF,{asChild:!0,children:i.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[i.jsx(dve,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),i.jsxs(Hn,{className:"sm:max-w-md",children:[i.jsxs(Wn,{children:[i.jsxs(Vn,{className:"flex items-center gap-2",children:[i.jsx(B3,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),i.jsx(dr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(xge,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),i.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[i.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),i.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),i.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(VC,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),i.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:i.jsx("code",{className:"text-primary",children:"data/webui.json"})}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",i.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),i.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx(xg,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),i.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[i.jsx("p",{className:"font-semibold",children:"安全提示"}),i.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[i.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),i.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[i.jsx(uh,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsxs(wn,{className:"flex items-center gap-2",children:[i.jsx(uh,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),i.jsx(jn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),i.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>d(!1),children:"关闭动画"})]})]})]})]})})]}),i.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:i.jsx("p",{children:nye})})]})}function Gxe(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l);u.displayName=o+"Context";const d=n.length;n=[...n,l];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||u,w=y.useMemo(()=>j,Object.values(j));return i.jsx(b.Provider,{value:w,children:x})};f.displayName=o+"Provider";function m(p,g){const x=g?.[e]?.[d]||u,j=y.useContext(x);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{const o=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,Yxe(a,...t)]}function Yxe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Kxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],u8=Kxe.reduce((e,t)=>{const n=Bh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),sE="Progress",lE=100,[Xxe]=Gxe(sE),[Zxe,Qxe]=Xxe(sE),d8=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:o=Jxe,...l}=e;(a||a===0)&&!aL(a)&&console.error(ebe(`${a}`,"Progress"));const u=aL(a)?a:lE;r!==null&&!iL(r,u)&&console.error(tbe(`${r}`,"Progress"));const d=iL(r,u)?r:null,f=Ng(d)?o(d,u):void 0;return i.jsx(Zxe,{scope:n,value:d,max:u,children:i.jsx(u8.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Ng(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":m8(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});d8.displayName=sE;var f8="ProgressIndicator",h8=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Qxe(f8,n);return i.jsx(u8.div,{"data-state":m8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});h8.displayName=f8;function Jxe(e,t){return`${Math.round(e/t*100)}%`}function m8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ng(e){return typeof e=="number"}function aL(e){return Ng(e)&&!isNaN(e)&&e>0}function iL(e,t){return Ng(e)&&!isNaN(e)&&e<=t&&e>=0}function ebe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${lE}\`.`}function tbe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${lE} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var p8=d8,nbe=h8;const cE=y.forwardRef(({className:e,value:t,...n},r)=>i.jsx(p8,{ref:r,className:ue("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:i.jsx(nbe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));cE.displayName=p8.displayName;const qt=y.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:ue("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));qt.displayName="Textarea";var rbe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],abe=rbe.reduce((e,t)=>{const n=Bh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ibe="Separator",oL="horizontal",obe=["horizontal","vertical"],v8=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=oL,...a}=e,o=sbe(r)?r:oL,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(abe.div,{"data-orientation":o,...u,...a,ref:t})});v8.displayName=ibe;function sbe(e){return obe.includes(e)}var g8=v8;const fh=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>i.jsx(g8,{ref:a,decorative:n,orientation:t,className:ue("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));fh.displayName=g8.displayName;const lbe=zh("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function tn({className:e,variant:t,...n}){return i.jsx("div",{className:ue(lbe({variant:t}),e),...n})}function cbe({config:e,onChange:t}){const n=a=>{a.trim()&&!e.alias_names.includes(a.trim())&&t({...e,alias_names:[...e.alias_names,a.trim()]})},r=a=>{t({...e,alias_names:e.alias_names.filter((o,l)=>l!==a)})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"qq_account",children:"QQ账号 *"}),i.jsx(Ne,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:e.qq_account||"",onChange:a=>t({...e,qq_account:Number(a.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"nickname",children:"昵称 *"}),i.jsx(Ne,{id:"nickname",placeholder:"请输入机器人的昵称",value:e.nickname,onChange:a=>t({...e,nickname:a.target.value})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{children:"别名"}),i.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:e.alias_names.map((a,o)=>i.jsxs(tn,{variant:"secondary",className:"gap-1",children:[a,i.jsx("button",{type:"button",onClick:()=>r(o),className:"ml-1 hover:text-destructive",children:i.jsx(Lh,{className:"h-3 w-3"})})]},o))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:a=>{a.key==="Enter"&&(n(a.target.value),a.target.value="")}}),i.jsx(fe,{type:"button",variant:"outline",onClick:()=>{const a=document.getElementById("alias_input");a&&(n(a.value),a.value="")},children:"添加"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function ube({config:e,onChange:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"personality",children:"人格特征 *"}),i.jsx(qt,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:e.personality,onChange:n=>t({...e,personality:n.target.value}),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"reply_style",children:"表达风格 *"}),i.jsx(qt,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:e.reply_style,onChange:n=>t({...e,reply_style:n.target.value}),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"interest",children:"兴趣 *"}),i.jsx(qt,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:e.interest,onChange:n=>t({...e,interest:n.target.value}),rows:2}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),i.jsx(fh,{}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"plan_style",children:"群聊说话规则 *"}),i.jsx(qt,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:e.plan_style,onChange:n=>t({...e,plan_style:n.target.value}),rows:4}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),i.jsx(qt,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:e.private_plan_style,onChange:n=>t({...e,private_plan_style:n.target.value}),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function dbe({config:e,onChange:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{htmlFor:"emoji_chance",children:"表情包激活概率"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[(e.emoji_chance*100).toFixed(0),"%"]})]}),i.jsx(Ne,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:e.emoji_chance,onChange:n=>t({...e,emoji_chance:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"max_reg_num",children:"最大表情包数量"}),i.jsx(Ne,{id:"max_reg_num",type:"number",min:"1",max:"200",value:e.max_reg_num,onChange:n=>t({...e,max_reg_num:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"do_replace",children:"达到最大数量时替换"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),i.jsx(at,{id:"do_replace",checked:e.do_replace,onCheckedChange:n=>t({...e,do_replace:n})})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),i.jsx(Ne,{id:"check_interval",type:"number",min:"1",max:"120",value:e.check_interval,onChange:n=>t({...e,check_interval:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),i.jsx(fh,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"steal_emoji",children:"偷取表情包"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),i.jsx(at,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:n=>t({...e,steal_emoji:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"content_filtration",children:"启用表情包过滤"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),i.jsx(at,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:n=>t({...e,content_filtration:n})})]}),e.content_filtration&&i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"filtration_prompt",children:"过滤要求"}),i.jsx(Ne,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:e.filtration_prompt,onChange:n=>t({...e,filtration_prompt:n.target.value})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function fbe({config:e,onChange:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"enable_tool",children:"启用工具系统"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),i.jsx(at,{id:"enable_tool",checked:e.enable_tool,onCheckedChange:n=>t({...e,enable_tool:n})})]}),i.jsx(fh,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"enable_mood",children:"启用情绪系统"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),i.jsx(at,{id:"enable_mood",checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})})]}),e.enable_mood&&i.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),i.jsx(Ne,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:e.mood_update_threshold||1,onChange:n=>t({...e,mood_update_threshold:Number(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(J,{htmlFor:"emotion_style",children:"情感特征"}),i.jsx(qt,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:e.emotion_style||"",onChange:n=>t({...e,emotion_style:n.target.value}),rows:2}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),i.jsx(fh,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(J,{htmlFor:"all_global",children:"启用全局黑话模式"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),i.jsx(at,{id:"all_global",checked:e.all_global,onCheckedChange:n=>t({...e,all_global:n})})]})]})}async function Ze(e,t){const n=await fetch(e,t);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function st(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function hbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取Bot配置失败");const n=(await e.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function mbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取人格配置失败");const n=(await e.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function pbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取表情包配置失败");const n=(await e.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function vbe(){const e=await Ze("/api/webui/config/bot",{method:"GET",headers:st()});if(!e.ok)throw new Error("读取其他配置失败");const n=(await e.json()).config,r=n.tool||{},a=n.mood||{},o=n.jargon||{};return{enable_tool:r.enable_tool??!0,enable_mood:a.enable_mood??!1,mood_update_threshold:a.mood_update_threshold,emotion_style:a.emotion_style,all_global:o.all_global??!0}}async function gbe(e){const t=await Ze("/api/webui/config/bot/section/bot",{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await t.json()}async function ybe(e){const t=await Ze("/api/webui/config/bot/section/personality",{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存人格配置失败")}return await t.json()}async function xbe(e){const t=await Ze("/api/webui/config/bot/section/emoji",{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存表情包配置失败")}return await t.json()}async function bbe(e){const t=[];t.push(Ze("/api/webui/config/bot/section/tool",{method:"POST",headers:st(),body:JSON.stringify({enable_tool:e.enable_tool})})),t.push(Ze("/api/webui/config/bot/section/jargon",{method:"POST",headers:st(),body:JSON.stringify({all_global:e.all_global})}));const n={enable_mood:e.enable_mood};e.enable_mood&&(n.mood_update_threshold=e.mood_update_threshold||1,n.emotion_style=e.emotion_style||""),t.push(Ze("/api/webui/config/bot/section/mood",{method:"POST",headers:st(),body:JSON.stringify(n)}));const r=await Promise.all(t);for(const a of r)if(!a.ok){const o=await a.json();throw new Error(o.detail||"保存其他配置失败")}return{success:!0}}async function sL(){const e=localStorage.getItem("access-token"),t=await Ze("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){const n=await t.json();throw new Error(n.message||"标记配置完成失败")}return await t.json()}function wbe(){const e=oa(),{toast:t}=mr(),[n,r]=y.useState(0),[a,o]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!0),[m,p]=y.useState({qq_account:0,nickname:"",alias_names:[]}),[g,x]=y.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 2.如果相同的内容已经被执行,请不要重复执行 3.请控制你的发言频率,不要太过频繁的发言 4.如果有人对你感到厌烦,请减少回复 5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 2.如果相同的内容已经被执行,请不要重复执行 3.某句话如果已经被回复过,不要重复回复`}),[j,b]=y.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[w,N]=y.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),O=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:Xpe},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Qq},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:YC},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Hc},{id:"complete",title:"完成设置",description:"后续配置提示",icon:uh}],C=(n+1)/O.length*100;y.useEffect(()=>{(async()=>{try{f(!0);const[D,U,V,H]=await Promise.all([hbe(),mbe(),pbe(),vbe()]);p(D),x(U),b(V),N(H)}catch(D){t({title:"加载配置失败",description:D instanceof Error?D.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{f(!1)}})()},[t]);const A=async()=>{u(!0);try{switch(n){case 0:await gbe(m);break;case 1:await ybe(g);break;case 2:await xbe(j);break;case 3:await bbe(w);break}return t({title:"保存成功",description:`${O[n].title}配置已保存`}),!0}catch(z){return t({title:"保存失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"}),!1}finally{u(!1)}},E=async()=>{await A()&&n{n>0&&r(n-1)},T=async()=>{o(!0);try{if(!await A()){o(!1);return}await sL(),t({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{e({to:"/"})},500)}catch(z){t({title:"完成失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}finally{o(!1)}},M=async()=>{try{await sL(),e({to:"/"})}catch(z){t({title:"跳过失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}},$=()=>{switch(n){case 0:return i.jsx(cbe,{config:m,onChange:p});case 1:return i.jsx(ube,{config:g,onChange:x});case 2:return i.jsx(dbe,{config:j,onChange:b});case 3:return i.jsx(fbe,{config:w,onChange:N});case 4:return i.jsxs("div",{className:"space-y-6 text-center py-8",children:[i.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:i.jsx(uh,{className:"h-8 w-8 text-primary",strokeWidth:2})}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),i.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-0.5",children:i.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-0.5",children:i.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"添加模型"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-0.5",children:i.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"配置模型任务"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return i.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[i.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[i.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),i.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),d?i.jsxs("div",{className:"relative z-10 text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:i.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),i.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),i.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[i.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:i.jsx(mge,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),i.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),i.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",QC," 的初始配置"]})]}),i.jsxs("div",{className:"mb-6 md:mb-8",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[i.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",O.length]}),i.jsxs("span",{className:"font-medium text-primary",children:[Math.round(C),"%"]})]}),i.jsx(cE,{value:C,className:"h-2"})]}),i.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:O.map((z,D)=>{const U=z.icon;return i.jsxs("div",{className:ue("flex flex-1 flex-col items-center gap-1 md:gap-2",De({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[i.jsx(jg,{className:"h-4 w-4"}),"返回首页"]}),i.jsxs(fe,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[i.jsx(Hq,{className:"h-4 w-4"}),"返回上一页"]})]}),i.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var x8=["PageUp","PageDown"],b8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],w8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Vu="Slider",[ZN,jbe,Sbe]=Nh(Vu),[j8]=hr(Vu,[Sbe]),[_be,Ly]=j8(Vu),S8=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:j,...b}=e,w=y.useRef(new Set),N=y.useRef(0),C=l==="horizontal"?Nbe:Obe,[A=[],E]=Na({prop:m,defaultProp:f,onChange:D=>{[...w.current][N.current]?.focus(),p(D)}}),k=y.useRef(A);function T(D){const U=kbe(A,D);z(D,U)}function M(D){z(D,N.current)}function $(){const D=k.current[N.current];A[N.current]!==D&&g(A)}function z(D,U,{commit:V}={commit:!1}){const H=Dbe(o),G=$be(Math.round((D-r)/o)*o+r,H),L=Cf(G,[r,a]);E((R=[])=>{const F=Abe(R,L,U);if(Rbe(F,d*o)){N.current=F.indexOf(L);const K=String(F)!==String(R);return K&&V&&g(F),K?F:R}else return R})}return i.jsx(_be,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:a,valueIndexToChangeRef:N,thumbs:w.current,values:A,orientation:l,form:j,children:i.jsx(ZN.Provider,{scope:e.__scopeSlider,children:i.jsx(ZN.Slot,{scope:e.__scopeSlider,children:i.jsx(C,{"aria-disabled":u,"data-disabled":u?"":void 0,...b,ref:t,onPointerDown:Se(b.onPointerDown,()=>{u||(k.current=A)}),min:r,max:a,inverted:x,onSlideStart:u?void 0:T,onSlideMove:u?void 0:M,onSlideEnd:u?void 0:$,onHomeKeyDown:()=>!u&&z(r,0,{commit:!0}),onEndKeyDown:()=>!u&&z(a,A.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:U})=>{if(!u){const G=x8.includes(D.key)||D.shiftKey&&b8.includes(D.key)?10:1,L=N.current,R=A[L],F=o*G*U;z(R+F,L,{commit:!0})}}})})})})});S8.displayName=Vu;var[_8,N8]=j8(Vu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Nbe=y.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...m}=e,[p,g]=y.useState(null),x=qe(t,C=>g(C)),j=y.useRef(void 0),b=Iu(a),w=b==="ltr",N=w&&!o||!w&&o;function O(C){const A=j.current||p.getBoundingClientRect(),E=[0,A.width],T=uE(E,N?[n,r]:[r,n]);return j.current=A,T(C-A.left)}return i.jsx(_8,{scope:e.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:i.jsx(O8,{dir:b,"data-orientation":"horizontal",...m,ref:x,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const A=O(C.clientX);l?.(A)},onSlideMove:C=>{const A=O(C.clientX);u?.(A)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:C=>{const E=w8[N?"from-left":"from-right"].includes(C.key);f?.({event:C,direction:E?-1:1})}})})}),Obe=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,m=y.useRef(null),p=qe(t,m),g=y.useRef(void 0),x=!a;function j(b){const w=g.current||m.current.getBoundingClientRect(),N=[0,w.height],C=uE(N,x?[r,n]:[n,r]);return g.current=w,C(b-w.top)}return i.jsx(_8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:i.jsx(O8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const w=j(b.clientY);o?.(w)},onSlideMove:b=>{const w=j(b.clientY);l?.(w)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:b=>{const N=w8[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:N?-1:1})}})})}),O8=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,m=Ly(Vu,n);return i.jsx(Pe.span,{...f,ref:t,onKeyDown:Se(e.onKeyDown,p=>{p.key==="Home"?(l(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):x8.concat(b8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Se(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Se(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Se(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),o(p))})})}),C8="SliderTrack",E8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Ly(C8,n);return i.jsx(Pe.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});E8.displayName=C8;var QN="SliderRange",A8=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Ly(QN,n),o=N8(QN,n),l=y.useRef(null),u=qe(t,l),d=a.values.length,f=a.values.map(g=>M8(g,a.min,a.max)),m=d>1?Math.min(...f):0,p=100-Math.max(...f);return i.jsx(Pe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:u,style:{...e.style,[o.startEdge]:m+"%",[o.endEdge]:p+"%"}})});A8.displayName=QN;var JN="SliderThumb",T8=y.forwardRef((e,t)=>{const n=jbe(e.__scopeSlider),[r,a]=y.useState(null),o=qe(t,u=>a(u)),l=y.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return i.jsx(Cbe,{...e,ref:o,index:l})}),Cbe=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...o}=e,l=Ly(JN,n),u=N8(JN,n),[d,f]=y.useState(null),m=qe(t,O=>f(O)),p=d?l.form||!!d.closest("form"):!0,g=Ty(d),x=l.values[r],j=x===void 0?0:M8(x,l.min,l.max),b=Tbe(r,l.values.length),w=g?.[u.size],N=w?Mbe(w,j,u.direction):0;return y.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${j}% + ${N}px)`},children:[i.jsx(ZN.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(Pe.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":l.min,"aria-valuenow":x,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:m,style:x===void 0?{display:"none"}:e.style,onFocus:Se(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),p&&i.jsx(k8,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:x},r)]})});T8.displayName=JN;var Ebe="RadioBubbleInput",k8=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=y.useRef(null),o=qe(a,r),l=Ay(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("input",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),i.jsx(Pe.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});k8.displayName=Ebe;function Abe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,o)=>a-o)}function M8(e,t,n){const o=100/(n-t)*(e-t);return Cf(o,[0,100])}function Tbe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function kbe(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function Mbe(e,t,n){const r=e/2,o=uE([0,50],[0,r]);return(r-o(t)*n)*n}function Pbe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Rbe(e,t){if(t>0){const n=Pbe(e);return Math.min(...n)>=t}return!0}function uE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Dbe(e){return(String(e).split(".")[1]||"").length}function $be(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var P8=S8,Ibe=E8,Lbe=A8,Bbe=T8;const dE=y.forwardRef(({className:e,...t},n)=>i.jsxs(P8,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(Ibe,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:i.jsx(Lbe,{className:"absolute h-full bg-primary"})}),i.jsx(Bbe,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));dE.displayName=P8.displayName;const zbe=["top","right","bottom","left"],Qo=Math.min,Jr=Math.max,Og=Math.round,Hp=Math.floor,hi=e=>({x:e,y:e}),qbe={left:"right",right:"left",bottom:"top",top:"bottom"},Fbe={start:"end",end:"start"};function eO(e,t,n){return Jr(e,Qo(t,n))}function io(e,t){return typeof e=="function"?e(t):e}function oo(e){return e.split("-")[0]}function Gu(e){return e.split("-")[1]}function fE(e){return e==="x"?"y":"x"}function hE(e){return e==="y"?"height":"width"}const Ube=new Set(["top","bottom"]);function li(e){return Ube.has(oo(e))?"y":"x"}function mE(e){return fE(li(e))}function Hbe(e,t,n){n===void 0&&(n=!1);const r=Gu(e),a=mE(e),o=hE(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Cg(l)),[l,Cg(l)]}function Wbe(e){const t=Cg(e);return[tO(e),t,tO(t)]}function tO(e){return e.replace(/start|end/g,t=>Fbe[t])}const lL=["left","right"],cL=["right","left"],Vbe=["top","bottom"],Gbe=["bottom","top"];function Ybe(e,t,n){switch(e){case"top":case"bottom":return n?t?cL:lL:t?lL:cL;case"left":case"right":return t?Vbe:Gbe;default:return[]}}function Kbe(e,t,n,r){const a=Gu(e);let o=Ybe(oo(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(tO)))),o}function Cg(e){return e.replace(/left|right|bottom|top/g,t=>qbe[t])}function Xbe(e){return{top:0,right:0,bottom:0,left:0,...e}}function R8(e){return typeof e!="number"?Xbe(e):{top:e,right:e,bottom:e,left:e}}function Eg(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function uL(e,t,n){let{reference:r,floating:a}=e;const o=li(t),l=mE(t),u=hE(l),d=oo(t),f=o==="y",m=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-a.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(Gu(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const Zbe=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:p}=uL(f,r,d),g=r,x={},j=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:m=0}=io(e,t)||{};if(f==null)return{};const p=R8(m),g={x:n,y:r},x=mE(a),j=hE(x),b=await l.getDimensions(f),w=x==="y",N=w?"top":"left",O=w?"bottom":"right",C=w?"clientHeight":"clientWidth",A=o.reference[j]+o.reference[x]-g[x]-o.floating[j],E=g[x]-o.reference[x],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let T=k?k[C]:0;(!T||!await(l.isElement==null?void 0:l.isElement(k)))&&(T=u.floating[C]||o.floating[j]);const M=A/2-E/2,$=T/2-b[j]/2-1,z=Qo(p[N],$),D=Qo(p[O],$),U=z,V=T-b[j]-D,H=T/2-b[j]/2+M,G=eO(U,H,V),L=!d.arrow&&Gu(a)!=null&&H!==G&&o.reference[j]/2-(HH<=0)){var D,U;const H=(((D=o.flip)==null?void 0:D.index)||0)+1,G=T[H];if(G&&(!(p==="alignment"?O!==li(G):!1)||z.every(F=>li(F.placement)===O?F.overflows[0]>0:!0)))return{data:{index:H,overflows:z},reset:{placement:G}};let L=(U=z.filter(R=>R.overflows[0]<=0).sort((R,F)=>R.overflows[1]-F.overflows[1])[0])==null?void 0:U.placement;if(!L)switch(x){case"bestFit":{var V;const R=(V=z.filter(F=>{if(k){const K=li(F.placement);return K===O||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,te)=>K+te,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:V[0];R&&(L=R);break}case"initialPlacement":L=u;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function dL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fL(e){return zbe.some(t=>e[t]>=0)}const e0e=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=io(e,t);switch(r){case"referenceHidden":{const o=await hh(t,{...a,elementContext:"reference"}),l=dL(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:fL(l)}}}case"escaped":{const o=await hh(t,{...a,altBoundary:!0}),l=dL(o,n.floating);return{data:{escapedOffsets:l,escaped:fL(l)}}}default:return{}}}}},D8=new Set(["left","top"]);async function t0e(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=oo(n),u=Gu(n),d=li(n)==="y",f=D8.has(l)?-1:1,m=o&&d?-1:1,p=io(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof j=="number"&&(x=u==="end"?j*-1:j),d?{x:x*m,y:g*f}:{x:g*f,y:x*m}}const n0e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:u}=t,d=await t0e(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:l}}}}},r0e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:N,y:O}=w;return{x:N,y:O}}},...d}=io(e,t),f={x:n,y:r},m=await hh(t,d),p=li(oo(a)),g=fE(p);let x=f[g],j=f[p];if(o){const w=g==="y"?"top":"left",N=g==="y"?"bottom":"right",O=x+m[w],C=x-m[N];x=eO(O,x,C)}if(l){const w=p==="y"?"top":"left",N=p==="y"?"bottom":"right",O=j+m[w],C=j-m[N];j=eO(O,j,C)}const b=u.fn({...t,[g]:x,[p]:j});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:o,[p]:l}}}}}},a0e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=io(e,t),m={x:n,y:r},p=li(a),g=fE(p);let x=m[g],j=m[p];const b=io(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const C=g==="y"?"height":"width",A=o.reference[g]-o.floating[C]+w.mainAxis,E=o.reference[g]+o.reference[C]-w.mainAxis;xE&&(x=E)}if(f){var N,O;const C=g==="y"?"width":"height",A=D8.has(oo(a)),E=o.reference[p]-o.floating[C]+(A&&((N=l.offset)==null?void 0:N[p])||0)+(A?0:w.crossAxis),k=o.reference[p]+o.reference[C]+(A?0:((O=l.offset)==null?void 0:O[p])||0)-(A?w.crossAxis:0);jk&&(j=k)}return{[g]:x,[p]:j}}}},i0e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...f}=io(e,t),m=await hh(t,f),p=oo(a),g=Gu(a),x=li(a)==="y",{width:j,height:b}=o.floating;let w,N;p==="top"||p==="bottom"?(w=p,N=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(N=p,w=g==="end"?"top":"bottom");const O=b-m.top-m.bottom,C=j-m.left-m.right,A=Qo(b-m[w],O),E=Qo(j-m[N],C),k=!t.middlewareData.shift;let T=A,M=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=O),k&&!g){const z=Jr(m.left,0),D=Jr(m.right,0),U=Jr(m.top,0),V=Jr(m.bottom,0);x?M=j-2*(z!==0||D!==0?z+D:Jr(m.left,m.right)):T=b-2*(U!==0||V!==0?U+V:Jr(m.top,m.bottom))}await d({...t,availableWidth:M,availableHeight:T});const $=await l.getDimensions(u.floating);return j!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function By(){return typeof window<"u"}function Yu(e){return $8(e)?(e.nodeName||"").toLowerCase():"#document"}function aa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wi(e){var t;return(t=($8(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $8(e){return By()?e instanceof Node||e instanceof aa(e).Node:!1}function Ua(e){return By()?e instanceof Element||e instanceof aa(e).Element:!1}function gi(e){return By()?e instanceof HTMLElement||e instanceof aa(e).HTMLElement:!1}function hL(e){return!By()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof aa(e).ShadowRoot}const o0e=new Set(["inline","contents"]);function Uh(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!o0e.has(a)}const s0e=new Set(["table","td","th"]);function l0e(e){return s0e.has(Yu(e))}const c0e=[":popover-open",":modal"];function zy(e){return c0e.some(t=>{try{return e.matches(t)}catch{return!1}})}const u0e=["transform","translate","scale","rotate","perspective"],d0e=["transform","translate","scale","rotate","perspective","filter"],f0e=["paint","layout","strict","content"];function pE(e){const t=vE(),n=Ua(e)?Ha(e):e;return u0e.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||d0e.some(r=>(n.willChange||"").includes(r))||f0e.some(r=>(n.contain||"").includes(r))}function h0e(e){let t=Jo(e);for(;gi(t)&&!Au(t);){if(pE(t))return t;if(zy(t))return null;t=Jo(t)}return null}function vE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const m0e=new Set(["html","body","#document"]);function Au(e){return m0e.has(Yu(e))}function Ha(e){return aa(e).getComputedStyle(e)}function qy(e){return Ua(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jo(e){if(Yu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hL(e)&&e.host||wi(e);return hL(t)?t.host:t}function I8(e){const t=Jo(e);return Au(t)?e.ownerDocument?e.ownerDocument.body:e.body:gi(t)&&Uh(t)?t:I8(t)}function mh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=I8(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=aa(a);if(o){const u=nO(l);return t.concat(l,l.visualViewport||[],Uh(a)?a:[],u&&n?mh(u):[])}return t.concat(a,mh(a,[],n))}function nO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function L8(e){const t=Ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=gi(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Og(n)!==o||Og(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function gE(e){return Ua(e)?e:e.contextElement}function Yc(e){const t=gE(e);if(!gi(t))return hi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=L8(t);let l=(o?Og(n.width):n.width)/r,u=(o?Og(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const p0e=hi(0);function B8(e){const t=aa(e);return!vE()||!t.visualViewport?p0e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function v0e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==aa(e)?!1:t}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=gE(e);let l=hi(1);t&&(r?Ua(r)&&(l=Yc(r)):l=Yc(e));const u=v0e(o,n,r)?B8(o):hi(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,m=a.width/l.x,p=a.height/l.y;if(o){const g=aa(o),x=r&&Ua(r)?aa(r):r;let j=g,b=nO(j);for(;b&&r&&x!==j;){const w=Yc(b),N=b.getBoundingClientRect(),O=Ha(b),C=N.left+(b.clientLeft+parseFloat(O.paddingLeft))*w.x,A=N.top+(b.clientTop+parseFloat(O.paddingTop))*w.y;d*=w.x,f*=w.y,m*=w.x,p*=w.y,d+=C,f+=A,j=aa(b),b=nO(j)}}return Eg({width:m,height:p,x:d,y:f})}function Fy(e,t){const n=qy(e).scrollLeft;return t?t.left+n:ml(wi(e)).left+n}function z8(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Fy(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function g0e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=wi(r),u=t?zy(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},f=hi(1);const m=hi(0),p=gi(r);if((p||!p&&!o)&&((Yu(r)!=="body"||Uh(l))&&(d=qy(r)),gi(r))){const x=ml(r);f=Yc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const g=l&&!p&&!o?z8(l,d):hi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-d.scrollTop*f.y+m.y+g.y}}function y0e(e){return Array.from(e.getClientRects())}function x0e(e){const t=wi(e),n=qy(e),r=e.ownerDocument.body,a=Jr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Jr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Fy(e);const u=-n.scrollTop;return Ha(r).direction==="rtl"&&(l+=Jr(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:u}}const mL=25;function b0e(e,t){const n=aa(e),r=wi(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){o=a.width,l=a.height;const m=vE();(!m||m&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const f=Fy(r);if(f<=0){const m=r.ownerDocument,p=m.body,g=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=mL&&(o-=j)}else f<=mL&&(o+=f);return{width:o,height:l,x:u,y:d}}const w0e=new Set(["absolute","fixed"]);function j0e(e,t){const n=ml(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=gi(e)?Yc(e):hi(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=a*o.x,f=r*o.y;return{width:l,height:u,x:d,y:f}}function pL(e,t,n){let r;if(t==="viewport")r=b0e(e,n);else if(t==="document")r=x0e(wi(e));else if(Ua(t))r=j0e(t,n);else{const a=B8(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Eg(r)}function q8(e,t){const n=Jo(e);return n===t||!Ua(n)||Au(n)?!1:Ha(n).position==="fixed"||q8(n,t)}function S0e(e,t){const n=t.get(e);if(n)return n;let r=mh(e,[],!1).filter(u=>Ua(u)&&Yu(u)!=="body"),a=null;const o=Ha(e).position==="fixed";let l=o?Jo(e):e;for(;Ua(l)&&!Au(l);){const u=Ha(l),d=pE(l);!d&&u.position==="fixed"&&(a=null),(o?!d&&!a:!d&&u.position==="static"&&!!a&&w0e.has(a.position)||Uh(l)&&!d&&q8(e,l))?r=r.filter(m=>m!==l):a=u,l=Jo(l)}return t.set(e,r),r}function _0e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?zy(t)?[]:S0e(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,m)=>{const p=pL(t,m,a);return f.top=Jr(p.top,f.top),f.right=Qo(p.right,f.right),f.bottom=Qo(p.bottom,f.bottom),f.left=Jr(p.left,f.left),f},pL(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function N0e(e){const{width:t,height:n}=L8(e);return{width:t,height:n}}function O0e(e,t,n){const r=gi(t),a=wi(t),o=n==="fixed",l=ml(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=hi(0);function f(){d.x=Fy(a)}if(r||!r&&!o)if((Yu(t)!=="body"||Uh(a))&&(u=qy(t)),r){const x=ml(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else a&&f();o&&!r&&a&&f();const m=a&&!r&&!o?z8(a,u):hi(0),p=l.left+u.scrollLeft-d.x-m.x,g=l.top+u.scrollTop-d.y-m.y;return{x:p,y:g,width:l.width,height:l.height}}function JS(e){return Ha(e).position==="static"}function vL(e,t){if(!gi(e)||Ha(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wi(e)===n&&(n=n.ownerDocument.body),n}function F8(e,t){const n=aa(e);if(zy(e))return n;if(!gi(e)){let a=Jo(e);for(;a&&!Au(a);){if(Ua(a)&&!JS(a))return a;a=Jo(a)}return n}let r=vL(e,t);for(;r&&l0e(r)&&JS(r);)r=vL(r,t);return r&&Au(r)&&JS(r)&&!pE(r)?n:r||h0e(e)||n}const C0e=async function(e){const t=this.getOffsetParent||F8,n=this.getDimensions,r=await n(e.floating);return{reference:O0e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function E0e(e){return Ha(e).direction==="rtl"}const A0e={convertOffsetParentRelativeRectToViewportRelativeRect:g0e,getDocumentElement:wi,getClippingRect:_0e,getOffsetParent:F8,getElementRects:C0e,getClientRects:y0e,getDimensions:N0e,getScale:Yc,isElement:Ua,isRTL:E0e};function U8(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T0e(e,t){let n=null,r;const a=wi(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:m,top:p,width:g,height:x}=f;if(u||t(),!g||!x)return;const j=Hp(p),b=Hp(a.clientWidth-(m+g)),w=Hp(a.clientHeight-(p+x)),N=Hp(m),C={rootMargin:-j+"px "+-b+"px "+-w+"px "+-N+"px",threshold:Jr(0,Qo(1,d))||1};let A=!0;function E(k){const T=k[0].intersectionRatio;if(T!==d){if(!A)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!U8(f,e.getBoundingClientRect())&&l(),A=!1}try{n=new IntersectionObserver(E,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,C)}n.observe(e)}return l(!0),o}function k0e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=gE(e),m=a||o?[...f?mh(f):[],...mh(t)]:[];m.forEach(N=>{a&&N.addEventListener("scroll",n,{passive:!0}),o&&N.addEventListener("resize",n)});const p=f&&u?T0e(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(N=>{let[O]=N;O&&O.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?ml(e):null;d&&w();function w(){const N=ml(e);b&&!U8(b,N)&&n(),b=N,j=requestAnimationFrame(w)}return n(),()=>{var N;m.forEach(O=>{a&&O.removeEventListener("scroll",n),o&&O.removeEventListener("resize",n)}),p?.(),(N=x)==null||N.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const M0e=n0e,P0e=r0e,R0e=Jbe,D0e=i0e,$0e=e0e,gL=Qbe,I0e=a0e,L0e=(e,t,n)=>{const r=new Map,a={platform:A0e,...n},o={...a.platform,_c:r};return Zbe(e,t,{...a,platform:o})};var B0e=typeof document<"u",z0e=function(){},lv=B0e?y.useLayoutEffect:z0e;function Ag(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,a;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(!Ag(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Ag(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function H8(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yL(e,t){const n=H8(e);return Math.round(t*n)/n}function e_(e){const t=y.useRef(e);return lv(()=>{t.current=e}),t}function q0e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=y.useState(r);Ag(g,r)||x(r);const[j,b]=y.useState(null),[w,N]=y.useState(null),O=y.useCallback(F=>{F!==k.current&&(k.current=F,b(F))},[]),C=y.useCallback(F=>{F!==T.current&&(T.current=F,N(F))},[]),A=o||j,E=l||w,k=y.useRef(null),T=y.useRef(null),M=y.useRef(m),$=d!=null,z=e_(d),D=e_(a),U=e_(f),V=y.useCallback(()=>{if(!k.current||!T.current)return;const F={placement:t,strategy:n,middleware:g};D.current&&(F.platform=D.current),L0e(k.current,T.current,F).then(K=>{const te={...K,isPositioned:U.current!==!1};H.current&&!Ag(M.current,te)&&(M.current=te,yl.flushSync(()=>{p(te)}))})},[g,t,n,D,U]);lv(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const H=y.useRef(!1);lv(()=>(H.current=!0,()=>{H.current=!1}),[]),lv(()=>{if(A&&(k.current=A),E&&(T.current=E),A&&E){if(z.current)return z.current(A,E,V);V()}},[A,E,V,z,$]);const G=y.useMemo(()=>({reference:k,floating:T,setReference:O,setFloating:C}),[O,C]),L=y.useMemo(()=>({reference:A,floating:E}),[A,E]),R=y.useMemo(()=>{const F={position:n,left:0,top:0};if(!L.floating)return F;const K=yL(L.floating,m.x),te=yL(L.floating,m.y);return u?{...F,transform:"translate("+K+"px, "+te+"px)",...H8(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:te}},[n,u,L.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:V,refs:G,elements:L,floatingStyles:R}),[m,V,G,L,R])}const F0e=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gL({element:r.current,padding:a}).fn(n):{}:r?gL({element:r,padding:a}).fn(n):{}}}},U0e=(e,t)=>({...M0e(e),options:[e,t]}),H0e=(e,t)=>({...P0e(e),options:[e,t]}),W0e=(e,t)=>({...I0e(e),options:[e,t]}),V0e=(e,t)=>({...R0e(e),options:[e,t]}),G0e=(e,t)=>({...D0e(e),options:[e,t]}),Y0e=(e,t)=>({...$0e(e),options:[e,t]}),K0e=(e,t)=>({...F0e(e),options:[e,t]});var X0e="Arrow",W8=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return i.jsx(Pe.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});W8.displayName=X0e;var Z0e=W8,yE="Popper",[V8,ls]=hr(yE),[Q0e,G8]=V8(yE),Y8=e=>{const{__scopePopper:t,children:n}=e,[r,a]=y.useState(null);return i.jsx(Q0e,{scope:t,anchor:r,onAnchorChange:a,children:n})};Y8.displayName=yE;var K8="PopperAnchor",X8=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=G8(K8,n),l=y.useRef(null),u=qe(t,l),d=y.useRef(null);return y.useEffect(()=>{const f=d.current;d.current=r?.current||l.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:i.jsx(Pe.div,{...a,ref:u})});X8.displayName=K8;var xE="PopperContent",[J0e,ewe]=V8(xE),Z8=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,w=G8(xE,n),[N,O]=y.useState(null),C=qe(t,ee=>O(ee)),[A,E]=y.useState(null),k=Ty(A),T=k?.width??0,M=k?.height??0,$=r+(o!=="center"?"-"+o:""),z=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},D=Array.isArray(f)?f:[f],U=D.length>0,V={padding:z,boundary:D.filter(nwe),altBoundary:U},{refs:H,floatingStyles:G,placement:L,isPositioned:R,middlewareData:F}=q0e({strategy:"fixed",placement:$,whileElementsMounted:(...ee)=>k0e(...ee,{animationFrame:x==="always"}),elements:{reference:w.anchor},middleware:[U0e({mainAxis:a+M,alignmentAxis:l}),d&&H0e({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?W0e():void 0,...V}),d&&V0e({...V}),G0e({...V,apply:({elements:ee,rects:ae,availableWidth:Z,availableHeight:pe})=>{const{width:je,height:le}=ae.reference,Re=ee.floating.style;Re.setProperty("--radix-popper-available-width",`${Z}px`),Re.setProperty("--radix-popper-available-height",`${pe}px`),Re.setProperty("--radix-popper-anchor-width",`${je}px`),Re.setProperty("--radix-popper-anchor-height",`${le}px`)}}),A&&K0e({element:A,padding:u}),rwe({arrowWidth:T,arrowHeight:M}),g&&Y0e({strategy:"referenceHidden",...V})]}),[K,te]=eU(L),I=nn(j);Un(()=>{R&&I?.()},[R,I]);const B=F.arrow?.x,Y=F.arrow?.y,ne=F.arrow?.centerOffset!==0,[oe,xe]=y.useState();return Un(()=>{N&&xe(window.getComputedStyle(N).zIndex)},[N]),i.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:R?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(J0e,{scope:n,placedSide:K,onArrowChange:E,arrowX:B,arrowY:Y,shouldHideArrow:ne,children:i.jsx(Pe.div,{"data-side":K,"data-align":te,...b,ref:C,style:{...b.style,animation:R?void 0:"none"}})})})});Z8.displayName=xE;var Q8="PopperArrow",twe={top:"bottom",right:"left",bottom:"top",left:"right"},J8=y.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=ewe(Q8,r),l=twe[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(Z0e,{...a,ref:n,style:{...a.style,display:"block"}})})});J8.displayName=Q8;function nwe(e){return e!==null}var rwe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,m]=eU(n),p={start:"0%",center:"50%",end:"100%"}[m],g=(a.arrow?.x??0)+u/2,x=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=l?p:`${g}px`,b=`${-d}px`):f==="top"?(j=l?p:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=l?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=l?p:`${x}px`),{data:{x:j,y:b}}}});function eU(e){const[t,n="center"]=e.split("-");return[t,n]}var Hh=Y8,Wh=X8,Uy=Z8,Hy=J8;function awe(e){const t=iwe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(swe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function iwe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=cwe(a),u=lwe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var owe=Symbol("radix.slottable");function swe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===owe}function lwe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function cwe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uwe="VisuallyHidden",Wy=y.forwardRef((e,t)=>i.jsx(Pe.span,{...e,ref:t,style:{...tU,...e.style}}));Wy.displayName=uwe;var dwe=Wy,fwe=[" ","Enter","ArrowUp","ArrowDown"],hwe=[" ","Enter"],pl="Select",[Vy,Gy,mwe]=Nh(pl),[Ku]=hr(pl,[mwe,ls]),Yy=ls(),[pwe,cs]=Ku(pl),[vwe,gwe]=Ku(pl),nU=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:p,disabled:g,required:x,form:j}=e,b=Yy(t),[w,N]=y.useState(null),[O,C]=y.useState(null),[A,E]=y.useState(!1),k=Iu(f),[T,M]=Na({prop:r,defaultProp:a??!1,onChange:o,caller:pl}),[$,z]=Na({prop:l,defaultProp:u,onChange:d,caller:pl}),D=y.useRef(null),U=w?j||!!w.closest("form"):!0,[V,H]=y.useState(new Set),G=Array.from(V).map(L=>L.props.value).join(";");return i.jsx(Hh,{...b,children:i.jsxs(pwe,{required:x,scope:t,trigger:w,onTriggerChange:N,valueNode:O,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:E,contentId:Fn(),value:$,onValueChange:z,open:T,onOpenChange:M,dir:k,triggerPointerDownPosRef:D,disabled:g,children:[i.jsx(Vy.Provider,{scope:t,children:i.jsx(vwe,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(L=>{H(R=>new Set(R).add(L))},[]),onNativeOptionRemove:y.useCallback(L=>{H(R=>{const F=new Set(R);return F.delete(L),F})},[]),children:n})}),U?i.jsxs(OU,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:p,value:$,onChange:L=>z(L.target.value),disabled:g,form:j,children:[$===void 0?i.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};nU.displayName=pl;var rU="SelectTrigger",aU=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=Yy(n),l=cs(rU,n),u=l.disabled||r,d=qe(t,l.onTriggerChange),f=Gy(n),m=y.useRef("touch"),[p,g,x]=EU(b=>{const w=f().filter(C=>!C.disabled),N=w.find(C=>C.value===l.value),O=AU(w,b,N);O!==void 0&&l.onValueChange(O.value)}),j=b=>{u||(l.onOpenChange(!0),x()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return i.jsx(Wh,{asChild:!0,...o,children:i.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":CU(l.value)?"":void 0,...a,ref:d,onClick:Se(a.onClick,b=>{b.currentTarget.focus(),m.current!=="mouse"&&j(b)}),onPointerDown:Se(a.onPointerDown,b=>{m.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Se(a.onKeyDown,b=>{const w=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&g(b.key),!(w&&b.key===" ")&&fwe.includes(b.key)&&(j(),b.preventDefault())})})})});aU.displayName=rU;var iU="SelectValue",oU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:l="",...u}=e,d=cs(iU,n),{onValueNodeHasChildrenChange:f}=d,m=o!==void 0,p=qe(t,d.onValueNodeChange);return Un(()=>{f(m)},[f,m]),i.jsx(Pe.span,{...u,ref:p,style:{pointerEvents:"none"},children:CU(d.value)?i.jsx(i.Fragment,{children:l}):o})});oU.displayName=iU;var ywe="SelectIcon",sU=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return i.jsx(Pe.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});sU.displayName=ywe;var xwe="SelectPortal",lU=e=>i.jsx(Nl,{asChild:!0,...e});lU.displayName=xwe;var vl="SelectContent",cU=y.forwardRef((e,t)=>{const n=cs(vl,e.__scopeSelect),[r,a]=y.useState();if(Un(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?yl.createPortal(i.jsx(uU,{scope:e.__scopeSelect,children:i.jsx(Vy.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(dU,{...e,ref:t})});cU.displayName=vl;var $a=10,[uU,us]=Ku(vl),bwe="SelectContentImpl",wwe=awe("SelectContent.RemoveScroll"),dU=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w,...N}=e,O=cs(vl,n),[C,A]=y.useState(null),[E,k]=y.useState(null),T=qe(t,ee=>A(ee)),[M,$]=y.useState(null),[z,D]=y.useState(null),U=Gy(n),[V,H]=y.useState(!1),G=y.useRef(!1);y.useEffect(()=>{if(C)return Ry(C)},[C]),My();const L=y.useCallback(ee=>{const[ae,...Z]=U().map(le=>le.ref.current),[pe]=Z.slice(-1),je=document.activeElement;for(const le of ee)if(le===je||(le?.scrollIntoView({block:"nearest"}),le===ae&&E&&(E.scrollTop=0),le===pe&&E&&(E.scrollTop=E.scrollHeight),le?.focus(),document.activeElement!==je))return},[U,E]),R=y.useCallback(()=>L([M,C]),[L,M,C]);y.useEffect(()=>{V&&R()},[V,R]);const{onOpenChange:F,triggerPointerDownPosRef:K}=O;y.useEffect(()=>{if(C){let ee={x:0,y:0};const ae=pe=>{ee={x:Math.abs(Math.round(pe.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(K.current?.y??0))}},Z=pe=>{ee.x<=10&&ee.y<=10?pe.preventDefault():C.contains(pe.target)||F(!1),document.removeEventListener("pointermove",ae),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",Z,{capture:!0})}}},[C,F,K]),y.useEffect(()=>{const ee=()=>F(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[F]);const[te,I]=EU(ee=>{const ae=U().filter(je=>!je.disabled),Z=ae.find(je=>je.ref.current===document.activeElement),pe=AU(ae,ee,Z);pe&&setTimeout(()=>pe.ref.current.focus())}),B=y.useCallback((ee,ae,Z)=>{const pe=!G.current&&!Z;(O.value!==void 0&&O.value===ae||pe)&&($(ee),pe&&(G.current=!0))},[O.value]),Y=y.useCallback(()=>C?.focus(),[C]),ne=y.useCallback((ee,ae,Z)=>{const pe=!G.current&&!Z;(O.value!==void 0&&O.value===ae||pe)&&D(ee)},[O.value]),oe=r==="popper"?rO:fU,xe=oe===rO?{side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:w}:{};return i.jsx(uU,{scope:n,content:C,viewport:E,onViewportChange:k,itemRefCallback:B,selectedItem:M,onItemLeave:Y,itemTextRefCallback:ne,focusSelectedItem:R,selectedItemText:z,position:r,isPositioned:V,searchRef:te,children:i.jsx(Fh,{as:wwe,allowPinchZoom:!0,children:i.jsx(qh,{asChild:!0,trapped:O.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Se(a,ee=>{O.trigger?.focus({preventScroll:!0}),ee.preventDefault()}),children:i.jsx(_l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:i.jsx(oe,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ee=>ee.preventDefault(),...N,...xe,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Se(N.onKeyDown,ee=>{const ae=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ae&&ee.key.length===1&&I(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let pe=U().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const je=ee.target,le=pe.indexOf(je);pe=pe.slice(le+1)}setTimeout(()=>L(pe)),ee.preventDefault()}})})})})})})});dU.displayName=bwe;var jwe="SelectItemAlignedPosition",fU=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=cs(vl,n),l=us(vl,n),[u,d]=y.useState(null),[f,m]=y.useState(null),p=qe(t,T=>m(T)),g=Gy(n),x=y.useRef(!1),j=y.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:N,focusSelectedItem:O}=l,C=y.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&f&&b&&w&&N){const T=o.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),z=N.getBoundingClientRect();if(o.dir!=="rtl"){const je=z.left-M.left,le=$.left-je,Re=T.left-le,_e=T.width+Re,me=Math.max(_e,M.width),ve=window.innerWidth-$a,Le=Cf(le,[$a,Math.max($a,ve-me)]);u.style.minWidth=_e+"px",u.style.left=Le+"px"}else{const je=M.right-z.right,le=window.innerWidth-$.right-je,Re=window.innerWidth-T.right-le,_e=T.width+Re,me=Math.max(_e,M.width),ve=window.innerWidth-$a,Le=Cf(le,[$a,Math.max($a,ve-me)]);u.style.minWidth=_e+"px",u.style.right=Le+"px"}const D=g(),U=window.innerHeight-$a*2,V=b.scrollHeight,H=window.getComputedStyle(f),G=parseInt(H.borderTopWidth,10),L=parseInt(H.paddingTop,10),R=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),K=G+L+V+F+R,te=Math.min(w.offsetHeight*5,K),I=window.getComputedStyle(b),B=parseInt(I.paddingTop,10),Y=parseInt(I.paddingBottom,10),ne=T.top+T.height/2-$a,oe=U-ne,xe=w.offsetHeight/2,ee=w.offsetTop+xe,ae=G+L+ee,Z=K-ae;if(ae<=ne){const je=D.length>0&&w===D[D.length-1].ref.current;u.style.bottom="0px";const le=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(oe,xe+(je?Y:0)+le+R),_e=ae+Re;u.style.height=_e+"px"}else{const je=D.length>0&&w===D[0].ref.current;u.style.top="0px";const Re=Math.max(ne,G+b.offsetTop+(je?B:0)+xe)+Z;u.style.height=Re+"px",b.scrollTop=ae-ne+b.offsetTop}u.style.margin=`${$a}px 0`,u.style.minHeight=te+"px",u.style.maxHeight=U+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,u,f,b,w,N,o.dir,r]);Un(()=>C(),[C]);const[A,E]=y.useState();Un(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const k=y.useCallback(T=>{T&&j.current===!0&&(C(),O?.(),j.current=!1)},[C,O]);return i.jsx(_we,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:i.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:i.jsx(Pe.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});fU.displayName=jwe;var Swe="SelectPopperPosition",rO=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=$a,...o}=e,l=Yy(n);return i.jsx(Uy,{...l,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.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)"}})});rO.displayName=Swe;var[_we,bE]=Ku(vl,{}),aO="SelectViewport",hU=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=us(aO,n),l=bE(aO,n),u=qe(t,o.onViewportChange),d=y.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(Vy.Slot,{scope:n,children:i.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Se(a.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=l;if(g?.current&&p){const x=Math.abs(d.current-m.scrollTop);if(x>0){const j=window.innerHeight-$a*2,b=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),N=Math.max(b,w);if(N0?A:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});hU.displayName=aO;var mU="SelectGroup",[Nwe,Owe]=Ku(mU),Cwe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Fn();return i.jsx(Nwe,{scope:n,id:a,children:i.jsx(Pe.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Cwe.displayName=mU;var pU="SelectLabel",vU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Owe(pU,n);return i.jsx(Pe.div,{id:a.id,...r,ref:t})});vU.displayName=pU;var Tg="SelectItem",[Ewe,gU]=Ku(Tg),yU=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...l}=e,u=cs(Tg,n),d=us(Tg,n),f=u.value===r,[m,p]=y.useState(o??""),[g,x]=y.useState(!1),j=qe(t,O=>d.itemRefCallback?.(O,r,a)),b=Fn(),w=y.useRef("touch"),N=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Ewe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:y.useCallback(O=>{p(C=>C||(O?.textContent??"").trim())},[]),children:i.jsx(Vy.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:i.jsx(Pe.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:j,onFocus:Se(l.onFocus,()=>x(!0)),onBlur:Se(l.onBlur,()=>x(!1)),onClick:Se(l.onClick,()=>{w.current!=="mouse"&&N()}),onPointerUp:Se(l.onPointerUp,()=>{w.current==="mouse"&&N()}),onPointerDown:Se(l.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Se(l.onPointerMove,O=>{w.current=O.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,O=>{O.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Se(l.onKeyDown,O=>{d.searchRef?.current!==""&&O.key===" "||(hwe.includes(O.key)&&N(),O.key===" "&&O.preventDefault())})})})})});yU.displayName=Tg;var ff="SelectItemText",xU=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,l=cs(ff,n),u=us(ff,n),d=gU(ff,n),f=gwe(ff,n),[m,p]=y.useState(null),g=qe(t,N=>p(N),d.onItemTextChange,N=>u.itemTextRefCallback?.(N,d.value,d.disabled)),x=m?.textContent,j=y.useMemo(()=>i.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=f;return Un(()=>(b(j),()=>w(j)),[b,w,j]),i.jsxs(i.Fragment,{children:[i.jsx(Pe.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?yl.createPortal(o.children,l.valueNode):null]})});xU.displayName=ff;var bU="SelectItemIndicator",wU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return gU(bU,n).isSelected?i.jsx(Pe.span,{"aria-hidden":!0,...r,ref:t}):null});wU.displayName=bU;var iO="SelectScrollUpButton",jU=y.forwardRef((e,t)=>{const n=us(iO,e.__scopeSelect),r=bE(iO,e.__scopeSelect),[a,o]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?i.jsx(_U,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});jU.displayName=iO;var oO="SelectScrollDownButton",SU=y.forwardRef((e,t)=>{const n=us(oO,e.__scopeSelect),r=bE(oO,e.__scopeSelect),[a,o]=y.useState(!1),l=qe(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?i.jsx(_U,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});SU.displayName=oO;var _U=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=us("SelectScrollButton",n),l=y.useRef(null),u=Gy(n),d=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),Un(()=>{u().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),i.jsx(Pe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Se(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Se(a.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Se(a.onPointerLeave,()=>{d()})})}),Awe="SelectSeparator",NU=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(Pe.div,{"aria-hidden":!0,...r,ref:t})});NU.displayName=Awe;var sO="SelectArrow",Twe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Yy(n),o=cs(sO,n),l=us(sO,n);return o.open&&l.position==="popper"?i.jsx(Hy,{...a,...r,ref:t}):null});Twe.displayName=sO;var kwe="SelectBubbleInput",OU=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=y.useRef(null),o=qe(r,a),l=Ay(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const p=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(p)}},[l,t]),i.jsx(Pe.select,{...n,style:{...tU,...n.style},ref:o,defaultValue:t})});OU.displayName=kwe;function CU(e){return e===""||e===void 0}function EU(e){const t=nn(e),n=y.useRef(""),r=y.useRef(0),a=y.useCallback(l=>{const u=n.current+l;t(u),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function AU(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Mwe(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Mwe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Pwe=nU,TU=aU,Rwe=oU,Dwe=sU,$we=lU,kU=cU,Iwe=hU,MU=vU,PU=yU,Lwe=xU,Bwe=wU,RU=jU,DU=SU,$U=NU;const Et=Pwe,At=Rwe,wt=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(TU,{ref:r,className:ue("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(Dwe,{asChild:!0,children:i.jsx(ch,{className:"h-4 w-4 opacity-50"})})]}));wt.displayName=TU.displayName;const IU=y.forwardRef(({className:e,...t},n)=>i.jsx(RU,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(qN,{className:"h-4 w-4"})}));IU.displayName=RU.displayName;const LU=y.forwardRef(({className:e,...t},n)=>i.jsx(DU,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(ch,{className:"h-4 w-4"})}));LU.displayName=DU.displayName;const jt=y.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>i.jsx($we,{children:i.jsxs(kU,{ref:a,className:ue("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",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,...r,children:[i.jsx(IU,{}),i.jsx(Iwe,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(LU,{})]})}));jt.displayName=kU.displayName;const zwe=y.forwardRef(({className:e,...t},n)=>i.jsx(MU,{ref:n,className:ue("px-2 py-1.5 text-sm font-semibold",e),...t}));zwe.displayName=MU.displayName;const Me=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(PU,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(Bwe,{children:i.jsx(nl,{className:"h-4 w-4"})})}),i.jsx(Lwe,{children:t})]}));Me.displayName=PU.displayName;const qwe=y.forwardRef(({className:e,...t},n)=>i.jsx($U,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));qwe.displayName=$U.displayName;function Fwe(e){const t=Uwe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(Wwe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Uwe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=Gwe(a),u=Vwe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hwe=Symbol("radix.slottable");function Wwe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hwe}function Vwe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Gwe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ky="Popover",[BU]=hr(Ky,[ls]),Vh=ls(),[Ywe,ds]=BU(Ky),zU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!1}=e,u=Vh(t),d=y.useRef(null),[f,m]=y.useState(!1),[p,g]=Na({prop:r,defaultProp:a??!1,onChange:o,caller:Ky});return i.jsx(Hh,{...u,children:i.jsx(Ywe,{scope:t,contentId:Fn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:y.useCallback(()=>m(!0),[]),onCustomAnchorRemove:y.useCallback(()=>m(!1),[]),modal:l,children:n})})};zU.displayName=Ky;var qU="PopoverAnchor",Kwe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ds(qU,n),o=Vh(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return y.useEffect(()=>(l(),()=>u()),[l,u]),i.jsx(Wh,{...o,...r,ref:t})});Kwe.displayName=qU;var FU="PopoverTrigger",UU=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ds(FU,n),o=Vh(n),l=qe(t,a.triggerRef),u=i.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":YU(a.open),...r,ref:l,onClick:Se(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:i.jsx(Wh,{asChild:!0,...o,children:u})});UU.displayName=FU;var wE="PopoverPortal",[Xwe,Zwe]=BU(wE,{forceMount:void 0}),HU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=ds(wE,t);return i.jsx(Xwe,{scope:t,forceMount:n,children:i.jsx(Rn,{present:n||o.open,children:i.jsx(Nl,{asChild:!0,container:a,children:r})})})};HU.displayName=wE;var Tu="PopoverContent",WU=y.forwardRef((e,t)=>{const n=Zwe(Tu,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=ds(Tu,e.__scopePopover);return i.jsx(Rn,{present:r||o.open,children:o.modal?i.jsx(Jwe,{...a,ref:t}):i.jsx(eje,{...a,ref:t})})});WU.displayName=Tu;var Qwe=Fwe("PopoverContent.RemoveScroll"),Jwe=y.forwardRef((e,t)=>{const n=ds(Tu,e.__scopePopover),r=y.useRef(null),a=qe(t,r),o=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return Ry(l)},[]),i.jsx(Fh,{as:Qwe,allowPinchZoom:!0,children:i.jsx(VU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,l=>{l.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Se(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),eje=y.forwardRef((e,t)=>{const n=ds(Tu,e.__scopePopover),r=y.useRef(!1),a=y.useRef(!1);return i.jsx(VU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),VU=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:m,...p}=e,g=ds(Tu,n),x=Vh(n);return My(),i.jsx(qh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:i.jsx(_l,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:i.jsx(Uy,{"data-state":YU(g.open),role:"dialog",id:g.contentId,...x,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),GU="PopoverClose",tje=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ds(GU,n);return i.jsx(Pe.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});tje.displayName=GU;var nje="PopoverArrow",rje=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vh(n);return i.jsx(Hy,{...a,...r,ref:t})});rje.displayName=nje;function YU(e){return e?"open":"closed"}var aje=zU,ije=UU,oje=HU,KU=WU;const es=aje,ts=ije,so=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>i.jsx(oje,{children:i.jsx(KU,{ref:a,align:t,sideOffset:n,className:ue("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));so.displayName=KU.displayName;const Xu="/api/webui/config";async function sje(){const t=await(await Ze(`${Xu}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function kg(){const t=await(await Ze(`${Xu}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function lje(e){const n=await(await Ze(`${Xu}/bot`,{method:"POST",headers:st(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function XU(e){const n=await(await Ze(`${Xu}/model`,{method:"POST",headers:st(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function cje(e,t){const r=await(await Ze(`${Xu}/bot/section/${e}`,{method:"POST",headers:st(),body:JSON.stringify(t)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${e} 失败`)}async function lO(e,t){const r=await(await Ze(`${Xu}/model/section/${e}`,{method:"POST",headers:st(),body:JSON.stringify(t)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${e} 失败`)}function uje(){const[e,t]=y.useState(!0),[n,r]=y.useState(!1),[a,o]=y.useState(!1),[l,u]=y.useState(!1),{toast:d}=mr(),[f,m]=y.useState(null),[p,g]=y.useState(null),[x,j]=y.useState(null),[b,w]=y.useState(null),[N,O]=y.useState(null),[C,A]=y.useState(null),[E,k]=y.useState(null),[T,M]=y.useState(null),[$,z]=y.useState(null),[D,U]=y.useState(null),[V,H]=y.useState(null),[G,L]=y.useState(null),[R,F]=y.useState(null),[K,te]=y.useState(null),[I,B]=y.useState(null),[Y,ne]=y.useState(null),[oe,xe]=y.useState(null),[ee,ae]=y.useState(null),Z=y.useRef(null),pe=y.useRef(!0),je=y.useRef({}),le=y.useCallback(async()=>{try{t(!0);const ve=await sje();je.current=ve,m(ve.bot),g(ve.personality);const Le=ve.chat;Le.talk_value_rules||(Le.talk_value_rules=[]),j(Le),w(ve.expression),O(ve.emoji),A(ve.memory),k(ve.tool),M(ve.mood),z(ve.voice),U(ve.lpmm_knowledge),H(ve.keyword_reaction),L(ve.response_post_process),F(ve.chinese_typo),te(ve.response_splitter),B(ve.log),ne(ve.debug),xe(ve.maim_message),ae(ve.telemetry),u(!1),pe.current=!1}catch(ve){console.error("加载配置失败:",ve),d({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[d]);y.useEffect(()=>{le()},[le]);const Re=y.useCallback(async(ve,Le)=>{if(!pe.current)try{o(!0),await cje(ve,Le),u(!1)}catch(Dt){console.error(`自动保存 ${ve} 失败:`,Dt),u(!0)}finally{o(!1)}},[]),_e=y.useCallback((ve,Le)=>{pe.current||(u(!0),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{Re(ve,Le)},2e3))},[Re]);y.useEffect(()=>{f&&!pe.current&&_e("bot",f)},[f,_e]),y.useEffect(()=>{p&&!pe.current&&_e("personality",p)},[p,_e]),y.useEffect(()=>{x&&!pe.current&&_e("chat",x)},[x,_e]),y.useEffect(()=>{b&&!pe.current&&_e("expression",b)},[b,_e]),y.useEffect(()=>{N&&!pe.current&&_e("emoji",N)},[N,_e]),y.useEffect(()=>{C&&!pe.current&&_e("memory",C)},[C,_e]),y.useEffect(()=>{E&&!pe.current&&_e("tool",E)},[E,_e]),y.useEffect(()=>{T&&!pe.current&&_e("mood",T)},[T,_e]),y.useEffect(()=>{$&&!pe.current&&_e("voice",$)},[$,_e]),y.useEffect(()=>{D&&!pe.current&&_e("lpmm_knowledge",D)},[D,_e]),y.useEffect(()=>{V&&!pe.current&&_e("keyword_reaction",V)},[V,_e]),y.useEffect(()=>{G&&!pe.current&&_e("response_post_process",G)},[G,_e]),y.useEffect(()=>{R&&!pe.current&&_e("chinese_typo",R)},[R,_e]),y.useEffect(()=>{K&&!pe.current&&_e("response_splitter",K)},[K,_e]),y.useEffect(()=>{I&&!pe.current&&_e("log",I)},[I,_e]),y.useEffect(()=>{Y&&!pe.current&&_e("debug",Y)},[Y,_e]),y.useEffect(()=>{oe&&!pe.current&&_e("maim_message",oe)},[oe,_e]),y.useEffect(()=>{ee&&!pe.current&&_e("telemetry",ee)},[ee,_e]);const me=async()=>{try{r(!0),Z.current&&clearTimeout(Z.current);const ve={...je.current,bot:f,personality:p,chat:x,expression:b,emoji:N,memory:C,tool:E,mood:T,voice:$,lpmm_knowledge:D,keyword_reaction:V,response_post_process:G,chinese_typo:R,response_splitter:K,log:I,debug:Y,maim_message:oe,telemetry:ee};await lje(ve),u(!1),d({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(ve){console.error("保存配置失败:",ve),d({title:"保存失败",description:ve.message,variant:"destructive"})}finally{r(!1)}};return e?i.jsx(Kt,{className:"h-full",children:i.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):i.jsx(Kt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),i.jsxs(fe,{onClick:me,disabled:n||a||!l,size:"sm",className:"w-full sm:w-auto",children:[i.jsx(GC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":a?"自动保存中...":l?"保存配置":"已保存"]})]}),i.jsxs(sl,{defaultValue:"bot",className:"w-full",children:[i.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:i.jsxs(Zo,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[i.jsx(Ct,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),i.jsx(Ct,{value:"personality",className:"flex-shrink-0",children:"人格"}),i.jsx(Ct,{value:"chat",className:"flex-shrink-0",children:"聊天"}),i.jsx(Ct,{value:"expression",className:"flex-shrink-0",children:"表达"}),i.jsx(Ct,{value:"features",className:"flex-shrink-0",children:"功能"}),i.jsx(Ct,{value:"processing",className:"flex-shrink-0",children:"处理"}),i.jsx(Ct,{value:"mood",className:"flex-shrink-0",children:"情绪"}),i.jsx(Ct,{value:"voice",className:"flex-shrink-0",children:"语音"}),i.jsx(Ct,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),i.jsx(Ct,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),i.jsx(Jt,{value:"bot",className:"space-y-4",children:f&&i.jsx(dje,{config:f,onChange:m})}),i.jsx(Jt,{value:"personality",className:"space-y-4",children:p&&i.jsx(fje,{config:p,onChange:g})}),i.jsx(Jt,{value:"chat",className:"space-y-4",children:x&&i.jsx(hje,{config:x,onChange:j})}),i.jsx(Jt,{value:"expression",className:"space-y-4",children:b&&i.jsx(mje,{config:b,onChange:w})}),i.jsx(Jt,{value:"features",className:"space-y-4",children:N&&C&&E&&i.jsx(pje,{emojiConfig:N,memoryConfig:C,toolConfig:E,onEmojiChange:O,onMemoryChange:A,onToolChange:k})}),i.jsx(Jt,{value:"processing",className:"space-y-4",children:V&&G&&R&&K&&i.jsx(vje,{keywordReactionConfig:V,responsePostProcessConfig:G,chineseTypoConfig:R,responseSplitterConfig:K,onKeywordReactionChange:H,onResponsePostProcessChange:L,onChineseTypoChange:F,onResponseSplitterChange:te})}),i.jsx(Jt,{value:"mood",className:"space-y-4",children:T&&i.jsx(gje,{config:T,onChange:M})}),i.jsx(Jt,{value:"voice",className:"space-y-4",children:$&&i.jsx(yje,{config:$,onChange:z})}),i.jsx(Jt,{value:"lpmm",className:"space-y-4",children:D&&i.jsx(xje,{config:D,onChange:U})}),i.jsxs(Jt,{value:"other",className:"space-y-4",children:[I&&i.jsx(bje,{config:I,onChange:B}),Y&&i.jsx(wje,{config:Y,onChange:ne}),oe&&i.jsx(jje,{config:oe,onChange:xe}),ee&&i.jsx(Sje,{config:ee,onChange:ae})]})]})]})})}function dje({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},r=d=>{t({...e,platforms:e.platforms.filter((f,m)=>m!==d)})},a=(d,f)=>{const m=[...e.platforms];m[d]=f,t({...e,platforms:m})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},l=d=>{t({...e,alias_names:e.alias_names.filter((f,m)=>m!==d)})},u=(d,f)=>{const m=[...e.alias_names];m[d]=f,t({...e,alias_names:m})};return i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"platform",children:"平台"}),i.jsx(Ne,{id:"platform",value:e.platform,onChange:d=>t({...e,platform:d.target.value}),placeholder:"qq"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"qq_account",children:"QQ账号"}),i.jsx(Ne,{id:"qq_account",value:e.qq_account,onChange:d=>t({...e,qq_account:d.target.value}),placeholder:"123456789"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"nickname",children:"昵称"}),i.jsx(Ne,{id:"nickname",value:e.nickname,onChange:d=>t({...e,nickname:d.target.value}),placeholder:"麦麦"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{children:"其他平台账号"}),i.jsxs(fe,{onClick:n,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),i.jsxs("div",{className:"space-y-2",children:[e.platforms.map((d,f)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{value:d,onChange:m=>a(f,m.target.value),placeholder:"wx:114514"}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"icon",variant:"outline",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除平台账号 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{children:"别名"}),i.jsxs(fe,{onClick:o,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),i.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((d,f)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{value:d,onChange:m=>u(f,m.target.value),placeholder:"小麦"}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"icon",variant:"outline",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除别名 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>l(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function fje({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},r=o=>{t({...e,states:e.states.filter((l,u)=>u!==o)})},a=(o,l)=>{const u=[...e.states];u[o]=l,t({...e,states:u})};return i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"personality",children:"人格特质"}),i.jsx(qt,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"reply_style",children:"表达风格"}),i.jsx(qt,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"interest",children:"兴趣"}),i.jsx(qt,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"plan_style",children:"说话规则与行为风格"}),i.jsx(qt,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"visual_style",children:"识图规则"}),i.jsx(qt,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"private_plan_style",children:"私聊规则"}),i.jsx(qt,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{children:"状态列表(人格多样性)"}),i.jsxs(fe,{onClick:n,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),i.jsx("div",{className:"space-y-2",children:e.states.map((o,l)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(qt,{value:o,onChange:u=>a(l,u.target.value),placeholder:"描述一个人格状态",rows:2}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"icon",variant:"outline",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsx(jn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"state_probability",children:"状态替换概率"}),i.jsx(Ne,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:o=>t({...e,state_probability:parseFloat(o.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function hje({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=u=>{t({...e,talk_value_rules:e.talk_value_rules.filter((d,f)=>f!==u)})},a=(u,d,f)=>{const m=[...e.talk_value_rules];m[u]={...m[u],[d]:f},t({...e,talk_value_rules:m})},o=({value:u,onChange:d})=>{const[f,m]=y.useState("00"),[p,g]=y.useState("00"),[x,j]=y.useState("23"),[b,w]=y.useState("59");y.useEffect(()=>{const O=u.split("-");if(O.length===2){const[C,A]=O,[E,k]=C.split(":"),[T,M]=A.split(":");E&&m(E.padStart(2,"0")),k&&g(k.padStart(2,"0")),T&&j(T.padStart(2,"0")),M&&w(M.padStart(2,"0"))}},[u]);const N=(O,C,A,E)=>{const k=`${O}:${C}-${A}:${E}`;d(k)};return i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[i.jsx(rl,{className:"h-4 w-4 mr-2"}),u||"选择时间段"]})}),i.jsx(so,{className:"w-80",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"小时"}),i.jsxs(Et,{value:f,onValueChange:O=>{m(O),N(O,p,x,b)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:24},(O,C)=>C).map(O=>i.jsx(Me,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"分钟"}),i.jsxs(Et,{value:p,onValueChange:O=>{g(O),N(f,O,x,b)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:60},(O,C)=>C).map(O=>i.jsx(Me,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"小时"}),i.jsxs(Et,{value:x,onValueChange:O=>{j(O),N(f,p,O,b)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:24},(O,C)=>C).map(O=>i.jsx(Me,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-xs",children:"分钟"}),i.jsxs(Et,{value:b,onValueChange:O=>{w(O),N(f,p,x,O)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:Array.from({length:60},(O,C)=>C).map(O=>i.jsx(Me,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]})]})})]})},l=({rule:u})=>{const d=`{ target = "${u.target}", time = "${u.time}", value = ${u.value.toFixed(1)} }`;return i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",children:[i.jsx(ao,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-96",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:d}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),i.jsx(Ne,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:u=>t({...e,talk_value:parseFloat(u.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),i.jsx(Ne,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:u=>t({...e,mentioned_bot_reply:parseFloat(u.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_context_size",children:"上下文长度"}),i.jsx(Ne,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:u=>t({...e,max_context_size:parseInt(u.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"planner_smooth",children:"规划器平滑"}),i.jsx(Ne,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:u=>t({...e,planner_smooth:parseFloat(u.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:u=>t({...e,enable_talk_value_rules:u})}),i.jsx(J,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:u=>t({...e,include_planner_reasoning:u})}),i.jsx(J,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&i.jsxs("div",{className:"border-t pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),i.jsxs(fe,{onClick:n,size:"sm",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?i.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((u,d)=>i.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",d+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(l,{rule:u}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{variant:"ghost",size:"sm",children:i.jsx(Ut,{className:"h-4 w-4 text-destructive"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除规则 #",d+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(d),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"配置类型"}),i.jsxs(Et,{value:u.target===""?"global":"specific",onValueChange:f=>{f==="global"?a(d,"target",""):a(d,"target","qq::group")},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"global",children:"全局配置"}),i.jsx(Me,{value:"specific",children:"详细配置"})]})]})]}),u.target!==""&&(()=>{const f=u.target.split(":"),m=f[0]||"qq",p=f[1]||"",g=f[2]||"group";return i.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"平台"}),i.jsxs(Et,{value:m,onValueChange:x=>{a(d,"target",`${x}:${p}:${g}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"qq",children:"QQ"}),i.jsx(Me,{value:"wx",children:"微信"})]})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"群 ID"}),i.jsx(Ne,{value:p,onChange:x=>{a(d,"target",`${m}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"类型"}),i.jsxs(Et,{value:g,onValueChange:x=>{a(d,"target",`${m}:${p}:${x}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"group",children:"群组(group)"}),i.jsx(Me,{value:"private",children:"私聊(private)"})]})]})]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",u.target||"(未设置)"]})]})})(),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"时间段 (Time)"}),i.jsx(o,{value:u.time,onChange:f=>a(d,"time",f)}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{htmlFor:`rule-value-${d}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),i.jsx(Ne,{id:`rule-value-${d}`,type:"number",step:"0.01",min:"0",max:"1",value:u.value,onChange:f=>{const m=parseFloat(f.target.value);isNaN(m)||a(d,"value",Math.max(0,Math.min(1,m)))},className:"w-20 h-8 text-xs"})]}),i.jsx(dE,{value:[u.value],onValueChange:f=>a(d,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:"0 (完全沉默)"}),i.jsx("span",{children:"0.5"}),i.jsx("span",{children:"1.0 (正常)"})]})]})]})]},d))}):i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:i.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),i.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[i.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),i.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function mje({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},r=g=>{t({...e,learning_list:e.learning_list.filter((x,j)=>j!==g)})},a=(g,x,j)=>{const b=[...e.learning_list];b[g][x]=j,t({...e,learning_list:b})},o=({rule:g})=>{const x=`["${g[0]}", "${g[1]}", "${g[2]}", "${g[3]}"]`;return i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",children:[i.jsx(ao,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-96",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:x}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=({member:g,groupIndex:x,memberIndex:j,availableChatIds:b})=>{const w=b.includes(g)||g==="*",[N,O]=y.useState(!w);return i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{className:"flex-1 flex gap-2",children:N?i.jsxs(i.Fragment,{children:[i.jsx(Ne,{value:g,onChange:C=>p(x,j,C.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),b.length>0&&i.jsx(fe,{size:"sm",variant:"outline",onClick:()=>O(!1),title:"切换到下拉选择",children:"下拉"})]}):i.jsxs(i.Fragment,{children:[i.jsxs(Et,{value:g,onValueChange:C=>p(x,j,C),children:[i.jsx(wt,{className:"flex-1",children:i.jsx(At,{placeholder:"选择聊天流"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"*",children:"* (全局共享)"}),b.map((C,A)=>i.jsx(Me,{value:C,children:C},A))]})]}),i.jsx(fe,{size:"sm",variant:"outline",onClick:()=>O(!0),title:"切换到手动输入",children:"输入"})]})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"icon",variant:"outline",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除组成员 "',g||"(空)",'" 吗?此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>m(x,j),children:"删除"})]})]})]})]})},u=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},d=g=>{t({...e,expression_groups:e.expression_groups.filter((x,j)=>j!==g)})},f=g=>{const x=[...e.expression_groups];x[g]=[...x[g],""],t({...e,expression_groups:x})},m=(g,x)=>{const j=[...e.expression_groups];j[g]=j[g].filter((b,w)=>w!==x),t({...e,expression_groups:j})},p=(g,x,j)=>{const b=[...e.expression_groups];b[g][x]=j,t({...e,expression_groups:b})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),i.jsxs(fe,{onClick:n,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),i.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((g,x)=>{const j=e.learning_list.some((A,E)=>E!==x&&A[0]===""),b=g[0]==="",w=g[0].split(":"),N=w[0]||"qq",O=w[1]||"",C=w[2]||"group";return i.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["规则 ",x+1," ",b&&"(全局配置)"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(o,{rule:g}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"sm",variant:"ghost",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除学习规则 ",x+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>r(x),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"配置类型"}),i.jsxs(Et,{value:b?"global":"specific",onValueChange:A=>{A==="global"?a(x,0,""):a(x,0,"qq::group")},disabled:j&&!b,children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"global",children:"全局配置"}),i.jsx(Me,{value:"specific",disabled:j&&!b,children:"详细配置"})]})]}),j&&!b&&i.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!b&&i.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[i.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"平台"}),i.jsxs(Et,{value:N,onValueChange:A=>{a(x,0,`${A}:${O}:${C}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"qq",children:"QQ"}),i.jsx(Me,{value:"wx",children:"微信"})]})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"群 ID"}),i.jsx(Ne,{value:O,onChange:A=>{a(x,0,`${N}:${A.target.value}:${C}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"类型"}),i.jsxs(Et,{value:C,onValueChange:A=>{a(x,0,`${N}:${O}:${A}`)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"group",children:"群组(group)"}),i.jsx(Me,{value:"private",children:"私聊(private)"})]})]})]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",g[0]||"(未设置)"]})]}),i.jsx("div",{className:"grid gap-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs font-medium",children:"使用学到的表达"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),i.jsx(at,{checked:g[1]==="enable",onCheckedChange:A=>a(x,1,A?"enable":"disable")})]})}),i.jsx("div",{className:"grid gap-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-xs font-medium",children:"学习表达"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),i.jsx(at,{checked:g[2]==="enable",onCheckedChange:A=>a(x,2,A?"enable":"disable")})]})}),i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{className:"text-xs font-medium",children:"学习强度"}),i.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"5",value:g[3],onChange:A=>{const E=parseFloat(A.target.value);isNaN(E)||a(x,3,Math.max(0,Math.min(5,E)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),i.jsx(dE,{value:[parseFloat(g[3])||1],onValueChange:A=>a(x,3,A[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:"0 (不学习)"}),i.jsx("span",{children:"2.5"}),i.jsx("span",{children:"5.0 (快速学习)"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},x)}),e.learning_list.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),i.jsxs(fe,{onClick:u,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),i.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((g,x)=>{const j=e.learning_list.map(b=>b[0]).filter(b=>b!=="");return i.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",x+1,g.length===1&&g[0]==="*"&&"(全局共享)"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(fe,{onClick:()=>f(x),size:"sm",variant:"outline",children:i.jsx(tr,{className:"h-4 w-4"})}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"sm",variant:"ghost",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除共享组 ",x+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>d(x),children:"删除"})]})]})]})]})]}),i.jsx("div",{className:"space-y-2",children:g.map((b,w)=>i.jsx(l,{member:b,groupIndex:x,memberIndex:w,availableChatIds:j},w))}),i.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},x)}),e.expression_groups.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function pje({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:r,onMemoryChange:a,onToolChange:o}){return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:l=>o({...n,enable_tool:l})}),i.jsx(J,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),i.jsx(Ne,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:l=>a({...t,max_agent_iterations:parseInt(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),i.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"emoji_chance",children:"表情包激活概率"}),i.jsx(Ne,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:l=>r({...e,emoji_chance:parseFloat(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_reg_num",children:"最大注册数量"}),i.jsx(Ne,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:l=>r({...e,max_reg_num:parseInt(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),i.jsx(Ne,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:l=>r({...e,check_interval:parseInt(l.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"do_replace",checked:e.do_replace,onCheckedChange:l=>r({...e,do_replace:l})}),i.jsx(J,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:l=>r({...e,steal_emoji:l})}),i.jsx(J,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),i.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:l=>r({...e,content_filtration:l})}),i.jsx(J,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&i.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[i.jsx(J,{htmlFor:"filtration_prompt",children:"过滤要求"}),i.jsx(Ne,{id:"filtration_prompt",value:e.filtration_prompt,onChange:l=>r({...e,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function vje({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:a,onResponsePostProcessChange:o,onChineseTypoChange:l,onResponseSplitterChange:u}){const d=()=>{a({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=A=>{a({...e,regex_rules:e.regex_rules.filter((E,k)=>k!==A)})},m=(A,E,k)=>{const T=[...e.regex_rules];E==="regex"&&typeof k=="string"?T[A]={...T[A],regex:[k]}:E==="reaction"&&typeof k=="string"&&(T[A]={...T[A],reaction:k}),a({...e,regex_rules:T})},p=({regex:A,reaction:E,onRegexChange:k,onReactionChange:T})=>{const[M,$]=y.useState(!1),[z,D]=y.useState(""),[U,V]=y.useState(null),[H,G]=y.useState(""),[L,R]=y.useState({}),[F,K]=y.useState(""),te=y.useRef(null),[I,B]=y.useState("build"),Y=ee=>ee.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),ne=(ee,ae=0)=>{const Z=te.current;if(!Z)return;const pe=Z.selectionStart||0,je=Z.selectionEnd||0,le=A.substring(0,pe)+ee+A.substring(je);k(le),setTimeout(()=>{const Re=pe+ee.length+ae;Z.setSelectionRange(Re,Re),Z.focus()},0)};y.useEffect(()=>{if(!A||!z){V(null),R({}),K(E),G("");return}try{const ee=Y(A),ae=new RegExp(ee,"g"),Z=z.match(ae);V(Z),G("");const je=new RegExp(ee).exec(z);if(je&&je.groups){R(je.groups);let le=E;Object.entries(je.groups).forEach(([Re,_e])=>{le=le.replace(new RegExp(`\\[${Re}\\]`,"g"),_e||"")}),K(le)}else R({}),K(E)}catch(ee){G(ee.message),V(null),R({}),K(E)}},[A,z,E]);const oe=()=>{if(!z||!U||U.length===0)return i.jsx("span",{className:"text-muted-foreground",children:z||"请输入测试文本"});try{const ee=Y(A),ae=new RegExp(ee,"g");let Z=0;const pe=[];let je;for(;(je=ae.exec(z))!==null;)je.index>Z&&pe.push(i.jsx("span",{children:z.substring(Z,je.index)},`text-${Z}`)),pe.push(i.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:je[0]},`match-${je.index}`)),Z=je.index+je[0].length;return Z)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return i.jsxs(nr,{open:M,onOpenChange:$,children:[i.jsx(qF,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",children:[i.jsx(bg,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),i.jsxs(Hn,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"正则表达式编辑器"}),i.jsx(dr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),i.jsx(Kt,{className:"max-h-[calc(90vh-120px)]",children:i.jsxs(sl,{value:I,onValueChange:ee=>B(ee),className:"w-full",children:[i.jsxs(Zo,{className:"grid w-full grid-cols-2",children:[i.jsx(Ct,{value:"build",children:"🔧 构建器"}),i.jsx(Ct,{value:"test",children:"🧪 测试器"})]}),i.jsxs(Jt,{value:"build",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"正则表达式"}),i.jsx(Ne,{ref:te,value:A,onChange:ee=>k(ee.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"Reaction 内容"}),i.jsx(qt,{value:E,onChange:ee=>T(ee.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),i.jsxs("div",{className:"space-y-4 border-t pt-4",children:[xe.map(ee=>i.jsxs("div",{className:"space-y-2",children:[i.jsx("h5",{className:"text-xs font-semibold text-primary",children:ee.category}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ee.items.map(ae=>i.jsx(fe,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>ne(ae.pattern,ae.moveCursor||0),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsxs("div",{className:"flex items-center gap-2 w-full",children:[i.jsx("span",{className:"text-xs font-medium",children:ae.label}),i.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ae.pattern})]}),i.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ae.desc})]})},ae.label))})]},ee.category)),i.jsxs("div",{className:"space-y-2 border-t pt-4",children:[i.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(fe,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("^(?P\\S{1,20})是这样的$"),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),i.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),i.jsx(fe,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),i.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),i.jsx(fe,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>k("(?P.+?)(?:是|为什么|怎么)"),children:i.jsxs("div",{className:"flex flex-col items-start w-full",children:[i.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),i.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),i.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[i.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),i.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),i.jsxs("li",{children:["命名捕获组格式:",i.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),i.jsxs("li",{children:["在 reaction 中使用 ",i.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),i.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),i.jsxs(Jt,{value:"test",className:"space-y-4 mt-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"当前正则表达式"}),i.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:A||"(未设置)"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),i.jsx(qt,{id:"test-text",value:z,onChange:ee=>D(ee.target.value),placeholder:`在此输入要测试的文本... 例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),H&&i.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[i.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),i.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:H})]}),!H&&z&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"flex items-center gap-2",children:U&&U.length>0?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),i.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",U.length," 处)"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),i.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"匹配高亮"}),i.jsx(Kt,{className:"h-40 rounded-md bg-muted p-3",children:i.jsx("div",{className:"text-sm break-words",children:oe()})})]}),Object.keys(L).length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"命名捕获组"}),i.jsx(Kt,{className:"h-32 rounded-md border p-3",children:i.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([ee,ae])=>i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",ee,"]"]}),i.jsx("span",{className:"text-muted-foreground",children:"="}),i.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ae})]},ee))})})]}),Object.keys(L).length>0&&E&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{className:"text-sm font-medium",children:"Reaction 替换预览"}),i.jsx(Kt,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:i.jsx("div",{className:"text-sm break-words",children:F})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),i.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[i.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),i.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),i.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),i.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),i.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{a({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},x=A=>{a({...e,keyword_rules:e.keyword_rules.filter((E,k)=>k!==A)})},j=(A,E,k)=>{const T=[...e.keyword_rules];typeof k=="string"&&(T[A]={...T[A],reaction:k}),a({...e,keyword_rules:T})},b=A=>{const E=[...e.keyword_rules];E[A]={...E[A],keywords:[...E[A].keywords||[],""]},a({...e,keyword_rules:E})},w=(A,E)=>{const k=[...e.keyword_rules];k[A]={...k[A],keywords:(k[A].keywords||[]).filter((T,M)=>M!==E)},a({...e,keyword_rules:k})},N=(A,E,k)=>{const T=[...e.keyword_rules],M=[...T[A].keywords||[]];M[E]=k,T[A]={...T[A],keywords:M},a({...e,keyword_rules:T})},O=({rule:A})=>{const E=`{ regex = [${(A.regex||[]).map(k=>`"${k}"`).join(", ")}], reaction = "${A.reaction}" }`;return i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",children:[i.jsx(ao,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-[95vw] sm:w-[500px]",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx(Kt,{className:"h-60 rounded-md bg-muted p-3",children:i.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},C=({rule:A})=>{const E=`[[keyword_reaction.keyword_rules]] keywords = [${(A.keywords||[]).map(k=>`"${k}"`).join(", ")}] reaction = "${A.reaction}"`;return i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",children:[i.jsx(ao,{className:"h-4 w-4 mr-1"}),"预览"]})}),i.jsx(so,{className:"w-[95vw] sm:w-[500px]",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),i.jsx(Kt,{className:"h-60 rounded-md bg-muted p-3",children:i.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),i.jsxs(fe,{onClick:d,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),i.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((A,E)=>i.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(p,{regex:A.regex&&A.regex[0]||"",reaction:A.reaction,onRegexChange:k=>m(E,"regex",k),onReactionChange:k=>m(E,"reaction",k)}),i.jsx(O,{rule:A}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"sm",variant:"ghost",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>f(E),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),i.jsx(Ne,{value:A.regex&&A.regex[0]||"",onChange:k=>m(E,"regex",k.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"反应内容"}),i.jsx(qt,{value:A.reaction,onChange:k=>m(E,"reaction",k.target.value),placeholder:`触发后麦麦的反应... 可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),e.regex_rules.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),i.jsxs("div",{className:"space-y-4 border-t pt-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),i.jsxs(fe,{onClick:g,size:"sm",variant:"outline",children:[i.jsx(tr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),i.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((A,E)=>i.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(C,{rule:A}),i.jsxs(Pn,{children:[i.jsx(ra,{asChild:!0,children:i.jsx(fe,{size:"sm",variant:"ghost",children:i.jsx(Ut,{className:"h-4 w-4"})})}),i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>x(E),children:"删除"})]})]})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{className:"text-xs font-medium",children:"关键词列表"}),i.jsxs(fe,{onClick:()=>b(E),size:"sm",variant:"ghost",children:[i.jsx(tr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),i.jsxs("div",{className:"space-y-2",children:[(A.keywords||[]).map((k,T)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ne,{value:k,onChange:M=>N(E,T,M.target.value),placeholder:"关键词",className:"flex-1"}),i.jsx(fe,{onClick:()=>w(E,T),size:"sm",variant:"ghost",children:i.jsx(Ut,{className:"h-4 w-4"})})]},T)),(!A.keywords||A.keywords.length===0)&&i.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{className:"text-xs font-medium",children:"反应内容"}),i.jsx(qt,{value:A.reaction,onChange:k=>j(E,"reaction",k.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),e.keyword_rules.length===0&&i.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:A=>o({...t,enable_response_post_process:A})}),i.jsx(J,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"border-t pt-6 space-y-4",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[i.jsx(at,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:A=>l({...n,enable:A})}),i.jsx(J,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&i.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),i.jsx(Ne,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:A=>l({...n,error_rate:parseFloat(A.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),i.jsx(Ne,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:A=>l({...n,min_freq:parseInt(A.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),i.jsx(Ne,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:A=>l({...n,tone_error_rate:parseFloat(A.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),i.jsx(Ne,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:A=>l({...n,word_replace_rate:parseFloat(A.target.value)})})]})]})]})}),i.jsx("div",{className:"border-t pt-6 space-y-4",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[i.jsx(at,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:A=>u({...r,enable:A})}),i.jsx(J,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&i.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),i.jsx(Ne,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:A=>u({...r,max_length:parseInt(A.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),i.jsx(Ne,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:A=>u({...r,max_sentence_num:parseInt(A.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:A=>u({...r,enable_kaomoji_protection:A})}),i.jsx(J,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:A=>u({...r,enable_overflow_return_all:A})}),i.jsx(J,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),i.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function gje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),i.jsx(J,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"情绪更新阈值"}),i.jsx(Ne,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"情感特征"}),i.jsx(qt,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function yje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),i.jsx(J,{className:"cursor-pointer",children:"启用语音识别"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function xje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),i.jsx(J,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"LPMM 模式"}),i.jsxs(Et,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[i.jsx(wt,{children:i.jsx(At,{placeholder:"选择 LPMM 模式"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"classic",children:"经典模式"}),i.jsx(Me,{value:"agent",children:"Agent 模式"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"同义词搜索 TopK"}),i.jsx(Ne,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"同义词阈值"}),i.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"实体提取线程数"}),i.jsx(Ne,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"嵌入向量维度"}),i.jsx(Ne,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function bje({config:e,onChange:t}){const[n,r]=y.useState(""),[a,o]=y.useState("WARNING"),l=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),r(""))},u=x=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==x)})},d=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:a}}),r(""),o("WARNING"))},f=x=>{const j={...e.library_log_levels};delete j[x],t({...e,library_log_levels:j})},m=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],p=["FULL","compact","lite"],g=["none","title","full"];return i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"日期格式"}),i.jsx(Ne,{value:e.date_style,onChange:x=>t({...e,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"日志级别样式"}),i.jsxs(Et,{value:e.log_level_style,onValueChange:x=>t({...e,log_level_style:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:p.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"日志文本颜色"}),i.jsxs(Et,{value:e.color_text,onValueChange:x=>t({...e,color_text:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:g.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"全局日志级别"}),i.jsxs(Et,{value:e.log_level,onValueChange:x=>t({...e,log_level:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"控制台日志级别"}),i.jsxs(Et,{value:e.console_log_level,onValueChange:x=>t({...e,console_log_level:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"文件日志级别"}),i.jsxs(Et,{value:e.file_log_level,onValueChange:x=>t({...e,file_log_level:x}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]})]})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"mb-2 block",children:"完全屏蔽的库"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(Ne,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),l())}}),i.jsx(fe,{onClick:l,size:"sm",className:"flex-shrink-0",children:i.jsx(tr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(x=>i.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[i.jsx("span",{className:"text-sm",children:x}),i.jsx(fe,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>u(x),children:i.jsx(Ut,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),i.jsxs("div",{children:[i.jsx(J,{className:"mb-2 block",children:"特定库的日志级别"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(Ne,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),i.jsxs(Et,{value:a,onValueChange:o,children:[i.jsx(wt,{className:"w-32",children:i.jsx(At,{})}),i.jsx(jt,{children:m.map(x=>i.jsx(Me,{value:x,children:x},x))})]}),i.jsx(fe,{onClick:d,size:"sm",children:i.jsx(tr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),i.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([x,j])=>i.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[i.jsx("span",{className:"text-sm font-medium",children:x}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:j}),i.jsx(fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(x),children:i.jsx(Ut,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function wje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示 Prompt"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),i.jsx(at,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示回复器 Prompt"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),i.jsx(at,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示回复器推理"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),i.jsx(at,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"显示 Jargon Prompt"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),i.jsx(at,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function jje({config:e,onChange:t}){const[n,r]=y.useState(""),a=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),r(""))},o=l=>{t({...e,auth_token:e.auth_token.filter((u,d)=>d!==l)})};return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"启用自定义服务器"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),i.jsx(at,{checked:e.use_custom,onCheckedChange:l=>t({...e,use_custom:l})})]}),e.use_custom&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"主机地址"}),i.jsx(Ne,{value:e.host,onChange:l=>t({...e,host:l.target.value}),placeholder:"127.0.0.1"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"端口号"}),i.jsx(Ne,{type:"number",value:e.port,onChange:l=>t({...e,port:parseInt(l.target.value)}),placeholder:"8090"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"连接模式"}),i.jsxs(Et,{value:e.mode,onValueChange:l=>t({...e,mode:l}),children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"ws",children:"WebSocket (ws)"}),i.jsx(Me,{value:"tcp",children:"TCP"})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{checked:e.use_wss,onCheckedChange:l=>t({...e,use_wss:l}),disabled:e.mode!=="ws"}),i.jsx(J,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"SSL 证书文件路径"}),i.jsx(Ne,{value:e.cert_file,onChange:l=>t({...e,cert_file:l.target.value}),placeholder:"cert.pem"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"SSL 密钥文件路径"}),i.jsx(Ne,{value:e.key_file,onChange:l=>t({...e,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"mb-2 block",children:"认证令牌"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(Ne,{value:n,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())}}),i.jsx(fe,{onClick:a,size:"sm",children:i.jsx(tr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),i.jsx("div",{className:"space-y-2",children:e.auth_token.map((l,u)=>i.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[i.jsx("span",{className:"text-sm font-mono",children:l}),i.jsx(fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(u),children:i.jsx(Ut,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},u))})]})]})}function Sje({config:e,onChange:t}){return i.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(J,{children:"启用统计信息发送"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),i.jsx(at,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const Ol=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:n,className:ue("w-full caption-bottom text-sm",e),...t})}));Ol.displayName="Table";const Cl=y.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:ue("[&_tr]:border-b",e),...t}));Cl.displayName="TableHeader";const El=y.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:ue("[&_tr:last-child]:border-0",e),...t}));El.displayName="TableBody";const _je=y.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:ue("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));_je.displayName="TableFooter";const vn=y.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:ue("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));vn.displayName="TableRow";const Je=y.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:ue("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Je.displayName="TableHead";const Ue=y.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:ue("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ue.displayName="TableCell";const Nje=y.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:ue("mt-4 text-sm text-muted-foreground",e),...t}));Nje.displayName="TableCaption";var Xy="Checkbox",[Oje]=hr(Xy),[Cje,jE]=Oje(Xy);function Eje(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:l,name:u,onCheckedChange:d,required:f,value:m="on",internal_do_not_use_render:p}=e,[g,x]=Na({prop:n,defaultProp:a??!1,onChange:d,caller:Xy}),[j,b]=y.useState(null),[w,N]=y.useState(null),O=y.useRef(!1),C=j?!!l||!!j.closest("form"):!0,A={checked:g,disabled:o,setChecked:x,control:j,setControl:b,name:u,form:l,value:m,hasConsumerStoppedPropagationRef:O,required:f,defaultChecked:Xo(a)?!1:a,isFormControl:C,bubbleInput:w,setBubbleInput:N};return i.jsx(Cje,{scope:t,...A,children:Aje(p)?p(A):r})}var ZU="CheckboxTrigger",QU=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:l,disabled:u,checked:d,required:f,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:j}=jE(ZU,e),b=qe(a,m),w=y.useRef(d);return y.useEffect(()=>{const N=o?.form;if(N){const O=()=>p(w.current);return N.addEventListener("reset",O),()=>N.removeEventListener("reset",O)}},[o,p]),i.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":Xo(d)?"mixed":d,"aria-required":f,"data-state":rH(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:b,onKeyDown:Se(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:Se(n,N=>{p(O=>Xo(O)?!0:!O),j&&x&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})})});QU.displayName=ZU;var SE=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:f,form:m,...p}=e;return i.jsx(Eje,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:u,required:l,onCheckedChange:f,name:r,form:m,value:d,internal_do_not_use_render:({isFormControl:g})=>i.jsxs(i.Fragment,{children:[i.jsx(QU,{...p,ref:t,__scopeCheckbox:n}),g&&i.jsx(nH,{__scopeCheckbox:n})]})})});SE.displayName=Xy;var JU="CheckboxIndicator",eH=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=jE(JU,n);return i.jsx(Rn,{present:r||Xo(o.checked)||o.checked===!0,children:i.jsx(Pe.span,{"data-state":rH(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});eH.displayName=JU;var tH="CheckboxBubbleInput",nH=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:u,disabled:d,name:f,value:m,form:p,bubbleInput:g,setBubbleInput:x}=jE(tH,e),j=qe(n,x),b=Ay(o),w=Ty(r);y.useEffect(()=>{const O=g;if(!O)return;const C=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(C,"checked").set,k=!a.current;if(b!==o&&E){const T=new Event("click",{bubbles:k});O.indeterminate=Xo(o),E.call(O,Xo(o)?!1:o),O.dispatchEvent(T)}},[g,b,o,a]);const N=y.useRef(Xo(o)?!1:o);return i.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??N.current,required:u,disabled:d,name:f,value:m,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});nH.displayName=tH;function Aje(e){return typeof e=="function"}function Xo(e){return e==="indeterminate"}function rH(e){return Xo(e)?"indeterminate":e?"checked":"unchecked"}const ku=y.forwardRef(({className:e,...t},n)=>i.jsx(SE,{ref:n,className:ue("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(eH,{className:ue("grid place-content-center text-current"),children:i.jsx(nl,{className:"h-4 w-4"})})}));ku.displayName=SE.displayName;function Tje(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,o]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(null),[j,b]=y.useState(null),[w,N]=y.useState(!1),[O,C]=y.useState(null),[A,E]=y.useState(!1),[k,T]=y.useState(""),[M,$]=y.useState(new Set),[z,D]=y.useState(!1),{toast:U}=mr(),V=y.useRef(null),H=y.useRef(!0);y.useEffect(()=>{G()},[]);const G=async()=>{try{r(!0);const ae=await kg();t(ae.api_providers||[]),f(!1),H.current=!1}catch(ae){console.error("加载配置失败:",ae)}finally{r(!1)}},L=y.useCallback(async ae=>{if(!H.current)try{u(!0),await lO("api_providers",ae),f(!1)}catch(Z){console.error("自动保存失败:",Z),f(!0)}finally{u(!1)}},[]);y.useEffect(()=>{if(!H.current)return f(!0),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{L(e)},2e3),()=>{V.current&&clearTimeout(V.current)}},[e,L]);const R=async()=>{try{o(!0),V.current&&clearTimeout(V.current);const ae=await kg();ae.api_providers=e,await XU(ae),f(!1),U({title:"保存成功",description:"模型提供商配置已保存"})}catch(ae){console.error("保存配置失败:",ae),U({title:"保存失败",description:ae.message,variant:"destructive"})}finally{o(!1)}},F=(ae,Z)=>{x(ae||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),b(Z),E(!1),p(!0)},K=async()=>{if(g?.api_key)try{await navigator.clipboard.writeText(g.api_key),U({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{U({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},te=()=>{if(g){if(j!==null){const ae=[...e];ae[j]=g,t(ae)}else t([...e,g]);p(!1),x(null),b(null)}},I=ae=>{C(ae),N(!0)},B=()=>{if(O!==null){const ae=e.filter((Z,pe)=>pe!==O);t(ae),U({title:"删除成功",description:"提供商已从列表中移除"})}N(!1),C(null)},Y=ae=>{const Z=new Set(M);Z.has(ae)?Z.delete(ae):Z.add(ae),$(Z)},ne=()=>{if(M.size===ee.length)$(new Set);else{const ae=ee.map((Z,pe)=>e.findIndex(je=>je===ee[pe]));$(new Set(ae))}},oe=()=>{if(M.size===0){U({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}D(!0)},xe=()=>{const ae=e.filter((Z,pe)=>!M.has(pe));t(ae),$(new Set),D(!1),U({title:"批量删除成功",description:`已删除 ${M.size} 个提供商`})},ee=e.filter(ae=>{if(!k)return!0;const Z=k.toLowerCase();return ae.name.toLowerCase().includes(Z)||ae.base_url.toLowerCase().includes(Z)||ae.client_type.toLowerCase().includes(Z)});return n?i.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[M.size>0&&i.jsxs(fe,{onClick:oe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[i.jsx(Ut,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",M.size,")"]}),i.jsxs(fe,{onClick:()=>F(null,null),size:"sm",className:"w-full sm:w-auto",children:[i.jsx(tr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),i.jsxs(fe,{onClick:R,disabled:a||l||!d,size:"sm",variant:"default",className:"w-full sm:w-auto",children:[i.jsx(GC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),a?"保存中...":l?"自动保存中...":d?"保存配置":"已保存"]})]})]}),i.jsxs(Kt,{className:"h-[calc(100vh-260px)]",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[i.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索提供商名称、URL 或类型...",value:k,onChange:ae=>T(ae.target.value),className:"pl-9"})]}),k&&i.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",ee.length," 个结果"]})]}),i.jsx("div",{className:"md:hidden space-y-3",children:ee.length===0?i.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):ee.map((ae,Z)=>i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"font-semibold text-base truncate",children:ae.name}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ae.base_url})]}),i.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(ae,Z),children:i.jsx(Eu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>I(Z),children:i.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),i.jsx("p",{className:"font-medium",children:ae.client_type})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),i.jsx("p",{className:"font-medium",children:ae.max_retry})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),i.jsx("p",{className:"font-medium",children:ae.timeout})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),i.jsx("p",{className:"font-medium",children:ae.retry_interval})]})]})]},Z))}),i.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:i.jsxs(Ol,{children:[i.jsx(Cl,{children:i.jsxs(vn,{children:[i.jsx(Je,{className:"w-12",children:i.jsx(ku,{checked:M.size===ee.length&&ee.length>0,onCheckedChange:ne})}),i.jsx(Je,{children:"名称"}),i.jsx(Je,{children:"基础URL"}),i.jsx(Je,{children:"客户端类型"}),i.jsx(Je,{className:"text-right",children:"最大重试"}),i.jsx(Je,{className:"text-right",children:"超时(秒)"}),i.jsx(Je,{className:"text-right",children:"重试间隔(秒)"}),i.jsx(Je,{className:"text-right",children:"操作"})]})}),i.jsx(El,{children:ee.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:8,className:"text-center text-muted-foreground py-8",children:k?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):ee.map((ae,Z)=>{const pe=e.findIndex(je=>je===ae);return i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx(ku,{checked:M.has(pe),onCheckedChange:()=>Y(pe)})}),i.jsx(Ue,{className:"font-medium",children:ae.name}),i.jsx(Ue,{className:"max-w-xs truncate",title:ae.base_url,children:ae.base_url}),i.jsx(Ue,{children:ae.client_type}),i.jsx(Ue,{className:"text-right",children:ae.max_retry}),i.jsx(Ue,{className:"text-right",children:ae.timeout}),i.jsx(Ue,{className:"text-right",children:ae.retry_interval}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(ae,pe),children:i.jsx(Eu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>I(pe),children:i.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},Z)})})]})})]}),i.jsx(nr,{open:m,onOpenChange:p,children:i.jsxs(Hn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:j!==null?"编辑提供商":"添加提供商"}),i.jsx(dr,{children:"配置 API 提供商的连接信息和参数"})]}),i.jsxs("div",{className:"grid gap-4 py-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"name",children:"名称 *"}),i.jsx(Ne,{id:"name",value:g?.name||"",onChange:ae=>x(Z=>Z?{...Z,name:ae.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"base_url",children:"基础 URL *"}),i.jsx(Ne,{id:"base_url",value:g?.base_url||"",onChange:ae=>x(Z=>Z?{...Z,base_url:ae.target.value}:null),placeholder:"https://api.example.com/v1"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"api_key",children:"API Key *"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ne,{id:"api_key",type:A?"text":"password",value:g?.api_key||"",onChange:ae=>x(Z=>Z?{...Z,api_key:ae.target.value}:null),placeholder:"sk-...",className:"flex-1"}),i.jsx(fe,{type:"button",variant:"outline",size:"icon",onClick:()=>E(!A),title:A?"隐藏密钥":"显示密钥",children:A?i.jsx(HN,{className:"h-4 w-4"}):i.jsx(ao,{className:"h-4 w-4"})}),i.jsx(fe,{type:"button",variant:"outline",size:"icon",onClick:K,title:"复制密钥",children:i.jsx(FN,{className:"h-4 w-4"})})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"client_type",children:"客户端类型"}),i.jsxs(Et,{value:g?.client_type||"openai",onValueChange:ae=>x(Z=>Z?{...Z,client_type:ae}:null),children:[i.jsx(wt,{id:"client_type",children:i.jsx(At,{placeholder:"选择客户端类型"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"openai",children:"OpenAI"}),i.jsx(Me,{value:"gemini",children:"Gemini"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"max_retry",children:"最大重试"}),i.jsx(Ne,{id:"max_retry",type:"number",min:"0",value:g?.max_retry||2,onChange:ae=>x(Z=>Z?{...Z,max_retry:parseInt(ae.target.value)}:null)})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"timeout",children:"超时(秒)"}),i.jsx(Ne,{id:"timeout",type:"number",min:"1",value:g?.timeout||30,onChange:ae=>x(Z=>Z?{...Z,timeout:parseInt(ae.target.value)}:null)})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),i.jsx(Ne,{id:"retry_interval",type:"number",min:"1",value:g?.retry_interval||10,onChange:ae=>x(Z=>Z?{...Z,retry_interval:parseInt(ae.target.value)}:null)})]})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"取消"}),i.jsx(fe,{onClick:te,children:"保存"})]})]})}),i.jsx(Pn,{open:w,onOpenChange:N,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除提供商 "',O!==null?e[O]?.name:"",'" 吗? 此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:B,children:"删除"})]})]})}),i.jsx(Pn,{open:z,onOpenChange:D,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认批量删除"}),i.jsxs(jn,{children:["确定要删除选中的 ",M.size," 个提供商吗? 此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}var xL=1,kje=.9,Mje=.8,Pje=.17,t_=.1,n_=.999,Rje=.9999,Dje=.99,$je=/[\\\/_+.#"@\[\(\{&]/,Ije=/[\\\/_+.#"@\[\(\{&]/g,Lje=/[\s-]/,aH=/[\s-]/g;function cO(e,t,n,r,a,o,l){if(o===t.length)return a===e.length?xL:Dje;var u=`${a},${o}`;if(l[u]!==void 0)return l[u];for(var d=r.charAt(o),f=n.indexOf(d,a),m=0,p,g,x,j;f>=0;)p=cO(e,t,n,r,f+1,o+1,l),p>m&&(f===a?p*=xL:$je.test(e.charAt(f-1))?(p*=Mje,x=e.slice(a,f-1).match(Ije),x&&a>0&&(p*=Math.pow(n_,x.length))):Lje.test(e.charAt(f-1))?(p*=kje,j=e.slice(a,f-1).match(aH),j&&a>0&&(p*=Math.pow(n_,j.length))):(p*=Pje,a>0&&(p*=Math.pow(n_,f-a))),e.charAt(f)!==t.charAt(o)&&(p*=Rje)),(pp&&(p=g*t_)),p>m&&(m=p),f=n.indexOf(d,f+1);return l[u]=m,m}function bL(e){return e.toLowerCase().replace(aH," ")}function Bje(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,cO(e,t,bL(e),bL(t),0,0,{})}var zje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fs=zje.reduce((e,t)=>{const n=Bh(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),of='[cmdk-group=""]',r_='[cmdk-group-items=""]',qje='[cmdk-group-heading=""]',iH='[cmdk-item=""]',wL=`${iH}:not([aria-disabled="true"])`,uO="cmdk-item-select",Mc="data-value",Fje=(e,t,n)=>Bje(e,t,n),oH=y.createContext(void 0),Gh=()=>y.useContext(oH),sH=y.createContext(void 0),_E=()=>y.useContext(sH),lH=y.createContext(void 0),cH=y.forwardRef((e,t)=>{let n=Pc(()=>{var B,Y;return{search:"",value:(Y=(B=e.value)!=null?B:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pc(()=>new Set),a=Pc(()=>new Map),o=Pc(()=>new Map),l=Pc(()=>new Set),u=uH(e),{label:d,children:f,value:m,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:w=!0,...N}=e,O=Fn(),C=Fn(),A=Fn(),E=y.useRef(null),k=Jje();gl(()=>{if(m!==void 0){let B=m.trim();n.current.value=B,T.emit()}},[m]),gl(()=>{k(6,V)},[]);let T=y.useMemo(()=>({subscribe:B=>(l.current.add(B),()=>l.current.delete(B)),snapshot:()=>n.current,setState:(B,Y,ne)=>{var oe,xe,ee,ae;if(!Object.is(n.current[B],Y)){if(n.current[B]=Y,B==="search")U(),z(),k(1,D);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(A);Z?Z.focus():(oe=document.getElementById(O))==null||oe.focus()}if(k(7,()=>{var Z;n.current.selectedItemId=(Z=H())==null?void 0:Z.id,T.emit()}),ne||k(5,V),((xe=u.current)==null?void 0:xe.value)!==void 0){let Z=Y??"";(ae=(ee=u.current).onValueChange)==null||ae.call(ee,Z);return}}T.emit()}},emit:()=>{l.current.forEach(B=>B())}}),[]),M=y.useMemo(()=>({value:(B,Y,ne)=>{var oe;Y!==((oe=o.current.get(B))==null?void 0:oe.value)&&(o.current.set(B,{value:Y,keywords:ne}),n.current.filtered.items.set(B,$(Y,ne)),k(2,()=>{z(),T.emit()}))},item:(B,Y)=>(r.current.add(B),Y&&(a.current.has(Y)?a.current.get(Y).add(B):a.current.set(Y,new Set([B]))),k(3,()=>{U(),z(),n.current.value||D(),T.emit()}),()=>{o.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let ne=H();k(4,()=>{U(),ne?.getAttribute("id")===B&&D(),T.emit()})}),group:B=>(a.current.has(B)||a.current.set(B,new Set),()=>{o.current.delete(B),a.current.delete(B)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:O,inputId:A,labelId:C,listInnerRef:E}),[]);function $(B,Y){var ne,oe;let xe=(oe=(ne=u.current)==null?void 0:ne.filter)!=null?oe:Fje;return B?xe(B,n.current.search,Y):0}function z(){if(!n.current.search||u.current.shouldFilter===!1)return;let B=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(oe=>{let xe=a.current.get(oe),ee=0;xe.forEach(ae=>{let Z=B.get(ae);ee=Math.max(Z,ee)}),Y.push([oe,ee])});let ne=E.current;G().sort((oe,xe)=>{var ee,ae;let Z=oe.getAttribute("id"),pe=xe.getAttribute("id");return((ee=B.get(pe))!=null?ee:0)-((ae=B.get(Z))!=null?ae:0)}).forEach(oe=>{let xe=oe.closest(r_);xe?xe.appendChild(oe.parentElement===xe?oe:oe.closest(`${r_} > *`)):ne.appendChild(oe.parentElement===ne?oe:oe.closest(`${r_} > *`))}),Y.sort((oe,xe)=>xe[1]-oe[1]).forEach(oe=>{var xe;let ee=(xe=E.current)==null?void 0:xe.querySelector(`${of}[${Mc}="${encodeURIComponent(oe[0])}"]`);ee?.parentElement.appendChild(ee)})}function D(){let B=G().find(ne=>ne.getAttribute("aria-disabled")!=="true"),Y=B?.getAttribute(Mc);T.setState("value",Y||void 0)}function U(){var B,Y,ne,oe;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let ee of r.current){let ae=(Y=(B=o.current.get(ee))==null?void 0:B.value)!=null?Y:"",Z=(oe=(ne=o.current.get(ee))==null?void 0:ne.keywords)!=null?oe:[],pe=$(ae,Z);n.current.filtered.items.set(ee,pe),pe>0&&xe++}for(let[ee,ae]of a.current)for(let Z of ae)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=xe}function V(){var B,Y,ne;let oe=H();oe&&(((B=oe.parentElement)==null?void 0:B.firstChild)===oe&&((ne=(Y=oe.closest(of))==null?void 0:Y.querySelector(qje))==null||ne.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function H(){var B;return(B=E.current)==null?void 0:B.querySelector(`${iH}[aria-selected="true"]`)}function G(){var B;return Array.from(((B=E.current)==null?void 0:B.querySelectorAll(wL))||[])}function L(B){let Y=G()[B];Y&&T.setState("value",Y.getAttribute(Mc))}function R(B){var Y;let ne=H(),oe=G(),xe=oe.findIndex(ae=>ae===ne),ee=oe[xe+B];(Y=u.current)!=null&&Y.loop&&(ee=xe+B<0?oe[oe.length-1]:xe+B===oe.length?oe[0]:oe[xe+B]),ee&&T.setState("value",ee.getAttribute(Mc))}function F(B){let Y=H(),ne=Y?.closest(of),oe;for(;ne&&!oe;)ne=B>0?Zje(ne,of):Qje(ne,of),oe=ne?.querySelector(wL);oe?T.setState("value",oe.getAttribute(Mc)):R(B)}let K=()=>L(G().length-1),te=B=>{B.preventDefault(),B.metaKey?K():B.altKey?F(1):R(1)},I=B=>{B.preventDefault(),B.metaKey?L(0):B.altKey?F(-1):R(-1)};return y.createElement(fs.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:B=>{var Y;(Y=N.onKeyDown)==null||Y.call(N,B);let ne=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||ne))switch(B.key){case"n":case"j":{w&&B.ctrlKey&&te(B);break}case"ArrowDown":{te(B);break}case"p":case"k":{w&&B.ctrlKey&&I(B);break}case"ArrowUp":{I(B);break}case"Home":{B.preventDefault(),L(0);break}case"End":{B.preventDefault(),K();break}case"Enter":{B.preventDefault();let oe=H();if(oe){let xe=new Event(uO);oe.dispatchEvent(xe)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:t1e},d),Zy(e,B=>y.createElement(sH.Provider,{value:T},y.createElement(oH.Provider,{value:M},B))))}),Uje=y.forwardRef((e,t)=>{var n,r;let a=Fn(),o=y.useRef(null),l=y.useContext(lH),u=Gh(),d=uH(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:l?.forceMount;gl(()=>{if(!f)return u.item(a,l?.id)},[f]);let m=dH(a,o,[e.value,e.children,o],e.keywords),p=_E(),g=ns(k=>k.value&&k.value===m.current),x=ns(k=>f||u.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);y.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(uO,j),()=>k.removeEventListener(uO,j)},[x,e.onSelect,e.disabled]);function j(){var k,T;b(),(T=(k=d.current).onSelect)==null||T.call(k,m.current)}function b(){p.setState("value",m.current,!0)}if(!x)return null;let{disabled:w,value:N,onSelect:O,forceMount:C,keywords:A,...E}=e;return y.createElement(fs.div,{ref:Rr(o,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!g,"data-disabled":!!w,"data-selected":!!g,onPointerMove:w||u.getDisablePointerSelection()?void 0:b,onClick:w?void 0:j},e.children)}),Hje=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,l=Fn(),u=y.useRef(null),d=y.useRef(null),f=Fn(),m=Gh(),p=ns(x=>a||m.filter()===!1?!0:x.search?x.filtered.groups.has(l):!0);gl(()=>m.group(l),[]),dH(l,u,[e.value,e.heading,d]);let g=y.useMemo(()=>({id:l,forceMount:a}),[a]);return y.createElement(fs.div,{ref:Rr(u,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&y.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Zy(e,x=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},y.createElement(lH.Provider,{value:g},x))))}),Wje=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=y.useRef(null),o=ns(l=>!l.search);return!n&&!o?null:y.createElement(fs.div,{ref:Rr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Vje=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=_E(),l=ns(f=>f.search),u=ns(f=>f.selectedItemId),d=Gh();return y.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),y.createElement(fs.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:l,onChange:f=>{a||o.setState("search",f.target.value),n?.(f.target.value)}})}),Gje=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=y.useRef(null),l=y.useRef(null),u=ns(f=>f.selectedItemId),d=Gh();return y.useEffect(()=>{if(l.current&&o.current){let f=l.current,m=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;m.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),y.createElement(fs.div,{ref:Rr(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:d.listId},Zy(e,f=>y.createElement("div",{ref:Rr(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Yje=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:l,...u}=e;return y.createElement(nE,{open:n,onOpenChange:r},y.createElement(rE,{container:l},y.createElement($y,{"cmdk-overlay":"",className:a}),y.createElement(Iy,{"aria-label":e.label,"cmdk-dialog":"",className:o},y.createElement(cH,{ref:t,...u}))))}),Kje=y.forwardRef((e,t)=>ns(n=>n.filtered.count===0)?y.createElement(fs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Xje=y.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return y.createElement(fs.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Zy(e,l=>y.createElement("div",{"aria-hidden":!0},l)))}),Br=Object.assign(cH,{List:Gje,Item:Uje,Input:Vje,Group:Hje,Separator:Wje,Dialog:Yje,Empty:Kje,Loading:Xje});function Zje(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Qje(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uH(e){let t=y.useRef(e);return gl(()=>{t.current=e}),t}var gl=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Pc(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function ns(e){let t=_E(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function dH(e,t,n,r=[]){let a=y.useRef(),o=Gh();return gl(()=>{var l;let u=(()=>{var f;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(f=m.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());o.value(e,u,d),(l=t.current)==null||l.setAttribute(Mc,u),a.current=u}),a}var Jje=()=>{let[e,t]=y.useState(),n=Pc(()=>new Map);return gl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function e1e(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Zy({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(e1e(t),{ref:t.ref},n(t.props.children)):n(t)}var t1e={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const fH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br,{ref:n,className:ue("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));fH.displayName=Br.displayName;const hH=y.forwardRef(({className:e,...t},n)=>i.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[i.jsx(Dr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),i.jsx(Br.Input,{ref:n,className:ue("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));hH.displayName=Br.Input.displayName;const mH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.List,{ref:n,className:ue("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));mH.displayName=Br.List.displayName;const pH=y.forwardRef((e,t)=>i.jsx(Br.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));pH.displayName=Br.Empty.displayName;const vH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.Group,{ref:n,className:ue("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));vH.displayName=Br.Group.displayName;const n1e=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.Separator,{ref:n,className:ue("-mx-1 h-px bg-border",e),...t}));n1e.displayName=Br.Separator.displayName;const gH=y.forwardRef(({className:e,...t},n)=>i.jsx(Br.Item,{ref:n,className:ue("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));gH.displayName=Br.Item.displayName;function r1e({options:e,selected:t,onChange:n,placeholder:r="选择选项...",emptyText:a="未找到选项",className:o}){const[l,u]=y.useState(!1),d=m=>{t.includes(m)?n(t.filter(p=>p!==m)):n([...t,m])},f=m=>{n(t.filter(p=>p!==m))};return i.jsxs(es,{open:l,onOpenChange:u,children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",role:"combobox","aria-expanded":l,className:ue("w-full justify-between min-h-10 h-auto",o),children:[i.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?i.jsx("span",{className:"text-muted-foreground",children:r}):t.map(m=>{const p=e.find(g=>g.value===m);return i.jsxs(tn,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:g=>{g.stopPropagation(),f(m)},children:[p?.label||m,i.jsx(Lh,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},m)})}),i.jsx(sve,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),i.jsx(so,{className:"w-full p-0",align:"start",children:i.jsxs(fH,{children:[i.jsx(hH,{placeholder:"搜索...",className:"h-9"}),i.jsxs(mH,{children:[i.jsx(pH,{children:a}),i.jsx(vH,{children:e.map(m=>{const p=t.includes(m.value);return i.jsxs(gH,{value:m.value,onSelect:()=>d(m.value),children:[i.jsx("div",{className:ue("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",p?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:i.jsx(nl,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),i.jsx("span",{children:m.label})]},m.value)})})]})]})})]})}function a1e(){const[e,t]=y.useState([]),[n,r]=y.useState([]),[a,o]=y.useState([]),[l,u]=y.useState(null),[d,f]=y.useState(!0),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState(!1),[w,N]=y.useState(!1),[O,C]=y.useState(null),[A,E]=y.useState(null),[k,T]=y.useState(!1),[M,$]=y.useState(null),[z,D]=y.useState(""),[U,V]=y.useState(new Set),[H,G]=y.useState(!1),{toast:L}=mr(),R=y.useRef(null),F=y.useRef(null),K=y.useRef(!0);y.useEffect(()=>{te()},[]);const te=async()=>{try{f(!0);const me=await kg(),ve=me.models||[];t(ve),o(ve.map(Dt=>Dt.name));const Le=me.api_providers||[];r(Le.map(Dt=>Dt.name)),u(me.model_task_config||null),b(!1),K.current=!1}catch(me){console.error("加载配置失败:",me)}finally{f(!1)}},I=y.useCallback(async me=>{if(!K.current)try{x(!0),await lO("models",me),b(!1)}catch(ve){console.error("自动保存模型列表失败:",ve),b(!0)}finally{x(!1)}},[]),B=y.useCallback(async me=>{if(!K.current)try{x(!0),await lO("model_task_config",me),b(!1)}catch(ve){console.error("自动保存任务配置失败:",ve),b(!0)}finally{x(!1)}},[]);y.useEffect(()=>{if(!K.current)return b(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{I(e)},2e3),()=>{R.current&&clearTimeout(R.current)}},[e,I]),y.useEffect(()=>{if(!(K.current||!l))return b(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{B(l)},2e3),()=>{F.current&&clearTimeout(F.current)}},[l,B]);const Y=async()=>{try{p(!0),R.current&&clearTimeout(R.current),F.current&&clearTimeout(F.current);const me=await kg();me.models=e,me.model_task_config=l,await XU(me),b(!1),L({title:"保存成功",description:"模型配置已保存"}),await te()}catch(me){console.error("保存配置失败:",me),L({title:"保存失败",description:me.message,variant:"destructive"})}finally{p(!1)}},ne=(me,ve)=>{C(me||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),E(ve),N(!0)},oe=()=>{if(O){if(A!==null){const me=[...e];me[A]=O,t(me)}else t([...e,O]);N(!1),C(null),E(null)}},xe=me=>{$(me),T(!0)},ee=()=>{if(M!==null){const me=e.filter((ve,Le)=>Le!==M);t(me),L({title:"删除成功",description:"模型已从列表中移除"})}T(!1),$(null)},ae=me=>{const ve=new Set(U);ve.has(me)?ve.delete(me):ve.add(me),V(ve)},Z=()=>{if(U.size===Re.length)V(new Set);else{const me=Re.map((ve,Le)=>e.findIndex(Dt=>Dt===Re[Le]));V(new Set(me))}},pe=()=>{if(U.size===0){L({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}G(!0)},je=()=>{const me=e.filter((ve,Le)=>!U.has(Le));t(me),V(new Set),G(!1),L({title:"批量删除成功",description:`已删除 ${U.size} 个模型`})},le=(me,ve,Le)=>{l&&u({...l,[me]:{...l[me],[ve]:Le}})},Re=e.filter(me=>{if(!z)return!0;const ve=z.toLowerCase();return me.name.toLowerCase().includes(ve)||me.model_identifier.toLowerCase().includes(ve)||me.api_provider.toLowerCase().includes(ve)}),_e=me=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some(Le=>Le.includes(me)):!1;return d?i.jsx(Kt,{className:"h-full",children:i.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:i.jsx("div",{className:"flex items-center justify-center h-64",children:i.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):i.jsx(Kt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),i.jsxs(fe,{onClick:Y,disabled:m||g||!j,size:"sm",className:"w-full sm:w-auto",children:[i.jsx(GC,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),m?"保存中...":g?"自动保存中...":j?"保存配置":"已保存"]})]}),i.jsxs(sl,{defaultValue:"models",className:"w-full",children:[i.jsxs(Zo,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[i.jsx(Ct,{value:"models",children:"模型配置"}),i.jsx(Ct,{value:"tasks",children:"模型任务配置"})]}),i.jsxs(Jt,{value:"models",className:"space-y-4 mt-0",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),i.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[U.size>0&&i.jsxs(fe,{onClick:pe,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[i.jsx(Ut,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",U.size,")"]}),i.jsxs(fe,{onClick:()=>ne(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[i.jsx(tr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[i.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索模型名称、标识符或提供商...",value:z,onChange:me=>D(me.target.value),className:"pl-9"})]}),z&&i.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Re.length," 个结果"]})]}),i.jsx("div",{className:"md:hidden space-y-3",children:Re.length===0?i.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的模型":"暂无模型配置"}):Re.map((me,ve)=>{const Le=_e(me.name);return i.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("h3",{className:"font-semibold text-base",children:me.name}),i.jsx(tn,{variant:Le?"default":"secondary",className:Le?"bg-green-600 hover:bg-green-700":"",children:Le?"已使用":"未使用"})]}),i.jsx("p",{className:"text-xs text-muted-foreground break-all",title:me.model_identifier,children:me.model_identifier})]}),i.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>ne(me,ve),children:i.jsx(Eu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>xe(ve),children:i.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),i.jsx("p",{className:"font-medium",children:me.api_provider})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),i.jsx("p",{className:"font-medium",children:me.force_stream_mode?"是":"否"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),i.jsxs("p",{className:"font-medium",children:["¥",me.price_in,"/M"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),i.jsxs("p",{className:"font-medium",children:["¥",me.price_out,"/M"]})]})]})]},ve)})}),i.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:i.jsxs(Ol,{children:[i.jsx(Cl,{children:i.jsxs(vn,{children:[i.jsx(Je,{className:"w-12",children:i.jsx(ku,{checked:U.size===Re.length&&Re.length>0,onCheckedChange:Z})}),i.jsx(Je,{className:"w-24",children:"使用状态"}),i.jsx(Je,{children:"模型名称"}),i.jsx(Je,{children:"模型标识符"}),i.jsx(Je,{children:"提供商"}),i.jsx(Je,{className:"text-right",children:"输入价格"}),i.jsx(Je,{className:"text-right",children:"输出价格"}),i.jsx(Je,{className:"text-center",children:"强制流式"}),i.jsx(Je,{className:"text-right",children:"操作"})]})}),i.jsx(El,{children:Re.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:9,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的模型":"暂无模型配置"})}):Re.map((me,ve)=>{const Le=e.findIndex(On=>On===me),Dt=_e(me.name);return i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx(ku,{checked:U.has(Le),onCheckedChange:()=>ae(Le)})}),i.jsx(Ue,{children:i.jsx(tn,{variant:Dt?"default":"secondary",className:Dt?"bg-green-600 hover:bg-green-700":"",children:Dt?"已使用":"未使用"})}),i.jsx(Ue,{className:"font-medium",children:me.name}),i.jsx(Ue,{className:"max-w-xs truncate",title:me.model_identifier,children:me.model_identifier}),i.jsx(Ue,{children:me.api_provider}),i.jsxs(Ue,{className:"text-right",children:["¥",me.price_in,"/M"]}),i.jsxs(Ue,{className:"text-right",children:["¥",me.price_out,"/M"]}),i.jsx(Ue,{className:"text-center",children:me.force_stream_mode?"是":"否"}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>ne(me,Le),children:i.jsx(Eu,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>xe(Le),children:i.jsx(Ut,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},ve)})})]})})]}),i.jsxs(Jt,{value:"tasks",className:"space-y-6 mt-0",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&i.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[i.jsx(Ra,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:a,onChange:(me,ve)=>le("utils",me,ve)}),i.jsx(Ra,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:a,onChange:(me,ve)=>le("utils_small",me,ve)}),i.jsx(Ra,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:a,onChange:(me,ve)=>le("tool_use",me,ve)}),i.jsx(Ra,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:a,onChange:(me,ve)=>le("replyer",me,ve)}),i.jsx(Ra,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:a,onChange:(me,ve)=>le("planner",me,ve)}),i.jsx(Ra,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:a,onChange:(me,ve)=>le("vlm",me,ve),hideTemperature:!0}),i.jsx(Ra,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:a,onChange:(me,ve)=>le("voice",me,ve),hideTemperature:!0,hideMaxTokens:!0}),i.jsx(Ra,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:a,onChange:(me,ve)=>le("embedding",me,ve),hideTemperature:!0,hideMaxTokens:!0}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),i.jsx(Ra,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:a,onChange:(me,ve)=>le("lpmm_entity_extract",me,ve)}),i.jsx(Ra,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:a,onChange:(me,ve)=>le("lpmm_rdf_build",me,ve)}),i.jsx(Ra,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:a,onChange:(me,ve)=>le("lpmm_qa",me,ve)})]})]})]})]}),i.jsx(nr,{open:w,onOpenChange:N,children:i.jsxs(Hn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:A!==null?"编辑模型":"添加模型"}),i.jsx(dr,{children:"配置模型的基本信息和参数"})]}),i.jsxs("div",{className:"grid gap-4 py-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"model_name",children:"模型名称 *"}),i.jsx(Ne,{id:"model_name",value:O?.name||"",onChange:me=>C(ve=>ve?{...ve,name:me.target.value}:null),placeholder:"例如: qwen3-30b"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"model_identifier",children:"模型标识符 *"}),i.jsx(Ne,{id:"model_identifier",value:O?.model_identifier||"",onChange:me=>C(ve=>ve?{...ve,model_identifier:me.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"api_provider",children:"API 提供商 *"}),i.jsxs(Et,{value:O?.api_provider||"",onValueChange:me=>C(ve=>ve?{...ve,api_provider:me}:null),children:[i.jsx(wt,{id:"api_provider",children:i.jsx(At,{placeholder:"选择提供商"})}),i.jsx(jt,{children:n.map(me=>i.jsx(Me,{value:me,children:me},me))})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),i.jsx(Ne,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in||0,onChange:me=>C(ve=>ve?{...ve,price_in:parseFloat(me.target.value)}:null)})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),i.jsx(Ne,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out||0,onChange:me=>C(ve=>ve?{...ve,price_out:parseFloat(me.target.value)}:null)})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:me=>C(ve=>ve?{...ve,force_stream_mode:me}:null)}),i.jsx(J,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>N(!1),children:"取消"}),i.jsx(fe,{onClick:oe,children:"保存"})]})]})}),i.jsx(Pn,{open:k,onOpenChange:T,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除模型 "',M!==null?e[M]?.name:"",'" 吗? 此操作无法撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:ee,children:"删除"})]})]})}),i.jsx(Pn,{open:H,onOpenChange:G,children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认批量删除"}),i.jsxs(jn,{children:["确定要删除选中的 ",U.size," 个模型吗? 此操作无法撤销。"]})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})})}function Ra({title:e,description:t,taskConfig:n,modelNames:r,onChange:a,hideTemperature:o=!1,hideMaxTokens:l=!1}){const u=d=>{a("model_list",d)};return i.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),i.jsxs("div",{className:"grid gap-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"模型列表"}),i.jsx(r1e,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:u,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"温度"}),i.jsx(Ne,{type:"number",step:"0.1",min:"0",max:"2",value:n.temperature||.3,onChange:d=>a("temperature",parseFloat(d.target.value))})]}),!l&&i.jsxs("div",{className:"grid gap-2",children:[i.jsx(J,{children:"最大 Token"}),i.jsx(Ne,{type:"number",step:"1",min:"1",value:n.max_tokens||1024,onChange:d=>a("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Al="/api/webui/emoji";async function i1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await Ze(`${Al}/list?${t}`,{headers:st()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function o1e(e){const t=await Ze(`${Al}/${e}`,{headers:st()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function s1e(e,t){const n=await Ze(`${Al}/${e}`,{method:"PATCH",headers:st(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function l1e(e){const t=await Ze(`${Al}/${e}`,{method:"DELETE",headers:st()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function c1e(){const e=await Ze(`${Al}/stats/summary`,{headers:st()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function u1e(e){const t=await Ze(`${Al}/${e}/register`,{method:"POST",headers:st()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function d1e(e){const t=await Ze(`${Al}/${e}/ban`,{method:"POST",headers:st()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function f1e(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[a,o]=y.useState(!1),[l,u]=y.useState(1),[d,f]=y.useState(0),[m]=y.useState(20),[p,g]=y.useState(""),[x,j]=y.useState("all"),[b,w]=y.useState("all"),[N,O]=y.useState("all"),[C,A]=y.useState(null),[E,k]=y.useState(!1),[T,M]=y.useState(!1),[$,z]=y.useState(!1),{toast:D}=mr(),U=y.useCallback(async()=>{try{o(!0);const I=await i1e({page:l,page_size:m,search:p||void 0,is_registered:x==="all"?void 0:x==="registered",is_banned:b==="all"?void 0:b==="banned",format:N==="all"?void 0:N,sort_by:"usage_count",sort_order:"desc"});t(I.data),f(I.total)}catch(I){const B=I instanceof Error?I.message:"加载表情包列表失败";D({title:"错误",description:B,variant:"destructive"})}finally{o(!1)}},[l,m,p,x,b,N,D]),V=async()=>{try{const I=await c1e();r(I.data)}catch(I){console.error("加载统计数据失败:",I)}};y.useEffect(()=>{U()},[U]),y.useEffect(()=>{V()},[]);const H=async I=>{try{const B=await o1e(I.id);A(B.data),k(!0)}catch(B){const Y=B instanceof Error?B.message:"加载详情失败";D({title:"错误",description:Y,variant:"destructive"})}},G=I=>{A(I),M(!0)},L=I=>{A(I),z(!0)},R=async()=>{if(C)try{await l1e(C.id),D({title:"成功",description:"表情包已删除"}),z(!1),A(null),U(),V()}catch(I){const B=I instanceof Error?I.message:"删除失败";D({title:"错误",description:B,variant:"destructive"})}},F=async I=>{try{await u1e(I.id),D({title:"成功",description:"表情包已注册"}),U(),V()}catch(B){const Y=B instanceof Error?B.message:"注册失败";D({title:"错误",description:Y,variant:"destructive"})}},K=async I=>{try{await d1e(I.id),D({title:"成功",description:"表情包已封禁"}),U(),V()}catch(B){const Y=B instanceof Error?B.message:"封禁失败";D({title:"错误",description:Y,variant:"destructive"})}},te=n?.formats?Object.keys(n.formats):[];return i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),n&&i.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[i.jsx(dt,{children:i.jsxs(Vt,{className:"pb-2",children:[i.jsx(er,{children:"总数"}),i.jsx(Gt,{className:"text-2xl",children:n.total})]})}),i.jsx(dt,{children:i.jsxs(Vt,{className:"pb-2",children:[i.jsx(er,{children:"已注册"}),i.jsx(Gt,{className:"text-2xl text-green-600",children:n.registered})]})}),i.jsx(dt,{children:i.jsxs(Vt,{className:"pb-2",children:[i.jsx(er,{children:"已封禁"}),i.jsx(Gt,{className:"text-2xl text-red-600",children:n.banned})]})}),i.jsx(dt,{children:i.jsxs(Vt,{className:"pb-2",children:[i.jsx(er,{children:"未注册"}),i.jsx(Gt,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),i.jsxs(dt,{children:[i.jsx(Vt,{children:i.jsxs(Gt,{className:"flex items-center gap-2",children:[i.jsx(WN,{className:"h-5 w-5"}),"搜索和筛选"]})}),i.jsxs(cn,{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"搜索"}),i.jsxs("div",{className:"relative",children:[i.jsx(Dr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"描述或哈希值...",value:p,onChange:I=>{g(I.target.value),u(1)},className:"pl-8"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"注册状态"}),i.jsxs(Et,{value:x,onValueChange:I=>{j(I),u(1)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),i.jsx(Me,{value:"registered",children:"已注册"}),i.jsx(Me,{value:"unregistered",children:"未注册"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"封禁状态"}),i.jsxs(Et,{value:b,onValueChange:I=>{w(I),u(1)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),i.jsx(Me,{value:"banned",children:"已封禁"}),i.jsx(Me,{value:"unbanned",children:"未封禁"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"格式"}),i.jsxs(Et,{value:N,onValueChange:I=>{O(I),u(1)},children:[i.jsx(wt,{children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),te.map(I=>i.jsxs(Me,{value:I,children:[I.toUpperCase()," (",n?.formats[I],")"]},I))]})]})]})]}),i.jsx("div",{className:"flex justify-end",children:i.jsxs(fe,{variant:"outline",size:"sm",onClick:U,disabled:a,children:[i.jsx(al,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"刷新"]})})]})]}),i.jsxs(dt,{children:[i.jsxs(Vt,{children:[i.jsx(Gt,{children:"表情包列表"}),i.jsxs(er,{children:["共 ",d," 个表情包,当前第 ",l," 页"]})]}),i.jsxs(cn,{children:[i.jsx("div",{className:"rounded-md border",children:i.jsxs(Ol,{children:[i.jsx(Cl,{children:i.jsxs(vn,{children:[i.jsx(Je,{className:"w-16",children:"预览"}),i.jsx(Je,{children:"描述"}),i.jsx(Je,{children:"格式"}),i.jsx(Je,{className:"text-center",children:"状态"}),i.jsx(Je,{className:"text-right",children:"使用次数"}),i.jsx(Je,{className:"text-right",children:"操作"})]})}),i.jsx(El,{children:e.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(I=>i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx("div",{className:"w-12 h-12 bg-muted rounded flex items-center justify-center",children:i.jsx(Mve,{className:"h-6 w-6 text-muted-foreground"})})}),i.jsx(Ue,{children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"font-medium",children:I.description||"无描述"}),i.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[I.emoji_hash.slice(0,16),"..."]})]})}),i.jsx(Ue,{children:i.jsx(tn,{variant:"outline",children:I.format.toUpperCase()})}),i.jsx(Ue,{children:i.jsxs("div",{className:"flex gap-2 justify-center",children:[I.is_registered&&i.jsxs(tn,{variant:"default",className:"bg-green-600",children:[i.jsx(Cu,{className:"h-3 w-3 mr-1"}),"已注册"]}),I.is_banned&&i.jsxs(tn,{variant:"destructive",children:[i.jsx(Gq,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),i.jsx(Ue,{className:"text-right font-mono",children:I.usage_count}),i.jsx(Ue,{children:i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>H(I),children:i.jsx(Yq,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>G(I),children:i.jsx(KC,{className:"h-4 w-4"})}),!I.is_registered&&i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(I),className:"text-green-600 hover:text-green-700",children:i.jsx(Cu,{className:"h-4 w-4"})}),!I.is_banned&&i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>K(I),className:"text-orange-600 hover:text-orange-700",children:i.jsx(Vpe,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>L(I),className:"text-red-600 hover:text-red-700",children:i.jsx(Ut,{className:"h-4 w-4"})})]})})]},I.id))})]})}),d>m&&i.jsxs("div",{className:"flex items-center justify-between mt-4",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*m+1," 到"," ",Math.min(l*m,d)," 条,共 ",d," 条"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(fe,{variant:"outline",size:"sm",onClick:()=>u(I=>Math.max(1,I-1)),disabled:l===1,children:[i.jsx(HC,{className:"h-4 w-4"}),"上一页"]}),i.jsxs("div",{className:"text-sm",children:["第 ",l," / ",Math.ceil(d/m)," 页"]}),i.jsxs(fe,{variant:"outline",size:"sm",onClick:()=>u(I=>I+1),disabled:l>=Math.ceil(d/m),children:["下一页",i.jsx(WC,{className:"h-4 w-4"})]})]})]})]})]}),i.jsx(h1e,{emoji:C,open:E,onOpenChange:k}),i.jsx(m1e,{emoji:C,open:T,onOpenChange:M,onSuccess:()=>{U(),V()}}),i.jsx(nr,{open:$,onOpenChange:z,children:i.jsxs(Hn,{children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"确认删除"}),i.jsx(dr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>z(!1),children:"取消"}),i.jsx(fe,{variant:"destructive",onClick:R,children:"删除"})]})]})})]})}function h1e({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl",children:[i.jsx(Wn,{children:i.jsx(Vn,{children:"表情包详情"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"ID"}),i.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"格式"}),i.jsx("div",{className:"mt-1",children:i.jsx(tn,{variant:"outline",children:e.format.toUpperCase()})})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"文件路径"}),i.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"哈希值"}),i.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"描述"}),i.jsx("div",{className:"mt-1",children:e.description||"-"})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"情绪标签"}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.emotion&&e.emotion.length>0?e.emotion.map((a,o)=>i.jsx(tn,{variant:"secondary",children:a},o)):i.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"状态"}),i.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&i.jsx(tn,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&i.jsx(tn,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&i.jsx(tn,{variant:"outline",children:"未注册"})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"使用次数"}),i.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"记录时间"}),i.jsx("div",{className:"mt-1 text-sm",children:r(e.record_time)})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"注册时间"}),i.jsx("div",{className:"mt-1 text-sm",children:r(e.register_time)})]})]}),i.jsxs("div",{children:[i.jsx(J,{className:"text-muted-foreground",children:"最后使用"}),i.jsx("div",{className:"mt-1 text-sm",children:r(e.last_used_time)})]})]})]})})}function m1e({emoji:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=y.useState(""),[l,u]=y.useState(""),[d,f]=y.useState(!1),[m,p]=y.useState(!1),[g,x]=y.useState(!1),{toast:j}=mr();y.useEffect(()=>{e&&(o(e.description||""),u(e.emotion?e.emotion.join(", "):""),f(e.is_registered),p(e.is_banned))},[e]);const b=async()=>{if(e)try{x(!0);const w=l.split(",").map(N=>N.trim()).filter(Boolean);await s1e(e.id,{description:a||void 0,emotion:w.length>0?w:void 0,is_registered:d,is_banned:m}),j({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(w){const N=w instanceof Error?w.message:"保存失败";j({title:"错误",description:N,variant:"destructive"})}finally{x(!1)}};return e?i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑表情包"}),i.jsx(dr,{children:"修改表情包的描述和标签信息"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(J,{children:"描述"}),i.jsx(qt,{value:a,onChange:w=>o(w.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx(J,{children:"情绪标签"}),i.jsx(Ne,{value:l,onChange:w=>u(w.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔"})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"checkbox",id:"is_registered",checked:d,onChange:w=>f(w.target.checked),className:"rounded border-gray-300"}),i.jsx(J,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"checkbox",id:"is_banned",checked:m,onChange:w=>p(w.target.checked),className:"rounded border-gray-300"}),i.jsx(J,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"取消"}),i.jsx(fe,{onClick:b,disabled:g,children:g?"保存中...":"保存"})]})]})}):null}const Zu="/api/webui/expression";async function p1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await Ze(`${Zu}/list?${t}`,{headers:st()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function v1e(e){const t=await Ze(`${Zu}/${e}`,{headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function g1e(e){const t=await Ze(`${Zu}/`,{method:"POST",headers:st(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function y1e(e,t){const n=await Ze(`${Zu}/${e}`,{method:"PATCH",headers:st(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function x1e(e){const t=await Ze(`${Zu}/${e}`,{method:"DELETE",headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function b1e(){const e=await Ze(`${Zu}/stats/summary`,{headers:st()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function w1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,o]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(null),[x,j]=y.useState(!1),[b,w]=y.useState(!1),[N,O]=y.useState(!1),[C,A]=y.useState(null),[E,k]=y.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:T}=mr(),M=async()=>{try{r(!0);const H=await p1e({page:l,page_size:d,search:f||void 0});t(H.data),o(H.total)}catch(H){T({title:"加载失败",description:H instanceof Error?H.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},$=async()=>{try{const H=await b1e();k(H.data)}catch(H){console.error("加载统计数据失败:",H)}};y.useEffect(()=>{M(),$()},[l,d,f]);const z=async H=>{try{const G=await v1e(H.id);g(G.data),j(!0)}catch(G){T({title:"加载详情失败",description:G instanceof Error?G.message:"无法加载表达方式详情",variant:"destructive"})}},D=H=>{g(H),w(!0)},U=async H=>{try{await x1e(H.id),T({title:"删除成功",description:`已删除表达方式: ${H.situation}`}),A(null),M(),$()}catch(G){T({title:"删除失败",description:G instanceof Error?G.message:"无法删除表达方式",variant:"destructive"})}},V=H=>H?new Date(H*1e3).toLocaleString("zh-CN"):"-";return i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[i.jsx(Ih,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),i.jsxs(fe,{onClick:()=>O(!0),className:"gap-2",children:[i.jsx(tr,{className:"h-4 w-4"}),"新增表达方式"]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),i.jsx("div",{className:"text-2xl font-bold mt-1",children:E.total})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:E.recent_7days})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:E.chat_count})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx(J,{htmlFor:"search",children:"搜索"}),i.jsxs("div",{className:"relative mt-1.5",children:[i.jsx(Dr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{id:"search",placeholder:"搜索情境、风格或上下文...",value:f,onChange:H=>m(H.target.value),className:"pl-9"})]})]}),i.jsxs("div",{className:"rounded-lg border bg-card",children:[i.jsx(Kt,{className:"h-[calc(100vh-500px)]",children:i.jsxs(Ol,{children:[i.jsx(Cl,{children:i.jsxs(vn,{children:[i.jsx(Je,{children:"情境"}),i.jsx(Je,{children:"风格"}),i.jsx(Je,{children:"聊天ID"}),i.jsx(Je,{children:"最后活跃"}),i.jsx(Je,{className:"text-right",children:"操作"})]})}),i.jsx(El,{children:n?i.jsx(vn,{children:i.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(H=>i.jsxs(vn,{children:[i.jsx(Ue,{className:"font-medium max-w-xs truncate",children:H.situation}),i.jsx(Ue,{className:"max-w-xs truncate",children:H.style}),i.jsx(Ue,{className:"font-mono text-sm",children:H.chat_id}),i.jsx(Ue,{className:"text-sm text-muted-foreground",children:V(H.last_active_time)}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>z(H),children:i.jsx(ao,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>D(H),children:i.jsx(KC,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>A(H),children:i.jsx(Ut,{className:"h-4 w-4 text-destructive"})})]})})]},H.id))})]})}),a>d&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),i.jsx(j1e,{expression:p,open:x,onOpenChange:j}),i.jsx(S1e,{open:N,onOpenChange:O,onSuccess:()=>{M(),$(),O(!1)}}),i.jsx(_1e,{expression:p,open:b,onOpenChange:w,onSuccess:()=>{M(),$(),w(!1)}}),i.jsx(Pn,{open:!!C,onOpenChange:()=>A(null),children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除表达方式 "',C?.situation,'" 吗? 此操作不可撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>C&&U(C),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function j1e({expression:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"表达方式详情"}),i.jsx(dr,{children:"查看表达方式的完整信息"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Cc,{label:"情境",value:e.situation}),i.jsx(Cc,{label:"风格",value:e.style}),i.jsx(Cc,{icon:wg,label:"聊天ID",value:e.chat_id,mono:!0}),i.jsx(Cc,{icon:wg,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"上下文"}),i.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"上文内容"}),i.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Cc,{icon:rl,label:"最后活跃",value:r(e.last_active_time)}),i.jsx(Cc,{icon:rl,label:"创建时间",value:r(e.create_date)})]})]}),i.jsx($r,{children:i.jsx(fe,{onClick:()=>n(!1),children:"关闭"})})]})})}function Cc({icon:e,label:t,value:n,mono:r=!1}){return i.jsxs("div",{className:"space-y-1",children:[i.jsxs(J,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&i.jsx(e,{className:"h-3 w-3"}),t]}),i.jsx("div",{className:ue("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function S1e({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=y.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[o,l]=y.useState(!1),{toast:u}=mr(),d=async()=>{if(!r.situation||!r.style||!r.chat_id){u({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await g1e(r),u({title:"创建成功",description:"表达方式已创建"}),a({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){u({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return i.jsx(nr,{open:e,onOpenChange:t,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"新增表达方式"}),i.jsx(dr,{children:"创建新的表达方式记录"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(J,{htmlFor:"situation",children:["情境 ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Ne,{id:"situation",value:r.situation,onChange:f=>a({...r,situation:f.target.value}),placeholder:"描述使用场景"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(J,{htmlFor:"style",children:["风格 ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Ne,{id:"style",value:r.style,onChange:f=>a({...r,style:f.target.value}),placeholder:"描述表达风格"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(J,{htmlFor:"chat_id",children:["聊天ID ",i.jsx("span",{className:"text-destructive",children:"*"})]}),i.jsx(Ne,{id:"chat_id",value:r.chat_id,onChange:f=>a({...r,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"context",children:"上下文"}),i.jsx(qt,{id:"context",value:r.context,onChange:f=>a({...r,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"up_content",children:"上文内容"}),i.jsx(qt,{id:"up_content",value:r.up_content,onChange:f=>a({...r,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"取消"}),i.jsx(fe,{onClick:d,disabled:o,children:o?"创建中...":"创建"})]})]})})}function _1e({expression:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=mr();y.useEffect(()=>{e&&o({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{u(!0),await y1e(e.id,a),d({title:"保存成功",description:"表达方式已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{u(!1)}};return e?i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑表达方式"}),i.jsx(dr,{children:"修改表达方式的信息"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_situation",children:"情境"}),i.jsx(Ne,{id:"edit_situation",value:a.situation||"",onChange:m=>o({...a,situation:m.target.value}),placeholder:"描述使用场景"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_style",children:"风格"}),i.jsx(Ne,{id:"edit_style",value:a.style||"",onChange:m=>o({...a,style:m.target.value}),placeholder:"描述表达风格"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_chat_id",children:"聊天ID"}),i.jsx(Ne,{id:"edit_chat_id",value:a.chat_id||"",onChange:m=>o({...a,chat_id:m.target.value}),placeholder:"关联的聊天ID"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_context",children:"上下文"}),i.jsx(qt,{id:"edit_context",value:a.context||"",onChange:m=>o({...a,context:m.target.value}),placeholder:"上下文信息",rows:3})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit_up_content",children:"上文内容"}),i.jsx(qt,{id:"edit_up_content",value:a.up_content||"",onChange:m=>o({...a,up_content:m.target.value}),placeholder:"上文内容",rows:3})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"取消"}),i.jsx(fe,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}const Yh="/api/webui/person";async function N1e(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await Ze(`${Yh}/list?${t}`,{headers:st()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function O1e(e){const t=await Ze(`${Yh}/${e}`,{headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function C1e(e,t){const n=await Ze(`${Yh}/${e}`,{method:"PATCH",headers:st(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function E1e(e){const t=await Ze(`${Yh}/${e}`,{method:"DELETE",headers:st()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function A1e(){const e=await Ze(`${Yh}/stats/summary`,{headers:st()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function T1e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[a,o]=y.useState(0),[l,u]=y.useState(1),[d]=y.useState(20),[f,m]=y.useState(""),[p,g]=y.useState(void 0),[x,j]=y.useState(void 0),[b,w]=y.useState(null),[N,O]=y.useState(!1),[C,A]=y.useState(!1),[E,k]=y.useState(null),[T,M]=y.useState({total:0,known:0,unknown:0,platforms:{}}),{toast:$}=mr(),z=async()=>{try{r(!0);const R=await N1e({page:l,page_size:d,search:f||void 0,is_known:p,platform:x});t(R.data),o(R.total)}catch(R){$({title:"加载失败",description:R instanceof Error?R.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},D=async()=>{try{const R=await A1e();M(R.data)}catch(R){console.error("加载统计数据失败:",R)}};y.useEffect(()=>{z(),D()},[l,d,f,p,x]);const U=async R=>{try{const F=await O1e(R.person_id);w(F.data),O(!0)}catch(F){$({title:"加载详情失败",description:F instanceof Error?F.message:"无法加载人物详情",variant:"destructive"})}},V=R=>{w(R),A(!0)},H=async R=>{try{await E1e(R.person_id),$({title:"删除成功",description:`已删除人物信息: ${R.person_name||R.nickname||R.user_id}`}),k(null),z(),D()}catch(F){$({title:"删除失败",description:F instanceof Error?F.message:"无法删除人物信息",variant:"destructive"})}},G=y.useMemo(()=>Object.keys(T.platforms),[T.platforms]),L=R=>R?new Date(R*1e3).toLocaleString("zh-CN"):"-";return i.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[i.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[i.jsx(Oge,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),i.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),i.jsx("div",{className:"text-2xl font-bold mt-1",children:T.total})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:T.known})]}),i.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),i.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:T.unknown})]})]}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx(J,{htmlFor:"search",children:"搜索"}),i.jsxs("div",{className:"relative mt-1.5",children:[i.jsx(Dr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:f,onChange:R=>m(R.target.value),className:"pl-9"})]})]}),i.jsxs("div",{children:[i.jsx(J,{htmlFor:"filter-known",children:"认识状态"}),i.jsxs(Et,{value:p===void 0?"all":p.toString(),onValueChange:R=>{g(R==="all"?void 0:R==="true"),u(1)},children:[i.jsx(wt,{id:"filter-known",className:"mt-1.5",children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部"}),i.jsx(Me,{value:"true",children:"已认识"}),i.jsx(Me,{value:"false",children:"未认识"})]})]})]}),i.jsxs("div",{children:[i.jsx(J,{htmlFor:"filter-platform",children:"平台"}),i.jsxs(Et,{value:x||"all",onValueChange:R=>{j(R==="all"?void 0:R),u(1)},children:[i.jsx(wt,{id:"filter-platform",className:"mt-1.5",children:i.jsx(At,{})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部平台"}),G.map(R=>i.jsxs(Me,{value:R,children:[R," (",T.platforms[R],")"]},R))]})]})]})]})}),i.jsxs("div",{className:"rounded-lg border bg-card",children:[i.jsx(Kt,{className:"h-[calc(100vh-500px)]",children:i.jsxs(Ol,{children:[i.jsx(Cl,{children:i.jsxs(vn,{children:[i.jsx(Je,{children:"状态"}),i.jsx(Je,{children:"名称"}),i.jsx(Je,{children:"昵称"}),i.jsx(Je,{children:"平台"}),i.jsx(Je,{children:"用户ID"}),i.jsx(Je,{children:"最后更新"}),i.jsx(Je,{className:"text-right",children:"操作"})]})}),i.jsx(El,{children:n?i.jsx(vn,{children:i.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?i.jsx(vn,{children:i.jsx(Ue,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(R=>i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx("div",{className:ue("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",R.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:R.is_known?"已认识":"未认识"})}),i.jsx(Ue,{className:"font-medium",children:R.person_name||i.jsx("span",{className:"text-muted-foreground",children:"-"})}),i.jsx(Ue,{children:R.nickname||"-"}),i.jsx(Ue,{children:R.platform}),i.jsx(Ue,{className:"font-mono text-sm",children:R.user_id}),i.jsx(Ue,{className:"text-sm text-muted-foreground",children:L(R.last_know)}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>U(R),children:i.jsx(ao,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>V(R),children:i.jsx(KC,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>k(R),children:i.jsx(Ut,{className:"h-4 w-4 text-destructive"})})]})})]},R.id))})]})}),a>d&&i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[i.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),i.jsx(k1e,{person:b,open:N,onOpenChange:O}),i.jsx(M1e,{person:b,open:C,onOpenChange:A,onSuccess:()=>{z(),D(),A(!1)}}),i.jsx(Pn,{open:!!E,onOpenChange:()=>k(null),children:i.jsxs(yn,{children:[i.jsxs(xn,{children:[i.jsx(wn,{children:"确认删除"}),i.jsxs(jn,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),i.jsxs(bn,{children:[i.jsx(_n,{children:"取消"}),i.jsx(Sn,{onClick:()=>E&&H(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function k1e({person:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"人物详情"}),i.jsxs(dr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Ui,{icon:Qq,label:"人物名称",value:e.person_name}),i.jsx(Ui,{icon:Ih,label:"昵称",value:e.nickname}),i.jsx(Ui,{icon:wg,label:"用户ID",value:e.user_id,mono:!0}),i.jsx(Ui,{icon:wg,label:"人物ID",value:e.person_id,mono:!0}),i.jsx(Ui,{label:"平台",value:e.platform}),i.jsx(Ui,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),i.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"个人印象"}),i.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&i.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[i.jsx(J,{className:"text-xs text-muted-foreground",children:"群昵称"}),i.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((a,o)=>i.jsxs("div",{className:"text-sm flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:a.group_id}),i.jsx("span",{children:"→"}),i.jsx("span",{children:a.group_nick_name})]},o))})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[i.jsx(Ui,{icon:rl,label:"认识时间",value:r(e.know_times)}),i.jsx(Ui,{icon:rl,label:"首次记录",value:r(e.know_since)}),i.jsx(Ui,{icon:rl,label:"最后更新",value:r(e.last_know)})]})]}),i.jsx($r,{children:i.jsx(fe,{onClick:()=>n(!1),children:"关闭"})})]})})}function Ui({icon:e,label:t,value:n,mono:r=!1}){return i.jsxs("div",{className:"space-y-1",children:[i.jsxs(J,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&i.jsx(e,{className:"h-3 w-3"}),t]}),i.jsx("div",{className:ue("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function M1e({person:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=y.useState({}),[l,u]=y.useState(!1),{toast:d}=mr();y.useEffect(()=>{e&&o({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{u(!0),await C1e(e.person_id,a),d({title:"保存成功",description:"人物信息已更新"}),r()}catch(m){d({title:"保存失败",description:m instanceof Error?m.message:"无法更新人物信息",variant:"destructive"})}finally{u(!1)}};return e?i.jsx(nr,{open:t,onOpenChange:n,children:i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑人物信息"}),i.jsxs(dr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"person_name",children:"人物名称"}),i.jsx(Ne,{id:"person_name",value:a.person_name||"",onChange:m=>o({...a,person_name:m.target.value}),placeholder:"为这个人设置一个名称"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"nickname",children:"昵称"}),i.jsx(Ne,{id:"nickname",value:a.nickname||"",onChange:m=>o({...a,nickname:m.target.value}),placeholder:"昵称"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"name_reason",children:"名称设定原因"}),i.jsx(qt,{id:"name_reason",value:a.name_reason||"",onChange:m=>o({...a,name_reason:m.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"memory_points",children:"个人印象"}),i.jsx(qt,{id:"memory_points",value:a.memory_points||"",onChange:m=>o({...a,memory_points:m.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),i.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[i.jsxs("div",{children:[i.jsx(J,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),i.jsx(at,{id:"is_known",checked:a.is_known,onCheckedChange:m=>o({...a,is_known:m})})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>n(!1),children:"取消"}),i.jsx(fe,{onClick:f,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function P1e(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const R1e={},hf={};function Ys(e,t){try{const r=(R1e[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in hf?hf[r]:jL(r,r.split(":"))}catch{if(e in hf)return hf[e];const n=e?.match(D1e);return n?jL(e,n.slice(1)):NaN}}const D1e=/([+-]\d\d):?(\d\d)?/;function jL(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return hf[e]=n*60+r>0?n*60+r+a:n*60-r-a}class ci extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ys(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),yH(this),dO(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new ci(...n,t):new ci(Date.now(),t)}withTimeZone(t){return new ci(+this,t)}getTimezoneOffset(){const t=-Ys(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),dO(this),+this}[Symbol.for("constructDateFrom")](t){return new ci(+new Date(t),this.timeZone)}}const SL=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!SL.test(e))return;const t=e.replace(SL,"$1UTC");ci.prototype[t]&&(e.startsWith("get")?ci.prototype[e]=function(){return this.internal[t]()}:(ci.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),$1e(this),+this},ci.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),dO(this),+this}))});function dO(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Ys(e.timeZone,e)*60))}function $1e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),yH(e)}function yH(e){const t=Ys(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),l=a-o,u=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&u&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const f=new Date(+e);f.setUTCSeconds(0);const m=a>0?f.getSeconds():(f.getSeconds()-60)%60,p=Math.round(-(Ys(e.timeZone,e)*60))%60;(p||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+m));const g=Ys(e.timeZone,e),x=g>0?Math.floor(g):Math.ceil(g),b=-new Date(+e).getTimezoneOffset()-x,w=x!==n,N=b-d;if(w&&N){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N);const O=Ys(e.timeZone,e),C=O>0?Math.floor(O):Math.ceil(O),A=x-C;A&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+A))}}class sr extends ci{static tz(t,...n){return n.length?new sr(...n,t):new sr(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${P1e(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new sr(+this,t)}[Symbol.for("constructDateFrom")](t){return new sr(+new Date(t),this.timeZone)}}const xH=6048e5,I1e=864e5,_L=Symbol.for("constructDateFrom");function Nn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_L in e?e[_L](t):e instanceof Date?new e.constructor(t):new Date(t)}function Rt(e,t){return Nn(t||e,e)}function bH(e,t,n){const r=Rt(e,n?.in);return isNaN(t)?Nn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function wH(e,t,n){const r=Rt(e,n?.in);if(isNaN(t))return Nn(e,NaN);if(!t)return r;const a=r.getDate(),o=Nn(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const l=o.getDate();return a>=l?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let L1e={};function Kh(){return L1e}function rs(e,t){const n=Kh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Rt(e,t?.in),o=a.getDay(),l=(o=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function NL(e){const t=Rt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Tl(e,...t){const n=Nn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function vh(e,t){const n=Rt(e,t?.in);return n.setHours(0,0,0,0),n}function SH(e,t,n){const[r,a]=Tl(n?.in,e,t),o=vh(r),l=vh(a),u=+o-NL(o),d=+l-NL(l);return Math.round((u-d)/I1e)}function B1e(e,t){const n=jH(e,t),r=Nn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ph(r)}function z1e(e,t,n){return bH(e,t*7,n)}function q1e(e,t,n){return wH(e,t*12,n)}function F1e(e,t){let n,r=t?.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=Nn.bind(null,a));const o=Rt(a,r);(!n||n{!r&&typeof a=="object"&&(r=Nn.bind(null,a));const o=Rt(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),Nn(r,n||NaN)}function H1e(e,t,n){const[r,a]=Tl(n?.in,e,t);return+vh(r)==+vh(a)}function _H(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function W1e(e){return!(!_H(e)&&typeof e!="number"||isNaN(+Rt(e)))}function V1e(e,t,n){const[r,a]=Tl(n?.in,e,t),o=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return o*12+l}function G1e(e,t){const n=Rt(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function NH(e,t){const[n,r]=Tl(e,t.start,t.end);return{start:n,end:r}}function Y1e(e,t){const{start:n,end:r}=NH(t?.in,e);let a=+n>+r;const o=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=o;)d.push(Nn(n,l)),l.setMonth(l.getMonth()+u);return a?d.reverse():d}function K1e(e,t){const n=Rt(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function X1e(e,t){const n=Rt(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function OH(e,t){const n=Rt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Z1e(e,t){const{start:n,end:r}=NH(t?.in,e);let a=+n>+r;const o=a?+n:+r,l=a?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=o;)d.push(Nn(n,l)),l.setFullYear(l.getFullYear()+u);return a?d.reverse():d}function CH(e,t){const n=Kh(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Rt(e,t?.in),o=a.getDay(),l=(o{let r;const a=J1e[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Kc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const tSe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nSe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rSe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},aSe={date:Kc({formats:tSe,defaultWidth:"full"}),time:Kc({formats:nSe,defaultWidth:"full"}),dateTime:Kc({formats:rSe,defaultWidth:"full"})},iSe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oSe=(e,t,n,r)=>iSe[e];function ri(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n?.width?String(n.width):l;a=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n?.width?String(n.width):e.defaultWidth;a=e.values[u]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const sSe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lSe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cSe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},uSe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hSe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},mSe={ordinalNumber:hSe,era:ri({values:sSe,defaultWidth:"wide"}),quarter:ri({values:lSe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ri({values:cSe,defaultWidth:"wide"}),day:ri({values:uSe,defaultWidth:"wide"}),dayPeriod:ri({values:dSe,defaultWidth:"wide",formattingValues:fSe,defaultFormattingWidth:"wide"})};function ai(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const l=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?vSe(u,p=>p.test(l)):pSe(u,p=>p.test(l));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const m=t.slice(l.length);return{value:f,rest:m}}}function pSe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vSe(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}const gSe=/^(\d+)(th|st|nd|rd)?/i,ySe=/\d+/i,xSe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bSe={any:[/^b/i,/^(a|c)/i]},wSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jSe={any:[/1/i,/2/i,/3/i,/4/i]},SSe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_Se={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},NSe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},OSe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},CSe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ESe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ASe={ordinalNumber:EH({matchPattern:gSe,parsePattern:ySe,valueCallback:e=>parseInt(e,10)}),era:ai({matchPatterns:xSe,defaultMatchWidth:"wide",parsePatterns:bSe,defaultParseWidth:"any"}),quarter:ai({matchPatterns:wSe,defaultMatchWidth:"wide",parsePatterns:jSe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ai({matchPatterns:SSe,defaultMatchWidth:"wide",parsePatterns:_Se,defaultParseWidth:"any"}),day:ai({matchPatterns:NSe,defaultMatchWidth:"wide",parsePatterns:OSe,defaultParseWidth:"any"}),dayPeriod:ai({matchPatterns:CSe,defaultMatchWidth:"any",parsePatterns:ESe,defaultParseWidth:"any"})},NE={code:"en-US",formatDistance:eSe,formatLong:aSe,formatRelative:oSe,localize:mSe,match:ASe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function TSe(e,t){const n=Rt(e,t?.in);return SH(n,OH(n))+1}function AH(e,t){const n=Rt(e,t?.in),r=+ph(n)-+B1e(n);return Math.round(r/xH)+1}function TH(e,t){const n=Rt(e,t?.in),r=n.getFullYear(),a=Kh(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=Nn(t?.in||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const u=rs(l,t),d=Nn(t?.in||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const f=rs(d,t);return+n>=+u?r+1:+n>=+f?r:r-1}function kSe(e,t){const n=Kh(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=TH(e,t),o=Nn(t?.in||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),rs(o,t)}function kH(e,t){const n=Rt(e,t?.in),r=+rs(n,t)-+kSe(n,t);return Math.round(r/xH)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Bo={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Ot(a,t.length)}},Ec={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},OL={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Bo.y(e,t)},Y:function(e,t,n,r){const a=TH(e,r),o=a>0?a:1-a;if(t==="YY"){const l=o%100;return Ot(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Ot(o,t.length)},R:function(e,t){const n=jH(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Bo.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=kH(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Ot(a,t.length)},I:function(e,t,n){const r=AH(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Bo.d(e,t)},D:function(e,t,n){const r=TSe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Ot(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Ot(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Ot(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Ec.noon:r===0?a=Ec.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Ec.evening:r>=12?a=Ec.afternoon:r>=4?a=Ec.morning:a=Ec.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Bo.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Bo.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Bo.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Bo.s(e,t)},S:function(e,t){return Bo.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return EL(r);case"XXXX":case"XX":return qs(r);case"XXXXX":case"XXX":default:return qs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return EL(r);case"xxxx":case"xx":return qs(r);case"xxxxx":case"xxx":default:return qs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+CL(r,":");case"OOOO":default:return"GMT"+qs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+CL(r,":");case"zzzz":default:return"GMT"+qs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ot(r,t.length)},T:function(e,t,n){return Ot(+e,t.length)}};function CL(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+t+Ot(o,2)}function EL(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):qs(e,t)}function qs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Ot(Math.trunc(r/60),2),o=Ot(r%60,2);return n+a+t+o}const AL=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},MH=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},MSe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return AL(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",AL(r,t)).replace("{{time}}",MH(a,t))},PSe={p:MH,P:MSe},RSe=/^D+$/,DSe=/^Y+$/,$Se=["D","DD","YY","YYYY"];function ISe(e){return RSe.test(e)}function LSe(e){return DSe.test(e)}function BSe(e,t,n){const r=zSe(e,t,n);if(console.warn(r),$Se.includes(e))throw new RangeError(r)}function zSe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qSe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,USe=/^'([^]*?)'?$/,HSe=/''/g,WSe=/[a-zA-Z]/;function cv(e,t,n){const r=Kh(),a=n?.locale??r.locale??NE,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=Rt(e,n?.in);if(!W1e(u))throw new RangeError("Invalid time value");let d=t.match(FSe).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=PSe[p];return g(m,a.formatLong)}return m}).join("").match(qSe).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:VSe(m)};if(OL[p])return{isToken:!0,value:m};if(p.match(WSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const f={firstWeekContainsDate:o,weekStartsOn:l,locale:a};return d.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&LSe(p)||!n?.useAdditionalDayOfYearTokens&&ISe(p))&&BSe(p,t,String(e));const g=OL[p[0]];return g(u,p,a.localize,f)}).join("")}function VSe(e){const t=e.match(USe);return t?t[1].replace(HSe,"'"):e}function GSe(e,t){const n=Rt(e,t?.in),r=n.getFullYear(),a=n.getMonth(),o=Nn(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function YSe(e,t){return Rt(e,t?.in).getMonth()}function KSe(e,t){return Rt(e,t?.in).getFullYear()}function XSe(e,t){return+Rt(e)>+Rt(t)}function ZSe(e,t){return+Rt(e)<+Rt(t)}function QSe(e,t,n){const[r,a]=Tl(n?.in,e,t);return+rs(r,n)==+rs(a,n)}function JSe(e,t,n){const[r,a]=Tl(n?.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function e_e(e,t,n){const[r,a]=Tl(n?.in,e,t);return r.getFullYear()===a.getFullYear()}function t_e(e,t,n){const r=Rt(e,n?.in),a=r.getFullYear(),o=r.getDate(),l=Nn(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const u=GSe(l);return r.setMonth(t,Math.min(o,u)),r}function n_e(e,t,n){const r=Rt(e,n?.in);return isNaN(+r)?Nn(e,NaN):(r.setFullYear(t),r)}const TL=5,r_e=4;function a_e(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),o=t.addDays(a,TL*7-1);return t.getMonth(e)===t.getMonth(o)?TL:r_e}function PH(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function i_e(e,t){const n=PH(e,t),r=a_e(e,t);return t.addDays(n,r*7-1)}class ia{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?sr.tz(this.options.timeZone):new this.Date,this.newDate=(r,a,o)=>this.overrides?.newDate?this.overrides.newDate(r,a,o):this.options.timeZone?new sr(r,a,o,this.options.timeZone):new Date(r,a,o),this.addDays=(r,a)=>this.overrides?.addDays?this.overrides.addDays(r,a):bH(r,a),this.addMonths=(r,a)=>this.overrides?.addMonths?this.overrides.addMonths(r,a):wH(r,a),this.addWeeks=(r,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,a):z1e(r,a),this.addYears=(r,a)=>this.overrides?.addYears?this.overrides.addYears(r,a):q1e(r,a),this.differenceInCalendarDays=(r,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):SH(r,a),this.differenceInCalendarMonths=(r,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):V1e(r,a),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Y1e(r),this.eachYearOfInterval=r=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Z1e(r),o=new Set(a.map(u=>this.getYear(u)));if(o.size===a.length)return a;const l=[];return o.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):i_e(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Q1e(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):G1e(r),this.endOfWeek=(r,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,a):CH(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):X1e(r),this.format=(r,a,o)=>{const l=this.overrides?.format?this.overrides.format(r,a,this.options):cv(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):AH(r),this.getMonth=(r,a)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):YSe(r,this.options),this.getYear=(r,a)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):KSe(r,this.options),this.getWeek=(r,a)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):kH(r,this.options),this.isAfter=(r,a)=>this.overrides?.isAfter?this.overrides.isAfter(r,a):XSe(r,a),this.isBefore=(r,a)=>this.overrides?.isBefore?this.overrides.isBefore(r,a):ZSe(r,a),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):_H(r),this.isSameDay=(r,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,a):H1e(r,a),this.isSameMonth=(r,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,a):JSe(r,a),this.isSameYear=(r,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,a):e_e(r,a),this.max=r=>this.overrides?.max?this.overrides.max(r):F1e(r),this.min=r=>this.overrides?.min?this.overrides.min(r):U1e(r),this.setMonth=(r,a)=>this.overrides?.setMonth?this.overrides.setMonth(r,a):t_e(r,a),this.setYear=(r,a)=>this.overrides?.setYear?this.overrides.setYear(r,a):n_e(r,a),this.startOfBroadcastWeek=(r,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):PH(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):vh(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):ph(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):K1e(r),this.startOfWeek=(r,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):rs(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):OH(r),this.options={locale:NE,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ia.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,o=n?.code;if(o&&ia.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}ia.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const ji=new ia;class RH{constructor(t,n,r=ji){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class o_e{constructor(t,n){this.date=t,this.weeks=n}}class s_e{constructor(t,n){this.days=n,this.weekNumber=t}}function l_e(e){return W.createElement("button",{...e})}function c_e(e){return W.createElement("span",{...e})}function u_e(e){const{size:t=24,orientation:n="left",className:r}=e;return W.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&W.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&W.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&W.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&W.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function d_e(e){const{day:t,modifiers:n,...r}=e;return W.createElement("td",{...r})}function f_e(e){const{day:t,modifiers:n,...r}=e,a=W.useRef(null);return W.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),W.createElement("button",{ref:a,...r})}var $e;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})($e||($e={}));var en;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(en||(en={}));var za;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(za||(za={}));var Xr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Xr||(Xr={}));function h_e(e){const{options:t,className:n,components:r,classNames:a,...o}=e,l=[a[$e.Dropdown],n].join(" "),u=t?.find(({value:d})=>d===o.value);return W.createElement("span",{"data-disabled":o.disabled,className:a[$e.DropdownRoot]},W.createElement(r.Select,{className:l,...o},t?.map(({value:d,label:f,disabled:m})=>W.createElement(r.Option,{key:d,value:d,disabled:m},f))),W.createElement("span",{className:a[$e.CaptionLabel],"aria-hidden":!0},u?.label,W.createElement(r.Chevron,{orientation:"down",size:18,className:a[$e.Chevron]})))}function m_e(e){return W.createElement("div",{...e})}function p_e(e){return W.createElement("div",{...e})}function v_e(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r},e.children)}function g_e(e){const{calendarMonth:t,displayIndex:n,...r}=e;return W.createElement("div",{...r})}function y_e(e){return W.createElement("table",{...e})}function x_e(e){return W.createElement("div",{...e})}const DH=y.createContext(void 0);function Xh(){const e=y.useContext(DH);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function b_e(e){const{components:t}=Xh();return W.createElement(t.Dropdown,{...e})}function w_e(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=Xh(),m=y.useCallback(g=>{a&&n?.(g)},[a,n]),p=y.useCallback(g=>{r&&t?.(g)},[r,t]);return W.createElement("nav",{...o},W.createElement(l.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:p},W.createElement(l.Chevron,{disabled:r?void 0:!0,className:u[$e.Chevron],orientation:"left"})),W.createElement(l.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:m},W.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:u[$e.Chevron]})))}function j_e(e){const{components:t}=Xh();return W.createElement(t.Button,{...e})}function S_e(e){return W.createElement("option",{...e})}function __e(e){const{components:t}=Xh();return W.createElement(t.Button,{...e})}function N_e(e){const{rootRef:t,...n}=e;return W.createElement("div",{...n,ref:t})}function O_e(e){return W.createElement("select",{...e})}function C_e(e){const{week:t,...n}=e;return W.createElement("tr",{...n})}function E_e(e){return W.createElement("th",{...e})}function A_e(e){return W.createElement("thead",{"aria-hidden":!0},W.createElement("tr",{...e}))}function T_e(e){const{week:t,...n}=e;return W.createElement("th",{...n})}function k_e(e){return W.createElement("th",{...e})}function M_e(e){return W.createElement("tbody",{...e})}function P_e(e){const{components:t}=Xh();return W.createElement(t.Dropdown,{...e})}const R_e=Object.freeze(Object.defineProperty({__proto__:null,Button:l_e,CaptionLabel:c_e,Chevron:u_e,Day:d_e,DayButton:f_e,Dropdown:h_e,DropdownNav:m_e,Footer:p_e,Month:v_e,MonthCaption:g_e,MonthGrid:y_e,Months:x_e,MonthsDropdown:b_e,Nav:w_e,NextMonthButton:j_e,Option:S_e,PreviousMonthButton:__e,Root:N_e,Select:O_e,Week:C_e,WeekNumber:T_e,WeekNumberHeader:k_e,Weekday:E_e,Weekdays:A_e,Weeks:M_e,YearsDropdown:P_e},Symbol.toStringTag,{value:"Module"}));function Ki(e,t,n=!1,r=ji){let{from:a,to:o}=e;const{differenceInCalendarDays:l,isSameDay:u}=r;return a&&o?(l(o,a)<0&&([a,o]=[o,a]),l(t,a)>=(n?1:0)&&l(o,t)>=(n?1:0)):!n&&o?u(o,t):!n&&a?u(a,t):!1}function $H(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function OE(e){return!!(e&&typeof e=="object"&&"from"in e)}function IH(e){return!!(e&&typeof e=="object"&&"after"in e)}function LH(e){return!!(e&&typeof e=="object"&&"before"in e)}function BH(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function zH(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Xi(e,t,n=ji){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:o,isAfter:l}=n;return r.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return a(e,u);if(zH(u,n))return u.includes(e);if(OE(u))return Ki(u,e,!1,n);if(BH(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(e.getDay()):u.dayOfWeek===e.getDay();if($H(u)){const d=o(u.before,e),f=o(u.after,e),m=d>0,p=f<0;return l(u.before,u.after)?p&&m:m||p}return IH(u)?o(e,u.after)>0:LH(u)?o(u.before,e)>0:typeof u=="function"?u(e):!1})}function D_e(e,t,n,r,a){const{disabled:o,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:m}=t,{isSameDay:p,isSameMonth:g,startOfMonth:x,isBefore:j,endOfMonth:b,isAfter:w}=a,N=n&&x(n),O=r&&b(r),C={[en.focused]:[],[en.outside]:[],[en.disabled]:[],[en.hidden]:[],[en.today]:[]},A={};for(const E of e){const{date:k,displayMonth:T}=E,M=!!(T&&!g(k,T)),$=!!(N&&j(k,N)),z=!!(O&&w(k,O)),D=!!(o&&Xi(k,o,a)),U=!!(l&&Xi(k,l,a))||$||z||!f&&!d&&M||f&&d===!1&&M,V=p(k,m??a.today());M&&C.outside.push(E),D&&C.disabled.push(E),U&&C.hidden.push(E),V&&C.today.push(E),u&&Object.keys(u).forEach(H=>{const G=u?.[H];G&&Xi(k,G,a)&&(A[H]?A[H].push(E):A[H]=[E])})}return E=>{const k={[en.focused]:!1,[en.disabled]:!1,[en.hidden]:!1,[en.outside]:!1,[en.today]:!1},T={};for(const M in C){const $=C[M];k[M]=$.some(z=>z===E)}for(const M in A)T[M]=A[M].some($=>$===E);return{...k,...T}}}function $_e(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):t[en[o]]?a.push(t[en[o]]):t[za[o]]&&a.push(t[za[o]]),a),[t[$e.Day]])}function I_e(e){return{...R_e,...e}}function L_e(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function CE(){const e={};for(const t in $e)e[$e[t]]=`rdp-${$e[t]}`;for(const t in en)e[en[t]]=`rdp-${en[t]}`;for(const t in za)e[za[t]]=`rdp-${za[t]}`;for(const t in Xr)e[Xr[t]]=`rdp-${Xr[t]}`;return e}function qH(e,t,n){return(n??new ia(t)).formatMonthYear(e)}const B_e=qH;function z_e(e,t,n){return(n??new ia(t)).format(e,"d")}function q_e(e,t=ji){return t.format(e,"LLLL")}function F_e(e,t,n){return(n??new ia(t)).format(e,"cccccc")}function U_e(e,t=ji){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function H_e(){return""}function FH(e,t=ji){return t.format(e,"yyyy")}const W_e=FH,V_e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:qH,formatDay:z_e,formatMonthCaption:B_e,formatMonthDropdown:q_e,formatWeekNumber:U_e,formatWeekNumberHeader:H_e,formatWeekdayName:F_e,formatYearCaption:W_e,formatYearDropdown:FH},Symbol.toStringTag,{value:"Module"}));function G_e(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...V_e,...e}}function Y_e(e,t,n,r,a){const{startOfMonth:o,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=a;return d({start:l(e),end:u(e)}).map(g=>{const x=r.formatMonthDropdown(g,a),j=f(g),b=t&&go(n)||!1;return{value:j,label:x,disabled:b}})}function K_e(e,t={},n={}){let r={...t?.[$e.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n?.[a]}}),r}function X_e(e,t,n){const r=e.today(),a=t?e.startOfISOWeek(r):e.startOfWeek(r),o=[];for(let l=0;l<7;l++){const u=e.addDays(a,l);o.push(u)}return o}function Z_e(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:l,eachYearOfInterval:u,getYear:d}=r,f=o(e),m=l(t),p=u({start:f,end:m});return a&&p.reverse(),p.map(g=>{const x=n.formatYearDropdown(g,r);return{value:d(g),label:x,disabled:!1}})}function UH(e,t,n,r){let a=(r??new ia(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const Q_e=UH;function HH(e,t,n){return(n??new ia(t)).formatMonthYear(e)}const J_e=HH;function eNe(e,t,n,r){let a=(r??new ia(n)).format(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a}function tNe(e){return"Choose the Month"}function nNe(){return""}function rNe(e){return"Go to the Next Month"}function aNe(e){return"Go to the Previous Month"}function iNe(e,t,n){return(n??new ia(t)).format(e,"cccc")}function oNe(e,t){return`Week ${e}`}function sNe(e){return"Week Number"}function lNe(e){return"Choose the Year"}const cNe=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:J_e,labelDay:Q_e,labelDayButton:UH,labelGrid:HH,labelGridcell:eNe,labelMonthDropdown:tNe,labelNav:nNe,labelNext:rNe,labelPrevious:aNe,labelWeekNumber:oNe,labelWeekNumberHeader:sNe,labelWeekday:iNe,labelYearDropdown:lNe},Symbol.toStringTag,{value:"Module"})),Zh=e=>e instanceof HTMLElement?e:null,a_=e=>[...e.querySelectorAll("[data-animated-month]")??[]],uNe=e=>Zh(e.querySelector("[data-animated-month]")),i_=e=>Zh(e.querySelector("[data-animated-caption]")),o_=e=>Zh(e.querySelector("[data-animated-weeks]")),dNe=e=>Zh(e.querySelector("[data-animated-nav]")),fNe=e=>Zh(e.querySelector("[data-animated-weekdays]"));function hNe(e,t,{classNames:n,months:r,focused:a,dateLib:o}){const l=y.useRef(null),u=y.useRef(r),d=y.useRef(!1);y.useLayoutEffect(()=>{const f=u.current;if(u.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||f.length===0||r.length!==f.length)return;const m=o.isSameMonth(r[0].date,f[0].date),p=o.isAfter(r[0].date,f[0].date),g=p?n[Xr.caption_after_enter]:n[Xr.caption_before_enter],x=p?n[Xr.weeks_after_enter]:n[Xr.weeks_before_enter],j=l.current,b=e.current.cloneNode(!0);if(b instanceof HTMLElement?(a_(b).forEach(C=>{if(!(C instanceof HTMLElement))return;const A=uNe(C);A&&C.contains(A)&&C.removeChild(A);const E=i_(C);E&&E.classList.remove(g);const k=o_(C);k&&k.classList.remove(x)}),l.current=b):l.current=null,d.current||m||a)return;const w=j instanceof HTMLElement?a_(j):[],N=a_(e.current);if(N?.every(O=>O instanceof HTMLElement)&&w&&w.every(O=>O instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const O=dNe(e.current);O&&(O.style.zIndex="1"),N.forEach((C,A)=>{const E=w[A];if(!E)return;C.style.position="relative",C.style.overflow="hidden";const k=i_(C);k&&k.classList.add(g);const T=o_(C);T&&T.classList.add(x);const M=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),O&&(O.style.zIndex=""),k&&k.classList.remove(g),T&&T.classList.remove(x),C.style.position="",C.style.overflow="",C.contains(E)&&C.removeChild(E)};E.style.pointerEvents="none",E.style.position="absolute",E.style.overflow="hidden",E.setAttribute("aria-hidden","true");const $=fNe(E);$&&($.style.opacity="0");const z=i_(E);z&&(z.classList.add(p?n[Xr.caption_before_exit]:n[Xr.caption_after_exit]),z.addEventListener("animationend",M));const D=o_(E);D&&D.classList.add(p?n[Xr.weeks_before_exit]:n[Xr.weeks_after_exit]),C.insertBefore(E,C.firstChild)})}})}function mNe(e,t,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:j,endOfWeek:b,isAfter:w,startOfBroadcastWeek:N,startOfISOWeek:O,startOfWeek:C}=r,A=d?N(a,r):l?O(a):C(a),E=d?g(o):l?x(j(o)):b(j(o)),k=m(E,A),T=p(o,a)+1,M=[];for(let D=0;D<=k;D++){const U=f(A,D);if(t&&w(U,t))break;M.push(U)}const z=(d?35:42)*T;if(u&&M.length{const a=r.weeks.reduce((o,l)=>o.concat(l.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function vNe(e,t,n,r){const{numberOfMonths:a=1}=n,o=[];for(let l=0;lt)break;o.push(u)}return o}function kL(e,t,n,r){const{month:a,defaultMonth:o,today:l=r.today(),numberOfMonths:u=1}=e;let d=a||o||l;const{differenceInCalendarMonths:f,addMonths:m,startOfMonth:p}=r;if(n&&f(n,d){const N=n.broadcastCalendar?p(w,r):n.ISOWeek?g(w):x(w),O=n.broadcastCalendar?o(w):n.ISOWeek?l(u(w)):d(u(w)),C=t.filter(T=>T>=N&&T<=O),A=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length{const $=A-C.length;return M>O&&M<=a(O,$)});C.push(...T)}const E=C.reduce((T,M)=>{const $=n.ISOWeek?f(M):m(M),z=T.find(U=>U.weekNumber===$),D=new RH(M,w,r);return z?z.days.push(D):T.push(new s_e($,[D])),T},[]),k=new o_e(w,E);return b.push(k),b},[]);return n.reverseMonths?j.reverse():j}function yNe(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:m,today:p}=t,{fromYear:g,toYear:x,fromMonth:j,toMonth:b}=e;!n&&j&&(n=j),!n&&g&&(n=t.newDate(g,0,1)),!r&&b&&(r=b),!r&&x&&(r=m(x,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):g?n=m(g,0,1):!n&&w&&(n=a(d(e.today??p(),-100))),r?r=u(r):x?r=m(x,11,31):!r&&w&&(r=f(e.today??p())),[n&&o(n),r&&o(r)]}function xNe(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=r,f=a?o:1,m=l(e);if(!t)return u(m,f);if(!(d(t,e)n.concat(r.weeks.slice()),t.slice())}function Qy(e,t){const[n,r]=y.useState(e);return[t===void 0?n:t,r]}function jNe(e,t){const[n,r]=yNe(e,t),{startOfMonth:a,endOfMonth:o}=t,l=kL(e,n,r,t),[u,d]=Qy(l,e.month?l:void 0);y.useEffect(()=>{const k=kL(e,n,r,t);d(k)},[e.timeZone]);const f=vNe(u,r,e,t),m=mNe(f,e.endMonth?o(e.endMonth):void 0,e,t),p=gNe(f,m,e,t),g=wNe(p),x=pNe(p),j=bNe(u,n,e,t),b=xNe(u,r,e,t),{disableNavigation:w,onMonthChange:N}=e,O=k=>g.some(T=>T.days.some(M=>M.isEqualTo(k))),C=k=>{if(w)return;let T=a(k);n&&Ta(r)&&(T=a(r)),d(T),N?.(T)};return{months:p,weeks:g,days:x,navStart:n,navEnd:r,previousMonth:j,nextMonth:b,goToMonth:C,goToDay:k=>{O(k)||C(k.date)}}}var ei;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(ei||(ei={}));function ML(e){return!e[en.disabled]&&!e[en.hidden]&&!e[en.outside]}function SNe(e,t,n,r){let a,o=-1;for(const l of e){const u=t(l);ML(u)&&(u[en.focused]&&oML(t(l)))),a}function _Ne(e,t,n,r,a,o,l){const{ISOWeek:u,broadcastCalendar:d}=o,{addDays:f,addMonths:m,addWeeks:p,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:j,endOfWeek:b,max:w,min:N,startOfBroadcastWeek:O,startOfISOWeek:C,startOfWeek:A}=l;let k={day:f,week:p,month:m,year:g,startOfWeek:T=>d?O(T,l):u?C(T):A(T),endOfWeek:T=>d?x(T):u?j(T):b(T)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=w([r,k]):t==="after"&&a&&(k=N([a,k])),k}function WH(e,t,n,r,a,o,l,u=0){if(u>365)return;const d=_Ne(e,t,n.date,r,a,o,l),f=!!(o.disabled&&Xi(d,o.disabled,l)),m=!!(o.hidden&&Xi(d,o.hidden,l)),p=d,g=new RH(d,p,l);return!f&&!m?g:WH(e,t,g,r,a,o,l,u+1)}function NNe(e,t,n,r,a){const{autoFocus:o}=e,[l,u]=y.useState(),d=SNe(t.days,n,r||(()=>!1),l),[f,m]=y.useState(o?d:void 0);return{isFocusTarget:b=>!!d?.isEqualTo(b),setFocused:m,focused:f,blur:()=>{u(f),m(void 0)},moveFocus:(b,w)=>{if(!f)return;const N=WH(b,w,f,t.navStart,t.navEnd,e,a);N&&(e.disableNavigation&&!t.days.some(C=>C.isEqualTo(N))||(t.goToDay(N),m(N)))}}}function ONe(e,t){const{selected:n,required:r,onSelect:a}=e,[o,l]=Qy(n,a?n:void 0),u=a?n:o,{isSameDay:d}=t,f=x=>u?.some(j=>d(j,x))??!1,{min:m,max:p}=e;return{selected:u,select:(x,j,b)=>{let w=[...u??[]];if(f(x)){if(u?.length===m||r&&u?.length===1)return;w=u?.filter(N=>!d(N,x))}else u?.length===p?w=[x]:w=[...w,x];return a||l(w),a?.(w,x,j,b),w},isSelected:f}}function CNe(e,t,n=0,r=0,a=!1,o=ji){const{from:l,to:u}=t||{},{isSameDay:d,isAfter:f,isBefore:m}=o;let p;if(!l&&!u)p={from:e,to:n>0?void 0:e};else if(l&&!u)d(l,e)?n===0?p={from:l,to:e}:a?p={from:l,to:void 0}:p=void 0:m(e,l)?p={from:e,to:l}:p={from:l,to:e};else if(l&&u)if(d(l,e)&&d(u,e))a?p={from:l,to:u}:p=void 0;else if(d(l,e))p={from:l,to:n>0?void 0:e};else if(d(u,e))p={from:e,to:n>0?void 0:e};else if(m(e,l))p={from:e,to:u};else if(f(e,l))p={from:l,to:e};else if(f(e,u))p={from:l,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const g=o.differenceInCalendarDays(p.to,p.from);r>0&&g>r?p={from:e,to:void 0}:n>1&&gtypeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?Ki(e,u,!1,n):zH(u,n)?u.some(d=>Ki(e,d,!1,n)):OE(u)?u.from&&u.to?PL(e,{from:u.from,to:u.to},n):!1:BH(u)?ENe(e,u.dayOfWeek,n):$H(u)?n.isAfter(u.before,u.after)?PL(e,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):Xi(e.from,u,n)||Xi(e.to,u,n):IH(u)||LH(u)?Xi(e.from,u,n)||Xi(e.to,u,n):!1))return!0;const l=r.filter(u=>typeof u=="function");if(l.length){let u=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=d;f++){if(l.some(m=>m(u)))return!0;u=n.addDays(u,1)}}return!1}function TNe(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:l}=e,[u,d]=Qy(a,l?a:void 0),f=l?a:u;return{selected:f,select:(g,x,j)=>{const{min:b,max:w}=e,N=g?CNe(g,f,b,w,o,t):void 0;return r&&n&&N?.from&&N.to&&ANe({from:N.from,to:N.to},n,t)&&(N.from=g,N.to=void 0),l||d(N),l?.(N,g,x,j),N},isSelected:g=>f&&Ki(f,g,!1,t)}}function kNe(e,t){const{selected:n,required:r,onSelect:a}=e,[o,l]=Qy(n,a?n:void 0),u=a?n:o,{isSameDay:d}=t;return{selected:u,select:(p,g,x)=>{let j=p;return!r&&u&&u&&d(p,u)&&(j=void 0),a||l(j),a?.(j,p,g,x),j},isSelected:p=>u?d(u,p):!1}}function MNe(e,t){const n=kNe(e,t),r=ONe(e,t),a=TNe(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function PNe(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new sr(t.today,t.timeZone)),t.month&&(t.month=new sr(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new sr(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new sr(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new sr(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new sr(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(et=>new sr(et,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new sr(t.selected.from,t.timeZone):void 0,to:t.selected.to?new sr(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:a,dateLib:o,locale:l,classNames:u}=y.useMemo(()=>{const et={...NE,...t.locale};return{dateLib:new ia({locale:et,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:I_e(t.components),formatters:G_e(t.formatters),labels:{...cNe,...t.labels},locale:et,classNames:{...CE(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:d,mode:f,navLayout:m,numberOfMonths:p=1,onDayBlur:g,onDayClick:x,onDayFocus:j,onDayKeyDown:b,onDayMouseEnter:w,onDayMouseLeave:N,onNextClick:O,onPrevClick:C,showWeekNumber:A,styles:E}=t,{formatCaption:k,formatDay:T,formatMonthDropdown:M,formatWeekNumber:$,formatWeekNumberHeader:z,formatWeekdayName:D,formatYearDropdown:U}=r,V=jNe(t,o),{days:H,months:G,navStart:L,navEnd:R,previousMonth:F,nextMonth:K,goToMonth:te}=V,I=D_e(H,t,L,R,o),{isSelected:B,select:Y,selected:ne}=MNe(t,o)??{},{blur:oe,focused:xe,isFocusTarget:ee,moveFocus:ae,setFocused:Z}=NNe(t,V,I,B??(()=>!1),o),{labelDayButton:pe,labelGridcell:je,labelGrid:le,labelMonthDropdown:Re,labelNav:_e,labelPrevious:me,labelNext:ve,labelWeekday:Le,labelWeekNumber:Dt,labelWeekNumberHeader:On,labelYearDropdown:vr}=a,rr=y.useMemo(()=>X_e(o,t.ISOWeek),[o,t.ISOWeek]),gr=f!==void 0||x!==void 0,lt=y.useCallback(()=>{F&&(te(F),C?.(F))},[F,te,C]),rt=y.useCallback(()=>{K&&(te(K),O?.(K))},[te,K,O]),$n=y.useCallback((et,Lt)=>He=>{He.preventDefault(),He.stopPropagation(),Z(et),Y?.(et.date,Lt,He),x?.(et.date,Lt,He)},[Y,x,Z]),ms=y.useCallback((et,Lt)=>He=>{Z(et),j?.(et.date,Lt,He)},[j,Z]),am=y.useCallback((et,Lt)=>He=>{oe(),g?.(et.date,Lt,He)},[oe,g]),Ml=y.useCallback((et,Lt)=>He=>{const gt={ArrowLeft:[He.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[He.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[He.shiftKey?"year":"week","after"],ArrowUp:[He.shiftKey?"year":"week","before"],PageUp:[He.shiftKey?"year":"month","before"],PageDown:[He.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(gt[He.key]){He.preventDefault(),He.stopPropagation();const[In,tt]=gt[He.key];ae(In,tt)}b?.(et.date,Lt,He)},[ae,b,t.dir]),rx=y.useCallback((et,Lt)=>He=>{w?.(et.date,Lt,He)},[w]),im=y.useCallback((et,Lt)=>He=>{N?.(et.date,Lt,He)},[N]),ax=y.useCallback(et=>Lt=>{const He=Number(Lt.target.value),gt=o.setMonth(o.startOfMonth(et),He);te(gt)},[o,te]),ix=y.useCallback(et=>Lt=>{const He=Number(Lt.target.value),gt=o.setYear(o.startOfMonth(et),He);te(gt)},[o,te]),{className:ps,style:yr}=y.useMemo(()=>({className:[u[$e.Root],t.className].filter(Boolean).join(" "),style:{...E?.[$e.Root],...t.style}}),[u,t.className,t.style,E]),Ya=L_e(t),ar=y.useRef(null);hNe(ar,!!t.animate,{classNames:u,months:G,focused:xe,dateLib:o});const ox={dayPickerProps:t,selected:ne,select:Y,isSelected:B,months:G,nextMonth:K,previousMonth:F,goToMonth:te,getModifiers:I,components:n,classNames:u,styles:E,labels:a,formatters:r};return W.createElement(DH.Provider,{value:ox},W.createElement(n.Root,{rootRef:t.animate?ar:void 0,className:ps,style:yr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Ya},W.createElement(n.Months,{className:u[$e.Months],style:E?.[$e.Months]},!t.hideNavigation&&!m&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:E?.[$e.Nav],"aria-label":_e(),onPreviousClick:lt,onNextClick:rt,previousMonth:F,nextMonth:K}),G.map((et,Lt)=>W.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:u[$e.Month],style:E?.[$e.Month],key:Lt,displayIndex:Lt,calendarMonth:et},m==="around"&&!t.hideNavigation&&Lt===0&&W.createElement(n.PreviousMonthButton,{type:"button",className:u[$e.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":me(F),onClick:lt,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:F?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"right":"left"})),W.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[$e.MonthCaption],style:E?.[$e.MonthCaption],calendarMonth:et,displayIndex:Lt},d?.startsWith("dropdown")?W.createElement(n.DropdownNav,{className:u[$e.Dropdowns],style:E?.[$e.Dropdowns]},(()=>{const He=d==="dropdown"||d==="dropdown-months"?W.createElement(n.MonthsDropdown,{key:"month",className:u[$e.MonthsDropdown],"aria-label":Re(),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:ax(et.date),options:Y_e(et.date,L,R,r,o),style:E?.[$e.Dropdown],value:o.getMonth(et.date)}):W.createElement("span",{key:"month"},M(et.date,o)),gt=d==="dropdown"||d==="dropdown-years"?W.createElement(n.YearsDropdown,{key:"year",className:u[$e.YearsDropdown],"aria-label":vr(o.options),classNames:u,components:n,disabled:!!t.disableNavigation,onChange:ix(et.date),options:Z_e(L,R,r,o,!!t.reverseYears),style:E?.[$e.Dropdown],value:o.getYear(et.date)}):W.createElement("span",{key:"year"},U(et.date,o));return o.getMonthYearOrder()==="year-first"?[gt,He]:[He,gt]})(),W.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(et.date,o.options,o))):W.createElement(n.CaptionLabel,{className:u[$e.CaptionLabel],role:"status","aria-live":"polite"},k(et.date,o.options,o))),m==="around"&&!t.hideNavigation&&Lt===p-1&&W.createElement(n.NextMonthButton,{type:"button",className:u[$e.NextMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":ve(K),onClick:rt,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:K?void 0:!0,className:u[$e.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Lt===p-1&&m==="after"&&!t.hideNavigation&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[$e.Nav],style:E?.[$e.Nav],"aria-label":_e(),onPreviousClick:lt,onNextClick:rt,previousMonth:F,nextMonth:K}),W.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":le(et.date,o.options,o)||void 0,className:u[$e.MonthGrid],style:E?.[$e.MonthGrid]},!t.hideWeekdays&&W.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[$e.Weekdays],style:E?.[$e.Weekdays]},A&&W.createElement(n.WeekNumberHeader,{"aria-label":On(o.options),className:u[$e.WeekNumberHeader],style:E?.[$e.WeekNumberHeader],scope:"col"},z()),rr.map(He=>W.createElement(n.Weekday,{"aria-label":Le(He,o.options,o),className:u[$e.Weekday],key:String(He),style:E?.[$e.Weekday],scope:"col"},D(He,o.options,o)))),W.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[$e.Weeks],style:E?.[$e.Weeks]},et.weeks.map(He=>W.createElement(n.Week,{className:u[$e.Week],key:He.weekNumber,style:E?.[$e.Week],week:He},A&&W.createElement(n.WeekNumber,{week:He,style:E?.[$e.WeekNumber],"aria-label":Dt(He.weekNumber,{locale:l}),className:u[$e.WeekNumber],scope:"row",role:"rowheader"},$(He.weekNumber,o)),He.days.map(gt=>{const{date:In}=gt,tt=I(gt);if(tt[en.focused]=!tt.hidden&&!!xe?.isEqualTo(gt),tt[za.selected]=B?.(In)||tt.selected,OE(ne)){const{from:Rl,to:gs}=ne;tt[za.range_start]=!!(Rl&&gs&&o.isSameDay(In,Rl)),tt[za.range_end]=!!(Rl&&gs&&o.isSameDay(In,gs)),tt[za.range_middle]=Ki(ne,In,!0,o)}const Pl=K_e(tt,E,t.modifiersStyles),vs=$_e(tt,u,t.modifiersClassNames),sx=!gr&&!tt.hidden?je(In,tt,o.options,o):void 0;return W.createElement(n.Day,{key:`${o.format(In,"yyyy-MM-dd")}_${o.format(gt.displayMonth,"yyyy-MM")}`,day:gt,modifiers:tt,className:vs.join(" "),style:Pl,role:"gridcell","aria-selected":tt.selected||void 0,"aria-label":sx,"data-day":o.format(In,"yyyy-MM-dd"),"data-month":gt.outside?o.format(In,"yyyy-MM"):void 0,"data-selected":tt.selected||void 0,"data-disabled":tt.disabled||void 0,"data-hidden":tt.hidden||void 0,"data-outside":gt.outside||void 0,"data-focused":tt.focused||void 0,"data-today":tt.today||void 0},!tt.hidden&&gr?W.createElement(n.DayButton,{className:u[$e.DayButton],style:E?.[$e.DayButton],type:"button",day:gt,modifiers:tt,disabled:tt.disabled||void 0,tabIndex:ee(gt)?0:-1,"aria-label":pe(In,tt,o.options,o),onClick:$n(gt,tt),onBlur:am(gt,tt),onFocus:ms(gt,tt),onKeyDown:Ml(gt,tt),onMouseEnter:rx(gt,tt),onMouseLeave:im(gt,tt)},T(In,o.options,o)):!tt.hidden&&T(gt.date,o.options,o))})))))))),t.footer&&W.createElement(n.Footer,{className:u[$e.Footer],style:E?.[$e.Footer],role:"status","aria-live":"polite"},t.footer)))}function RL({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:o,components:l,...u}){const d=CE();return i.jsx(PNe,{showOutsideDays:n,className:ue("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...o},classNames:{root:ue("w-fit",d.root),months:ue("relative flex flex-col gap-4 md:flex-row",d.months),month:ue("flex w-full flex-col gap-4",d.month),nav:ue("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",d.nav),button_previous:ue(dh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_previous),button_next:ue(dh({variant:a}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",d.button_next),month_caption:ue("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",d.month_caption),dropdowns:ue("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",d.dropdowns),dropdown_root:ue("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",d.dropdown_root),dropdown:ue("bg-popover absolute inset-0 opacity-0",d.dropdown),caption_label:ue("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:ue("flex",d.weekdays),weekday:ue("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",d.weekday),week:ue("mt-2 flex w-full",d.week),week_number_header:ue("w-[--cell-size] select-none",d.week_number_header),week_number:ue("text-muted-foreground select-none text-[0.8rem]",d.week_number),day:ue("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",d.day),range_start:ue("bg-accent rounded-l-md",d.range_start),range_middle:ue("rounded-none",d.range_middle),range_end:ue("bg-accent rounded-r-md",d.range_end),today:ue("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:ue("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:ue("text-muted-foreground opacity-50",d.disabled),hidden:ue("invisible",d.hidden),...t},components:{Root:({className:f,rootRef:m,...p})=>i.jsx("div",{"data-slot":"calendar",ref:m,className:ue(f),...p}),Chevron:({className:f,orientation:m,...p})=>m==="left"?i.jsx(HC,{className:ue("size-4",f),...p}):m==="right"?i.jsx(WC,{className:ue("size-4",f),...p}):i.jsx(ch,{className:ue("size-4",f),...p}),DayButton:RNe,WeekNumber:({children:f,...m})=>i.jsx("td",{...m,children:i.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...l},...u})}function RNe({className:e,day:t,modifiers:n,...r}){const a=CE(),o=y.useRef(null);return y.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),i.jsx(fe,{ref:o,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:ue("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",a.day,e),...r})}class DNe{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const r=JSON.parse(n.data);this.notifyLog(r)}catch(r){console.error("解析日志消息失败:",r)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(r=>r.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(r=>{try{r(t)}catch(a){console.error("日志回调执行失败:",a)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(r){console.error("连接状态回调执行失败:",r)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Rc=new DNe;typeof window<"u"&&Rc.connect();const $Ne={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},INe=(e,t,n)=>{let r;const a=$Ne[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},LNe={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},BNe={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},zNe={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},qNe={date:Kc({formats:LNe,defaultWidth:"full"}),time:Kc({formats:BNe,defaultWidth:"full"}),dateTime:Kc({formats:zNe,defaultWidth:"full"})};function DL(e,t,n){const r="eeee p";return QSe(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const FNe={lastWeek:DL,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:DL,other:"PP p"},UNe=(e,t,n,r)=>{const a=FNe[e];return typeof a=="function"?a(t,n,r):a},HNe={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},WNe={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},VNe={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},GNe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},YNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},KNe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},XNe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},ZNe={ordinalNumber:XNe,era:ri({values:HNe,defaultWidth:"wide"}),quarter:ri({values:WNe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ri({values:VNe,defaultWidth:"wide"}),day:ri({values:GNe,defaultWidth:"wide"}),dayPeriod:ri({values:YNe,defaultWidth:"wide",formattingValues:KNe,defaultFormattingWidth:"wide"})},QNe=/^(第\s*)?\d+(日|时|分|秒)?/i,JNe=/\d+/i,eOe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},tOe={any:[/^(前)/i,/^(公元)/i]},nOe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},rOe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},aOe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},iOe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},oOe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},sOe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},lOe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},cOe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},uOe={ordinalNumber:EH({matchPattern:QNe,parsePattern:JNe,valueCallback:e=>parseInt(e,10)}),era:ai({matchPatterns:eOe,defaultMatchWidth:"wide",parsePatterns:tOe,defaultParseWidth:"any"}),quarter:ai({matchPatterns:nOe,defaultMatchWidth:"wide",parsePatterns:rOe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ai({matchPatterns:aOe,defaultMatchWidth:"wide",parsePatterns:iOe,defaultParseWidth:"any"}),day:ai({matchPatterns:oOe,defaultMatchWidth:"wide",parsePatterns:sOe,defaultParseWidth:"any"}),dayPeriod:ai({matchPatterns:lOe,defaultMatchWidth:"any",parsePatterns:cOe,defaultParseWidth:"any"})},Wp={code:"zh-CN",formatDistance:INe,formatLong:qNe,formatRelative:UNe,localize:ZNe,match:uOe,options:{weekStartsOn:1,firstWeekContainsDate:4}};function dOe(){const[e,t]=y.useState([]),[n,r]=y.useState(""),[a,o]=y.useState("all"),[l,u]=y.useState("all"),[d,f]=y.useState(void 0),[m,p]=y.useState(void 0),[g,x]=y.useState(!0),[j,b]=y.useState(!1),w=y.useRef(null),N=y.useRef(null);y.useEffect(()=>{const D=Rc.getAllLogs();t(D);const U=Rc.onLog(()=>{t(Rc.getAllLogs())}),V=Rc.onConnectionChange(H=>{b(H)});return()=>{U(),V()}},[]),y.useEffect(()=>{g&&N.current&&N.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,g]);const O=y.useMemo(()=>{const D=new Set(e.map(U=>U.module));return Array.from(D).sort()},[e]),C=D=>{switch(D){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},A=D=>{switch(D){case"DEBUG":return"bg-secondary/50";case"INFO":return"bg-blue-500/10 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-500/10 dark:bg-yellow-500/20";case"ERROR":return"bg-red-500/10 dark:bg-red-500/20";case"CRITICAL":return"bg-red-600/20 dark:bg-red-600/30";default:return"bg-muted/50"}},E=()=>{window.location.reload()},k=()=>{Rc.clearLogs(),t([])},T=()=>{const D=z.map(G=>`${G.timestamp} [${G.level.padEnd(8)}] [${G.module}] ${G.message}`).join(` `),U=new Blob([D],{type:"text/plain;charset=utf-8"}),V=URL.createObjectURL(U),H=document.createElement("a");H.href=V,H.download=`logs-${cv(new Date,"yyyy-MM-dd-HHmmss")}.txt`,H.click(),URL.revokeObjectURL(V)},M=()=>{x(!g)},$=()=>{f(void 0),p(void 0)},z=y.useMemo(()=>e.filter(D=>{const U=n===""||D.message.toLowerCase().includes(n.toLowerCase())||D.module.toLowerCase().includes(n.toLowerCase()),V=a==="all"||D.level===a,H=l==="all"||D.module===l;let G=!0;if(d||m){const L=new Date(D.timestamp);if(d){const R=new Date(d);R.setHours(0,0,0,0),G=G&&L>=R}if(m){const R=new Date(m);R.setHours(23,59,59,999),G=G&&L<=R}}return U&&V&&H&&G}),[e,n,a,l,d,m]);return i.jsx(Kt,{className:"h-full",children:i.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:ue("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",j?"bg-green-500 animate-pulse":"bg-red-500")}),i.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:j?"已连接":"未连接"})]})]}),i.jsx(dt,{className:"p-3 sm:p-4",children:i.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索日志...",value:n,onChange:D=>r(D.target.value),className:"pl-9 h-9 text-sm"})]}),i.jsxs(Et,{value:a,onValueChange:o,children:[i.jsxs(wt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[i.jsx(WN,{className:"h-4 w-4 mr-2"}),i.jsx(At,{placeholder:"级别"})]}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部级别"}),i.jsx(Me,{value:"DEBUG",children:"DEBUG"}),i.jsx(Me,{value:"INFO",children:"INFO"}),i.jsx(Me,{value:"WARNING",children:"WARNING"}),i.jsx(Me,{value:"ERROR",children:"ERROR"}),i.jsx(Me,{value:"CRITICAL",children:"CRITICAL"})]})]}),i.jsxs(Et,{value:l,onValueChange:u,children:[i.jsxs(wt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[i.jsx(WN,{className:"h-4 w-4 mr-2"}),i.jsx(At,{placeholder:"模块"})]}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部模块"}),O.map(D=>i.jsx(Me,{value:D,children:D},D))]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",className:ue("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!d&&"text-muted-foreground"),children:[i.jsx(L3,{className:"mr-2 h-4 w-4"}),i.jsx("span",{className:"text-xs sm:text-sm",children:d?cv(d,"PPP",{locale:Wp}):"开始日期"})]})}),i.jsx(so,{className:"w-auto p-0",align:"start",children:i.jsx(RL,{mode:"single",selected:d,onSelect:f,initialFocus:!0,locale:Wp})})]}),i.jsxs(es,{children:[i.jsx(ts,{asChild:!0,children:i.jsxs(fe,{variant:"outline",size:"sm",className:ue("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[i.jsx(L3,{className:"mr-2 h-4 w-4"}),i.jsx("span",{className:"text-xs sm:text-sm",children:m?cv(m,"PPP",{locale:Wp}):"结束日期"})]})}),i.jsx(so,{className:"w-auto p-0",align:"start",children:i.jsx(RL,{mode:"single",selected:m,onSelect:p,initialFocus:!0,locale:Wp})})]}),(d||m)&&i.jsxs(fe,{variant:"outline",size:"sm",onClick:$,className:"w-full sm:w-auto h-9",children:[i.jsx(Lh,{className:"h-4 w-4 sm:mr-2"}),i.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),i.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[i.jsxs("div",{className:"flex gap-2 flex-wrap",children:[i.jsxs(fe,{variant:g?"default":"outline",size:"sm",onClick:M,className:"flex-1 sm:flex-none h-9",children:[g?i.jsx(Vve,{className:"h-4 w-4"}):i.jsx(Kve,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),i.jsxs(fe,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[i.jsx(al,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),i.jsxs(fe,{variant:"outline",size:"sm",onClick:k,className:"flex-1 sm:flex-none h-9",children:[i.jsx(Ut,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),i.jsxs(fe,{variant:"outline",size:"sm",onClick:T,className:"flex-1 sm:flex-none h-9",children:[i.jsx(UN,{className:"h-4 w-4"}),i.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),i.jsx("div",{className:"flex-1 hidden sm:block"}),i.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[i.jsxs("span",{className:"font-mono",children:[z.length," / ",e.length]}),i.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),i.jsx(dt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:i.jsx(Kt,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:i.jsxs("div",{ref:w,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[z.length===0?i.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):z.map(D=>i.jsxs("div",{className:ue("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",A(D.level)),children:[i.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:D.timestamp}),i.jsxs("span",{className:ue("text-xs font-semibold",C(D.level)),children:["[",D.level,"]"]})]}),i.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:D.module}),i.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:D.message})]}),i.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[i.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:D.timestamp}),i.jsxs("span",{className:ue("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",C(D.level)),children:["[",D.level,"]"]}),i.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:D.module}),i.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:D.message})]})]},D.id)),i.jsx("div",{ref:N,className:"h-4"})]})})})]})})}const fOe="Mai-with-u",hOe="plugin-repo",mOe="main",pOe="plugin_details.json";async function vOe(){try{const e=await Ze("/api/webui/plugins/fetch-raw",{method:"POST",headers:st(),body:JSON.stringify({owner:fOe,repo:hOe,branch:mOe,file_path:pOe})});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success||!t.data)throw new Error(t.error||"获取插件列表失败");return JSON.parse(t.data).filter(a=>!a?.id||!a?.manifest?(console.warn("跳过无效插件数据:",a),!1):!a.manifest.name||!a.manifest.version?(console.warn("跳过缺少必需字段的插件:",a.id),!1):!0).map(a=>({id:a.id,manifest:{manifest_version:a.manifest.manifest_version||1,name:a.manifest.name,version:a.manifest.version,description:a.manifest.description||"",author:a.manifest.author||{name:"Unknown"},license:a.manifest.license||"Unknown",host_application:a.manifest.host_application||{min_version:"0.0.0"},homepage_url:a.manifest.homepage_url,repository_url:a.manifest.repository_url,keywords:a.manifest.keywords||[],categories:a.manifest.categories||[],default_locale:a.manifest.default_locale||"zh-CN",locales_path:a.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function gOe(){try{const e=await Ze("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function yOe(){try{const e=await Ze("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function xOe(e,t,n){const r=e.split(".").map(u=>parseInt(u)||0),a=r[0]||0,o=r[1]||0,l=r[2]||0;if(n.version_majorparseInt(p)||0),d=u[0]||0,f=u[1]||0,m=u[2]||0;if(n.version_major>d||n.version_major===d&&n.version_minor>f||n.version_major===d&&n.version_minor===f&&n.version_patch>m)return!1}return!0}function bOe(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,a=new WebSocket(`${n}//${r}/api/webui/ws/plugin-progress`);return a.onopen=()=>{console.log("Plugin progress WebSocket connected");const o=setInterval(()=>{a.readyState===WebSocket.OPEN?a.send("ping"):clearInterval(o)},3e4)},a.onmessage=o=>{try{if(o.data==="pong")return;const l=JSON.parse(o.data);e(l)}catch(l){console.error("Failed to parse progress data:",l)}},a.onerror=o=>{console.error("Plugin progress WebSocket error:",o),t?.(o)},a.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},a}async function Vp(){try{const e=await Ze("/api/webui/plugins/installed",{headers:st()});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success)throw new Error(t.message||"获取已安装插件列表失败");return t.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function Gp(e,t){return t.some(n=>n.id===e)}function Yp(e,t){const n=t.find(r=>r.id===e);if(n)return n.manifest?.version||n.version}async function wOe(e,t,n="main"){const r=await Ze("/api/webui/plugins/install",{method:"POST",headers:st(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!r.ok){const a=await r.json();throw new Error(a.detail||"安装失败")}return await r.json()}async function jOe(e){const t=await Ze("/api/webui/plugins/uninstall",{method:"POST",headers:st(),body:JSON.stringify({plugin_id:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"卸载失败")}return await t.json()}async function SOe(e,t,n="main"){const r=await Ze("/api/webui/plugins/update",{method:"POST",headers:st(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!r.ok){const a=await r.json();throw new Error(a.detail||"更新失败")}return await r.json()}function _Oe(){const e=oa(),[t,n]=y.useState(null),[r,a]=y.useState(""),[o,l]=y.useState("all"),[u,d]=y.useState("all"),[f,m]=y.useState(!1),[p,g]=y.useState([]),[x,j]=y.useState(!0),[b,w]=y.useState(null),[N,O]=y.useState(null),[C,A]=y.useState(null),[E,k]=y.useState(null),[,T]=y.useState([]),{toast:M}=mr();y.useEffect(()=>{let R=null,F=!1;return(async()=>{if(R=bOe(te=>{F||(A(te),te.stage==="success"?setTimeout(()=>{F||A(null)},2e3):te.stage==="error"&&(j(!1),w(te.error||"加载失败")))},te=>{console.error("WebSocket error:",te),F||M({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(te=>{if(!R){te();return}const I=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),te()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),te()):setTimeout(I,100)};I()}),!F){const te=await gOe();O(te),te.installed||M({title:"Git 未安装",description:te.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!F){const te=await yOe();k(te)}if(!F)try{j(!0),w(null);const te=await vOe();if(!F){const I=await Vp();T(I);const B=te.map(Y=>{const ne=Gp(Y.id,I),oe=Yp(Y.id,I);return{...Y,installed:ne,installed_version:oe}});for(const Y of I)!B.some(oe=>oe.id===Y.id)&&Y.manifest&&B.push({id:Y.id,manifest:{manifest_version:Y.manifest.manifest_version||1,name:Y.manifest.name,version:Y.manifest.version,description:Y.manifest.description||"",author:Y.manifest.author,license:Y.manifest.license||"Unknown",host_application:Y.manifest.host_application,homepage_url:Y.manifest.homepage_url,repository_url:Y.manifest.repository_url,keywords:Y.manifest.keywords||[],categories:Y.manifest.categories||[],default_locale:Y.manifest.default_locale||"zh-CN",locales_path:Y.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:Y.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});g(B)}}catch(te){if(!F){const I=te instanceof Error?te.message:"加载插件列表失败";w(I),M({title:"加载失败",description:I,variant:"destructive"})}}finally{F||j(!1)}})(),()=>{F=!0,R&&R.close()}},[M]);const $=R=>{if(!R.installed&&E&&!z(R))return i.jsxs(tn,{variant:"destructive",className:"gap-1",children:[i.jsx(xg,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const F=R.installed_version?.trim(),K=R.manifest.version?.trim();if(F!==K){const te=F?.split(".").map(Number)||[0,0,0],I=K?.split(".").map(Number)||[0,0,0];for(let B=0;B<3;B++){if((I[B]||0)>(te[B]||0))return i.jsxs(tn,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[i.jsx(xg,{className:"h-3 w-3"}),"可更新"]});if((I[B]||0)<(te[B]||0))break}}return i.jsxs(tn,{variant:"default",className:"gap-1",children:[i.jsx(Cu,{className:"h-3 w-3"}),"已安装"]})}return null},z=R=>!E||!R.manifest?.host_application?!0:xOe(R.manifest.host_application.min_version,R.manifest.host_application.max_version,E),D=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const F=R.installed_version.trim(),K=R.manifest.version.trim();if(F===K)return!1;const te=F.split(".").map(Number),I=K.split(".").map(Number);for(let B=0;B<3;B++){if((I[B]||0)>(te[B]||0))return!0;if((I[B]||0)<(te[B]||0))return!1}return!1},U=p.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const F=r===""||R.manifest.name?.toLowerCase().includes(r.toLowerCase())||R.manifest.description?.toLowerCase().includes(r.toLowerCase())||R.manifest.keywords&&R.manifest.keywords.some(B=>B.toLowerCase().includes(r.toLowerCase())),K=o==="all"||R.manifest.categories&&R.manifest.categories.includes(o);let te=!0;u==="installed"?te=R.installed===!0:u==="updates"&&(te=R.installed===!0&&D(R));const I=!f||!E||z(R);return F&&K&&te&&I}),V=()=>{n(null)},H=async R=>{if(!N?.installed){M({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(E&&!z(R)){M({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await wOe(R.id,R.manifest.repository_url||"","main"),M({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const F=await Vp();T(F),g(K=>K.map(te=>{if(te.id===R.id){const I=Gp(te.id,F),B=Yp(te.id,F);return{...te,installed:I,installed_version:B}}return te}))}catch(F){M({title:"安装失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}},G=async R=>{try{await jOe(R.id),M({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const F=await Vp();T(F),g(K=>K.map(te=>{if(te.id===R.id){const I=Gp(te.id,F),B=Yp(te.id,F);return{...te,installed:I,installed_version:B}}return te}))}catch(F){M({title:"卸载失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}},L=async R=>{if(!N?.installed){M({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const F=await SOe(R.id,R.manifest.repository_url||"","main");M({title:"更新成功",description:`${R.manifest.name} 已从 ${F.old_version} 更新到 ${F.new_version}`});const K=await Vp();T(K),g(te=>te.map(I=>{if(I.id===R.id){const B=Gp(I.id,K),Y=Yp(I.id,K);return{...I,installed:B,installed_version:Y}}return I}))}catch(F){M({title:"更新失败",description:F instanceof Error?F.message:"未知错误",variant:"destructive"})}};return i.jsx(Kt,{className:"h-full",children:i.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),i.jsxs(fe,{onClick:()=>e({to:"/plugin-mirrors"}),children:[i.jsx(oge,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),N&&!N.installed&&i.jsxs(dt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[i.jsx(Vt,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Wc,{className:"h-5 w-5 text-orange-600"}),i.jsxs("div",{children:[i.jsx(Gt,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),i.jsx(er,{className:"text-orange-800 dark:text-orange-200",children:N.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),i.jsx(cn,{children:i.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",i.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),i.jsx(dt,{className:"p-4",children:i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Ne,{placeholder:"搜索插件...",value:r,onChange:R=>a(R.target.value),className:"pl-9"})]}),i.jsxs(Et,{value:o,onValueChange:l,children:[i.jsx(wt,{className:"w-full sm:w-[200px]",children:i.jsx(At,{placeholder:"选择分类"})}),i.jsxs(jt,{children:[i.jsx(Me,{value:"all",children:"全部分类"}),i.jsx(Me,{value:"Developer Tools",children:"开发工具"}),i.jsx(Me,{value:"AI Enhancement",children:"AI 增强"}),i.jsx(Me,{value:"Utility",children:"工具类"}),i.jsx(Me,{value:"Entertainment",children:"娱乐"}),i.jsx(Me,{value:"Integration",children:"集成"}),i.jsx(Me,{value:"Data Analysis",children:"数据分析"}),i.jsx(Me,{value:"Automation",children:"自动化"}),i.jsx(Me,{value:"Other",children:"其他"})]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ku,{id:"compatible-only",checked:f,onCheckedChange:R=>m(R===!0)}),i.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),i.jsx(sl,{value:u,onValueChange:d,className:"w-full",children:i.jsxs(Zo,{className:"grid w-full grid-cols-3",children:[i.jsxs(Ct,{value:"all",children:["全部插件 (",p.length,")"]}),i.jsxs(Ct,{value:"installed",children:["已安装 (",p.filter(R=>R.installed).length,")"]}),i.jsxs(Ct,{value:"updates",children:["可更新 (",p.filter(R=>R.installed&&D(R)).length,")"]})]})}),C&&C.stage==="loading"&&i.jsx(dt,{className:"p-4",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(VN,{className:"h-4 w-4 animate-spin"}),i.jsxs("span",{className:"text-sm font-medium",children:[C.operation==="fetch"&&"加载插件列表",C.operation==="install"&&`安装插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="uninstall"&&`卸载插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="update"&&`更新插件${C.plugin_id?`: ${C.plugin_id}`:""}`]})]}),i.jsxs("span",{className:"text-sm font-medium",children:[C.progress,"%"]})]}),i.jsx(cE,{value:C.progress,className:"h-2"}),i.jsx("div",{className:"text-xs text-muted-foreground",children:C.message}),C.operation==="fetch"&&C.total_plugins>0&&i.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",C.loaded_plugins," / ",C.total_plugins," 个插件"]})]})}),C&&C.stage==="error"&&C.error&&i.jsx(dt,{className:"border-destructive bg-destructive/10",children:i.jsx(Vt,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Wc,{className:"h-5 w-5 text-destructive"}),i.jsxs("div",{children:[i.jsx(Gt,{className:"text-lg text-destructive",children:"加载失败"}),i.jsx(er,{className:"text-destructive/80",children:C.error})]})]})})}),x?i.jsxs("div",{className:"flex items-center justify-center py-12",children:[i.jsx(VN,{className:"h-8 w-8 animate-spin text-muted-foreground"}),i.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):b?i.jsx(dt,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[i.jsx(Wc,{className:"h-12 w-12 text-destructive mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:b}),i.jsx(fe,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):U.length===0?i.jsx(dt,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[i.jsx(Dr,{className:"h-12 w-12 text-muted-foreground mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r||o!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:U.map(R=>i.jsxs(dt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[i.jsxs(Vt,{children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsx(Gt,{className:"text-xl",children:R.manifest?.name||R.id}),i.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&i.jsx(tn,{variant:"secondary",className:"text-xs whitespace-nowrap",children:R.manifest.categories[0]}),$(R)]})]}),i.jsx(er,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),i.jsx(cn,{className:"flex-1",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(UN,{className:"h-4 w-4"}),i.jsx("span",{children:R.downloads.toLocaleString()})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(q3,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),i.jsx("span",{children:R.rating.toFixed(1)})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(F=>i.jsx(tn,{variant:"outline",className:"text-xs",children:F},F)),R.manifest?.keywords&&R.manifest.keywords.length>3&&i.jsxs(tn,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),i.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[i.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{children:"支持:"}),i.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),i.jsx(B5,{className:"pt-4",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?D(R)?i.jsxs(fe,{size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>L(R),children:[i.jsx(al,{className:"h-4 w-4 mr-1"}),"更新"]}):i.jsxs(fe,{variant:"destructive",size:"sm",disabled:!N?.installed,title:N?.installed?void 0:"Git 未安装",onClick:()=>G(R),children:[i.jsx(Ut,{className:"h-4 w-4 mr-1"}),"卸载"]}):i.jsxs(fe,{size:"sm",disabled:!N?.installed||C?.operation==="install"||E!==null&&!z(R),title:N?.installed?E!==null&&!z(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${E?.version})`:void 0:"Git 未安装",onClick:()=>H(R),children:[i.jsx(UN,{className:"h-4 w-4 mr-1"}),C?.operation==="install"&&C?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),i.jsx(nr,{open:t!==null,onOpenChange:V,children:t&&t.manifest&&i.jsxs(Hn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[i.jsx(Wn,{children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"space-y-2 flex-1",children:[i.jsx(Vn,{className:"text-2xl",children:t.manifest.name}),i.jsxs(dr,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&i.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:i.jsx(rv,{className:"h-3 w-3 inline"})})]})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&i.jsx(tn,{variant:"secondary",children:t.manifest.categories[0]}),$(t)]})]})}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"版本"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"下载量"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.downloads.toLocaleString()})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"评分"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(q3,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.rating.toFixed(1)," (",t.review_count,")"]})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:"许可证"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),i.jsxs("div",{className:"col-span-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(R=>i.jsx(tn,{variant:"outline",children:R},R))})]}),t.detailed_description&&i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),i.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:"主页: "}),i.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:"仓库: "}),i.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),i.jsxs($r,{children:[t.manifest.homepage_url&&i.jsxs(fe,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[i.jsx(rv,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&i.jsxs(fe,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[i.jsx(rv,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function NOe(){const e=oa(),{toast:t}=mr(),[n,r]=y.useState([]),[a,o]=y.useState(!0),[l,u]=y.useState(null),[d,f]=y.useState(null),[m,p]=y.useState(!1),[g,x]=y.useState(!1),[j,b]=y.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w=y.useCallback(async()=>{try{o(!0),u(null);const T=localStorage.getItem("access-token"),M=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${T}`}});if(!M.ok)throw new Error("获取镜像源列表失败");const $=await M.json();r($.mirrors||[])}catch(T){const M=T instanceof Error?T.message:"加载镜像源失败";u(M),t({title:"加载失败",description:M,variant:"destructive"})}finally{o(!1)}},[t]);y.useEffect(()=>{w()},[w]);const N=async()=>{try{const T=localStorage.getItem("access-token"),M=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${T}`,"Content-Type":"application/json"},body:JSON.stringify(j)});if(!M.ok){const $=await M.json();throw new Error($.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),p(!1),b({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),w()}catch(T){t({title:"添加失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}},O=async()=>{if(d)try{const T=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${d.id}`,{method:"PUT",headers:{Authorization:`Bearer ${T}`,"Content-Type":"application/json"},body:JSON.stringify({name:j.name,raw_prefix:j.raw_prefix,clone_prefix:j.clone_prefix,enabled:j.enabled,priority:j.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),x(!1),f(null),w()}catch(T){t({title:"更新失败",description:T instanceof Error?T.message:"未知错误",variant:"destructive"})}},C=async T=>{if(confirm("确定要删除这个镜像源吗?"))try{const M=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T}`,{method:"DELETE",headers:{Authorization:`Bearer ${M}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),w()}catch(M){t({title:"删除失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},A=async T=>{try{const M=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T.id}`,{method:"PUT",headers:{Authorization:`Bearer ${M}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!T.enabled})})).ok)throw new Error("更新状态失败");w()}catch(M){t({title:"更新失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},E=T=>{f(T),b({id:T.id,name:T.name,raw_prefix:T.raw_prefix,clone_prefix:T.clone_prefix,enabled:T.enabled,priority:T.priority}),x(!0)},k=async(T,M)=>{const $=M==="up"?T.priority-1:T.priority+1;if(!($<1))try{const z=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${T.id}`,{method:"PUT",headers:{Authorization:`Bearer ${z}`,"Content-Type":"application/json"},body:JSON.stringify({priority:$})})).ok)throw new Error("更新优先级失败");w()}catch(z){t({title:"更新失败",description:z instanceof Error?z.message:"未知错误",variant:"destructive"})}};return i.jsx(Kt,{className:"h-full",children:i.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:i.jsx(Hq,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),i.jsxs(fe,{onClick:()=>p(!0),children:[i.jsx(tr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),a?i.jsx(dt,{className:"p-6",children:i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx(VN,{className:"h-8 w-8 animate-spin text-primary"})})}):l?i.jsx(dt,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[i.jsx(Wc,{className:"h-12 w-12 text-destructive mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:l}),i.jsx(fe,{onClick:w,children:"重新加载"})]})}):i.jsxs(dt,{children:[i.jsx("div",{className:"hidden md:block",children:i.jsxs(Ol,{children:[i.jsx(Cl,{children:i.jsxs(vn,{children:[i.jsx(Je,{children:"状态"}),i.jsx(Je,{children:"名称"}),i.jsx(Je,{children:"ID"}),i.jsx(Je,{children:"优先级"}),i.jsx(Je,{className:"text-right",children:"操作"})]})}),i.jsx(El,{children:n.map(T=>i.jsxs(vn,{children:[i.jsx(Ue,{children:i.jsx(at,{checked:T.enabled,onCheckedChange:()=>A(T)})}),i.jsx(Ue,{children:i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:T.name}),i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",T.raw_prefix]})]})}),i.jsx(Ue,{children:i.jsx(tn,{variant:"outline",children:T.id})}),i.jsx(Ue,{children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono",children:T.priority}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(fe,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(T,"up"),disabled:T.priority===1,children:i.jsx(qN,{className:"h-3 w-3"})}),i.jsx(fe,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>k(T,"down"),children:i.jsx(ch,{className:"h-3 w-3"})})]})]})}),i.jsx(Ue,{className:"text-right",children:i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>E(T),children:i.jsx(Eu,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>C(T.id),children:i.jsx(Ut,{className:"h-4 w-4 text-destructive"})})]})})]},T.id))})]})}),i.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(T=>i.jsx(dt,{className:"p-4",children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"font-semibold",children:T.name}),T.enabled&&i.jsx(tn,{variant:"default",className:"text-xs",children:"启用"})]}),i.jsx(tn,{variant:"outline",className:"mt-1 text-xs",children:T.id})]}),i.jsx(at,{checked:T.enabled,onCheckedChange:()=>A(T)})]}),i.jsxs("div",{className:"text-sm space-y-1",children:[i.jsxs("div",{className:"text-muted-foreground",children:[i.jsx("span",{className:"font-medium",children:"Raw: "}),i.jsx("span",{className:"break-all",children:T.raw_prefix})]}),i.jsxs("div",{className:"text-muted-foreground",children:[i.jsx("span",{className:"font-medium",children:"优先级: "}),i.jsx("span",{className:"font-mono",children:T.priority})]})]}),i.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[i.jsxs(fe,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>E(T),children:[i.jsx(Eu,{className:"h-4 w-4 mr-1"}),"编辑"]}),i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>k(T,"up"),disabled:T.priority===1,children:i.jsx(qN,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"outline",size:"sm",onClick:()=>k(T,"down"),children:i.jsx(ch,{className:"h-4 w-4"})}),i.jsx(fe,{variant:"destructive",size:"sm",onClick:()=>C(T.id),children:i.jsx(Ut,{className:"h-4 w-4"})})]})]})},T.id))})]}),i.jsx(nr,{open:m,onOpenChange:p,children:i.jsxs(Hn,{className:"max-w-lg",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"添加镜像源"}),i.jsx(dr,{children:"添加新的 Git 镜像源配置"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-id",children:"镜像源 ID *"}),i.jsx(Ne,{id:"add-id",placeholder:"例如: my-mirror",value:j.id,onChange:T=>b({...j,id:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-name",children:"名称 *"}),i.jsx(Ne,{id:"add-name",placeholder:"例如: 我的镜像源",value:j.name,onChange:T=>b({...j,name:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),i.jsx(Ne,{id:"add-raw",placeholder:"https://example.com/raw",value:j.raw_prefix,onChange:T=>b({...j,raw_prefix:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-clone",children:"克隆前缀 *"}),i.jsx(Ne,{id:"add-clone",placeholder:"https://example.com/clone",value:j.clone_prefix,onChange:T=>b({...j,clone_prefix:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"add-priority",children:"优先级"}),i.jsx(Ne,{id:"add-priority",type:"number",min:"1",value:j.priority,onChange:T=>b({...j,priority:parseInt(T.target.value)||1})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"add-enabled",checked:j.enabled,onCheckedChange:T=>b({...j,enabled:T})}),i.jsx(J,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"取消"}),i.jsx(fe,{onClick:N,children:"添加"})]})]})}),i.jsx(nr,{open:g,onOpenChange:x,children:i.jsxs(Hn,{className:"max-w-lg",children:[i.jsxs(Wn,{children:[i.jsx(Vn,{children:"编辑镜像源"}),i.jsx(dr,{children:"修改镜像源配置"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{children:"镜像源 ID"}),i.jsx(Ne,{value:j.id,disabled:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-name",children:"名称 *"}),i.jsx(Ne,{id:"edit-name",value:j.name,onChange:T=>b({...j,name:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),i.jsx(Ne,{id:"edit-raw",value:j.raw_prefix,onChange:T=>b({...j,raw_prefix:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-clone",children:"克隆前缀 *"}),i.jsx(Ne,{id:"edit-clone",value:j.clone_prefix,onChange:T=>b({...j,clone_prefix:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(J,{htmlFor:"edit-priority",children:"优先级"}),i.jsx(Ne,{id:"edit-priority",type:"number",min:"1",value:j.priority,onChange:T=>b({...j,priority:parseInt(T.target.value)||1})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(at,{id:"edit-enabled",checked:j.enabled,onCheckedChange:T=>b({...j,enabled:T})}),i.jsx(J,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),i.jsxs($r,{children:[i.jsx(fe,{variant:"outline",onClick:()=>x(!1),children:"取消"}),i.jsx(fe,{onClick:O,children:"保存"})]})]})})]})})}const OOe=zh("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),VH=y.forwardRef(({className:e,size:t,abbrTitle:n,children:r,...a},o)=>i.jsx("kbd",{className:ue(OOe({size:t,className:e})),ref:o,...a,children:n?i.jsx("abbr",{title:n,children:r}):r}));VH.displayName="Kbd";const COe=[{icon:jg,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:VC,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:Zq,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:Wq,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:YC,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Ih,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:Vq,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:eve,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:Kq,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:bg,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Hc,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function EOe({open:e,onOpenChange:t}){const[n,r]=y.useState(""),[a,o]=y.useState(0),l=oa(),u=COe.filter(m=>m.title.toLowerCase().includes(n.toLowerCase())||m.description.toLowerCase().includes(n.toLowerCase())||m.category.toLowerCase().includes(n.toLowerCase()));y.useEffect(()=>{e&&(r(""),o(0))},[e]);const d=y.useCallback(m=>{l({to:m}),t(!1)},[l,t]),f=y.useCallback(m=>{m.key==="ArrowDown"?(m.preventDefault(),o(p=>(p+1)%u.length)):m.key==="ArrowUp"?(m.preventDefault(),o(p=>(p-1+u.length)%u.length)):m.key==="Enter"&&u[a]&&(m.preventDefault(),d(u[a].path))},[u,a,d]);return i.jsx(nr,{open:e,onOpenChange:t,children:i.jsxs(Hn,{className:"max-w-2xl p-0 gap-0",children:[i.jsxs(Wn,{className:"px-4 pt-4 pb-0",children:[i.jsx(Vn,{className:"sr-only",children:"搜索"}),i.jsxs("div",{className:"relative",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),i.jsx(Ne,{value:n,onChange:m=>{r(m.target.value),o(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),i.jsx("div",{className:"border-t",children:i.jsx(Kt,{className:"h-[400px]",children:u.length>0?i.jsx("div",{className:"p-2",children:u.map((m,p)=>{const g=m.icon;return i.jsxs("button",{onClick:()=>d(m.path),onMouseEnter:()=>o(p),className:ue("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",p===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[i.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm",children:m.title}),i.jsx("div",{className:"text-xs text-muted-foreground truncate",children:m.description})]}),i.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:m.category})]},m.path)})}):i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[i.jsx(Dr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),i.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function AOe(e){const t=TOe(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(MOe);if(d){const f=d.props.children,m=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return i.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return i.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function TOe(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=ROe(a),u=POe(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Rr(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kOe=Symbol("radix.slottable");function MOe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kOe}function POe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function ROe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fO=["Enter"," "],DOe=["ArrowDown","PageUp","Home"],GH=["ArrowUp","PageDown","End"],$Oe=[...DOe,...GH],IOe={ltr:[...fO,"ArrowRight"],rtl:[...fO,"ArrowLeft"]},LOe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qh="Menu",[gh,BOe,zOe]=Nh(Qh),[kl,YH]=hr(Qh,[zOe,ls,Fg]),Jh=ls(),KH=Fg(),[XH,hs]=kl(Qh),[qOe,em]=kl(Qh),ZH=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:l=!0}=e,u=Jh(t),[d,f]=y.useState(null),m=y.useRef(!1),p=nn(o),g=Iu(a);return y.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>m.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),i.jsx(Hh,{...u,children:i.jsx(XH,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:i.jsx(qOe,{scope:t,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:l,children:r})})})};ZH.displayName=Qh;var FOe="MenuAnchor",EE=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Jh(n);return i.jsx(Wh,{...a,...r,ref:t})});EE.displayName=FOe;var AE="MenuPortal",[UOe,QH]=kl(AE,{forceMount:void 0}),JH=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,o=hs(AE,t);return i.jsx(UOe,{scope:t,forceMount:n,children:i.jsx(Rn,{present:n||o.open,children:i.jsx(Nl,{asChild:!0,container:a,children:r})})})};JH.displayName=AE;var _a="MenuContent",[HOe,TE]=kl(_a),e9=y.forwardRef((e,t)=>{const n=QH(_a,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=hs(_a,e.__scopeMenu),l=em(_a,e.__scopeMenu);return i.jsx(gh.Provider,{scope:e.__scopeMenu,children:i.jsx(Rn,{present:r||o.open,children:i.jsx(gh.Slot,{scope:e.__scopeMenu,children:l.modal?i.jsx(WOe,{...a,ref:t}):i.jsx(VOe,{...a,ref:t})})})})}),WOe=y.forwardRef((e,t)=>{const n=hs(_a,e.__scopeMenu),r=y.useRef(null),a=qe(t,r);return y.useEffect(()=>{const o=r.current;if(o)return Ry(o)},[]),i.jsx(kE,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),VOe=y.forwardRef((e,t)=>{const n=hs(_a,e.__scopeMenu);return i.jsx(kE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),GOe=AOe("MenuContent.ScrollLock"),kE=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:j,...b}=e,w=hs(_a,n),N=em(_a,n),O=Jh(n),C=KH(n),A=BOe(n),[E,k]=y.useState(null),T=y.useRef(null),M=qe(t,T,w.onContentChange),$=y.useRef(0),z=y.useRef(""),D=y.useRef(0),U=y.useRef(null),V=y.useRef("right"),H=y.useRef(0),G=j?Fh:y.Fragment,L=j?{as:GOe,allowPinchZoom:!0}:void 0,R=K=>{const te=z.current+K,I=A().filter(ee=>!ee.disabled),B=document.activeElement,Y=I.find(ee=>ee.ref.current===B)?.textValue,ne=I.map(ee=>ee.textValue),oe=iCe(ne,te,Y),xe=I.find(ee=>ee.textValue===oe)?.ref.current;(function ee(ae){z.current=ae,window.clearTimeout($.current),ae!==""&&($.current=window.setTimeout(()=>ee(""),1e3))})(te),xe&&setTimeout(()=>xe.focus())};y.useEffect(()=>()=>window.clearTimeout($.current),[]),My();const F=y.useCallback(K=>V.current===U.current?.side&&sCe(K,U.current?.area),[]);return i.jsx(HOe,{scope:n,searchRef:z,onItemEnter:y.useCallback(K=>{F(K)&&K.preventDefault()},[F]),onItemLeave:y.useCallback(K=>{F(K)||(T.current?.focus(),k(null))},[F]),onTriggerLeave:y.useCallback(K=>{F(K)&&K.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:y.useCallback(K=>{U.current=K},[]),children:i.jsx(G,{...L,children:i.jsx(qh,{asChild:!0,trapped:a,onMountAutoFocus:Se(o,K=>{K.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:i.jsx(_l,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:i.jsx(W5,{asChild:!0,...C,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:k,onEntryFocus:Se(d,K=>{N.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Uy,{role:"menu","aria-orientation":"vertical","data-state":g9(w.open),"data-radix-menu-content":"",dir:N.dir,...O,...b,ref:M,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,K=>{const I=K.target.closest("[data-radix-menu-content]")===K.currentTarget,B=K.ctrlKey||K.altKey||K.metaKey,Y=K.key.length===1;I&&(K.key==="Tab"&&K.preventDefault(),!B&&Y&&R(K.key));const ne=T.current;if(K.target!==ne||!$Oe.includes(K.key))return;K.preventDefault();const xe=A().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);GH.includes(K.key)&&xe.reverse(),rCe(xe)}),onBlur:Se(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout($.current),z.current="")}),onPointerMove:Se(e.onPointerMove,yh(K=>{const te=K.target,I=H.current!==K.clientX;if(K.currentTarget.contains(te)&&I){const B=K.clientX>H.current?"right":"left";V.current=B,H.current=K.clientX}}))})})})})})})});e9.displayName=_a;var YOe="MenuGroup",ME=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Pe.div,{role:"group",...r,ref:t})});ME.displayName=YOe;var KOe="MenuLabel",t9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Pe.div,{...r,ref:t})});t9.displayName=KOe;var Mg="MenuItem",$L="menu.itemSelect",Jy=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,o=y.useRef(null),l=em(Mg,e.__scopeMenu),u=TE(Mg,e.__scopeMenu),d=qe(t,o),f=y.useRef(!1),m=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent($L,{bubbles:!0,cancelable:!0});p.addEventListener($L,x=>r?.(x),{once:!0}),RO(p,g),g.defaultPrevented?f.current=!1:l.onClose()}};return i.jsx(n9,{...a,ref:d,disabled:n,onClick:Se(e.onClick,m),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Se(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Se(e.onKeyDown,p=>{const g=u.searchRef.current!=="";n||g&&p.key===" "||fO.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Jy.displayName=Mg;var n9=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,l=TE(Mg,n),u=KH(n),d=y.useRef(null),f=qe(t,d),[m,p]=y.useState(!1),[g,x]=y.useState("");return y.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[o.children]),i.jsx(gh.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:i.jsx(V5,{asChild:!0,...u,focusable:!r,children:i.jsx(Pe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Se(e.onPointerMove,yh(j=>{r?l.onItemLeave(j):(l.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,yh(j=>l.onItemLeave(j))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),XOe="MenuCheckboxItem",r9=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return i.jsx(l9,{scope:e.__scopeMenu,checked:n,children:i.jsx(Jy,{role:"menuitemcheckbox","aria-checked":Pg(n)?"mixed":n,...a,ref:t,"data-state":DE(n),onSelect:Se(a.onSelect,()=>r?.(Pg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});r9.displayName=XOe;var a9="MenuRadioGroup",[ZOe,QOe]=kl(a9,{value:void 0,onValueChange:()=>{}}),i9=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,o=nn(r);return i.jsx(ZOe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:i.jsx(ME,{...a,ref:t})})});i9.displayName=a9;var o9="MenuRadioItem",s9=y.forwardRef((e,t)=>{const{value:n,...r}=e,a=QOe(o9,e.__scopeMenu),o=n===a.value;return i.jsx(l9,{scope:e.__scopeMenu,checked:o,children:i.jsx(Jy,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":DE(o),onSelect:Se(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});s9.displayName=o9;var PE="MenuItemIndicator",[l9,JOe]=kl(PE,{checked:!1}),c9=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,o=JOe(PE,n);return i.jsx(Rn,{present:r||Pg(o.checked)||o.checked===!0,children:i.jsx(Pe.span,{...a,ref:t,"data-state":DE(o.checked)})})});c9.displayName=PE;var eCe="MenuSeparator",u9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});u9.displayName=eCe;var tCe="MenuArrow",d9=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Jh(n);return i.jsx(Hy,{...a,...r,ref:t})});d9.displayName=tCe;var RE="MenuSub",[nCe,f9]=kl(RE),h9=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,o=hs(RE,t),l=Jh(t),[u,d]=y.useState(null),[f,m]=y.useState(null),p=nn(a);return y.useEffect(()=>(o.open===!1&&p(!1),()=>p(!1)),[o.open,p]),i.jsx(Hh,{...l,children:i.jsx(XH,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:m,children:i.jsx(nCe,{scope:t,contentId:Fn(),triggerId:Fn(),trigger:u,onTriggerChange:d,children:n})})})};h9.displayName=RE;var mf="MenuSubTrigger",m9=y.forwardRef((e,t)=>{const n=hs(mf,e.__scopeMenu),r=em(mf,e.__scopeMenu),a=f9(mf,e.__scopeMenu),o=TE(mf,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),d(null)}},[u,d]),i.jsx(EE,{asChild:!0,...f,children:i.jsx(n9,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":g9(n.open),...e,ref:Rr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,yh(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Se(e.onPointerLeave,yh(p=>{m();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,w=g[j?"left":"right"],N=g[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:w,y:g.top},{x:N,y:g.top},{x:N,y:g.bottom},{x:w,y:g.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||IOe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});m9.displayName=mf;var p9="MenuSubContent",v9=y.forwardRef((e,t)=>{const n=QH(_a,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=hs(_a,e.__scopeMenu),l=em(_a,e.__scopeMenu),u=f9(p9,e.__scopeMenu),d=y.useRef(null),f=qe(t,d);return i.jsx(gh.Provider,{scope:e.__scopeMenu,children:i.jsx(Rn,{present:r||o.open,children:i.jsx(gh.Slot,{scope:e.__scopeMenu,children:i.jsx(kE,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Se(e.onFocusOutside,m=>{m.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Se(e.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),g=LOe[l.dir].includes(m.key);p&&g&&(o.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});v9.displayName=p9;function g9(e){return e?"open":"closed"}function Pg(e){return e==="indeterminate"}function DE(e){return Pg(e)?"indeterminate":e?"checked":"unchecked"}function rCe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function aCe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function iCe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=aCe(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function oCe(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function sCe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return oCe(n,t)}function yh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lCe=ZH,cCe=EE,uCe=JH,dCe=e9,fCe=ME,hCe=t9,mCe=Jy,pCe=r9,vCe=i9,gCe=s9,yCe=c9,xCe=u9,bCe=d9,wCe=h9,jCe=m9,SCe=v9,$E="ContextMenu",[_Ce]=hr($E,[YH]),pr=YH(),[NCe,y9]=_Ce($E),x9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:a,modal:o=!0}=e,[l,u]=y.useState(!1),d=pr(t),f=nn(r),m=y.useCallback(p=>{u(p),f(p)},[f]);return i.jsx(NCe,{scope:t,open:l,onOpenChange:m,modal:o,children:i.jsx(lCe,{...d,dir:a,open:l,onOpenChange:m,modal:o,children:n})})};x9.displayName=$E;var b9="ContextMenuTrigger",w9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...a}=e,o=y9(b9,n),l=pr(n),u=y.useRef({x:0,y:0}),d=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),f=y.useRef(0),m=y.useCallback(()=>window.clearTimeout(f.current),[]),p=g=>{u.current={x:g.clientX,y:g.clientY},o.onOpenChange(!0)};return y.useEffect(()=>m,[m]),y.useEffect(()=>void(r&&m()),[r,m]),i.jsxs(i.Fragment,{children:[i.jsx(cCe,{...l,virtualRef:d}),i.jsx(Pe.span,{"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Se(e.onContextMenu,g=>{m(),p(g),g.preventDefault()}),onPointerDown:r?e.onPointerDown:Se(e.onPointerDown,Kp(g=>{m(),f.current=window.setTimeout(()=>p(g),700)})),onPointerMove:r?e.onPointerMove:Se(e.onPointerMove,Kp(m)),onPointerCancel:r?e.onPointerCancel:Se(e.onPointerCancel,Kp(m)),onPointerUp:r?e.onPointerUp:Se(e.onPointerUp,Kp(m))})]})});w9.displayName=b9;var OCe="ContextMenuPortal",j9=e=>{const{__scopeContextMenu:t,...n}=e,r=pr(t);return i.jsx(uCe,{...r,...n})};j9.displayName=OCe;var S9="ContextMenuContent",_9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=y9(S9,n),o=pr(n),l=y.useRef(!1);return i.jsx(dCe,{...o,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),!u.defaultPrevented&&l.current&&u.preventDefault(),l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),!u.defaultPrevented&&!a.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_9.displayName=S9;var CCe="ContextMenuGroup",ECe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(fCe,{...a,...r,ref:t})});ECe.displayName=CCe;var ACe="ContextMenuLabel",N9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(hCe,{...a,...r,ref:t})});N9.displayName=ACe;var TCe="ContextMenuItem",O9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(mCe,{...a,...r,ref:t})});O9.displayName=TCe;var kCe="ContextMenuCheckboxItem",C9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(pCe,{...a,...r,ref:t})});C9.displayName=kCe;var MCe="ContextMenuRadioGroup",PCe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(vCe,{...a,...r,ref:t})});PCe.displayName=MCe;var RCe="ContextMenuRadioItem",E9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(gCe,{...a,...r,ref:t})});E9.displayName=RCe;var DCe="ContextMenuItemIndicator",A9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(yCe,{...a,...r,ref:t})});A9.displayName=DCe;var $Ce="ContextMenuSeparator",T9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(xCe,{...a,...r,ref:t})});T9.displayName=$Ce;var ICe="ContextMenuArrow",LCe=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(bCe,{...a,...r,ref:t})});LCe.displayName=ICe;var k9="ContextMenuSub",M9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:a,defaultOpen:o}=e,l=pr(t),[u,d]=Na({prop:a,defaultProp:o??!1,onChange:r,caller:k9});return i.jsx(wCe,{...l,open:u,onOpenChange:d,children:n})};M9.displayName=k9;var BCe="ContextMenuSubTrigger",P9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(jCe,{...a,...r,ref:t})});P9.displayName=BCe;var zCe="ContextMenuSubContent",R9=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,a=pr(n);return i.jsx(SCe,{...a,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});R9.displayName=zCe;function Kp(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var qCe=x9,FCe=w9,UCe=j9,D9=_9,$9=N9,I9=O9,L9=C9,B9=E9,z9=A9,q9=T9,HCe=M9,F9=P9,U9=R9;const WCe=qCe,VCe=FCe,GCe=HCe,H9=y.forwardRef(({className:e,inset:t,children:n,...r},a)=>i.jsxs(F9,{ref:a,className:ue("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,i.jsx(WC,{className:"ml-auto h-4 w-4"})]}));H9.displayName=F9.displayName;const W9=y.forwardRef(({className:e,...t},n)=>i.jsx(U9,{ref:n,className:ue("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));W9.displayName=U9.displayName;const V9=y.forwardRef(({className:e,...t},n)=>i.jsx(UCe,{children:i.jsx(D9,{ref:n,className:ue("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));V9.displayName=D9.displayName;const Da=y.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(I9,{ref:r,className:ue("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Da.displayName=I9.displayName;const YCe=y.forwardRef(({className:e,children:t,checked:n,...r},a)=>i.jsxs(L9,{ref:a,className:ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(z9,{children:i.jsx(nl,{className:"h-4 w-4"})})}),t]}));YCe.displayName=L9.displayName;const KCe=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(B9,{ref:r,className:ue("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(z9,{children:i.jsx(pve,{className:"h-2 w-2 fill-current"})})}),t]}));KCe.displayName=B9.displayName;const XCe=y.forwardRef(({className:e,inset:t,...n},r)=>i.jsx($9,{ref:r,className:ue("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));XCe.displayName=$9.displayName;const pf=y.forwardRef(({className:e,...t},n)=>i.jsx(q9,{ref:n,className:ue("-mx-1 my-1 h-px bg-border",e),...t}));pf.displayName=q9.displayName;const Dc=({className:e,...t})=>i.jsx("span",{className:ue("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Dc.displayName="ContextMenuShortcut";var ZCe=Symbol("radix.slottable");function QCe(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ZCe,t}var[ex]=hr("Tooltip",[ls]),tx=ls(),G9="TooltipProvider",JCe=700,hO="tooltip.open",[eEe,IE]=ex(G9),Y9=e=>{const{__scopeTooltip:t,delayDuration:n=JCe,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,l=y.useRef(!0),u=y.useRef(!1),d=y.useRef(0);return y.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),i.jsx(eEe,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:o})};Y9.displayName=G9;var xh="Tooltip",[tEe,tm]=ex(xh),K9=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,d=IE(xh,e.__scopeTooltip),f=tx(t),[m,p]=y.useState(null),g=Fn(),x=y.useRef(0),j=l??d.disableHoverableContent,b=u??d.delayDuration,w=y.useRef(!1),[N,O]=Na({prop:r,defaultProp:a??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(hO))):d.onClose(),o?.(T)},caller:xh}),C=y.useMemo(()=>N?w.current?"delayed-open":"instant-open":"closed",[N]),A=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,w.current=!1,O(!0)},[O]),E=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,O(!1)},[O]),k=y.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{w.current=!0,O(!0),x.current=0},b)},[b,O]);return y.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),i.jsx(Hh,{...f,children:i.jsx(tEe,{scope:t,contentId:g,open:N,stateAttribute:C,trigger:m,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{d.isOpenDelayedRef.current?k():A()},[d.isOpenDelayedRef,k,A]),onTriggerLeave:y.useCallback(()=>{j?E():(window.clearTimeout(x.current),x.current=0)},[E,j]),onOpen:A,onClose:E,disableHoverableContent:j,children:n})})};K9.displayName=xh;var mO="TooltipTrigger",X9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=tm(mO,n),o=IE(mO,n),l=tx(n),u=y.useRef(null),d=qe(t,u,a.onTriggerChange),f=y.useRef(!1),m=y.useRef(!1),p=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),i.jsx(Wh,{asChild:!0,...l,children:i.jsx(Pe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Se(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:Se(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:Se(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Se(e.onBlur,a.onClose),onClick:Se(e.onClick,a.onClose)})})});X9.displayName=mO;var LE="TooltipPortal",[nEe,rEe]=ex(LE,{forceMount:void 0}),Z9=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,o=tm(LE,t);return i.jsx(nEe,{scope:t,forceMount:n,children:i.jsx(Rn,{present:n||o.open,children:i.jsx(Nl,{asChild:!0,container:a,children:r})})})};Z9.displayName=LE;var Mu="TooltipContent",Q9=y.forwardRef((e,t)=>{const n=rEe(Mu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,l=tm(Mu,e.__scopeTooltip);return i.jsx(Rn,{present:r||l.open,children:l.disableHoverableContent?i.jsx(J9,{side:a,...o,ref:t}):i.jsx(aEe,{side:a,...o,ref:t})})}),aEe=y.forwardRef((e,t)=>{const n=tm(Mu,e.__scopeTooltip),r=IE(Mu,e.__scopeTooltip),a=y.useRef(null),o=qe(t,a),[l,u]=y.useState(null),{trigger:d,onClose:f}=n,m=a.current,{onPointerInTransitChange:p}=r,g=y.useCallback(()=>{u(null),p(!1)},[p]),x=y.useCallback((j,b)=>{const w=j.currentTarget,N={x:j.clientX,y:j.clientY},O=cEe(N,w.getBoundingClientRect()),C=uEe(N,O),A=dEe(b.getBoundingClientRect()),E=hEe([...C,...A]);u(E),p(!0)},[p]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(d&&m){const j=w=>x(w,m),b=w=>x(w,d);return d.addEventListener("pointerleave",j),m.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),m.removeEventListener("pointerleave",b)}}},[d,m,x,g]),y.useEffect(()=>{if(l){const j=b=>{const w=b.target,N={x:b.clientX,y:b.clientY},O=d?.contains(w)||m?.contains(w),C=!fEe(N,l);O?g():C&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,m,l,f,g]),i.jsx(J9,{...e,ref:o})}),[iEe,oEe]=ex(xh,{isInside:!1}),sEe=QCe("TooltipContent"),J9=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=tm(Mu,n),f=tx(n),{onClose:m}=d;return y.useEffect(()=>(document.addEventListener(hO,m),()=>document.removeEventListener(hO,m)),[m]),y.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,m]),i.jsx(_l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:i.jsxs(Uy,{"data-state":d.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(sEe,{children:r}),i.jsx(iEe,{scope:n,isInside:!0,children:i.jsx(dwe,{id:d.contentId,role:"tooltip",children:a||r})})]})})});Q9.displayName=Mu;var eW="TooltipArrow",lEe=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=tx(n);return oEe(eW,n).isInside?null:i.jsx(Hy,{...a,...r,ref:t})});lEe.displayName=eW;function cEe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function uEe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function dEe(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function fEe(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(p-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function hEe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),mEe(t)}function mEe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(a.y-l.y)>=(o.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(a.y-l.y)>=(o.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var pEe=Y9,vEe=K9,gEe=X9,yEe=Z9,tW=Q9;const xEe=pEe,bEe=vEe,wEe=gEe,nW=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(yEe,{children:i.jsx(tW,{ref:r,sideOffset:t,className:ue("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));nW.displayName=tW.displayName;function jEe({children:e}){Wxe();const[t,n]=y.useState(!0),[r,a]=y.useState(!1),[o,l]=y.useState(!1),{theme:u,setTheme:d}=XC(),f=DY(),m=oa();y.useEffect(()=>{const b=w=>{(w.metaKey||w.ctrlKey)&&w.key==="k"&&(w.preventDefault(),l(!0))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const p=[{title:"概览",items:[{icon:jg,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:VC,label:"麦麦主程序配置",path:"/config/bot"},{icon:Zq,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:Wq,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:YC,label:"表情包管理",path:"/resource/emoji"},{icon:Ih,label:"表达方式管理",path:"/resource/expression"},{icon:Vq,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:Kq,label:"插件市场",path:"/plugins"},{icon:bg,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Hc,label:"系统设置",path:"/settings"}]}],x=u==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":u,j=()=>{localStorage.removeItem("access-token"),m({to:"/auth"})};return i.jsx(xEe,{delayDuration:300,children:i.jsxs("div",{className:"flex h-screen overflow-hidden",children:[i.jsxs("aside",{className:ue("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[i.jsx("div",{className:"flex h-16 items-center border-b px-4",children:i.jsxs("div",{className:ue("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[i.jsxs("div",{className:ue("flex items-baseline gap-2",!t&&"lg:hidden"),children:[i.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),i.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:rye()})]}),!t&&i.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),i.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:i.jsx("ul",{className:ue("space-y-6",!t&&"lg:space-y-3"),children:p.map((b,w)=>i.jsxs("li",{children:[i.jsx("div",{className:ue("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:i.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:b.title})}),!t&&w>0&&i.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),i.jsx("ul",{className:"space-y-1",children:b.items.map(N=>{const O=f({to:N.path}),C=N.icon,A=i.jsxs(i.Fragment,{children:[O&&i.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),i.jsxs("div",{className:ue("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[i.jsx(C,{className:ue("h-5 w-5 flex-shrink-0",O&&"text-primary"),strokeWidth:2,fill:"none"}),i.jsx("span",{className:ue("text-sm font-medium whitespace-nowrap transition-all duration-300",O&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:N.label})]})]});return i.jsx("li",{className:"relative",children:i.jsxs(bEe,{children:[i.jsx(wEe,{asChild:!0,children:i.jsx(CO,{to:N.path,className:ue("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",O?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>a(!1),children:A})}),!t&&i.jsx(nW,{side:"right",className:"hidden lg:block",children:i.jsx("p",{children:N.label})})]})},N.path)})})]},b.title))})})]}),r&&i.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>a(!1)}),i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("button",{onClick:()=>a(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:i.jsx(zve,{className:"h-5 w-5"})}),i.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:i.jsx(HC,{className:ue("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>l(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[i.jsx(Dr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),i.jsxs(VH,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[i.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),i.jsx(EOe,{open:o,onOpenChange:l}),i.jsxs(fe,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[i.jsx(Ype,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),i.jsx("button",{onClick:b=>{Bge(x==="dark"?"light":"dark",d,b)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?i.jsx(YN,{className:"h-5 w-5"}):i.jsx(GN,{className:"h-5 w-5"})}),i.jsx("div",{className:"h-6 w-px bg-border"}),i.jsxs(fe,{variant:"ghost",size:"sm",onClick:j,className:"gap-2",title:"登出系统",children:[i.jsx(z3,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),i.jsxs(WCe,{children:[i.jsx(VCe,{asChild:!0,children:i.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),i.jsxs(V9,{className:"w-64",children:[i.jsxs(Da,{onClick:()=>m({to:"/"}),children:[i.jsx(jg,{className:"mr-2 h-4 w-4"}),"首页"]}),i.jsxs(Da,{onClick:()=>m({to:"/settings"}),children:[i.jsx(Hc,{className:"mr-2 h-4 w-4"}),"系统设置"]}),i.jsxs(Da,{onClick:()=>m({to:"/logs"}),children:[i.jsx(bg,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),i.jsx(pf,{}),i.jsxs(GCe,{children:[i.jsxs(H9,{children:[i.jsx(Xq,{className:"mr-2 h-4 w-4"}),"切换主题"]}),i.jsxs(W9,{className:"w-48",children:[i.jsxs(Da,{onClick:()=>d("light"),disabled:u==="light",children:[i.jsx(YN,{className:"mr-2 h-4 w-4"}),"浅色",u==="light"&&i.jsx(Dc,{children:"✓"})]}),i.jsxs(Da,{onClick:()=>d("dark"),disabled:u==="dark",children:[i.jsx(GN,{className:"mr-2 h-4 w-4"}),"深色",u==="dark"&&i.jsx(Dc,{children:"✓"})]}),i.jsxs(Da,{onClick:()=>d("system"),disabled:u==="system",children:[i.jsx(Hc,{className:"mr-2 h-4 w-4"}),"跟随系统",u==="system"&&i.jsx(Dc,{children:"✓"})]})]})]}),i.jsx(pf,{}),i.jsxs(Da,{onClick:()=>window.location.reload(),children:[i.jsx(tge,{className:"mr-2 h-4 w-4"}),"刷新页面",i.jsx(Dc,{children:"⌘R"})]}),i.jsxs(Da,{onClick:()=>l(!0),children:[i.jsx(Dr,{className:"mr-2 h-4 w-4"}),"搜索",i.jsx(Dc,{children:"⌘K"})]}),i.jsx(pf,{}),i.jsxs(Da,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[i.jsx(rv,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),i.jsx(pf,{}),i.jsxs(Da,{onClick:j,className:"text-destructive focus:text-destructive",children:[i.jsx(z3,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const nm=OY({component:()=>i.jsxs(i.Fragment,{children:[i.jsx(EO,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!c8())throw FL({to:"/auth"})}}),SEe=fr({getParentRoute:()=>nm,path:"/auth",component:Vxe}),_Ee=fr({getParentRoute:()=>nm,path:"/setup",component:wbe}),Aa=fr({getParentRoute:()=>nm,id:"protected",component:()=>i.jsx(jEe,{children:i.jsx(EO,{})})}),NEe=fr({getParentRoute:()=>Aa,path:"/",component:Ige}),OEe=fr({getParentRoute:()=>Aa,path:"/config/bot",component:uje}),CEe=fr({getParentRoute:()=>Aa,path:"/config/modelProvider",component:Tje}),EEe=fr({getParentRoute:()=>Aa,path:"/config/model",component:a1e}),AEe=fr({getParentRoute:()=>Aa,path:"/resource/emoji",component:f1e}),TEe=fr({getParentRoute:()=>Aa,path:"/resource/expression",component:w1e}),kEe=fr({getParentRoute:()=>Aa,path:"/resource/person",component:T1e}),MEe=fr({getParentRoute:()=>Aa,path:"/logs",component:dOe}),PEe=fr({getParentRoute:()=>Aa,path:"/plugins",component:_Oe}),REe=fr({getParentRoute:()=>Aa,path:"/plugin-mirrors",component:NOe}),DEe=fr({getParentRoute:()=>Aa,path:"/settings",component:Lxe}),$Ee=fr({getParentRoute:()=>nm,path:"*",component:y8}),IEe=nm.addChildren([SEe,_Ee,Aa.addChildren([NEe,OEe,CEe,EEe,AEe,TEe,kEe,PEe,REe,MEe,DEe]),$Ee]),LEe=$Y({routeTree:IEe,defaultNotFoundComponent:y8});function BEe({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...r}){const[a,o]=y.useState(()=>localStorage.getItem(n)||t);y.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]),y.useEffect(()=>{const u=localStorage.getItem("accent-color");if(u){const d=document.documentElement,m={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%"},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%"},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%"},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%"},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%"}}[u];m&&d.style.setProperty("--primary",m.hsl)}},[]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return i.jsx(eF.Provider,{...r,value:l,children:e})}function zEe({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:a="enable-waves-background"}){const[o,l]=y.useState(()=>{const m=localStorage.getItem(r);return m!==null?m==="true":t}),[u,d]=y.useState(()=>{const m=localStorage.getItem(a);return m!==null?m==="true":n});y.useEffect(()=>{const m=document.documentElement;o?m.classList.remove("no-animations"):m.classList.add("no-animations"),localStorage.setItem(r,String(o))},[o,r]),y.useEffect(()=>{localStorage.setItem(a,String(u))},[u,a]);const f={enableAnimations:o,setEnableAnimations:l,enableWavesBackground:u,setEnableWavesBackground:d};return i.jsx(tF.Provider,{value:f,children:e})}var BE="ToastProvider",[zE,qEe,FEe]=Nh("Toast"),[rW]=hr("Toast",[FEe]),[UEe,nx]=rW(BE),aW=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:l}=e,[u,d]=y.useState(null),[f,m]=y.useState(0),p=y.useRef(!1),g=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${BE}\`. Expected non-empty \`string\`.`),i.jsx(zE.Provider,{scope:t,children:i.jsx(UEe,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:o,toastCount:f,viewport:u,onViewportChange:d,onToastAdd:y.useCallback(()=>m(x=>x+1),[]),onToastRemove:y.useCallback(()=>m(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:l})})};aW.displayName=BE;var iW="ToastViewport",HEe=["F8"],pO="toast.viewportPause",vO="toast.viewportResume",oW=y.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=HEe,label:a="Notifications ({hotkey})",...o}=e,l=nx(iW,n),u=qEe(n),d=y.useRef(null),f=y.useRef(null),m=y.useRef(null),p=y.useRef(null),g=qe(t,p,l.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=l.toastCount>0;y.useEffect(()=>{const w=N=>{r.length!==0&&r.every(C=>N[C]||N.code===C)&&p.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),y.useEffect(()=>{const w=d.current,N=p.current;if(j&&w&&N){const O=()=>{if(!l.isClosePausedRef.current){const k=new CustomEvent(pO);N.dispatchEvent(k),l.isClosePausedRef.current=!0}},C=()=>{if(l.isClosePausedRef.current){const k=new CustomEvent(vO);N.dispatchEvent(k),l.isClosePausedRef.current=!1}},A=k=>{!w.contains(k.relatedTarget)&&C()},E=()=>{w.contains(document.activeElement)||C()};return w.addEventListener("focusin",O),w.addEventListener("focusout",A),w.addEventListener("pointermove",O),w.addEventListener("pointerleave",E),window.addEventListener("blur",O),window.addEventListener("focus",C),()=>{w.removeEventListener("focusin",O),w.removeEventListener("focusout",A),w.removeEventListener("pointermove",O),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",O),window.removeEventListener("focus",C)}}},[j,l.isClosePausedRef]);const b=y.useCallback(({tabbingDirection:w})=>{const O=u().map(C=>{const A=C.ref.current,E=[A,...rAe(A)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?O.reverse():O).flat()},[u]);return y.useEffect(()=>{const w=p.current;if(w){const N=O=>{const C=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!C){const E=document.activeElement,k=O.shiftKey;if(O.target===w&&k){f.current?.focus();return}const $=b({tabbingDirection:k?"backwards":"forwards"}),z=$.findIndex(D=>D===E);s_($.slice(z+1))?O.preventDefault():k?f.current?.focus():m.current?.focus()}};return w.addEventListener("keydown",N),()=>w.removeEventListener("keydown",N)}},[u,b]),i.jsxs(fye,{ref:d,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&i.jsx(gO,{ref:f,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"forwards"});s_(w)}}),i.jsx(zE.Slot,{scope:n,children:i.jsx(Pe.ol,{tabIndex:-1,...o,ref:g})}),j&&i.jsx(gO,{ref:m,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"backwards"});s_(w)}})]})});oW.displayName=iW;var sW="ToastFocusProxy",gO=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,o=nx(sW,n);return i.jsx(Wy,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!o.viewport?.contains(u)&&r()}})});gO.displayName=sW;var rm="Toast",WEe="toast.swipeStart",VEe="toast.swipeMove",GEe="toast.swipeCancel",YEe="toast.swipeEnd",lW=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:o,...l}=e,[u,d]=Na({prop:r,defaultProp:a??!0,onChange:o,caller:rm});return i.jsx(Rn,{present:n||u,children:i.jsx(ZEe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:nn(e.onPause),onResume:nn(e.onResume),onSwipeStart:Se(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Se(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});lW.displayName=rm;var[KEe,XEe]=rW(rm,{onClose(){}}),ZEe=y.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:o,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:x,...j}=e,b=nx(rm,n),[w,N]=y.useState(null),O=qe(t,H=>N(H)),C=y.useRef(null),A=y.useRef(null),E=a||b.duration,k=y.useRef(0),T=y.useRef(E),M=y.useRef(0),{onToastAdd:$,onToastRemove:z}=b,D=nn(()=>{w?.contains(document.activeElement)&&b.viewport?.focus(),l()}),U=y.useCallback(H=>{!H||H===1/0||(window.clearTimeout(M.current),k.current=new Date().getTime(),M.current=window.setTimeout(D,H))},[D]);y.useEffect(()=>{const H=b.viewport;if(H){const G=()=>{U(T.current),f?.()},L=()=>{const R=new Date().getTime()-k.current;T.current=T.current-R,window.clearTimeout(M.current),d?.()};return H.addEventListener(pO,L),H.addEventListener(vO,G),()=>{H.removeEventListener(pO,L),H.removeEventListener(vO,G)}}},[b.viewport,E,d,f,U]),y.useEffect(()=>{o&&!b.isClosePausedRef.current&&U(E)},[o,E,b.isClosePausedRef,U]),y.useEffect(()=>($(),()=>z()),[$,z]);const V=y.useMemo(()=>w?pW(w):null,[w]);return b.viewport?i.jsxs(i.Fragment,{children:[V&&i.jsx(QEe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),i.jsx(KEe,{scope:n,onClose:D,children:yl.createPortal(i.jsx(zE.ItemSlot,{scope:n,children:i.jsx(dye,{asChild:!0,onEscapeKeyDown:Se(u,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(Pe.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,H=>{H.key==="Escape"&&(u?.(H.nativeEvent),H.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Se(e.onPointerDown,H=>{H.button===0&&(C.current={x:H.clientX,y:H.clientY})}),onPointerMove:Se(e.onPointerMove,H=>{if(!C.current)return;const G=H.clientX-C.current.x,L=H.clientY-C.current.y,R=!!A.current,F=["left","right"].includes(b.swipeDirection),K=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,te=F?K(0,G):0,I=F?0:K(0,L),B=H.pointerType==="touch"?10:2,Y={x:te,y:I},ne={originalEvent:H,delta:Y};R?(A.current=Y,Xp(VEe,p,ne,{discrete:!1})):IL(Y,b.swipeDirection,B)?(A.current=Y,Xp(WEe,m,ne,{discrete:!1}),H.target.setPointerCapture(H.pointerId)):(Math.abs(G)>B||Math.abs(L)>B)&&(C.current=null)}),onPointerUp:Se(e.onPointerUp,H=>{const G=A.current,L=H.target;if(L.hasPointerCapture(H.pointerId)&&L.releasePointerCapture(H.pointerId),A.current=null,C.current=null,G){const R=H.currentTarget,F={originalEvent:H,delta:G};IL(G,b.swipeDirection,b.swipeThreshold)?Xp(YEe,x,F,{discrete:!0}):Xp(GEe,g,F,{discrete:!0}),R.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),QEe=e=>{const{__scopeToast:t,children:n,...r}=e,a=nx(rm,t),[o,l]=y.useState(!1),[u,d]=y.useState(!1);return tAe(()=>l(!0)),y.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:i.jsx(Nl,{asChild:!0,children:i.jsx(Wy,{...r,children:o&&i.jsxs(i.Fragment,{children:[a.label," ",n]})})})},JEe="ToastTitle",cW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(Pe.div,{...r,ref:t})});cW.displayName=JEe;var eAe="ToastDescription",uW=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(Pe.div,{...r,ref:t})});uW.displayName=eAe;var dW="ToastAction",fW=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(mW,{altText:n,asChild:!0,children:i.jsx(qE,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${dW}\`. Expected non-empty \`string\`.`),null)});fW.displayName=dW;var hW="ToastClose",qE=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=XEe(hW,n);return i.jsx(mW,{asChild:!0,children:i.jsx(Pe.button,{type:"button",...r,ref:t,onClick:Se(e.onClick,a.onClose)})})});qE.displayName=hW;var mW=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return i.jsx(Pe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function pW(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),nAe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...pW(r))}}),t}function Xp(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?RO(a,o):a.dispatchEvent(o)}var IL=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),o=r>a;return t==="left"||t==="right"?o&&r>n:!o&&a>n};function tAe(e=()=>{}){const t=nn(e);Un(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function nAe(e){return e.nodeType===e.ELEMENT_NODE}function rAe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function s_(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var aAe=aW,vW=oW,gW=lW,yW=cW,xW=uW,bW=fW,wW=qE;const iAe=aAe,jW=y.forwardRef(({className:e,...t},n)=>i.jsx(vW,{ref:n,className:ue("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));jW.displayName=vW.displayName;const oAe=zh("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),SW=y.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(gW,{ref:r,className:ue(oAe({variant:t}),e),...n}));SW.displayName=gW.displayName;const sAe=y.forwardRef(({className:e,...t},n)=>i.jsx(bW,{ref:n,className:ue("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));sAe.displayName=bW.displayName;const _W=y.forwardRef(({className:e,...t},n)=>i.jsx(wW,{ref:n,className:ue("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx(Lh,{className:"h-4 w-4"})}));_W.displayName=wW.displayName;const NW=y.forwardRef(({className:e,...t},n)=>i.jsx(yW,{ref:n,className:ue("text-sm font-semibold [&+div]:text-xs",e),...t}));NW.displayName=yW.displayName;const OW=y.forwardRef(({className:e,...t},n)=>i.jsx(xW,{ref:n,className:ue("text-sm opacity-90",e),...t}));OW.displayName=xW.displayName;function lAe(){const{toasts:e}=mr();return i.jsxs(iAe,{children:[e.map(function({id:t,title:n,description:r,action:a,...o}){return i.jsxs(SW,{...o,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(NW,{children:n}),r&&i.jsx(OW,{children:r})]}),a,i.jsx(_W,{})]},t)}),i.jsx(jW,{})]})}YV.createRoot(document.getElementById("root")).render(i.jsx(y.StrictMode,{children:i.jsx(BEe,{defaultTheme:"system",children:i.jsxs(zEe,{children:[i.jsx(BY,{router:LEe}),i.jsx(lAe,{})]})})}));