function r9(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 s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).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 ep=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hb={exports:{}},qu={};var GC;function a9(){if(GC)return qu;GC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var s=null;if(o!==void 0&&(s=""+o),a.key!==void 0&&(s=""+a.key),"key"in a){o={};for(var c in a)c!=="key"&&(o[c]=a[c])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:s,ref:a!==void 0?a:null,props:o}}return qu.Fragment=t,qu.jsx=n,qu.jsxs=n,qu}var KC;function i9(){return KC||(KC=1,Hb.exports=a9()),Hb.exports}var u=i9(),Vb={exports:{}},Be={};var WC;function o9(){if(WC)return Be;WC=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"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function A(I,q,X){this.props=I,this.context=q,this.refs=w,this.updater=X||S}A.prototype.isReactComponent={},A.prototype.setState=function(I,q){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,q,"setState")},A.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=A.prototype;function E(I,q,X){this.props=I,this.context=q,this.refs=w,this.updater=X||S}var N=E.prototype=new O;N.constructor=E,x(N,A.prototype),N.isPureReactComponent=!0;var T=Array.isArray;function C(){}var R={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function k(I,q,X){var te=X.ref;return{$$typeof:e,type:I,key:q,ref:te!==void 0?te:null,props:X}}function z(I,q){return k(I.type,q,I.props)}function L(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(X){return q[X]})}var F=/\/+/g;function U(I,q){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):q.toString(36)}function W(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(C,C):(I.status="pending",I.then(function(q){I.status==="pending"&&(I.status="fulfilled",I.value=q)},function(q){I.status==="pending"&&(I.status="rejected",I.reason=q)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function $(I,q,X,te,se){var Q=typeof I;(Q==="undefined"||Q==="boolean")&&(I=null);var G=!1;if(I===null)G=!0;else switch(Q){case"bigint":case"string":case"number":G=!0;break;case"object":switch(I.$$typeof){case e:case t:G=!0;break;case p:return G=I._init,$(G(I._payload),q,X,te,se)}}if(G)return se=se(I),G=te===""?"."+U(I,0):te,T(se)?(X="",G!=null&&(X=G.replace(F,"$&/")+"/"),$(se,q,X,"",function(pe){return pe})):se!=null&&(L(se)&&(se=z(se,X+(se.key==null||I&&I.key===se.key?"":(""+se.key).replace(F,"$&/")+"/")+G)),q.push(se)),1;G=0;var ge=te===""?".":te+":";if(T(I))for(var re=0;re>>1,ee=$[ne];if(0>>1;nea(X,H))tea(se,X)?($[ne]=se,$[te]=H,ne=te):($[ne]=X,$[q]=H,ne=q);else if(tea(se,H))$[ne]=se,$[te]=H,ne=te;else break e}}return V}function a($,V){var H=$.sortIndex-V.sortIndex;return H!==0?H:$.id-V.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 s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var f=[],h=[],p=1,m=null,g=3,y=!1,S=!1,x=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function N($){for(var V=n(h);V!==null;){if(V.callback===null)r(h);else if(V.startTime<=$)r(h),V.sortIndex=V.expirationTime,t(f,V);else break;V=n(h)}}function T($){if(x=!1,N($),!S)if(n(f)!==null)S=!0,C||(C=!0,B());else{var V=n(h);V!==null&&W(T,V.startTime-$)}}var C=!1,R=-1,M=5,k=-1;function z(){return w?!0:!(e.unstable_now()-k$&&z());){var ne=m.callback;if(typeof ne=="function"){m.callback=null,g=m.priorityLevel;var ee=ne(m.expirationTime<=$);if($=e.unstable_now(),typeof ee=="function"){m.callback=ee,N($),V=!0;break t}m===n(f)&&r(f),N($)}else r(f);m=n(f)}if(m!==null)V=!0;else{var I=n(h);I!==null&&W(T,I.startTime-$),V=!1}}break e}finally{m=null,g=H,y=!1}V=void 0}}finally{V?B():C=!1}}}var B;if(typeof E=="function")B=function(){E(L)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,U=F.port2;F.port1.onmessage=L,B=function(){U.postMessage(null)}}else B=function(){A(L,0)};function W($,V){R=A(function(){$(e.unstable_now())},V)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function($){switch(g){case 1:case 2:case 3:var V=3;break;default:V=g}var H=g;g=V;try{return $()}finally{g=H}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function($,V){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=g;g=$;try{return V()}finally{g=H}},e.unstable_scheduleCallback=function($,V,H){var ne=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0ne?($.sortIndex=H,t(h,$),n(f)===null&&$===n(h)&&(x?(O(R),R=-1):x=!0,W(T,H-ne))):($.sortIndex=ee,t(f,$),S||y||(S=!0,C||(C=!0,B()))),$},e.unstable_shouldYield=z,e.unstable_wrapCallback=function($){var V=g;return function(){var H=g;g=V;try{return $.apply(this,arguments)}finally{g=H}}}})(Wb)),Wb}var ZC;function l9(){return ZC||(ZC=1,Kb.exports=s9()),Kb.exports}var Yb={exports:{}},pn={};var QC;function c9(){if(QC)return pn;QC=1;var e=dd();function t(f){var h="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Yb.exports=c9(),Yb.exports}var e2;function u9(){if(e2)return Uu;e2=1;var e=l9(),t=dd(),n=DI();function r(i){var l="https://react.dev/errors/"+i;if(1ee||(i.current=ne[ee],ne[ee]=null,ee--)}function X(i,l){ee++,ne[ee]=i.current,i.current=l}var te=I(null),se=I(null),Q=I(null),G=I(null);function ge(i,l){switch(X(Q,l),X(se,i),X(te,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?mC(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=mC(l),i=vC(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(te),X(te,i)}function re(){q(te),q(se),q(Q)}function pe(i){i.memoizedState!==null&&X(G,i);var l=te.current,d=vC(l,i.type);l!==d&&(X(se,i),X(te,d))}function ye(i){se.current===i&&(q(te),q(se)),G.current===i&&(q(G),$u._currentValue=H)}var le,Le;function be(i){if(le===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);le=l&&l[1]||"",Le=-1)":-1b||Y[v]!==ie[b]){var fe=` `+Y[v].replace(" at new "," at ");return i.displayName&&fe.includes("")&&(fe=fe.replace("",i.displayName)),fe}while(1<=v&&0<=b);break}}}finally{et=!1,Error.prepareStackTrace=d}return(d=i?i.displayName||i.name:"")?be(d):""}function st(i,l){switch(i.tag){case 26:case 27:case 5:return be(i.type);case 16:return be("Lazy");case 13:return i.child!==l&&l!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Te(i.type,!1);case 11:return Te(i.type.render,!1);case 1:return Te(i.type,!0);case 31:return be("Activity");default:return""}}function En(i){try{var l="",d=null;do l+=st(i,d),d=i,i=i.return;while(i);return l}catch(v){return` Error generating stack: `+v.message+` `+v.stack}}var Tn=Object.prototype.hasOwnProperty,Jn=e.unstable_scheduleCallback,In=e.unstable_cancelCallback,Rr=e.unstable_shouldYield,tt=e.unstable_requestPaint,Je=e.unstable_now,hn=e.unstable_getCurrentPriorityLevel,Wc=e.unstable_ImmediatePriority,WO=e.unstable_UserBlockingPriority,$d=e.unstable_NormalPriority,I8=e.unstable_LowPriority,YO=e.unstable_IdlePriority,B8=e.log,z8=e.unstable_setDisableYieldValue,Yc=null,er=null;function Pi(i){if(typeof B8=="function"&&z8(i),er&&typeof er.setStrictMode=="function")try{er.setStrictMode(Yc,i)}catch{}}var tr=Math.clz32?Math.clz32:F8,q8=Math.log,U8=Math.LN2;function F8(i){return i>>>=0,i===0?32:31-(q8(i)/U8|0)|0}var Id=256,Bd=262144,zd=4194304;function Eo(i){var l=i&42;if(l!==0)return l;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function qd(i,l,d){var v=i.pendingLanes;if(v===0)return 0;var b=0,j=i.suspendedLanes,P=i.pingedLanes;i=i.warmLanes;var D=v&134217727;return D!==0?(v=D&~j,v!==0?b=Eo(v):(P&=D,P!==0?b=Eo(P):d||(d=D&~i,d!==0&&(b=Eo(d))))):(D=v&~j,D!==0?b=Eo(D):P!==0?b=Eo(P):d||(d=v&~i,d!==0&&(b=Eo(d)))),b===0?0:l!==0&&l!==b&&(l&j)===0&&(j=b&-b,d=l&-l,j>=d||j===32&&(d&4194048)!==0)?l:b}function Xc(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function H8(i,l){switch(i){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 XO(){var i=zd;return zd<<=1,(zd&62914560)===0&&(zd=4194304),i}function Pg(i){for(var l=[],d=0;31>d;d++)l.push(i);return l}function Zc(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function V8(i,l,d,v,b,j){var P=i.pendingLanes;i.pendingLanes=d,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=d,i.entangledLanes&=d,i.errorRecoveryDisabledLanes&=d,i.shellSuspendCounter=0;var D=i.entanglements,Y=i.expirationTimes,ie=i.hiddenUpdates;for(d=P&~d;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Z8=/[\n"\\]/g;function Mr(i){return i.replace(Z8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ig(i,l,d,v,b,j,P,D){i.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.type=P:i.removeAttribute("type"),l!=null?P==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Pr(l)):i.value!==""+Pr(l)&&(i.value=""+Pr(l)):P!=="submit"&&P!=="reset"||i.removeAttribute("value"),l!=null?Bg(i,P,Pr(l)):d!=null?Bg(i,P,Pr(d)):v!=null&&i.removeAttribute("value"),b==null&&j!=null&&(i.defaultChecked=!!j),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.name=""+Pr(D):i.removeAttribute("name")}function cE(i,l,d,v,b,j,P,D){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(i.type=j),l!=null||d!=null){if(!(j!=="submit"&&j!=="reset"||l!=null)){$g(i);return}d=d!=null?""+Pr(d):"",l=l!=null?""+Pr(l):d,D||l===i.value||(i.value=l),i.defaultValue=l}v=v??b,v=typeof v!="function"&&typeof v!="symbol"&&!!v,i.checked=D?i.checked:!!v,i.defaultChecked=!!v,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(i.name=P),$g(i)}function Bg(i,l,d){l==="number"&&Hd(i.ownerDocument)===i||i.defaultValue===""+d||(i.defaultValue=""+d)}function zs(i,l,d,v){if(i=i.options,l){l={};for(var b=0;b"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hg=!1;if(Ha)try{var tu={};Object.defineProperty(tu,"passive",{get:function(){Hg=!0}}),window.addEventListener("test",tu,tu),window.removeEventListener("test",tu,tu)}catch{Hg=!1}var ki=null,Vg=null,Gd=null;function vE(){if(Gd)return Gd;var i,l=Vg,d=l.length,v,b="value"in ki?ki.value:ki.textContent,j=b.length;for(i=0;i=au),SE=" ",_E=!1;function jE(i,l){switch(i){case"keyup":return AF.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function AE(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Hs=!1;function EF(i,l){switch(i){case"compositionend":return AE(l);case"keypress":return l.which!==32?null:(_E=!0,SE);case"textInput":return i=l.data,i===SE&&_E?null:i;default:return null}}function TF(i,l){if(Hs)return i==="compositionend"||!Xg&&jE(i,l)?(i=vE(),Gd=Vg=ki=null,Hs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:d,offset:l-i};i=v}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=ME(d)}}function DE(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?DE(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function LE(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Hd(i.document);l instanceof i.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)i=l.contentWindow;else break;l=Hd(i.document)}return l}function Jg(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var LF=Ha&&"documentMode"in document&&11>=document.documentMode,Vs=null,ey=null,lu=null,ty=!1;function $E(i,l,d){var v=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;ty||Vs==null||Vs!==Hd(v)||(v=Vs,"selectionStart"in v&&Jg(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}),lu&&su(lu,v)||(lu=v,v=Bh(ey,"onSelect"),0>=P,b-=P,ga=1<<32-tr(l)+b|d<Ge?(Ze=Ne,Ne=null):Ze=Ne.sibling;var rt=oe(J,Ne,ae[Ge],he);if(rt===null){Ne===null&&(Ne=Ze);break}i&&Ne&&rt.alternate===null&&l(J,Ne),Z=j(rt,Z,Ge),nt===null?Re=rt:nt.sibling=rt,nt=rt,Ne=Ze}if(Ge===ae.length)return d(J,Ne),Qe&&Ga(J,Ge),Re;if(Ne===null){for(;GeGe?(Ze=Ne,Ne=null):Ze=Ne.sibling;var no=oe(J,Ne,rt.value,he);if(no===null){Ne===null&&(Ne=Ze);break}i&&Ne&&no.alternate===null&&l(J,Ne),Z=j(no,Z,Ge),nt===null?Re=no:nt.sibling=no,nt=no,Ne=Ze}if(rt.done)return d(J,Ne),Qe&&Ga(J,Ge),Re;if(Ne===null){for(;!rt.done;Ge++,rt=ae.next())rt=me(J,rt.value,he),rt!==null&&(Z=j(rt,Z,Ge),nt===null?Re=rt:nt.sibling=rt,nt=rt);return Qe&&Ga(J,Ge),Re}for(Ne=v(Ne);!rt.done;Ge++,rt=ae.next())rt=ue(Ne,J,Ge,rt.value,he),rt!==null&&(i&&rt.alternate!==null&&Ne.delete(rt.key===null?Ge:rt.key),Z=j(rt,Z,Ge),nt===null?Re=rt:nt.sibling=rt,nt=rt);return i&&Ne.forEach(function(n9){return l(J,n9)}),Qe&&Ga(J,Ge),Re}function vt(J,Z,ae,he){if(typeof ae=="object"&&ae!==null&&ae.type===x&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:e:{for(var Re=ae.key;Z!==null;){if(Z.key===Re){if(Re=ae.type,Re===x){if(Z.tag===7){d(J,Z.sibling),he=b(Z,ae.props.children),he.return=J,J=he;break e}}else if(Z.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===M&&Io(Re)===Z.type){d(J,Z.sibling),he=b(Z,ae.props),pu(he,ae),he.return=J,J=he;break e}d(J,Z);break}else l(J,Z);Z=Z.sibling}ae.type===x?(he=Mo(ae.props.children,J.mode,he,ae.key),he.return=J,J=he):(he=nh(ae.type,ae.key,ae.props,null,J.mode,he),pu(he,ae),he.return=J,J=he)}return P(J);case S:e:{for(Re=ae.key;Z!==null;){if(Z.key===Re)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){d(J,Z.sibling),he=b(Z,ae.children||[]),he.return=J,J=he;break e}else{d(J,Z);break}else l(J,Z);Z=Z.sibling}he=ly(ae,J.mode,he),he.return=J,J=he}return P(J);case M:return ae=Io(ae),vt(J,Z,ae,he)}if(W(ae))return je(J,Z,ae,he);if(B(ae)){if(Re=B(ae),typeof Re!="function")throw Error(r(150));return ae=Re.call(ae),ke(J,Z,ae,he)}if(typeof ae.then=="function")return vt(J,Z,ch(ae),he);if(ae.$$typeof===E)return vt(J,Z,ih(J,ae),he);uh(J,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(d(J,Z.sibling),he=b(Z,ae),he.return=J,J=he):(d(J,Z),he=sy(ae,J.mode,he),he.return=J,J=he),P(J)):d(J,Z)}return function(J,Z,ae,he){try{hu=0;var Re=vt(J,Z,ae,he);return nl=null,Re}catch(Ne){if(Ne===tl||Ne===sh)throw Ne;var nt=rr(29,Ne,null,J.mode);return nt.lanes=he,nt.return=J,nt}finally{}}}var zo=oT(!0),sT=oT(!1),Bi=!1;function xy(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wy(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function zi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qi(i,l,d){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(ot&2)!==0){var b=v.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),v.pending=l,l=th(i),HE(i,null,d),l}return eh(i,v,l,d),th(i)}function mu(i,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var v=l.lanes;v&=i.pendingLanes,d|=v,l.lanes=d,QO(i,d)}}function Sy(i,l){var d=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,d===v)){var b=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var P={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?b=j=P:j=j.next=P,d=d.next}while(d!==null);j===null?b=j=l:j=j.next=l}else b=j=l;d={baseState:v.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:v.shared,callbacks:v.callbacks},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=l:i.next=l,d.lastBaseUpdate=l}var _y=!1;function vu(){if(_y){var i=el;if(i!==null)throw i}}function gu(i,l,d,v){_y=!1;var b=i.updateQueue;Bi=!1;var j=b.firstBaseUpdate,P=b.lastBaseUpdate,D=b.shared.pending;if(D!==null){b.shared.pending=null;var Y=D,ie=Y.next;Y.next=null,P===null?j=ie:P.next=ie,P=Y;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==P&&(D===null?fe.firstBaseUpdate=ie:D.next=ie,fe.lastBaseUpdate=Y))}if(j!==null){var me=b.baseState;P=0,fe=ie=Y=null,D=j;do{var oe=D.lane&-536870913,ue=oe!==D.lane;if(ue?(Xe&oe)===oe:(v&oe)===oe){oe!==0&&oe===Js&&(_y=!0),fe!==null&&(fe=fe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var je=i,ke=D;oe=l;var vt=d;switch(ke.tag){case 1:if(je=ke.payload,typeof je=="function"){me=je.call(vt,me,oe);break e}me=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ke.payload,oe=typeof je=="function"?je.call(vt,me,oe):je,oe==null)break e;me=m({},me,oe);break e;case 2:Bi=!0}}oe=D.callback,oe!==null&&(i.flags|=64,ue&&(i.flags|=8192),ue=b.callbacks,ue===null?b.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(ie=fe=ue,Y=me):fe=fe.next=ue,P|=oe;if(D=D.next,D===null){if(D=b.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);fe===null&&(Y=me),b.baseState=Y,b.firstBaseUpdate=ie,b.lastBaseUpdate=fe,j===null&&(b.shared.lanes=0),Gi|=P,i.lanes=P,i.memoizedState=me}}function lT(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function cT(i,l){var d=i.callbacks;if(d!==null)for(i.callbacks=null,i=0;ij?j:8;var P=$.T,D={};$.T=D,Uy(i,!1,l,d);try{var Y=b(),ie=$.S;if(ie!==null&&ie(D,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var fe=VF(Y,v);xu(i,l,fe,lr(i))}else xu(i,l,v,lr(i))}catch(me){xu(i,l,{then:function(){},status:"rejected",reason:me},lr())}finally{V.p=j,P!==null&&D.types!==null&&(P.types=D.types),$.T=P}}function ZF(){}function zy(i,l,d,v){if(i.tag!==5)throw Error(r(476));var b=qT(i).queue;zT(i,b,l,H,d===null?ZF:function(){return UT(i),d(v)})}function qT(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:H},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:d},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function UT(i){var l=qT(i);l.next===null&&(l=i.alternate.memoizedState),xu(i,l.next.queue,{},lr())}function qy(){return sn($u)}function FT(){return Lt().memoizedState}function HT(){return Lt().memoizedState}function QF(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var d=lr();i=zi(d);var v=qi(l,i,d);v!==null&&(Vn(v,l,d),mu(v,l,d)),l={cache:vy()},i.payload=l;return}l=l.return}}function JF(i,l,d){var v=lr();d={lane:v,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},xh(i)?GT(l,d):(d=iy(i,l,d,v),d!==null&&(Vn(d,i,v),KT(d,l,v)))}function VT(i,l,d){var v=lr();xu(i,l,d,v)}function xu(i,l,d,v){var b={lane:v,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(xh(i))GT(l,b);else{var j=i.alternate;if(i.lanes===0&&(j===null||j.lanes===0)&&(j=l.lastRenderedReducer,j!==null))try{var P=l.lastRenderedState,D=j(P,d);if(b.hasEagerState=!0,b.eagerState=D,nr(D,P))return eh(i,l,b,0),yt===null&&Jd(),!1}catch{}finally{}if(d=iy(i,l,b,v),d!==null)return Vn(d,i,v),KT(d,l,v),!0}return!1}function Uy(i,l,d,v){if(v={lane:2,revertLane:xb(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},xh(i)){if(l)throw Error(r(479))}else l=iy(i,d,v,2),l!==null&&Vn(l,i,2)}function xh(i){var l=i.alternate;return i===Ue||l!==null&&l===Ue}function GT(i,l){al=hh=!0;var d=i.pending;d===null?l.next=l:(l.next=d.next,d.next=l),i.pending=l}function KT(i,l,d){if((d&4194048)!==0){var v=l.lanes;v&=i.pendingLanes,d|=v,l.lanes=d,QO(i,d)}}var wu={readContext:sn,use:vh,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};wu.useEffectEvent=Pt;var WT={readContext:sn,use:vh,useCallback:function(i,l){return Nn().memoizedState=[i,l===void 0?null:l],i},useContext:sn,useEffect:RT,useImperativeHandle:function(i,l,d){d=d!=null?d.concat([i]):null,yh(4194308,4,DT.bind(null,l,i),d)},useLayoutEffect:function(i,l){return yh(4194308,4,i,l)},useInsertionEffect:function(i,l){yh(4,2,i,l)},useMemo:function(i,l){var d=Nn();l=l===void 0?null:l;var v=i();if(qo){Pi(!0);try{i()}finally{Pi(!1)}}return d.memoizedState=[v,l],v},useReducer:function(i,l,d){var v=Nn();if(d!==void 0){var b=d(l);if(qo){Pi(!0);try{d(l)}finally{Pi(!1)}}}else b=l;return v.memoizedState=v.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},v.queue=i,i=i.dispatch=JF.bind(null,Ue,i),[v.memoizedState,i]},useRef:function(i){var l=Nn();return i={current:i},l.memoizedState=i},useState:function(i){i=Dy(i);var l=i.queue,d=VT.bind(null,Ue,l);return l.dispatch=d,[i.memoizedState,d]},useDebugValue:Iy,useDeferredValue:function(i,l){var d=Nn();return By(d,i,l)},useTransition:function(){var i=Dy(!1);return i=zT.bind(null,Ue,i.queue,!0,!1),Nn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,d){var v=Ue,b=Nn();if(Qe){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),yt===null)throw Error(r(349));(Xe&127)!==0||mT(v,l,d)}b.memoizedState=d;var j={value:d,getSnapshot:l};return b.queue=j,RT(gT.bind(null,v,j,i),[i]),v.flags|=2048,ol(9,{destroy:void 0},vT.bind(null,v,j,d,l),null),d},useId:function(){var i=Nn(),l=yt.identifierPrefix;if(Qe){var d=ya,v=ga;d=(v&~(1<<32-tr(v)-1)).toString(32)+d,l="_"+l+"R_"+d,d=ph++,0<\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof v.is=="string"?P.createElement("select",{is:v.is}):P.createElement("select"),v.multiple?j.multiple=!0:v.size&&(j.size=v.size);break;default:j=typeof v.is=="string"?P.createElement(b,{is:v.is}):P.createElement(b)}}j[an]=l,j[Bn]=v;e:for(P=l.child;P!==null;){if(P.tag===5||P.tag===6)j.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===l)break e;for(;P.sibling===null;){if(P.return===null||P.return===l)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}l.stateNode=j;e:switch(cn(j,b,v),b){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Qa(l)}}return Ot(l),nb(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,d),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==v&&Qa(l);else{if(typeof v!="string"&&l.stateNode===null)throw Error(r(166));if(i=Q.current,Zs(l)){if(i=l.stateNode,d=l.memoizedProps,v=null,b=on,b!==null)switch(b.tag){case 27:case 5:v=b.memoizedProps}i[an]=l,i=!!(i.nodeValue===d||v!==null&&v.suppressHydrationWarning===!0||hC(i.nodeValue,d)),i||$i(l,!0)}else i=zh(i).createTextNode(v),i[an]=l,l.stateNode=i}return Ot(l),null;case 31:if(d=l.memoizedState,i===null||i.memoizedState!==null){if(v=Zs(l),d!==null){if(i===null){if(!v)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[an]=l}else ko(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ot(l),i=!1}else d=dy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),i=!0;if(!i)return l.flags&256?(ir(l),l):(ir(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Ot(l),null;case 13:if(v=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=Zs(l),v!==null&&v.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[an]=l}else ko(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ot(l),b=!1}else b=dy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(ir(l),l):(ir(l),null)}return ir(l),(l.flags&128)!==0?(l.lanes=d,l):(d=v!==null,i=i!==null&&i.memoizedState!==null,d&&(v=l.child,b=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(b=v.alternate.memoizedState.cachePool.pool),j=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(j=v.memoizedState.cachePool.pool),j!==b&&(v.flags|=2048)),d!==i&&d&&(l.child.flags|=8192),Ah(l,l.updateQueue),Ot(l),null);case 4:return re(),i===null&&jb(l.stateNode.containerInfo),Ot(l),null;case 10:return Wa(l.type),Ot(l),null;case 19:if(q(Dt),v=l.memoizedState,v===null)return Ot(l),null;if(b=(l.flags&128)!==0,j=v.rendering,j===null)if(b)_u(v,!1);else{if(Mt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(j=dh(i),j!==null){for(l.flags|=128,_u(v,!1),i=j.updateQueue,l.updateQueue=i,Ah(l,i),l.subtreeFlags=0,i=d,d=l.child;d!==null;)VE(d,i),d=d.sibling;return X(Dt,Dt.current&1|2),Qe&&Ga(l,v.treeForkCount),l.child}i=i.sibling}v.tail!==null&&Je()>Ch&&(l.flags|=128,b=!0,_u(v,!1),l.lanes=4194304)}else{if(!b)if(i=dh(j),i!==null){if(l.flags|=128,b=!0,i=i.updateQueue,l.updateQueue=i,Ah(l,i),_u(v,!0),v.tail===null&&v.tailMode==="hidden"&&!j.alternate&&!Qe)return Ot(l),null}else 2*Je()-v.renderingStartTime>Ch&&d!==536870912&&(l.flags|=128,b=!0,_u(v,!1),l.lanes=4194304);v.isBackwards?(j.sibling=l.child,l.child=j):(i=v.last,i!==null?i.sibling=j:l.child=j,v.last=j)}return v.tail!==null?(i=v.tail,v.rendering=i,v.tail=i.sibling,v.renderingStartTime=Je(),i.sibling=null,d=Dt.current,X(Dt,b?d&1|2:d&1),Qe&&Ga(l,v.treeForkCount),i):(Ot(l),null);case 22:case 23:return ir(l),Ay(),v=l.memoizedState!==null,i!==null?i.memoizedState!==null!==v&&(l.flags|=8192):v&&(l.flags|=8192),v?(d&536870912)!==0&&(l.flags&128)===0&&(Ot(l),l.subtreeFlags&6&&(l.flags|=8192)):Ot(l),d=l.updateQueue,d!==null&&Ah(l,d.retryQueue),d=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),v=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(v=l.memoizedState.cachePool.pool),v!==d&&(l.flags|=2048),i!==null&&q($o),null;case 24:return d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Wa(It),Ot(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function aH(i,l){switch(uy(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Wa(It),re(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return ye(l),null;case 31:if(l.memoizedState!==null){if(ir(l),l.alternate===null)throw Error(r(340));ko()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(ir(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ko()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return q(Dt),null;case 4:return re(),null;case 10:return Wa(l.type),null;case 22:case 23:return ir(l),Ay(),i!==null&&q($o),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return Wa(It),null;case 25:return null;default:return null}}function yN(i,l){switch(uy(l),l.tag){case 3:Wa(It),re();break;case 26:case 27:case 5:ye(l);break;case 4:re();break;case 31:l.memoizedState!==null&&ir(l);break;case 13:ir(l);break;case 19:q(Dt);break;case 10:Wa(l.type);break;case 22:case 23:ir(l),Ay(),i!==null&&q($o);break;case 24:Wa(It)}}function ju(i,l){try{var d=l.updateQueue,v=d!==null?d.lastEffect:null;if(v!==null){var b=v.next;d=b;do{if((d.tag&i)===i){v=void 0;var j=d.create,P=d.inst;v=j(),P.destroy=v}d=d.next}while(d!==b)}}catch(D){dt(l,l.return,D)}}function Hi(i,l,d){try{var v=l.updateQueue,b=v!==null?v.lastEffect:null;if(b!==null){var j=b.next;v=j;do{if((v.tag&i)===i){var P=v.inst,D=P.destroy;if(D!==void 0){P.destroy=void 0,b=l;var Y=d,ie=D;try{ie()}catch(fe){dt(b,Y,fe)}}}v=v.next}while(v!==j)}}catch(fe){dt(l,l.return,fe)}}function bN(i){var l=i.updateQueue;if(l!==null){var d=i.stateNode;try{cT(l,d)}catch(v){dt(i,i.return,v)}}}function xN(i,l,d){d.props=Uo(i.type,i.memoizedProps),d.state=i.memoizedState;try{d.componentWillUnmount()}catch(v){dt(i,l,v)}}function Au(i,l){try{var d=i.ref;if(d!==null){switch(i.tag){case 26:case 27:case 5:var v=i.stateNode;break;case 30:v=i.stateNode;break;default:v=i.stateNode}typeof d=="function"?i.refCleanup=d(v):d.current=v}}catch(b){dt(i,l,b)}}function ba(i,l){var d=i.ref,v=i.refCleanup;if(d!==null)if(typeof v=="function")try{v()}catch(b){dt(i,l,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){dt(i,l,b)}else d.current=null}function wN(i){var l=i.type,d=i.memoizedProps,v=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&v.focus();break e;case"img":d.src?v.src=d.src:d.srcSet&&(v.srcset=d.srcSet)}}catch(b){dt(i,i.return,b)}}function rb(i,l,d){try{var v=i.stateNode;OH(v,i.type,d,l),v[Bn]=l}catch(b){dt(i,i.return,b)}}function SN(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Zi(i.type)||i.tag===4}function ab(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||SN(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Zi(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function ib(i,l,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(i,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(i),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Fa));else if(v!==4&&(v===27&&Zi(i.type)&&(d=i.stateNode,l=null),i=i.child,i!==null))for(ib(i,l,d),i=i.sibling;i!==null;)ib(i,l,d),i=i.sibling}function Oh(i,l,d){var v=i.tag;if(v===5||v===6)i=i.stateNode,l?d.insertBefore(i,l):d.appendChild(i);else if(v!==4&&(v===27&&Zi(i.type)&&(d=i.stateNode),i=i.child,i!==null))for(Oh(i,l,d),i=i.sibling;i!==null;)Oh(i,l,d),i=i.sibling}function _N(i){var l=i.stateNode,d=i.memoizedProps;try{for(var v=i.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);cn(l,v,d),l[an]=i,l[Bn]=d}catch(j){dt(i,i.return,j)}}var Ja=!1,qt=!1,ob=!1,jN=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function iH(i,l){if(i=i.containerInfo,Eb=Kh,i=LE(i),Jg(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var v=d.getSelection&&d.getSelection();if(v&&v.rangeCount!==0){d=v.anchorNode;var b=v.anchorOffset,j=v.focusNode;v=v.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var P=0,D=-1,Y=-1,ie=0,fe=0,me=i,oe=null;t:for(;;){for(var ue;me!==d||b!==0&&me.nodeType!==3||(D=P+b),me!==j||v!==0&&me.nodeType!==3||(Y=P+v),me.nodeType===3&&(P+=me.nodeValue.length),(ue=me.firstChild)!==null;)oe=me,me=ue;for(;;){if(me===i)break t;if(oe===d&&++ie===b&&(D=P),oe===j&&++fe===v&&(Y=P),(ue=me.nextSibling)!==null)break;me=oe,oe=me.parentNode}me=ue}d=D===-1||Y===-1?null:{start:D,end:Y}}else d=null}d=d||{start:0,end:0}}else d=null;for(Tb={focusedElem:i,selectionRange:d},Kh=!1,Jt=l;Jt!==null;)if(l=Jt,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,Jt=i;else for(;Jt!==null;){switch(l=Jt,j=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(d=0;d title"))),cn(j,v,d),j[an]=i,Qt(j),v=j;break e;case"link":var P=CC("link","href",b).get(v+(d.href||""));if(P){for(var D=0;Dvt&&(P=vt,vt=ke,ke=P);var J=kE(D,ke),Z=kE(D,vt);if(J&&Z&&(ue.rangeCount!==1||ue.anchorNode!==J.node||ue.anchorOffset!==J.offset||ue.focusNode!==Z.node||ue.focusOffset!==Z.offset)){var ae=me.createRange();ae.setStart(J.node,J.offset),ue.removeAllRanges(),ke>vt?(ue.addRange(ae),ue.extend(Z.node,Z.offset)):(ae.setEnd(Z.node,Z.offset),ue.addRange(ae))}}}}for(me=[],ue=D;ue=ue.parentNode;)ue.nodeType===1&&me.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;Dd?32:d,$.T=null,d=hb,hb=null;var j=Wi,P=ai;if(Ht=0,fl=Wi=null,ai=0,(ot&6)!==0)throw Error(r(331));var D=ot;if(ot|=4,DN(j.current),PN(j,j.current,P,d),ot=D,Ru(0,!1),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(Yc,j)}catch{}return!0}finally{V.p=b,$.T=v,JN(i,l)}}function tC(i,l,d){l=Dr(d,l),l=Gy(i.stateNode,l,2),i=qi(i,l,2),i!==null&&(Zc(i,2),xa(i))}function dt(i,l,d){if(i.tag===3)tC(i,i,d);else for(;l!==null;){if(l.tag===3){tC(l,i,d);break}else if(l.tag===1){var v=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ki===null||!Ki.has(v))){i=Dr(d,i),d=nN(2),v=qi(l,d,2),v!==null&&(rN(d,v,l,i),Zc(v,2),xa(v));break}}l=l.return}}function gb(i,l,d){var v=i.pingCache;if(v===null){v=i.pingCache=new lH;var b=new Set;v.set(l,b)}else b=v.get(l),b===void 0&&(b=new Set,v.set(l,b));b.has(d)||(cb=!0,b.add(d),i=hH.bind(null,i,l,d),l.then(i,i))}function hH(i,l,d){var v=i.pingCache;v!==null&&v.delete(l),i.pingedLanes|=i.suspendedLanes&d,i.warmLanes&=~d,yt===i&&(Xe&d)===d&&(Mt===4||Mt===3&&(Xe&62914560)===Xe&&300>Je()-Nh?(ot&2)===0&&dl(i,0):ub|=d,ul===Xe&&(ul=0)),xa(i)}function nC(i,l){l===0&&(l=XO()),i=Po(i,l),i!==null&&(Zc(i,l),xa(i))}function pH(i){var l=i.memoizedState,d=0;l!==null&&(d=l.retryLane),nC(i,d)}function mH(i,l){var d=0;switch(i.tag){case 31:case 13:var v=i.stateNode,b=i.memoizedState;b!==null&&(d=b.retryLane);break;case 19:v=i.stateNode;break;case 22:v=i.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(l),nC(i,d)}function vH(i,l){return Jn(i,l)}var Lh=null,pl=null,yb=!1,$h=!1,bb=!1,Xi=0;function xa(i){i!==pl&&i.next===null&&(pl===null?Lh=pl=i:pl=pl.next=i),$h=!0,yb||(yb=!0,yH())}function Ru(i,l){if(!bb&&$h){bb=!0;do for(var d=!1,v=Lh;v!==null;){if(i!==0){var b=v.pendingLanes;if(b===0)var j=0;else{var P=v.suspendedLanes,D=v.pingedLanes;j=(1<<31-tr(42|i)+1)-1,j&=b&~(P&~D),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,oC(v,j))}else j=Xe,j=qd(v,v===yt?j:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(j&3)===0||Xc(v,j)||(d=!0,oC(v,j));v=v.next}while(d);bb=!1}}function gH(){rC()}function rC(){$h=yb=!1;var i=0;Xi!==0&&TH()&&(i=Xi);for(var l=Je(),d=null,v=Lh;v!==null;){var b=v.next,j=aC(v,l);j===0?(v.next=null,d===null?Lh=b:d.next=b,b===null&&(pl=d)):(d=v,(i!==0||(j&3)!==0)&&($h=!0)),v=b}Ht!==0&&Ht!==5||Ru(i),Xi!==0&&(Xi=0)}function aC(i,l){for(var d=i.suspendedLanes,v=i.pingedLanes,b=i.expirationTimes,j=i.pendingLanes&-62914561;0D)break;var fe=Y.transferSize,me=Y.initiatorType;fe&&pC(me)&&(Y=Y.responseEnd,P+=fe*(Y"u"?null:document;function OC(i,l,d){var v=ml;if(v&&typeof l=="string"&&l){var b=Mr(l);b='link[rel="'+i+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),AC.has(b)||(AC.add(b),i={rel:i,crossOrigin:d,href:l},v.querySelector(b)===null&&(l=v.createElement("link"),cn(l,"link",i),Qt(l),v.head.appendChild(l)))}}function $H(i){ii.D(i),OC("dns-prefetch",i,null)}function IH(i,l){ii.C(i,l),OC("preconnect",i,l)}function BH(i,l,d){ii.L(i,l,d);var v=ml;if(v&&i&&l){var b='link[rel="preload"][as="'+Mr(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Mr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Mr(d.imageSizes)+'"]')):b+='[href="'+Mr(i)+'"]';var j=b;switch(l){case"style":j=vl(i);break;case"script":j=gl(i)}qr.has(j)||(i=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:i,as:l},d),qr.set(j,i),v.querySelector(b)!==null||l==="style"&&v.querySelector(Du(j))||l==="script"&&v.querySelector(Lu(j))||(l=v.createElement("link"),cn(l,"link",i),Qt(l),v.head.appendChild(l)))}}function zH(i,l){ii.m(i,l);var d=ml;if(d&&i){var v=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+Mr(v)+'"][href="'+Mr(i)+'"]',j=b;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=gl(i)}if(!qr.has(j)&&(i=m({rel:"modulepreload",href:i},l),qr.set(j,i),d.querySelector(b)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Lu(j)))return}v=d.createElement("link"),cn(v,"link",i),Qt(v),d.head.appendChild(v)}}}function qH(i,l,d){ii.S(i,l,d);var v=ml;if(v&&i){var b=Is(v).hoistableStyles,j=vl(i);l=l||"default";var P=b.get(j);if(!P){var D={loading:0,preload:null};if(P=v.querySelector(Du(j)))D.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":l},d),(d=qr.get(j))&&Db(i,d);var Y=P=v.createElement("link");Qt(Y),cn(Y,"link",i),Y._p=new Promise(function(ie,fe){Y.onload=ie,Y.onerror=fe}),Y.addEventListener("load",function(){D.loading|=1}),Y.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Uh(P,l,v)}P={type:"stylesheet",instance:P,count:1,state:D},b.set(j,P)}}}function UH(i,l){ii.X(i,l);var d=ml;if(d&&i){var v=Is(d).hoistableScripts,b=gl(i),j=v.get(b);j||(j=d.querySelector(Lu(b)),j||(i=m({src:i,async:!0},l),(l=qr.get(b))&&Lb(i,l),j=d.createElement("script"),Qt(j),cn(j,"link",i),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},v.set(b,j))}}function FH(i,l){ii.M(i,l);var d=ml;if(d&&i){var v=Is(d).hoistableScripts,b=gl(i),j=v.get(b);j||(j=d.querySelector(Lu(b)),j||(i=m({src:i,async:!0,type:"module"},l),(l=qr.get(b))&&Lb(i,l),j=d.createElement("script"),Qt(j),cn(j,"link",i),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},v.set(b,j))}}function EC(i,l,d,v){var b=(b=Q.current)?qh(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=vl(d.href),d=Is(b).hoistableStyles,v=d.get(l),v||(v={type:"style",instance:null,count:0,state:null},d.set(l,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){i=vl(d.href);var j=Is(b).hoistableStyles,P=j.get(i);if(P||(b=b.ownerDocument||b,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(i,P),(j=b.querySelector(Du(i)))&&!j._p&&(P.instance=j,P.state.loading=5),qr.has(i)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},qr.set(i,d),j||HH(b,i,d,P.state))),l&&v===null)throw Error(r(528,""));return P}if(l&&v!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=gl(d),d=Is(b).hoistableScripts,v=d.get(l),v||(v={type:"script",instance:null,count:0,state:null},d.set(l,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function vl(i){return'href="'+Mr(i)+'"'}function Du(i){return'link[rel="stylesheet"]['+i+"]"}function TC(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function HH(i,l,d,v){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?v.loading=1:(l=i.createElement("link"),v.preload=l,l.addEventListener("load",function(){return v.loading|=1}),l.addEventListener("error",function(){return v.loading|=2}),cn(l,"link",d),Qt(l),i.head.appendChild(l))}function gl(i){return'[src="'+Mr(i)+'"]'}function Lu(i){return"script[async]"+i}function NC(i,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var v=i.querySelector('style[data-href~="'+Mr(d.href)+'"]');if(v)return l.instance=v,Qt(v),v;var b=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return v=(i.ownerDocument||i).createElement("style"),Qt(v),cn(v,"style",b),Uh(v,d.precedence,i),l.instance=v;case"stylesheet":b=vl(d.href);var j=i.querySelector(Du(b));if(j)return l.state.loading|=4,l.instance=j,Qt(j),j;v=TC(d),(b=qr.get(b))&&Db(v,b),j=(i.ownerDocument||i).createElement("link"),Qt(j);var P=j;return P._p=new Promise(function(D,Y){P.onload=D,P.onerror=Y}),cn(j,"link",v),l.state.loading|=4,Uh(j,d.precedence,i),l.instance=j;case"script":return j=gl(d.src),(b=i.querySelector(Lu(j)))?(l.instance=b,Qt(b),b):(v=d,(b=qr.get(j))&&(v=m({},d),Lb(v,b)),i=i.ownerDocument||i,b=i.createElement("script"),Qt(b),cn(b,"link",v),i.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(v=l.instance,l.state.loading|=4,Uh(v,d.precedence,i));return l.instance}function Uh(i,l,d){for(var v=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=v.length?v[v.length-1]:null,j=b,P=0;P title"):null)}function VH(i,l,d){if(d===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function PC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function GH(i,l,d,v){if(d.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=vl(v.href),j=l.querySelector(Du(b));if(j){l=j._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=Hh.bind(i),l.then(i,i)),d.state.loading|=4,d.instance=j,Qt(j);return}j=l.ownerDocument||l,v=TC(v),(b=qr.get(b))&&Db(v,b),j=j.createElement("link"),Qt(j);var P=j;P._p=new Promise(function(D,Y){P.onload=D,P.onerror=Y}),cn(j,"link",v),d.instance=j}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(i.count++,d=Hh.bind(i),l.addEventListener("load",d),l.addEventListener("error",d))}}var $b=0;function KH(i,l){return i.stylesheets&&i.count===0&&Gh(i,i.stylesheets),0$b?50:800)+l);return i.unsuspend=d,function(){i.unsuspend=null,clearTimeout(v),clearTimeout(b)}}:null}function Hh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Vh=null;function Gh(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Vh=new Map,l.forEach(WH,i),Vh=null,Hh.call(i))}function WH(i,l){if(!(l.state.loading&4)){var d=Vh.get(i);if(d)var v=d.get(null);else{d=new Map,Vh.set(i,d);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gb.exports=u9(),Gb.exports}var d9=f9();const M1=new WeakMap,h9=new WeakMap,Fp={current:[]};let Xb=!1,pf=0;const sf=new Set,tp=new Map;function LI(e){for(const t of e){if(Fp.current.includes(t))continue;Fp.current.push(t),t.recompute();const n=h9.get(t);if(n)for(const r of n){const a=M1.get(r);a?.length&&LI(a)}}}function p9(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function m9(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function $I(e){if(pf>0&&!tp.has(e)&&tp.set(e,e.prevState),sf.add(e),!(pf>0)&&!Xb)try{for(Xb=!0;sf.size>0;){const t=Array.from(sf);sf.clear();for(const n of t){const r=tp.get(n)??n.prevState;n.prevState=r,p9(n)}for(const n of t){const r=M1.get(n);r&&(Fp.current.push(n),LI(r))}for(const n of t){const r=M1.get(n);if(r)for(const a of r)m9(a)}}}finally{Xb=!1,Fp.current=[],tp.clear()}}function mf(e){pf++;try{e()}finally{if(pf--,pf===0){const t=sf.values().next().value;t&&$I(t)}}}function v9(e){return typeof e=="function"}class g9{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var a,o;this.listeners.add(r);const s=(o=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:o.call(a,r,this);return()=>{this.listeners.delete(r),s?.()}},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):v9(t)?this.state=t(this.prevState):this.state=t,(a=(r=this.options)==null?void 0:r.onUpdate)==null||a.call(r),$I(this)}}const uo="__TSR_index",n2="popstate",r2="beforeunload";function y9(e){let t=e.getLocation();const n=new Set,r=s=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:s}))},a=s=>{e.notifyOnIndexChange??!0?r(s):t=e.getLocation()},o=async({task:s,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){s();return}const p=e.getBlockers?.()??[],m=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&p.length&&m)for(const g of p){const y=Hp(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,action:f.type})){e.onBlocked?.();return}}s()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:s=>(n.add(s),()=>{n.delete(s)}),push:(s,c,f)=>{const h=t.state[uo];c=a2(h+1,c),o({task:()=>{e.pushState(s,c),r({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:s,state:c})},replace:(s,c,f)=>{const h=t.state[uo];c=a2(h,c),o({task:()=>{e.replaceState(s,c),r({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:s,state:c})},go:(s,c)=>{o({task:()=>{e.go(s),a({type:"GO",index:s})},navigateOpts:c,type:"GO"})},back:s=>{o({task:()=>{e.back(s?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:s,type:"BACK"})},forward:s=>{o({task:()=>{e.forward(s?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:s,type:"FORWARD"})},canGoBack:()=>t.state[uo]!==0,createHref:s=>e.createHref(s),block:s=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,s]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(h=>h!==s))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function a2(e,t){t||(t={});const n=Ij();return{...t,key:n,__TSR_key:n,[uo]:e}}function b9(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let a=[];const o=()=>a,s=M=>a=M,c=(M=>M),f=(()=>Hp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const M=Ij();t.history.replaceState({[uo]:0,key:M,__TSR_key:M},"")}let h=f(),p,m=!1,g=!1,y=!1,S=!1;const x=()=>h;let w,A;const O=()=>{w&&(R._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),R._ignoreSubscribers=!1,w=void 0,A=void 0,p=void 0)},E=(M,k,z)=>{const L=c(k);A||(p=h),h=Hp(k,z),w={href:L,state:z,isPush:w?.isPush||M==="push"},A||(A=Promise.resolve().then(()=>O()))},N=M=>{h=f(),R.notify({type:M})},T=async()=>{if(g){g=!1;return}const M=f(),k=M.state[uo]-h.state[uo],z=k===1,L=k===-1,B=!z&&!L||m;m=!1;const F=B?"GO":L?"BACK":"FORWARD",U=B?{type:"GO",index:k}:{type:L?"BACK":"FORWARD"};if(y)y=!1;else{const W=o();if(typeof document<"u"&&W.length){for(const $ of W)if(await $.blockerFn({currentLocation:h,nextLocation:M,action:F})){g=!0,t.history.go(1),R.notify(U);return}}}h=f(),R.notify(U)},C=M=>{if(S){S=!1;return}let k=!1;const z=o();if(typeof document<"u"&&z.length)for(const L of z){const B=L.enableBeforeUnload??!0;if(B===!0){k=!0;break}if(typeof B=="function"&&B()===!0){k=!0;break}}if(k)return M.preventDefault(),M.returnValue=""},R=y9({getLocation:x,getLength:()=>t.history.length,pushState:(M,k)=>E("push",M,k),replaceState:(M,k)=>E("replace",M,k),back:M=>(M&&(y=!0),S=!0,t.history.back()),forward:M=>{M&&(y=!0),S=!0,t.history.forward()},go:M=>{m=!0,t.history.go(M)},createHref:M=>c(M),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(r2,C,{capture:!0}),t.removeEventListener(n2,T)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:o,setBlockers:s,notifyOnIndexChange:!1});return t.addEventListener(r2,C,{capture:!0}),t.addEventListener(n2,T),t.history.pushState=function(...M){const k=n.apply(t.history,M);return R._ignoreSubscribers||N("PUSH"),k},t.history.replaceState=function(...M){const k=r.apply(t.history,M);return R._ignoreSubscribers||N("REPLACE"),k},R}function Hp(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),a=Ij();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||{[uo]:0,key:a,__TSR_key:a}}}function Ij(){return(Math.random()+1).toString(36).substring(7)}function k1(e){return e[e.length-1]}function x9(e){return typeof e=="function"}function rs(e,t){return x9(e)?e(t):e}const w9=Object.prototype.hasOwnProperty;function Vr(e,t){if(e===t)return e;const n=t,r=s2(e)&&s2(n);if(!r&&!(Vp(e)&&Vp(n)))return n;const a=r?e:i2(e);if(!a)return n;const o=r?n:i2(n);if(!o)return n;const s=a.length,c=o.length,f=r?new Array(c):{};let h=0;for(let p=0;p"u")return!0;const n=t.prototype;return!(!o2(n)||!n.hasOwnProperty("isPrototypeOf"))}function o2(e){return Object.prototype.toString.call(e)==="[object Object]"}function s2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function as(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||!as(e[s],t[s],n)))return!1;return a===o}return!1}function Hl(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 fo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const S9=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function l2(e,t=S9){function n(a,o,s=0){for(let c=s;c{try{return decodeURI(c)}catch{return c}})}}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 _9="Invariant failed";function On(e,t){if(!e)throw new Error(_9)}const Ta=0,ds=1,Vl=2,Gl=3;function mi(e){return Bj(e.filter(t=>t!==void 0).join("/"))}function Bj(e){return e.replace(/\/{2,}/g,"/")}function zj(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ho(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Np(e){return ho(zj(e))}function Gp(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function j9(e,t,n){return Gp(e,n)===Gp(t,n)}function A9(e){const{type:t,value:n}=e;if(t===Ta)return n;const{prefixSegment:r,suffixSegment:a}=e;if(t===ds){const o=n.substring(1);if(r&&a)return`${r}{$${o}}${a}`;if(r)return`${r}{$${o}}`;if(a)return`{$${o}}${a}`}if(t===Gl){const o=n.substring(1);return r&&a?`${r}{-$${o}}${a}`:r?`${r}{-$${o}}`:a?`{-$${o}}${a}`:`{-$${o}}`}if(t===Vl){if(r&&a)return`${r}{$}${a}`;if(r)return`${r}{$}`;if(a)return`{$}${a}`}return n}function O9({base:e,to:t,trailingSlash:n="never",parseCache:r}){let a=Kl(e,r).slice();const o=Kl(t,r);a.length>1&&k1(a)?.value==="/"&&a.pop();for(let f=0,h=o.length;f1&&(k1(a).value==="/"?n==="never"&&a.pop():n==="always"&&a.push({type:Ta,value:"/"}));const s=a.map(A9);return mi(s)}const Kl=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const r=P9(e);return t?.set(e,r),r},E9=/^\$.{1,}$/,T9=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,N9=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,C9=/^\$$/,R9=/^(.*?)\{\$\}(.*)$/;function P9(e){e=Bj(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:Ta,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>{const a=r.match(R9);if(a){const c=a[1],f=a[2];return{type:Vl,value:"$",prefixSegment:c||void 0,suffixSegment:f||void 0}}const o=r.match(N9);if(o){const c=o[1],f=o[2],h=o[3];return{type:Gl,value:f,prefixSegment:c||void 0,suffixSegment:h||void 0}}const s=r.match(T9);if(s){const c=s[1],f=s[2],h=s[3];return{type:ds,value:""+f,prefixSegment:c||void 0,suffixSegment:h||void 0}}if(E9.test(r)){const c=r.substring(1);return{type:ds,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return C9.test(r)?{type:Vl,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:Ta,value:r}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:Ta,value:"/"})),t}function Zb({path:e,params:t,decodeCharMap:n,parseCache:r}){const a=Kl(e,r);function o(h){const p=t[h],m=typeof p=="string";return h==="*"||h==="_splat"?m?encodeURI(p):p:m?M9(p,n):p}let s=!1;const c={},f=mi(a.map(h=>{if(h.type===Ta)return h.value;if(h.type===Vl){c._splat=t._splat,c["*"]=t._splat;const p=h.prefixSegment||"",m=h.suffixSegment||"";if(!t._splat)return s=!0,p||m?`${p}${m}`:void 0;const g=o("_splat");return`${p}${g}${m}`}if(h.type===ds){const p=h.value.substring(1);!s&&!(p in t)&&(s=!0),c[p]=t[p];const m=h.prefixSegment||"",g=h.suffixSegment||"";return`${m}${o(p)??"undefined"}${g}`}if(h.type===Gl){const p=h.value.substring(1),m=h.prefixSegment||"",g=h.suffixSegment||"";return!(p in t)||t[p]==null?m||g?`${m}${g}`:void 0:(c[p]=t[p],`${m}${o(p)??""}${g}`)}return h.value}));return{usedParams:c,interpolatedPath:f,isMissingParams:s}}function M9(e,t){let n=encodeURIComponent(e);if(t)for(const[r,a]of t)n=n.replaceAll(r,a);return n}function D1(e,t,n){const r=k9(e,t,n);if(!(t.to&&!r))return r??{}}function k9(e,{to:t,fuzzy:n,caseSensitive:r},a){const o=t,s=Kl(e.startsWith("/")?e:`/${e}`,a),c=Kl(o.startsWith("/")?o:`/${o}`,a),f={};return D9(s,c,f,n,r)?f:void 0}function D9(e,t,n,r,a){let o=0,s=0;for(;ox.value)));m&&S.startsWith(m)&&(S=S.slice(m.length)),g&&S.endsWith(g)&&(S=S.slice(0,S.length-g.length)),p=S}else p=decodeURI(mi(h.map(m=>m.value)));return n["*"]=p,n._splat=p,!0}if(f.type===Ta){if(f.value==="/"&&!c?.value){s++;continue}if(c){if(a){if(f.value!==c.value)return!1}else if(f.value.toLowerCase()!==c.value.toLowerCase())return!1;o++,s++;continue}else return!1}if(f.type===ds){if(!c||c.value==="/")return!1;let h="",p=!1;if(f.prefixSegment||f.suffixSegment){const m=f.prefixSegment||"",g=f.suffixSegment||"",y=c.value;if(m&&!y.startsWith(m)||g&&!y.endsWith(g))return!1;let S=y;m&&S.startsWith(m)&&(S=S.slice(m.length)),g&&S.endsWith(g)&&(S=S.slice(0,S.length-g.length)),h=decodeURIComponent(S),p=!0}else h=decodeURIComponent(c.value),p=!0;p&&(n[f.value.substring(1)]=h,o++),s++;continue}if(f.type===Gl){if(!c){s++;continue}if(c.value==="/"){s++;continue}let h="",p=!1;if(f.prefixSegment||f.suffixSegment){const m=f.prefixSegment||"",g=f.suffixSegment||"",y=c.value;if((!m||y.startsWith(m))&&(!g||y.endsWith(g))){let S=y;m&&S.startsWith(m)&&(S=S.slice(m.length)),g&&S.endsWith(g)&&(S=S.slice(0,S.length-g.length)),h=decodeURIComponent(S),p=!0}}else{let m=!0;for(let g=s+1;g=t.length)return n["**"]=mi(e.slice(o).map(h=>h.value)),!!r&&t[t.length-1]?.value!=="/";if(s=e.length){for(let h=s;h{if(r.isRoot||!r.path)return;const o=zj(r.fullPath);let s=Kl(o),c=0;for(;s.length>c+1&&s[c]?.value==="/";)c++;c>0&&(s=s.slice(c));let f=0,h=!1;const p=s.map((m,g)=>{if(m.value==="/")return L9;if(m.type===Ta)return $9;let y;m.type===ds?y=I9:m.type===Gl?(y=B9,f++):y=z9;for(let S=g+1;S{const o=Math.min(r.scores.length,a.scores.length);for(let s=0;sa.parsed[s].value?1:-1;return r.index-a.index}).map((r,a)=>(r.child.rank=a,r.child))}function G9({routeTree:e,initRoute:t}){const n={},r={},a=s=>{s.forEach((c,f)=>{t?.(c,f);const h=n[c.id];if(On(!h,`Duplicate routes found with id: ${String(c.id)}`),n[c.id]=c,!c.isRoot&&c.path){const m=ho(c.fullPath);(!r[m]||c.fullPath.endsWith("/"))&&(r[m]=c)}const p=c.children;p?.length&&a(p)})};a([e]);const o=V9(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function fa(e){return!!e?.isNotFound}function K9(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Kp="tsr-scroll-restoration-v1_3",W9=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function Y9(){const e=K9();if(!e)return null;const t=e.getItem(Kp);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=rs(r,n)||n,e.setItem(Kp,JSON.stringify(n)))}}const np=Y9(),L1=e=>e.state.__TSR_key||e.href;function X9(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 Wp=!1;function II({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:a,location:o}){let s;try{s=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const c=t||window.history.state?.__TSR_key,f=s[c];Wp=!0;e:{if(r&&f&&Object.keys(f).length>0){for(const m in f){const g=f[m];if(m==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(m){const y=document.querySelector(m);y&&(y.scrollLeft=g.scrollX,y.scrollTop=g.scrollY)}}break e}const h=(o??window.location).hash.split("#",2)[1];if(h){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(h);g&&g.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),a)for(const m of a){if(m==="window")continue;const g=typeof m=="function"?m():document.querySelector(m);g&&g.scrollTo(p)}}Wp=!1}function Z9(e,t){if(!np&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!np))return;e.isScrollRestorationSetup=!0,Wp=!1;const r=e.options.getScrollRestorationKey||L1;window.history.scrollRestoration="manual";const a=o=>{if(Wp||!e.isScrollRestoring)return;let s="";if(o.target===document||o.target===window)s="window";else{const f=o.target.getAttribute("data-scroll-restoration-id");f?s=`[data-scroll-restoration-id="${f}"]`:s=X9(o.target)}const c=r(e.state.location);np.set(f=>{const h=f[c]||={},p=h[s]||={};if(s==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(s){const m=document.querySelector(s);m&&(p.scrollX=m.scrollLeft||0,p.scrollY=m.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",W9(a,100),!0),e.subscribe("onRendered",o=>{const s=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(II({storageKey:Kp,key:s,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&np.set(c=>(c[s]||={},c)))})}function Q9(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 J9(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 Qb(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function eV(e){const t=new URLSearchParams(e),n={};for(const[r,a]of t.entries()){const o=n[r];o==null?n[r]=Qb(a):Array.isArray(o)?o.push(Qb(a)):n[r]=[o,Qb(a)]}return n}const tV=rV(JSON.parse),nV=aV(JSON.stringify,JSON.parse);function rV(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=eV(t);for(const r in n){const a=n[r];if(typeof a=="string")try{n[r]=e(a)}catch{}}return n}}function aV(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=J9(a,r);return o?`?${o}`:""}}const dr="__root__";function BI(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 ja(e){return e instanceof Response&&!!e.options}function iV(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 s=t.get(o);if(s)return a(s),s.value},set(o,s){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===r&&(r=void 0)}const c=t.get(o);if(c)c.value=s,a(c);else{const f={key:o,value:s,prev:r};r&&(r.next=f),r=f,n||(n=f),t.set(o,f)}}}}const Cp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},dv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),zI=(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),On(n.options.notFoundComponent);const r=e.matches.find(a=>a.routeId===n.id);On(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,zI(e,t))},so=(e,t,n)=>{if(!(!ja(n)&&!fa(n))){if(ja(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=ja(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 ja(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(zI(e,n),n)}},qI=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Fu=(e,t,n,r)=>{const{id:a,routeId:o}=e.matches[t],s=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,so(e,e.router.getMatch(a),n);try{s.options.onError?.(n)}catch(c){n=c,so(e,e.router.getMatch(a),n)}e.updateMatch(a,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},oV=(e,t,n,r)=>{const a=e.router.getMatch(t),o=e.matches[n-1]?.id,s=o?e.router.getMatch(o):void 0;if(e.router.isShell()){a.ssr=r.id===dr;return}if(s?.ssr===!1){a.ssr=!1;return}const c=y=>y===!0&&s?.ssr==="data-only"?"data-only":y,f=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=c(f);return}if(typeof r.options.ssr!="function"){a.ssr=c(r.options.ssr);return}const{search:h,params:p}=a,m={search:rp(h,a.searchError),params:rp(p,a.paramsError),location:e.location,matches:e.matches.map(y=>({index:y.index,pathname:y.pathname,fullPath:y.fullPath,staticData:y.staticData,id:y.id,routeId:y.routeId,search:rp(y.search,y.searchError),params:rp(y.params,y.paramsError),ssr:y.ssr}))},g=r.options.ssr(m);if(fo(g))return g.then(y=>{a.ssr=c(y??f)});a.ssr=c(g??f)},UI=(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&&!dv(e,t)&&(n.options.loader||n.options.beforeLoad||VI(n))&&typeof a=="number"&&a!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const s=setTimeout(()=>{Cp(e)},a);r._nonReactive.pendingTimeout=s}},sV=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;UI(e,t,n,r);const a=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&so(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},lV=(e,t,n,r)=>{const a=e.router.getMatch(t),o=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Hl(()=>{o?.resolve()});const{paramsError:s,searchError:c}=a;s&&Fu(e,n,s,"PARSE_PARAMS"),c&&Fu(e,n,c,"VALIDATE_SEARCH"),UI(e,t,r,a);const f=new AbortController,h=e.matches[n-1]?.id,g={...(h?e.router.getMatch(h):void 0)?.context??e.router.options.context??void 0,...a.__routeContext};let y=!1;const S=()=>{y||(y=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:f,context:g})))},x=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){mf(()=>{S(),x()});return}a._nonReactive.beforeLoadPromise=Hl();const{search:w,params:A,cause:O}=a,E=dv(e,t),N={search:w,abortController:f,params:A,preload:E,context:g,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:E?"preload":O,matches:e.matches,...e.router.options.additionalContext},T=R=>{if(R===void 0){mf(()=>{S(),x()});return}(ja(R)||fa(R))&&(S(),Fu(e,n,R,"BEFORE_LOAD")),mf(()=>{S(),e.updateMatch(t,M=>({...M,__beforeLoadContext:R,context:{...M.context,...R}})),x()})};let C;try{if(C=r.options.beforeLoad(N),fo(C))return S(),C.catch(R=>{Fu(e,n,R,"BEFORE_LOAD")}).then(T)}catch(R){S(),Fu(e,n,R,"BEFORE_LOAD")}T(C)},cV=(e,t)=>{const{id:n,routeId:r}=e.matches[t],a=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const f=oV(e,n,t,a);if(fo(f))return f.then(c)}return c()},s=()=>lV(e,n,t,a),c=()=>{if(qI(e,n))return;const f=sV(e,n,a);return fo(f)?f.then(s):s()};return o()},vf=(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,s,c])=>{const f=o?.meta,h=o?.links,p=o?.scripts,m=o?.styles;return{meta:f,links:h,headScripts:p,headers:c,scripts:s,styles:m}})},FI=(e,t,n,r)=>{const a=e.matchPromises[n-1],{params:o,loaderDeps:s,abortController:c,cause:f}=e.router.getMatch(t);let h=e.router.options.context??{};for(let m=0;m<=n;m++){const g=e.matches[m];if(!g)continue;const y=e.router.getMatch(g.id);y&&(h={...h,...y.__routeContext??{},...y.__beforeLoadContext??{}})}const p=dv(e,t);return{params:o,deps:s,preload:!!p,parentMatchPromise:a,abortController:c,context:h,location:e.location,navigate:m=>e.router.navigate({...m,_fromLocation:e.location}),cause:p?"preload":f,route:r,...e.router.options.additionalContext}},d2=async(e,t,n,r)=>{try{const a=e.router.getMatch(t);try{(!e.router.isServer||a.ssr===!0)&&HI(r);const o=r.options.loader?.(FI(e,t,n,r)),s=r.options.loader&&fo(o);if(!!(s||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,m=>({...m,isFetching:"loader"})),r.options.loader){const m=s?await o:o;so(e,e.router.getMatch(t),m),m!==void 0&&e.updateMatch(t,g=>({...g,loaderData:m}))}r._lazyPromise&&await r._lazyPromise;const f=vf(e,t,r),h=f?await f:void 0,p=a._nonReactive.minPendingPromise;p&&await p,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,m=>({...m,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...h}))}catch(o){let s=o;const c=a._nonReactive.minPendingPromise;c&&await c,fa(o)&&await r.options.notFoundComponent?.preload?.(),so(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(p){s=p,so(e,e.router.getMatch(t),p)}const f=vf(e,t,r),h=f?await f:void 0;e.updateMatch(t,p=>({...p,error:s,status:"error",isFetching:!1,...h}))}}catch(a){const o=e.router.getMatch(t);if(o){const s=vf(e,t,r);if(s){const c=await s;e.updateMatch(t,f=>({...f,...c}))}o._nonReactive.loaderPromise=void 0}so(e,o,a)}},uV=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let a=!1,o=!1;const s=e.router.looseRoutesById[r];if(qI(e,n)){if(e.router.isServer){const h=vf(e,n,s);if(h){const p=await h;e.updateMatch(n,m=>({...m,...p}))}return e.router.getMatch(n)}}else{const h=e.router.getMatch(n);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const p=e.router.getMatch(n),m=p._nonReactive.error||p.error;m&&so(e,p,m)}else{const p=Date.now()-h.updatedAt,m=dv(e,n),g=m?s.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:s.options.staleTime??e.router.options.defaultStaleTime??0,y=s.options.shouldReload,S=typeof y=="function"?y(FI(e,n,t,s)):y,x=!!m&&!e.router.state.matches.some(E=>E.id===n),w=e.router.getMatch(n);w._nonReactive.loaderPromise=Hl(),x!==w.preload&&e.updateMatch(n,E=>({...E,preload:x}));const{status:A,invalid:O}=w;if(a=A==="success"&&(O||(S??p>g)),!(m&&s.options.preload===!1))if(a&&!e.sync)o=!0,(async()=>{try{await d2(e,n,t,s);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){ja(E)&&await e.router.navigate(E.options)}})();else if(A!=="success"||a&&e.sync)await d2(e,n,t,s);else{const E=vf(e,n,s);if(E){const N=await E;e.updateMatch(n,T=>({...T,...N}))}}}}const c=e.router.getMatch(n);o||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,o||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const f=o?c.isFetching:!1;return f!==c.isFetching||c.invalid!==!1?(e.updateMatch(n,h=>({...h,isFetching:f,invalid:!1})),e.router.getMatch(n)):c};async function h2(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&Cp(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 GI){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 rp(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function VI(e){for(const t of GI)if(e.options[t]?.preload)return!0;return!1}const GI=["component","errorComponent","pendingComponent","notFoundComponent"];function fV(e){return{input:({url:t})=>{for(const n of e)t=KI(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=WI(e[n],t);return t}}}function dV(e){const t=Np(e.basepath),n=`/${t}`,r=`${n}/`,a=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:s})=>{const c=e.caseSensitive?s.pathname:s.pathname.toLowerCase();return c===a?s.pathname="/":c.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},output:({url:s})=>(s.pathname=mi(["/",t,s.pathname]),s)}}function KI(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 WI(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 is(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 hV{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,s=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=b9())),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 g9(mV(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),Z9(this));let c=!1;const f=this.options.basepath??"/",h=this.options.rewrite;if(o||a!==f||s!==h){this.basepath=f;const g=[];Np(f)!==""&&g.push(dV({basepath:f})),h&&g.push(h),this.rewrite=g.length===0?void 0:g.length===1?g[0]:fV(g),this.history&&this.updateLatestLocation(),c=!0}c&&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}=G9({routeTree:this.routeTree,initRoute:(s,c)=>{s.init({originalIndex:c})}});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:f,state:h})=>{const p=new URL(f,this.origin),m=KI(this.rewrite,p),g=this.options.parseSearch(m.search),y=this.options.stringifySearch(g);m.search=y;const S=m.href.replace(m.origin,""),{pathname:x,hash:w}=m;return{href:S,publicHref:f,url:m.href,pathname:l2(x),searchStr:y,search:Vr(r?.search,g),hash:w.split("#").reverse()[0]??"",state:Vr(r?.state,h)}},o=a(n),{__tempLocation:s,__tempKey:c}=o.state;if(s&&(!c||c===this.tempLocationKey)){const f=a(s);return f.state.key=o.state.key,f.state.__TSR_key=o.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>O9({base:n,to:Bj(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=iV(1e3),this.getMatchedRoutes=(n,r)=>vV({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 s=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutes(s,{_buildLocation:!0}),f=k1(c);o.from;const h=o.unsafeRelative==="path"?s.pathname:o.from??f.fullPath,p=this.resolvePathWithBase(h,"."),m=f.search,g={...f.params},y=o.to?this.resolvePathWithBase(p,`${o.to}`):this.resolvePathWithBase(p,"."),S=o.params===!1||o.params===null?{}:(o.params??!0)===!0?g:Object.assign(g,rs(o.params,g)),x=Zb({path:y,params:S,parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(x,void 0,{_buildLocation:!0}).map(z=>this.looseRoutesById[z.routeId]);if(Object.keys(S).length>0)for(const z of w){const L=z.options.params?.stringify??z.options.stringifyParams;L&&Object.assign(S,L(S))}const A=n.leaveParams?y:l2(Zb({path:y,params:S,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let O=m;if(n._includeValidateSearch&&this.options.search?.strict){const z={};w.forEach(L=>{if(L.options.validateSearch)try{Object.assign(z,$1(L.options.validateSearch,{...z,...O}))}catch{}}),O=z}O=gV({search:O,dest:o,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),O=Vr(m,O);const E=this.options.stringifySearch(O),N=o.hash===!0?s.hash:o.hash?rs(o.hash,s.hash):void 0,T=N?`#${N}`:"";let C=o.state===!0?s.state:o.state?rs(o.state,s.state):{};C=Vr(s.state,C);const R=`${A}${E}${T}`,M=new URL(R,this.origin),k=WI(this.rewrite,M);return{publicHref:k.pathname+k.search+k.hash,href:R,url:k.href,pathname:A,search:O,searchStr:E,state:C,hash:N??"",unmaskOnReload:o.unmaskOnReload}},a=(o={},s)=>{const c=r(o);let f=s?r(s):void 0;if(!f){let h={};const p=this.options.routeMasks?.find(m=>{const g=D1(c.pathname,{to:m.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return g?(h=g,!0):!1});if(p){const{from:m,...g}=p;s={from:n.from,...g,params:h},f=r(s)}}return f&&(c.maskedLocation=f),c};return n.mask?a(n,{from:n.from,...n.mask}):a(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...a})=>{const o=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const h=as(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),h},s=ho(this.latestLocation.href)===ho(a.href),c=this.commitLocationPromise;if(this.commitLocationPromise=Hl(()=>{c?.resolve()}),s&&o())this.load();else{let{maskedLocation:f,hashScrollIntoView:h,...p}=a;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[a.replace?"replace":"push"](p.publicHref,p.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:s,href:c,...f}={})=>{if(c){const m=this.history.location.state.__TSR_index,g=Hp(c,{__TSR_index:n?m:m+1});f.to=g.pathname,f.search=this.options.parseSearch(g.search),f.hash=g.hash.slice(1)}const h=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const p=this.commitLocation({...h,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),p},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(Np(a(this.latestLocation.href))!==Np(a(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),BI({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(c=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...is({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...is({resolvedLocation:h,location:f})}),await h2({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],g=[];mf(()=>{this.__store.setState(y=>{const S=y.matches,x=y.pendingMatches||y.matches;return p=S.filter(w=>!x.some(A=>A.id===w.id)),m=x.filter(w=>!S.some(A=>A.id===w.id)),g=x.filter(w=>S.some(A=>A.id===w.id)),{...y,isLoading:!1,loadedAt:Date.now(),matches:x,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...p.filter(w=>w.status!=="error")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[m,"onEnter"],[g,"onStay"]].forEach(([y,S])=>{y.forEach(x=>{this.looseRoutesById[x.routeId].options[S]?.(x)})})})})}})}catch(f){ja(f)?(r=f,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):fa(f)&&(a=f),this.__store.setState(h=>({...h,statusCode:r?r.status:a?404:h.matches.some(p=>p.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let s;this.hasNotFoundMatch()?s=404:this.__store.state.matches.some(c=>c.status==="error")&&(s=500),s!==void 0&&this.__store.setState(c=>({...c,statusCode:s}))},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,s=this.state.resolvedLocation,c=typeof r.types=="function"?r.types(is({resolvedLocation:s,location:o})):r.types;if(c===!1){n();return}a={update:n,types:c}}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(s=>s.id===n?r(s):s)}))})},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=HI,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(c=>c.id)),s=new Set([...o,...this.state.cachedMatches.map(c=>c.id)]);mf(()=>{a.forEach(c=>{s.has(c.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,c]}))})});try{return a=await h2({router:this,matches:a,location:r,preload:!0,updateMatch:(c,f)=>{o.has(c)?a=a.map(h=>h.id===c?f(h):h):this.updateMatch(c,f)}}),a}catch(c){if(ja(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});fa(c)||console.error(c);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 c=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,f=D1(c.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!f||n.params&&!as(f,n.params,{partial:!0})?!1:f&&(r?.includeSearch??!0)?as(c.search,o.search,{partial:!0})?f:!1:f},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??nV,parseSearch:t.parseSearch??tV}),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 s=!1;(r?r.path!=="/"&&o["**"]:ho(t.pathname))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):s=!0);const c=(()=>{if(s){if(this.options.notFoundMode!=="root")for(let p=a.length-1;p>=0;p--){const m=a[p];if(m.children)return m.id}return dr}})(),f=[],h=p=>p?.id?p.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((p,m)=>{const g=f[m-1],[y,S,x]=(()=>{const B=g?.search??t.search,F=g?._strictSearch??void 0;try{const U=$1(p.options.validateSearch,{...B})??void 0;return[{...B,...U},{...F,...U},void 0]}catch(U){let W=U;if(U instanceof Yp||(W=new Yp(U.message,{cause:U})),n?.throwOnError)throw W;return[B,{},W]}})(),w=p.options.loaderDeps?.({search:y})??"",A=w?JSON.stringify(w):"",{interpolatedPath:O,usedParams:E}=Zb({path:p.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),N=p.id+O+A,T=this.getMatch(N),C=this.state.matches.find(B=>B.routeId===p.id),R=T?._strictParams??E;let M;if(!T){const B=p.options.params?.parse??p.options.parseParams;if(B)try{Object.assign(R,B(R))}catch(F){if(M=new pV(F.message,{cause:F}),n?.throwOnError)throw M}}Object.assign(o,R);const k=C?"stay":"enter";let z;if(T)z={...T,cause:k,params:C?Vr(C.params,o):o,_strictParams:R,search:Vr(C?C.search:T.search,y),_strictSearch:S};else{const B=p.options.loader||p.options.beforeLoad||p.lazyFn||VI(p)?"pending":"success";z={id:N,index:m,routeId:p.id,params:C?Vr(C.params,o):o,_strictParams:R,pathname:O,updatedAt:Date.now(),search:C?Vr(C.search,y):y,_strictSearch:S,searchError:void 0,status:B,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:Hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:k,loaderDeps:C?Vr(C.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}n?.preload||(z.globalNotFound=c===p.id),z.searchError=x;const L=h(g);z.context={...L,...z.__routeContext,...z.__beforeLoadContext},f.push(z)}),f.forEach((p,m)=>{const g=this.looseRoutesById[p.routeId];if(!this.getMatch(p.id)&&n?._buildLocation!==!0){const S=f[m-1],x=h(S);if(g.options.context){const w={deps:p.loaderDeps,params:p.params,context:x??{},location:t,navigate:A=>this.navigate({...A,_fromLocation:t}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:f};p.__routeContext=g.options.context(w)??void 0}p.context={...x,...p.__routeContext,...p.__beforeLoadContext}}}),f}}class Yp extends Error{}class pV extends Error{}function mV(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function $1(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Yp("Async validation not supported");if(n.issues)throw new Yp(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 vV({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:a,flatRoutes:o,parseCache:s}){let c={};const f=ho(e),h=y=>D1(f,{to:y.fullPath,caseSensitive:y.options?.caseSensitive??n,fuzzy:!0},s);let p=t!==void 0?r[t]:void 0;if(p)c=h(p);else{let y;for(const S of o){const x=h(S);if(x)if(S.path!=="/"&&x["**"])y||(y={foundRoute:S,routeParams:x});else{p=S,c=x;break}}!p&&y&&(p=y.foundRoute,c=y.routeParams)}let m=p||a[dr];const g=[m];for(;m.parentRoute;)m=m.parentRoute,g.push(m);return g.reverse(),{matchedRoutes:g,routeParams:c,foundRoute:p}}function gV({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const a=n.reduce((c,f)=>{const h=[];if("search"in f.options)f.options.search?.middlewares&&h.push(...f.options.search.middlewares);else if(f.options.preSearchFilters||f.options.postSearchFilters){const p=({search:m,next:g})=>{let y=m;"preSearchFilters"in f.options&&f.options.preSearchFilters&&(y=f.options.preSearchFilters.reduce((x,w)=>w(x),m));const S=g(y);return"postSearchFilters"in f.options&&f.options.postSearchFilters?f.options.postSearchFilters.reduce((x,w)=>w(x),S):S};h.push(p)}if(r&&f.options.validateSearch){const p=({search:m,next:g})=>{const y=g(m);try{return{...y,...$1(f.options.validateSearch,y)??void 0}}catch{return y}};h.push(p)}return c.concat(h)},[])??[],o=({search:c})=>t.search?t.search===!0?c:rs(t.search,c):{};a.push(o);const s=(c,f)=>{if(c>=a.length)return f;const h=a[c];return h({search:f,next:m=>s(c+1,m)})};return s(0,e)}const yV="Error preloading route! ☝️";class YI{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=dr:this.parentRoute||On(!1);let o=a?dr:r?.path;o&&o!=="/"&&(o=zj(o));const s=r?.id||o;let c=a?dr:mi([this.parentRoute.id===dr?"":this.parentRoute.id,s]);o===dr&&(o="/"),c!==dr&&(c=mi(["/",c]));const f=c===dr?"/":mi([this.parentRoute.fullPath,o]);this._path=o,this._id=c,this._fullPath=f,this._to=f},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 bV extends YI{constructor(t){super(t)}}function qj(e){const t=e.errorComponent??hv;return u.jsx(xV,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}class xV extends _.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 hv({error:e}){const[t,n]=_.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.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"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function wV({children:e,fallback:t=null}){return SV()?u.jsx(K.Fragment,{children:e}):u.jsx(K.Fragment,{children:t})}function SV(){return K.useSyncExternalStore(_V,()=>!0,()=>!1)}function _V(){return()=>{}}var Jb={exports:{}},ex={},tx={exports:{}},nx={};var p2;function jV(){if(p2)return nx;p2=1;var e=dd();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function c(m,g){var y=g(),S=r({inst:{value:y,getSnapshot:g}}),x=S[0].inst,w=S[1];return o(function(){x.value=y,x.getSnapshot=g,f(x)&&w({inst:x})},[m,y,g]),a(function(){return f(x)&&w({inst:x}),m(function(){f(x)&&w({inst:x})})},[m]),s(y),y}function f(m){var g=m.getSnapshot;m=m.value;try{var y=g();return!n(m,y)}catch{return!0}}function h(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return nx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,nx}var m2;function AV(){return m2||(m2=1,tx.exports=jV()),tx.exports}var v2;function OV(){if(v2)return ex;v2=1;var e=dd(),t=AV();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,c=e.useMemo,f=e.useDebugValue;return ex.useSyncExternalStoreWithSelector=function(h,p,m,g,y){var S=o(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=c(function(){function A(C){if(!O){if(O=!0,E=C,C=g(C),y!==void 0&&x.hasValue){var R=x.value;if(y(R,C))return N=R}return N=C}if(R=N,r(E,C))return R;var M=g(C);return y!==void 0&&y(R,M)?(E=C,R):(E=C,N=M)}var O=!1,E,N,T=m===void 0?null:m;return[function(){return A(p())},T===null?void 0:function(){return A(T())}]},[p,m,g,y]);var w=a(h,S[0],S[1]);return s(function(){x.hasValue=!0,x.value=w},[w]),f(w),w},ex}var g2;function EV(){return g2||(g2=1,Jb.exports=OV()),Jb.exports}var TV=EV();function NV(e,t=r=>r,n={}){const r=n.equal??CV;return TV.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function CV(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=y2(e);if(n.length!==y2(t).length)return!1;for(let r=0;r"u"?rx:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=rx,rx)}function $n(e){const t=_.useContext(XI());return e?.warn,t}function jn(e){const t=$n({warn:e?.router===void 0}),n=e?.router||t,r=_.useRef(void 0);return NV(n.__store,a=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=Vr(r.current,e.select(a));return r.current=o,o}return e.select(a)}return a})}const pv=_.createContext(void 0),RV=_.createContext(void 0);function Ma(e){const t=_.useContext(e.from?RV:pv);return jn({select:r=>{const a=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(On(!((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 Uj(e){return Ma({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Fj(e){const{select:t,...n}=e;return Ma({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Hj(e){return Ma({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 Vj(e){return Ma({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Es(e){const t=$n();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Ts=DI();const PV=ut(Ts),ap=typeof window<"u"?_.useLayoutEffect:_.useEffect;function ax(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function MV(e,t,n={},r={}){_.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 kV(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function DV(e,t){const n=$n(),[r,a]=_.useState(!1),o=_.useRef(!1),s=kV(t),{activeProps:c,inactiveProps:f,activeOptions:h,to:p,preload:m,preloadDelay:g,hashScrollIntoView:y,replace:S,startTransition:x,resetScroll:w,viewTransition:A,children:O,target:E,disabled:N,style:T,className:C,onClick:R,onFocus:M,onMouseEnter:k,onMouseLeave:z,onTouchStart:L,ignoreBlocker:B,params:F,search:U,hash:W,state:$,mask:V,reloadDocument:H,unsafeRelative:ne,from:ee,_fromLocation:I,...q}=e,X=jn({select:tt=>tt.location.search,structuralSharing:!0}),te=e.from,se=_.useMemo(()=>({...e,from:te}),[n,X,te,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Q=_.useMemo(()=>n.buildLocation({...se}),[n,se]),G=_.useMemo(()=>{if(N)return;let tt=Q.maskedLocation?Q.maskedLocation.url:Q.url,Je=!1;return n.origin&&(tt.startsWith(n.origin)?tt=n.history.createHref(tt.replace(n.origin,""))||"/":Je=!0),{href:tt,external:Je}},[N,Q.maskedLocation,Q.url,n.origin,n.history]),ge=_.useMemo(()=>{if(G?.external)return G.href;try{return new URL(p),p}catch{}},[p,G]),re=e.reloadDocument||ge?!1:m??n.options.defaultPreload,pe=g??n.options.defaultPreloadDelay??0,ye=jn({select:tt=>{if(ge)return!1;if(h?.exact){if(!j9(tt.location.pathname,Q.pathname,n.basepath))return!1}else{const Je=Gp(tt.location.pathname,n.basepath),hn=Gp(Q.pathname,n.basepath);if(!(Je.startsWith(hn)&&(Je.length===hn.length||Je[hn.length]==="/")))return!1}return(h?.includeSearch??!0)&&!as(tt.location.search,Q.search,{partial:!h?.exact,ignoreUndefined:!h?.explicitUndefined})?!1:h?.includeHash?tt.location.hash===Q.hash:!0}}),le=_.useCallback(()=>{n.preloadRoute({...se}).catch(tt=>{console.warn(tt),console.warn(yV)})},[n,se]),Le=_.useCallback(tt=>{tt?.isIntersecting&&le()},[le]);MV(s,Le,zV,{disabled:!!N||re!=="viewport"}),_.useEffect(()=>{o.current||!N&&re==="render"&&(le(),o.current=!0)},[N,le,re]);const be=tt=>{const Je=tt.currentTarget.getAttribute("target"),hn=E!==void 0?E:Je;if(!N&&!qV(tt)&&!tt.defaultPrevented&&(!hn||hn==="_self")&&tt.button===0){tt.preventDefault(),Ts.flushSync(()=>{a(!0)});const Wc=n.subscribe("onResolved",()=>{Wc(),a(!1)});n.navigate({...se,replace:S,resetScroll:w,hashScrollIntoView:y,startTransition:x,viewTransition:A,ignoreBlocker:B})}};if(ge)return{...q,ref:s,href:ge,...O&&{children:O},...E&&{target:E},...N&&{disabled:N},...T&&{style:T},...C&&{className:C},...R&&{onClick:R},...M&&{onFocus:M},...k&&{onMouseEnter:k},...z&&{onMouseLeave:z},...L&&{onTouchStart:L}};const et=tt=>{N||re&&le()},Te=et,st=tt=>{if(!(N||!re))if(!pe)le();else{const Je=tt.target;if(Hu.has(Je))return;const hn=setTimeout(()=>{Hu.delete(Je),le()},pe);Hu.set(Je,hn)}},En=tt=>{if(N||!re||!pe)return;const Je=tt.target,hn=Hu.get(Je);hn&&(clearTimeout(hn),Hu.delete(Je))},Tn=ye?rs(c,{})??LV:ix,Jn=ye?ix:rs(f,{})??ix,In=[C,Tn.className,Jn.className].filter(Boolean).join(" "),Rr=(T||Tn.style||Jn.style)&&{...T,...Tn.style,...Jn.style};return{...q,...Tn,...Jn,href:G?.href,ref:s,onClick:Vu([R,be]),onFocus:Vu([M,et]),onMouseEnter:Vu([k,st]),onMouseLeave:Vu([z,En]),onTouchStart:Vu([L,Te]),disabled:!!N,target:E,...Rr&&{style:Rr},...In&&{className:In},...N&&$V,...ye&&IV,...r&&BV}}const ix={},LV={className:"active"},$V={role:"link","aria-disabled":!0},IV={"data-status":"active","aria-current":"page"},BV={"data-transitioning":"transitioning"},Hu=new WeakMap,zV={rootMargin:"100px"},Vu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},Gj=_.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:a,ref:o,...s}=DV(r,t),c=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;return n===void 0&&delete s.disabled,_.createElement(n||"a",{...s,ref:o},c)});function qV(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class UV extends YI{constructor(t){super(t),this.useMatch=n=>Ma({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ma({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Vj({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Hj({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Fj({...n,from:this.id}),this.useLoaderData=n=>Uj({...n,from:this.id}),this.useNavigate=()=>Es({from:this.fullPath}),this.Link=K.forwardRef((n,r)=>u.jsx(Gj,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Cr(e){return new UV(e)}class FV extends bV{constructor(t){super(t),this.useMatch=n=>Ma({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ma({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Vj({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Hj({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Fj({...n,from:this.id}),this.useLoaderData=n=>Uj({...n,from:this.id}),this.useNavigate=()=>Es({from:this.fullPath}),this.Link=K.forwardRef((n,r)=>u.jsx(Gj,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function HV(e){return new FV(e)}function b2(e){return typeof e=="object"?new x2(e,{silent:!0}).createRoute(e):new x2(e,{silent:!0}).createRoute}class x2{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const a=Cr(r);return a.isRoot=!1,a},this.silent=n?.silent}}class w2{constructor(t){this.useMatch=n=>Ma({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ma({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Vj({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Hj({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Fj({...n,from:this.options.id}),this.useLoaderData=n=>Uj({...n,from:this.options.id}),this.useNavigate=()=>{const n=$n();return Es({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function S2(e){return typeof e=="object"?new w2(e):t=>new w2({id:e,...t})}function VV(){const e=$n(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),{hasPendingMatches:a,isLoading:o}=jn({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),s=ax(o),c=o||n||a,f=ax(c),h=o||a,p=ax(h);return e.startTransition=m=>{r(!0),_.startTransition(()=>{m(),r(!1)})},_.useEffect(()=>{const m=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ho(e.latestLocation.href)!==ho(g.href)&&e.commitLocation({...g,replace:!0}),()=>{m()}},[e,e.history]),ap(()=>{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]),ap(()=>{s&&!o&&e.emit({type:"onLoad",...is(e.state)})},[s,e,o]),ap(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...is(e.state)})},[h,p,e]),ap(()=>{f&&!c&&(e.emit({type:"onResolved",...is(e.state)}),e.__store.setState(m=>({...m,status:"idle",resolvedLocation:m.location})),Q9(e))},[c,f,e]),null}function GV(e){const t=jn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(qj,{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 KV(){return u.jsx("p",{children:"Not Found"})}function Tl(e){return u.jsx(u.Fragment,{children:e.children})}function ZI(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{data:n}):u.jsx(KV,{})}function WV({children:e}){const t=$n();return t.isServer?u.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(` `)+";$_TSR.c()"}}):null}function YV(){const e=$n();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||L1)(e.latestLocation),r=n!==L1(e.latestLocation)?n:void 0,a={storageKey:Kp,shouldScrollRestoration:!0};return r&&(a.key=r),u.jsx(WV,{children:`(${II.toString()})(${JSON.stringify(a)})`})}const QI=_.memo(function({matchId:t}){const n=$n(),r=jn({select:A=>{const O=A.matches.find(E=>E.id===t);return On(O),{routeId:O.routeId,ssr:O.ssr,_displayPending:O._displayPending}},structuralSharing:!0}),a=n.routesById[r.routeId],o=a.options.pendingComponent??n.options.defaultPendingComponent,s=o?u.jsx(o,{}):null,c=a.options.errorComponent??n.options.defaultErrorComponent,f=a.options.onCatch??n.options.defaultOnCatch,h=a.isRoot?a.options.notFoundComponent??n.options.notFoundRoute?.options.component:a.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!a.isRoot||a.options.wrapInSuspense||p)&&(a.options.wrapInSuspense??o??(a.options.errorComponent?.preload||p))?_.Suspense:Tl,g=c?qj:Tl,y=h?GV:Tl,S=jn({select:A=>A.loadedAt}),x=jn({select:A=>{const O=A.matches.findIndex(E=>E.id===t);return A.matches[O-1]?.routeId}}),w=a.isRoot?a.options.shellComponent??Tl:Tl;return u.jsxs(w,{children:[u.jsx(pv.Provider,{value:t,children:u.jsx(m,{fallback:s,children:u.jsx(g,{getResetKey:()=>S,errorComponent:c||hv,onCatch:(A,O)=>{if(fa(A))throw A;f?.(A,O)},children:u.jsx(y,{fallback:A=>{if(!h||A.routeId&&A.routeId!==r.routeId||!A.routeId&&!a.isRoot)throw A;return _.createElement(h,A)},children:p||r._displayPending?u.jsx(wV,{fallback:s,children:u.jsx(_2,{matchId:t})}):u.jsx(_2,{matchId:t})})})})}),x===dr&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(XV,{}),u.jsx(YV,{})]}):null]})});function XV(){const e=$n(),t=_.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...is(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const _2=_.memo(function({matchId:t}){const n=$n(),{match:r,key:a,routeId:o}=jn({select:f=>{const h=f.matches.find(S=>S.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),s=n.routesById[o],c=_.useMemo(()=>{const f=s.options.component??n.options.defaultComponent;return f?u.jsx(f,{},a):u.jsx(Kj,{})},[a,s.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 f=s.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise&&!n.isServer){const p=Hl();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return On(fa(r.error)),ZI(n,s,r.error);if(r.status==="redirected")throw On(ja(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const f=(s.options.errorComponent??n.options.defaultErrorComponent)||hv;return u.jsx(f,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return c}),Kj=_.memo(function(){const t=$n(),n=_.useContext(pv),r=jn({select:h=>h.matches.find(p=>p.id===n)?.routeId}),a=t.routesById[r],o=jn({select:h=>{const m=h.matches.find(g=>g.id===n);return On(m),m.globalNotFound}}),s=jn({select:h=>{const p=h.matches,m=p.findIndex(g=>g.id===n);return p[m+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(o)return ZI(t,a,void 0);if(!s)return null;const f=u.jsx(QI,{matchId:s});return r===dr?u.jsx(_.Suspense,{fallback:c,children:f}):f});function ZV(){const e=$n(),n=e.routesById[dr].options.pendingComponent??e.options.defaultPendingComponent,r=n?u.jsx(n,{}):null,a=e.isServer||typeof document<"u"&&e.ssr?Tl:_.Suspense,o=u.jsxs(a,{fallback:r,children:[!e.isServer&&u.jsx(VV,{}),u.jsx(QV,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:o}):o}function QV(){const e=$n(),t=jn({select:a=>a.matches[0]?.id}),n=jn({select:a=>a.loadedAt}),r=t?u.jsx(QI,{matchId:t}):null;return u.jsx(pv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(qj,{getResetKey:()=>n,errorComponent:hv,onCatch:a=>{a.message||a.toString()},children:r})})}function JV(){const e=$n();return jn({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),_.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o,...s}=t;return e.matchRoute(s,{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o})},[e])}const e7=e=>new t7(e);class t7 extends hV{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=b2,globalThis.createLazyFileRoute=S2):typeof window<"u"&&(window.createFileRoute=b2,window.createLazyFileRoute=S2);function n7({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=XI(),a=u.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:a}):a}function r7({router:e,...t}){return u.jsx(n7,{router:e,...t,children:u.jsx(ZV,{})})}const a7="modulepreload",i7=function(e){return"/"+e},j2={},o7=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let f=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=s?.nonce||s?.getAttribute("nonce");a=f(n.map(h=>{if(h=i7(h),h in j2)return;j2[h]=!0;const p=h.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":a7,p||(g.as="script"),g.crossOrigin="",g.href=h,c&&g.setAttribute("nonce",c),document.head.appendChild(g),p)return new Promise((y,S)=>{g.addEventListener("load",y),g.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(s){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=s,window.dispatchEvent(c),!c.defaultPrevented)throw s}return a.then(s=>{for(const c of s||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})},Fe={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return A2(this.context.count)},getNextContextId(){return A2(this.context.count++)}};function A2(e){const t=String(e),n=t.length-1;return Fe.context.id+(n?String.fromCharCode(96+n):"")+t}function lf(e){Fe.context=e}const JI=!1,s7=(e,t)=>e===t,Xp=Symbol("solid-proxy"),e4=typeof Proxy=="function",l7=Symbol("solid-track"),Zp={equals:s7};let t4=s4;const Oi=1,Qp=2,n4={owned:null,cleanups:null,context:null,owner:null},ox={};var ht=null;let sx=null,c7=null,Et=null,An=null,vi=null,mv=0;function Rp(e,t){const n=Et,r=ht,a=e.length===0,o=t===void 0?r:t,s=a?n4:{owned:null,cleanups:null,context:o?o.context:null,owner:o},c=a?e:()=>e(()=>Ln(()=>Of(s)));ht=s,Et=null;try{return mo(c,!0)}finally{Et=n,ht=r}}function fi(e,t){t=t?Object.assign({},Zp,t):Zp;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=a=>(typeof a=="function"&&(a=a(n.value)),o4(n,a));return[i4.bind(n),r]}function u7(e,t,n){const r=vv(e,t,!0,Oi);Oc(r)}function os(e,t,n){const r=vv(e,t,!1,Oi);Oc(r)}function u0e(e,t,n){t4=b7;const r=vv(e,t,!1,Oi);(!n||!n.render)&&(r.user=!0),vi?vi.push(r):Oc(r)}function _n(e,t,n){n=n?Object.assign({},Zp,n):Zp;const r=vv(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Oc(r),i4.bind(r)}function f7(e){return e&&typeof e=="object"&&"then"in e}function d7(e,t,n){let r,a,o;r=!0,a=e,o={};let s=null,c=ox,f=null,h=!1,p="initialValue"in o,m=typeof r=="function"&&_n(r);const g=new Set,[y,S]=(o.storage||fi)(o.initialValue),[x,w]=fi(void 0),[A,O]=fi(void 0,{equals:!1}),[E,N]=fi(p?"ready":"unresolved");Fe.context&&(f=Fe.getNextContextId(),o.ssrLoadFrom==="initial"?c=o.initialValue:Fe.load&&Fe.has(f)&&(c=Fe.load(f)));function T(z,L,B,F){return s===z&&(s=null,F!==void 0&&(p=!0),(z===c||L===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(F,{value:L})),c=ox,C(L,B)),L}function C(z,L){mo(()=>{L===void 0&&S(()=>z),N(L!==void 0?"errored":p?"ready":"unresolved"),w(L);for(const B of g.keys())B.decrement();g.clear()},!1)}function R(){const z=v7,L=y(),B=x();if(B!==void 0&&!s)throw B;return Et&&Et.user,L}function M(z=!0){if(z!==!1&&h)return;h=!1;const L=m?m():r;if(L==null||L===!1){T(s,Ln(y));return}let B;const F=c!==ox?c:Ln(()=>{try{return a(L,{value:y(),refetching:z})}catch(U){B=U}});if(B!==void 0){T(s,void 0,Pp(B),L);return}else if(!f7(F))return T(s,F,void 0,L),F;return s=F,"v"in F?(F.s===1?T(s,F.v,void 0,L):T(s,void 0,Pp(F.v),L),F):(h=!0,queueMicrotask(()=>h=!1),mo(()=>{N(p?"refreshing":"pending"),O()},!1),F.then(U=>T(F,U,void 0,L),U=>T(F,void 0,Pp(U),L)))}Object.defineProperties(R,{state:{get:()=>E()},error:{get:()=>x()},loading:{get(){const z=E();return z==="pending"||z==="refreshing"}},latest:{get(){if(!p)return R();const z=x();if(z&&!s)throw z;return y()}}});let k=ht;return m?u7(()=>(k=ht,M(!1))):M(!1),[R,{refetch:z=>p7(k,()=>M(z)),mutate:S}]}function Ln(e){if(Et===null)return e();const t=Et;Et=null;try{return e()}finally{Et=t}}function h7(e){return ht===null||(ht.cleanups===null?ht.cleanups=[e]:ht.cleanups.push(e)),e}function p7(e,t){const n=ht,r=Et;ht=e,Et=null;try{return mo(t,!0)}catch(a){Wj(a)}finally{ht=n,Et=r}}const[f0e,d0e]=fi(!1);function r4(e,t){const n=Symbol("context");return{id:n,Provider:x7(n),defaultValue:e}}function m7(e){let t;return ht&&ht.context&&(t=ht.context[e.id])!==void 0?t:e.defaultValue}function a4(e){const t=_n(e),n=_n(()=>I1(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let v7;function i4(){if(this.sources&&this.state)if(this.state===Oi)Oc(this);else{const e=An;An=null,mo(()=>em(this),!1),An=e}if(Et){const e=this.observers?this.observers.length:0;Et.sources?(Et.sources.push(this),Et.sourceSlots.push(e)):(Et.sources=[this],Et.sourceSlots=[e]),this.observers?(this.observers.push(Et),this.observerSlots.push(Et.sources.length-1)):(this.observers=[Et],this.observerSlots=[Et.sources.length-1])}return this.value}function o4(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&mo(()=>{for(let a=0;a1e6)throw An=[],new Error},!1)),t}function Oc(e){if(!e.fn)return;Of(e);const t=mv;g7(e,e.value,t)}function g7(e,t,n){let r;const a=ht,o=Et;Et=ht=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=Oi,e.owned&&e.owned.forEach(Of),e.owned=null),e.updatedAt=n+1,Wj(s)}finally{Et=o,ht=a}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?o4(e,r):e.value=r,e.updatedAt=n)}function vv(e,t,n,r=Oi,a){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ht,context:ht?ht.context:null,pure:n};return ht===null||ht!==n4&&(ht.owned?ht.owned.push(o):ht.owned=[o]),o}function Jp(e){if(e.state===0)return;if(e.state===Qp)return em(e);if(e.suspense&&Ln(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=t[n],e.state===Oi)Oc(e);else if(e.state===Qp){const r=An;An=null,mo(()=>em(e,t[0]),!1),An=r}}function mo(e,t){if(An)return e();let n=!1;t||(An=[]),vi?n=!0:vi=[],mv++;try{const r=e();return y7(n),r}catch(r){n||(vi=null),An=null,Wj(r)}}function y7(e){if(An&&(s4(An),An=null),e)return;const t=vi;vi=null,t.length&&mo(()=>t4(t),!1)}function s4(e){for(let t=0;t=0;t--)Of(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Of(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Pp(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Wj(e,t=ht){throw Pp(e)}function I1(e){if(typeof e=="function"&&!e.length)return I1(e());if(Array.isArray(e)){const t=[];for(let n=0;na=Ln(()=>(ht.context={...ht.context,[e]:r.value},a4(()=>r.children))),void 0),a}}const w7=Symbol("fallback");function O2(e){for(let t=0;t1?[]:null;return h7(()=>O2(o)),()=>{let f=e()||[],h=f.length,p,m;return f[l7],Ln(()=>{let y,S,x,w,A,O,E,N,T;if(h===0)s!==0&&(O2(o),o=[],r=[],a=[],s=0,c&&(c=[])),n.fallback&&(r=[w7],a[0]=Rp(C=>(o[0]=C,n.fallback())),s=1);else if(s===0){for(a=new Array(h),m=0;m=O&&N>=O&&r[E]===f[N];E--,N--)x[N]=a[E],w[N]=o[E],c&&(A[N]=c[E]);for(y=new Map,S=new Array(N+1),m=N;m>=O;m--)T=f[m],p=y.get(T),S[m]=p===void 0?-1:p,y.set(T,m);for(p=O;p<=E;p++)T=r[p],m=y.get(T),m!==void 0&&m!==-1?(x[m]=a[p],w[m]=o[p],c&&(A[m]=c[p]),m=S[m],y.set(T,m)):o[p]();for(m=O;me(t||{}))}function ip(){return!0}const B1={get(e,t,n){return t===Xp?n:e.get(t)},has(e,t){return t===Xp?!0:e.has(t)},set:ip,deleteProperty:ip,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ip,deleteProperty:ip}},ownKeys(e){return e.keys()}};function lx(e){return(e=typeof e=="function"?e():e)?e:{}}function _7(){for(let e=0,t=this.length;e=0;c--){const f=lx(e[c])[s];if(f!==void 0)return f}},has(s){for(let c=e.length-1;c>=0;c--)if(s in lx(e[c]))return!0;return!1},keys(){const s=[];for(let c=0;c=0;s--){const c=e[s];if(!c)continue;const f=Object.getOwnPropertyNames(c);for(let h=f.length-1;h>=0;h--){const p=f[h];if(p==="__proto__"||p==="constructor")continue;const m=Object.getOwnPropertyDescriptor(c,p);if(!r[p])r[p]=m.get?{enumerable:!0,configurable:!0,get:_7.bind(n[p]=[m.get.bind(c)])}:m.value!==void 0?m:void 0;else{const g=n[p];g&&(m.get?g.push(m.get.bind(c)):m.value!==void 0&&g.push(()=>m.value))}}}const a={},o=Object.keys(r);for(let s=o.length-1;s>=0;s--){const c=o[s],f=r[c];f&&f.get?Object.defineProperty(a,c,f):a[c]=f?f.value:void 0}return a}function j7(e,...t){const n=t.length;if(e4&&Xp in e){const a=n>1?t.flat():t[0],o=t.map(s=>new Proxy({get(c){return s.includes(c)?e[c]:void 0},has(c){return s.includes(c)&&c in e},keys(){return s.filter(c=>c in e)}},B1));return o.push(new Proxy({get(s){return a.includes(s)?void 0:e[s]},has(s){return a.includes(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!a.includes(s))}},B1)),o}const r=[];for(let a=0;a<=n;a++)r[a]={};for(const a of Object.getOwnPropertyNames(e)){let o=n;for(let f=0;f{const o=Fe.context;if(o){const[c,f]=fi();Fe.count||(Fe.count=0),Fe.count++,(n||(n=e())).then(h=>{!Fe.done&&lf(o),Fe.count--,f(()=>h.default),lf()}),t=c}else if(!t){const[c]=d7(()=>(n||(n=e())).then(f=>f.default));t=c}let s;return _n(()=>(s=t())?Ln(()=>{if(!o||Fe.done)return s(a);const c=Fe.context;lf(o);const f=s(a);return lf(c),f}):"")};return r.preload=()=>n||((n=e()).then(a=>t=()=>a.default),n),r}let O7=0;function p0e(){return Fe.context?Fe.getNextContextId():`cl-${O7++}`}const c4=e=>`Stale read from <${e}>.`;function m0e(e){const t="fallback"in e&&{fallback:()=>e.fallback};return _n(S7(()=>e.each,e.children,t||void 0))}function v0e(e){const t=e.keyed,n=_n(()=>e.when,void 0,void 0),r=t?n:_n(n,void 0,{equals:(a,o)=>!a==!o});return _n(()=>{const a=r();if(a){const o=e.children;return typeof o=="function"&&o.length>0?Ln(()=>o(t?a:()=>{if(!Ln(r))throw c4("Show");return n()})):o}return e.fallback},void 0,void 0)}function g0e(e){const t=a4(()=>e.children),n=_n(()=>{const r=t(),a=Array.isArray(r)?r:[r];let o=()=>{};for(let s=0;sh()?void 0:f.when,void 0,void 0),m=f.keyed?p:_n(p,void 0,{equals:(g,y)=>!g==!y});o=()=>h()||(m()?[c,p,f]:void 0)}return o});return _n(()=>{const r=n()();if(!r)return e.fallback;const[a,o,s]=r,c=s.children;return typeof c=="function"&&c.length>0?Ln(()=>c(s.keyed?o():()=>{if(Ln(n)()?.[0]!==a)throw c4("Match");return o()})):c},void 0,void 0)}function y0e(e){return e}const E7=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],T7=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...E7]),N7=new Set(["innerHTML","textContent","innerText","children"]),C7=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),R7=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function P7(e,t){const n=R7[e];return typeof n=="object"?n[t]?n.$:void 0:n}const M7=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),k7=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","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-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),D7={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},b0e=e=>_n(()=>e());function L7(e,t,n){let r=n.length,a=t.length,o=r,s=0,c=0,f=t[a-1].nextSibling,h=null;for(;sp-c){const S=t[s];for(;c{a=o,t===document?e():K7(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{a(),t.textContent=""}}function x0e(e,t,n,r){let a;const o=()=>{const c=document.createElement("template");return c.innerHTML=e,c.content.firstChild},s=()=>(a||(a=o())).cloneNode(!0);return s.cloneNode=s,s}function I7(e,t=window.document){const n=t[T2]||(t[T2]=new Set);for(let r=0,a=e.length;ra.call(e,n[1],o))}else e.addEventListener(t,n,typeof n!="function"&&n)}function F7(e,t,n={}){const r=Object.keys(t||{}),a=Object.keys(n);let o,s;for(o=0,s=a.length;oa.children=Ef(e,t.children,a.children)),os(()=>typeof t.ref=="function"&&G7(t.ref,e)),os(()=>W7(e,t,n,!0,a,!0)),a}function G7(e,t,n){return Ln(()=>e(t,n))}function K7(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ef(e,t,r,n);os(a=>Ef(e,t(),a,n),r)}function W7(e,t,n,r,a={},o=!1){t||(t={});for(const s in a)if(!(s in t)){if(s==="children")continue;a[s]=C2(e,s,null,a[s],n,o,t)}for(const s in t){if(s==="children")continue;const c=t[s];a[s]=C2(e,s,c,a[s],n,o,t)}}function Y7(e){let t,n;return!Ns()||!(t=Fe.registry.get(n=Q7()))?e():(Fe.completed&&Fe.completed.add(t),Fe.registry.delete(n),t)}function Ns(e){return!!Fe.context&&!Fe.done&&(!e||e.isConnected)}function X7(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function N2(e,t,n){const r=t.trim().split(/\s+/);for(let a=0,o=r.length;a-1&&D7[t.split(":")[0]];g?B7(e,g,t,n):z1(e,C7[t]||t,n)}return n}function Z7(e){if(Fe.registry&&Fe.events&&Fe.events.find(([f,h])=>h===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,a=e.currentTarget,o=f=>Object.defineProperty(e,"target",{configurable:!0,value:f}),s=()=>{const f=t[n];if(f&&!t.disabled){const h=t[`${n}Data`];if(h!==void 0?f.call(t,h,e):f.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},c=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Fe.registry&&!Fe.done&&(Fe.done=_$HY.done=!0),e.composedPath){const f=e.composedPath();o(f[0]);for(let h=0;h{let f=t();for(;typeof f=="function";)f=f();n=Ef(e,f,n,r)}),()=>n;if(Array.isArray(t)){const f=[],h=n&&Array.isArray(n);if(q1(f,t,n,a))return os(()=>n=Ef(e,f,n,r,!0)),()=>n;if(o){if(!f.length)return n;if(r===void 0)return n=[...e.childNodes];let p=f[0];if(p.parentNode!==e)return n;const m=[p];for(;(p=p.nextSibling)!==r;)m.push(p);return n=m}if(f.length===0){if(n=bl(e,n,r),c)return n}else h?n.length===0?R2(e,f,r):L7(e,n,f):(n&&bl(e),R2(e,f));n=f}else if(t.nodeType){if(o&&t.parentNode)return n=c?[t]:t;if(Array.isArray(n)){if(c)return n=bl(e,n,r,t);bl(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function q1(e,t,n,r){let a=!1;for(let o=0,s=t.length;o=0;s--){const c=t[s];if(a!==c){const f=c.parentNode===e;!o&&!s?f?e.replaceChild(a,c):e.insertBefore(a,n):f&&c.remove()}else o=!0}}else e.insertBefore(a,n);return[a]}function Q7(){return Fe.getNextContextId()}const J7="http://www.w3.org/2000/svg";function eG(e,t=!1,n=void 0){return t?document.createElementNS(J7,e):document.createElement(e,{is:n})}function tG(e,t){const n=_n(e);return _n(()=>{const r=n();switch(typeof r){case"function":return Ln(()=>r(t));case"string":const a=k7.has(r),o=Fe.context?Y7():eG(r,a,Ln(()=>t.is));return V7(o,t,a),o}})}function w0e(e){const[,t]=j7(e,["component"]);return tG(()=>e.component,t)}const nG=r4(void 0),rG=r4(void 0),S0e=()=>{const e=m7(rG);if(!e)throw new Error("useDevtoolsOnClose must be used within a TanStackRouterDevtools component");return e};class aG{#t;#n;#r;#a;#i;#l;#c;#u;#o;#e=!1;#s;#f;constructor(t){this.#t=fi(t.router),this.#n=fi(t.routerState),this.#r=t.position??"bottom-left",this.#a=t.initialIsOpen??!1,this.#i=t.shadowDOMTarget,this.#l=t.panelProps,this.#c=t.closeButtonProps,this.#u=t.toggleButtonProps,this.#o=t.containerElement}mount(t){if(this.#e)throw new Error("Devtools is already mounted");const n=$7(()=>{const[r]=this.#t,[a]=this.#n,o=this.#r,s=this.#a,c=this.#i,f=this.#l,h=this.#c,p=this.#u,m=this.#o;let g;return this.#s?g=this.#s:(g=A7(()=>o7(()=>import("./FloatingTanStackRouterDevtools-CXkXeTp3-DxlgenHe.js"),[])),this.#s=g),E2(nG.Provider,{value:c,get children(){return E2(g,{position:o,initialIsOpen:s,router:r,routerState:a,shadowDOMTarget:c,panelProps:f,closeButtonProps:h,toggleButtonProps:p,containerElement:m})}})},t);this.#e=!0,this.#f=n}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#f?.(),this.#e=!1}setRouter(t){this.#t[1](t)}setRouterState(t){this.#n[1](t)}setOptions(t){t.position!==void 0&&(this.#r=t.position),t.initialIsOpen!==void 0&&(this.#a=t.initialIsOpen),t.shadowDOMTarget!==void 0&&(this.#i=t.shadowDOMTarget),t.containerElement!==void 0&&(this.#o=t.containerElement)}}function iG(e){const{initialIsOpen:t,panelProps:n,closeButtonProps:r,toggleButtonProps:a,position:o,containerElement:s,shadowDOMTarget:c,router:f}=e,h=$n({warn:!1}),p=f??h,m=jn({router:p}),g=_.useRef(null),[y]=_.useState(()=>new aG({initialIsOpen:t,panelProps:n,closeButtonProps:r,toggleButtonProps:a,position:o,containerElement:s,shadowDOMTarget:c,router:p,routerState:m}));return _.useEffect(()=>{y.setRouter(p)},[y,p]),_.useEffect(()=>{y.setRouterState(m)},[y,m]),_.useEffect(()=>{y.setOptions({initialIsOpen:t,panelProps:n,closeButtonProps:r,toggleButtonProps:a,position:o,containerElement:s,shadowDOMTarget:c})},[y,t,n,r,a,o,s,c]),_.useEffect(()=>(g.current&&y.mount(g.current),()=>{y.unmount()}),[y]),u.jsx(_.Fragment,{children:u.jsx("div",{ref:g})})}const oG=iG;console.warn("[@tanstack/router-devtools] This package has moved to @tanstack/react-router-devtools. Please switch to the new package at your earliest convenience, as this package will be dropped in the next major version release.");function u4(e,t){return function(){return e.apply(t,arguments)}}const{toString:sG}=Object.prototype,{getPrototypeOf:Yj}=Object,{iterator:gv,toStringTag:f4}=Symbol,yv=(e=>t=>{const n=sG.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pa=e=>(e=e.toLowerCase(),t=>yv(t)===e),bv=e=>t=>typeof t===e,{isArray:Ec}=Array,Wl=bv("undefined");function hd(e){return e!==null&&!Wl(e)&&e.constructor!==null&&!Wl(e.constructor)&&Yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d4=pa("ArrayBuffer");function lG(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&d4(e.buffer),t}const cG=bv("string"),Yn=bv("function"),h4=bv("number"),pd=e=>e!==null&&typeof e=="object",uG=e=>e===!0||e===!1,Mp=e=>{if(yv(e)!=="object")return!1;const t=Yj(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(f4 in e)&&!(gv in e)},fG=e=>{if(!pd(e)||hd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dG=pa("Date"),hG=pa("File"),pG=pa("Blob"),mG=pa("FileList"),vG=e=>pd(e)&&Yn(e.pipe),gG=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yn(e.append)&&((t=yv(e))==="formdata"||t==="object"&&Yn(e.toString)&&e.toString()==="[object FormData]"))},yG=pa("URLSearchParams"),[bG,xG,wG,SG]=["ReadableStream","Request","Response","Headers"].map(pa),_G=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function md(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Ec(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Qo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,m4=e=>!Wl(e)&&e!==Qo;function U1(){const{caseless:e,skipUndefined:t}=m4(this)&&this||{},n={},r=(a,o)=>{const s=e&&p4(n,o)||o;Mp(n[s])&&Mp(a)?n[s]=U1(n[s],a):Mp(a)?n[s]=U1({},a):Ec(a)?n[s]=a.slice():(!t||!Wl(a))&&(n[s]=a)};for(let a=0,o=arguments.length;a(md(t,(a,o)=>{n&&Yn(a)?e[o]=u4(a,n):e[o]=a},{allOwnKeys:r}),e),AG=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),OG=(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)},EG=(e,t,n,r)=>{let a,o,s;const c={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&Yj(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},TG=(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},NG=e=>{if(!e)return null;if(Ec(e))return e;let t=e.length;if(!h4(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},CG=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Yj(Uint8Array)),RG=(e,t)=>{const r=(e&&e[gv]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},PG=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},MG=pa("HTMLFormElement"),kG=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),P2=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),DG=pa("RegExp"),v4=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};md(n,(a,o)=>{let s;(s=t(a,o,e))!==!1&&(r[o]=s||a)}),Object.defineProperties(e,r)},LG=e=>{v4(e,(t,n)=>{if(Yn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Yn(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+"'")})}})},$G=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return Ec(e)?r(e):r(String(e).split(t)),n},IG=()=>{},BG=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function zG(e){return!!(e&&Yn(e.append)&&e[f4]==="FormData"&&e[gv])}const qG=e=>{const t=new Array(10),n=(r,a)=>{if(pd(r)){if(t.indexOf(r)>=0)return;if(hd(r))return r;if(!("toJSON"in r)){t[a]=r;const o=Ec(r)?[]:{};return md(r,(s,c)=>{const f=n(s,a+1);!Wl(f)&&(o[c]=f)}),t[a]=void 0,o}}return r};return n(e,0)},UG=pa("AsyncFunction"),FG=e=>e&&(pd(e)||Yn(e))&&Yn(e.then)&&Yn(e.catch),g4=((e,t)=>e?setImmediate:t?((n,r)=>(Qo.addEventListener("message",({source:a,data:o})=>{a===Qo&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Qo.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Yn(Qo.postMessage)),HG=typeof queueMicrotask<"u"?queueMicrotask.bind(Qo):typeof process<"u"&&process.nextTick||g4,VG=e=>e!=null&&Yn(e[gv]),ce={isArray:Ec,isArrayBuffer:d4,isBuffer:hd,isFormData:gG,isArrayBufferView:lG,isString:cG,isNumber:h4,isBoolean:uG,isObject:pd,isPlainObject:Mp,isEmptyObject:fG,isReadableStream:bG,isRequest:xG,isResponse:wG,isHeaders:SG,isUndefined:Wl,isDate:dG,isFile:hG,isBlob:pG,isRegExp:DG,isFunction:Yn,isStream:vG,isURLSearchParams:yG,isTypedArray:CG,isFileList:mG,forEach:md,merge:U1,extend:jG,trim:_G,stripBOM:AG,inherits:OG,toFlatObject:EG,kindOf:yv,kindOfTest:pa,endsWith:TG,toArray:NG,forEachEntry:RG,matchAll:PG,isHTMLForm:MG,hasOwnProperty:P2,hasOwnProp:P2,reduceDescriptors:v4,freezeMethods:LG,toObjectSet:$G,toCamelCase:kG,noop:IG,toFiniteNumber:BG,findKey:p4,global:Qo,isContextDefined:m4,isSpecCompliantForm:zG,toJSONObject:qG,isAsyncFn:UG,isThenable:FG,setImmediate:g4,asap:HG,isIterable:VG};function He(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)}ce.inherits(He,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:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const y4=He.prototype,b4={};["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=>{b4[e]={value:e}});Object.defineProperties(He,b4);Object.defineProperty(y4,"isAxiosError",{value:!0});He.from=(e,t,n,r,a,o)=>{const s=Object.create(y4);ce.toFlatObject(e,s,function(p){return p!==Error.prototype},h=>h!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return He.call(s,c,f,n,r,a),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};const GG=null;function F1(e){return ce.isPlainObject(e)||ce.isArray(e)}function x4(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function M2(e,t,n){return e?e.concat(t).map(function(a,o){return a=x4(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function KG(e){return ce.isArray(e)&&!e.some(F1)}const WG=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function xv(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,w){return!ce.isUndefined(w[x])});const r=n.metaTokens,a=n.visitor||p,o=n.dots,s=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(a))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(ce.isDate(S))return S.toISOString();if(ce.isBoolean(S))return S.toString();if(!f&&ce.isBlob(S))throw new He("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(S)||ce.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function p(S,x,w){let A=S;if(S&&!w&&typeof S=="object"){if(ce.endsWith(x,"{}"))x=r?x:x.slice(0,-2),S=JSON.stringify(S);else if(ce.isArray(S)&&KG(S)||(ce.isFileList(S)||ce.endsWith(x,"[]"))&&(A=ce.toArray(S)))return x=x4(x),A.forEach(function(E,N){!(ce.isUndefined(E)||E===null)&&t.append(s===!0?M2([x],N,o):s===null?x:x+"[]",h(E))}),!1}return F1(S)?!0:(t.append(M2(w,x,o),h(S)),!1)}const m=[],g=Object.assign(WG,{defaultVisitor:p,convertValue:h,isVisitable:F1});function y(S,x){if(!ce.isUndefined(S)){if(m.indexOf(S)!==-1)throw Error("Circular reference detected in "+x.join("."));m.push(S),ce.forEach(S,function(A,O){(!(ce.isUndefined(A)||A===null)&&a.call(t,A,ce.isString(O)?O.trim():O,x,g))===!0&&y(A,x?x.concat(O):[O])}),m.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return y(e),t}function k2(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Xj(e,t){this._pairs=[],e&&xv(e,this,t)}const w4=Xj.prototype;w4.append=function(t,n){this._pairs.push([t,n])};w4.toString=function(t){const n=t?function(r){return t.call(this,r,k2)}:k2;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function YG(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function S4(e,t,n){if(!t)return e;const r=n&&n.encode||YG;ce.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(a?o=a(t,n):o=ce.isURLSearchParams(t)?t.toString():new Xj(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class D2{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){ce.forEach(this.handlers,function(r){r!==null&&t(r)})}}const _4={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},XG=typeof URLSearchParams<"u"?URLSearchParams:Xj,ZG=typeof FormData<"u"?FormData:null,QG=typeof Blob<"u"?Blob:null,JG={isBrowser:!0,classes:{URLSearchParams:XG,FormData:ZG,Blob:QG},protocols:["http","https","file","blob","url","data"]},Zj=typeof window<"u"&&typeof document<"u",H1=typeof navigator=="object"&&navigator||void 0,eK=Zj&&(!H1||["ReactNative","NativeScript","NS"].indexOf(H1.product)<0),tK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",nK=Zj&&window.location.href||"http://localhost",rK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zj,hasStandardBrowserEnv:eK,hasStandardBrowserWebWorkerEnv:tK,navigator:H1,origin:nK},Symbol.toStringTag,{value:"Module"})),Sn={...rK,...JG};function aK(e,t){return xv(e,new Sn.classes.URLSearchParams,{visitor:function(n,r,a,o){return Sn.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function iK(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function oK(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r=n.length;return s=!s&&ce.isArray(a)?a.length:s,f?(ce.hasOwnProp(a,s)?a[s]=[a[s],r]:a[s]=r,!c):((!a[s]||!ce.isObject(a[s]))&&(a[s]=[]),t(n,r,a[s],o)&&ce.isArray(a[s])&&(a[s]=oK(a[s])),!c)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,a)=>{t(iK(r),a,n,0)}),n}return null}function sK(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const vd={transitional:_4,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=ce.isObject(t);if(o&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return a?JSON.stringify(j4(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return aK(t,this.formSerializer).toString();if((c=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return xv(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),sK(t)):t}],transformResponse:[function(t){const n=this.transitional||vd.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||a)){const s=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(c){if(s)throw c.name==="SyntaxError"?He.from(c,He.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sn.classes.FormData,Blob:Sn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{vd.headers[e]={}});const lK=ce.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"]),cK=e=>{const t={};let n,r,a;return e&&e.split(` `).forEach(function(s){a=s.indexOf(":"),n=s.substring(0,a).trim().toLowerCase(),r=s.substring(a+1).trim(),!(!n||t[n]&&lK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},L2=Symbol("internals");function Gu(e){return e&&String(e).trim().toLowerCase()}function kp(e){return e===!1||e==null?e:ce.isArray(e)?e.map(kp):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 fK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function cx(e,t,n,r,a){if(ce.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function dK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function hK(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,o,s){return this[r].call(this,t,a,o,s)},configurable:!0})})}let Xn=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(c,f,h){const p=Gu(f);if(!p)throw new Error("header name must be a non-empty string");const m=ce.findKey(a,p);(!m||a[m]===void 0||h===!0||h===void 0&&a[m]!==!1)&&(a[m||f]=kp(c))}const s=(c,f)=>ce.forEach(c,(h,p)=>o(h,p,f));if(ce.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(ce.isString(t)&&(t=t.trim())&&!fK(t))s(cK(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let c={},f,h;for(const p of t){if(!ce.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[h=p[0]]=(f=c[h])?ce.isArray(f)?[...f,p[1]]:[f,p[1]]:p[1]}s(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Gu(t),t){const r=ce.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return uK(a);if(ce.isFunction(n))return n.call(this,a,r);if(ce.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Gu(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||cx(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(s){if(s=Gu(s),s){const c=ce.findKey(r,s);c&&(!n||cx(r,r[c],c,n))&&(delete r[c],a=!0)}}return ce.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||cx(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return ce.forEach(this,(a,o)=>{const s=ce.findKey(r,o);if(s){n[s]=kp(a),delete n[o];return}const c=t?dK(o):String(o).trim();c!==o&&delete n[o],n[c]=kp(a),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&ce.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[L2]=this[L2]={accessors:{}}).accessors,a=this.prototype;function o(s){const c=Gu(s);r[c]||(hK(a,s),r[c]=!0)}return ce.isArray(t)?t.forEach(o):o(t),this}};Xn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(Xn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(Xn);function ux(e,t){const n=this||vd,r=t||n,a=Xn.from(r.headers);let o=r.data;return ce.forEach(e,function(c){o=c.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function A4(e){return!!(e&&e.__CANCEL__)}function Tc(e,t,n){He.call(this,e??"canceled",He.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Tc,He,{__CANCEL__:!0});function O4(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new He("Request failed with status code "+n.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,s;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),p=r[o];s||(s=h),n[a]=f,r[a]=h;let m=o,g=0;for(;m!==a;)g+=n[m++],m=m%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),h-s{n=p,a=null,o&&(clearTimeout(o),o=null),e(...h)};return[(...h)=>{const p=Date.now(),m=p-n;m>=r?s(h,p):(a=h,o||(o=setTimeout(()=>{o=null,s(a)},r-m)))},()=>a&&s(a)]}const tm=(e,t,n=3)=>{let r=0;const a=mK(50,250);return vK(o=>{const s=o.loaded,c=o.lengthComputable?o.total:void 0,f=s-r,h=a(f),p=s<=c;r=s;const m={loaded:s,total:c,progress:c?s/c:void 0,bytes:f,rate:h||void 0,estimated:h&&c&&p?(c-s)/h:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},$2=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},I2=e=>(...t)=>ce.asap(()=>e(...t)),gK=Sn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Sn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Sn.origin),Sn.navigator&&/(msie|trident)/i.test(Sn.navigator.userAgent)):()=>!0,yK=Sn.hasStandardBrowserEnv?{write(e,t,n,r,a,o,s){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),ce.isString(r)&&c.push(`path=${r}`),ce.isString(a)&&c.push(`domain=${a}`),o===!0&&c.push("secure"),ce.isString(s)&&c.push(`SameSite=${s}`),document.cookie=c.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 bK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function E4(e,t,n){let r=!bK(t);return e&&(r||n==!1)?xK(e,t):t}const B2=e=>e instanceof Xn?{...e}:e;function hs(e,t){t=t||{};const n={};function r(h,p,m,g){return ce.isPlainObject(h)&&ce.isPlainObject(p)?ce.merge.call({caseless:g},h,p):ce.isPlainObject(p)?ce.merge({},p):ce.isArray(p)?p.slice():p}function a(h,p,m,g){if(ce.isUndefined(p)){if(!ce.isUndefined(h))return r(void 0,h,m,g)}else return r(h,p,m,g)}function o(h,p){if(!ce.isUndefined(p))return r(void 0,p)}function s(h,p){if(ce.isUndefined(p)){if(!ce.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}function c(h,p,m){if(m in t)return r(h,p);if(m in e)return r(void 0,h)}const f={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(h,p,m)=>a(B2(h),B2(p),m,!0)};return ce.forEach(Object.keys({...e,...t}),function(p){const m=f[p]||a,g=m(e[p],t[p],p);ce.isUndefined(g)&&m!==c||(n[p]=g)}),n}const T4=e=>{const t=hs({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:s,auth:c}=t;if(t.headers=s=Xn.from(s),t.url=S4(E4(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ce.isFormData(n)){if(Sn.hasStandardBrowserEnv||Sn.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(ce.isFunction(n.getHeaders)){const f=n.getHeaders(),h=["content-type","content-length"];Object.entries(f).forEach(([p,m])=>{h.includes(p.toLowerCase())&&s.set(p,m)})}}if(Sn.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&gK(t.url))){const f=a&&o&&yK.read(o);f&&s.set(a,f)}return t},wK=typeof XMLHttpRequest<"u",SK=wK&&function(e){return new Promise(function(n,r){const a=T4(e);let o=a.data;const s=Xn.from(a.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:h}=a,p,m,g,y,S;function x(){y&&y(),S&&S(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function A(){if(!w)return;const E=Xn.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),T={data:!c||c==="text"||c==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:e,request:w};O4(function(R){n(R),x()},function(R){r(R),x()},T),w=null}"onloadend"in w?w.onloadend=A:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(A)},w.onabort=function(){w&&(r(new He("Request aborted",He.ECONNABORTED,e,w)),w=null)},w.onerror=function(N){const T=N&&N.message?N.message:"Network Error",C=new He(T,He.ERR_NETWORK,e,w);C.event=N||null,r(C),w=null},w.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const T=a.transitional||_4;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),r(new He(N,T.clarifyTimeoutError?He.ETIMEDOUT:He.ECONNABORTED,e,w)),w=null},o===void 0&&s.setContentType(null),"setRequestHeader"in w&&ce.forEach(s.toJSON(),function(N,T){w.setRequestHeader(T,N)}),ce.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),c&&c!=="json"&&(w.responseType=a.responseType),h&&([g,S]=tm(h,!0),w.addEventListener("progress",g)),f&&w.upload&&([m,y]=tm(f),w.upload.addEventListener("progress",m),w.upload.addEventListener("loadend",y)),(a.cancelToken||a.signal)&&(p=E=>{w&&(r(!E||E.type?new Tc(null,e,w):E),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const O=pK(a.url);if(O&&Sn.protocols.indexOf(O)===-1){r(new He("Unsupported protocol "+O+":",He.ERR_BAD_REQUEST,e));return}w.send(o||null)})},_K=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(h){if(!a){a=!0,c();const p=h instanceof Error?h:this.reason;r.abort(p instanceof He?p:new Tc(p instanceof Error?p.message:p))}};let s=t&&setTimeout(()=>{s=null,o(new He(`timeout ${t} of ms exceeded`,He.ETIMEDOUT))},t);const c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),e=null)};e.forEach(h=>h.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>ce.asap(c),f}},jK=function*(e,t){let n=e.byteLength;if(n{const a=AK(e,t);let o=0,s,c=f=>{s||(s=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:h,value:p}=await a.next();if(h){c(),f.close();return}let m=p.byteLength;if(n){let g=o+=m;n(g)}f.enqueue(new Uint8Array(p))}catch(h){throw c(h),h}},cancel(f){return c(f),a.return()}},{highWaterMark:2})},q2=64*1024,{isFunction:op}=ce,EK=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:U2,TextEncoder:F2}=ce.global,H2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},TK=e=>{e=ce.merge.call({skipUndefined:!0},EK,e);const{fetch:t,Request:n,Response:r}=e,a=t?op(t):typeof fetch=="function",o=op(n),s=op(r);if(!a)return!1;const c=a&&op(U2),f=a&&(typeof F2=="function"?(S=>x=>S.encode(x))(new F2):async S=>new Uint8Array(await new n(S).arrayBuffer())),h=o&&c&&H2(()=>{let S=!1;const x=new n(Sn.origin,{body:new U2,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!x}),p=s&&c&&H2(()=>ce.isReadableStream(new r("").body)),m={stream:p&&(S=>S.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!m[S]&&(m[S]=(x,w)=>{let A=x&&x[S];if(A)return A.call(x);throw new He(`Response type '${S}' is not supported`,He.ERR_NOT_SUPPORT,w)})});const g=async S=>{if(S==null)return 0;if(ce.isBlob(S))return S.size;if(ce.isSpecCompliantForm(S))return(await new n(Sn.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(S)||ce.isArrayBuffer(S))return S.byteLength;if(ce.isURLSearchParams(S)&&(S=S+""),ce.isString(S))return(await f(S)).byteLength},y=async(S,x)=>{const w=ce.toFiniteNumber(S.getContentLength());return w??g(x)};return async S=>{let{url:x,method:w,data:A,signal:O,cancelToken:E,timeout:N,onDownloadProgress:T,onUploadProgress:C,responseType:R,headers:M,withCredentials:k="same-origin",fetchOptions:z}=T4(S),L=t||fetch;R=R?(R+"").toLowerCase():"text";let B=_K([O,E&&E.toAbortSignal()],N),F=null;const U=B&&B.unsubscribe&&(()=>{B.unsubscribe()});let W;try{if(C&&h&&w!=="get"&&w!=="head"&&(W=await y(M,A))!==0){let I=new n(x,{method:"POST",body:A,duplex:"half"}),q;if(ce.isFormData(A)&&(q=I.headers.get("content-type"))&&M.setContentType(q),I.body){const[X,te]=$2(W,tm(I2(C)));A=z2(I.body,q2,X,te)}}ce.isString(k)||(k=k?"include":"omit");const $=o&&"credentials"in n.prototype,V={...z,signal:B,method:w.toUpperCase(),headers:M.normalize().toJSON(),body:A,duplex:"half",credentials:$?k:void 0};F=o&&new n(x,V);let H=await(o?L(F,z):L(x,V));const ne=p&&(R==="stream"||R==="response");if(p&&(T||ne&&U)){const I={};["status","statusText","headers"].forEach(se=>{I[se]=H[se]});const q=ce.toFiniteNumber(H.headers.get("content-length")),[X,te]=T&&$2(q,tm(I2(T),!0))||[];H=new r(z2(H.body,q2,X,()=>{te&&te(),U&&U()}),I)}R=R||"text";let ee=await m[ce.findKey(m,R)||"text"](H,S);return!ne&&U&&U(),await new Promise((I,q)=>{O4(I,q,{data:ee,headers:Xn.from(H.headers),status:H.status,statusText:H.statusText,config:S,request:F})})}catch($){throw U&&U(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new He("Network Error",He.ERR_NETWORK,S,F),{cause:$.cause||$}):He.from($,$&&$.code,S,F)}}},NK=new Map,N4=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let s=o.length,c=s,f,h,p=NK;for(;c--;)f=o[c],h=p.get(f),h===void 0&&p.set(f,h=c?new Map:TK(t)),p=h;return h};N4();const Qj={http:GG,xhr:SK,fetch:{get:N4}};ce.forEach(Qj,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const V2=e=>`- ${e}`,CK=e=>ce.isFunction(e)||e===null||e===!1;function RK(e,t){e=ce.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let s=0;s`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=n?s.length>1?`since : `+s.map(V2).join(` `):" "+V2(s[0]):"as no adapter specified";throw new He("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a}const C4={getAdapter:RK,adapters:Qj};function fx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tc(null,e)}function G2(e){return fx(e),e.headers=Xn.from(e.headers),e.data=ux.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),C4.getAdapter(e.adapter||vd.adapter,e)(e).then(function(r){return fx(e),r.data=ux.call(e,e.transformResponse,r),r.headers=Xn.from(r.headers),r},function(r){return A4(r)||(fx(e),r&&r.response&&(r.response.data=ux.call(e,e.transformResponse,r.response),r.response.headers=Xn.from(r.response.headers))),Promise.reject(r)})}const R4="1.13.2",wv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wv[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const K2={};wv.transitional=function(t,n,r){function a(o,s){return"[Axios v"+R4+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,c)=>{if(t===!1)throw new He(a(s," has been removed"+(n?" in "+n:"")),He.ERR_DEPRECATED);return n&&!K2[s]&&(K2[s]=!0,console.warn(a(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,c):!0}};wv.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function PK(e,t,n){if(typeof e!="object")throw new He("options must be an object",He.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],s=t[o];if(s){const c=e[o],f=c===void 0||s(c,o,e);if(f!==!0)throw new He("option "+o+" must be "+f,He.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new He("Unknown option "+o,He.ERR_BAD_OPTION)}}const Dp={assertOptions:PK,validators:wv},wa=Dp.validators;let ss=class{constructor(t){this.defaults=t||{},this.interceptors={request:new D2,response:new D2}}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=hs(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&Dp.assertOptions(r,{silentJSONParsing:wa.transitional(wa.boolean),forcedJSONParsing:wa.transitional(wa.boolean),clarifyTimeoutError:wa.transitional(wa.boolean)},!1),a!=null&&(ce.isFunction(a)?n.paramsSerializer={serialize:a}:Dp.assertOptions(a,{encode:wa.function,serialize:wa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Dp.assertOptions(n,{baseUrl:wa.spelling("baseURL"),withXsrfToken:wa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&ce.merge(o.common,o[n.method]);o&&ce.forEach(["delete","get","head","post","put","patch","common"],S=>{delete o[S]}),n.headers=Xn.concat(s,o);const c=[];let f=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(f=f&&x.synchronous,c.unshift(x.fulfilled,x.rejected))});const h=[];this.interceptors.response.forEach(function(x){h.push(x.fulfilled,x.rejected)});let p,m=0,g;if(!f){const S=[G2.bind(this),void 0];for(S.unshift(...c),S.push(...h),g=S.length,p=Promise.resolve(n);m{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 s=new Promise(c=>{r.subscribe(c),o=c}).then(a);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,c){r.reason||(r.reason=new Tc(o,s,c),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 P4(function(a){t=a}),cancel:t}}};function kK(e){return function(n){return e.apply(null,n)}}function DK(e){return ce.isObject(e)&&e.isAxiosError===!0}const V1={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(V1).forEach(([e,t])=>{V1[t]=e});function M4(e){const t=new ss(e),n=u4(ss.prototype.request,t);return ce.extend(n,ss.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return M4(hs(e,a))},n}const $t=M4(vd);$t.Axios=ss;$t.CanceledError=Tc;$t.CancelToken=MK;$t.isCancel=A4;$t.VERSION=R4;$t.toFormData=xv;$t.AxiosError=He;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=kK;$t.isAxiosError=DK;$t.mergeConfig=hs;$t.AxiosHeaders=Xn;$t.formToJSON=e=>j4(ce.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=C4.getAdapter;$t.HttpStatusCode=V1;$t.default=$t;const{Axios:A0e,AxiosError:O0e,CanceledError:E0e,isCancel:T0e,CancelToken:N0e,VERSION:C0e,all:R0e,Cancel:P0e,isAxiosError:M0e,spread:k0e,toFormData:D0e,AxiosHeaders:L0e,HttpStatusCode:$0e,formToJSON:I0e,getAdapter:B0e,mergeConfig:z0e}=$t;function k4(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}),D4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),nm="-",W2=[],IK="arbitrary..",BK=e=>{const t=qK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return zK(s);const c=s.split(nm),f=c[0]===""&&c.length>1?1:0;return L4(c,f,t)},getConflictingClassGroupIds:(s,c)=>{if(c){const f=r[s],h=n[s];return f?h?LK(h,f):f:h||W2}return n[s]||W2}}},L4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const h=L4(e,t+1,o);if(h)return h}const s=n.validators;if(s===null)return;const c=t===0?e.join(nm):e.slice(t).join(nm),f=s.length;for(let h=0;he.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?IK+r:void 0})(),qK=e=>{const{theme:t,classGroups:n}=e;return UK(n,t)},UK=(e,t)=>{const n=D4();for(const r in e){const a=e[r];Jj(a,n,r,t)}return n},Jj=(e,t,n,r)=>{const a=e.length;for(let o=0;o{if(typeof e=="string"){HK(e,t,n);return}if(typeof e=="function"){VK(e,t,n,r);return}GK(e,t,n,r)},HK=(e,t,n)=>{const r=e===""?t:$4(t,e);r.classGroupId=n},VK=(e,t,n,r)=>{if(KK(e)){Jj(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($K(n,e))},GK=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let s=0;s{let n=e;const r=t.split(nm),a=r.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,WK=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,s)=>{n[o]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=r[o])!==void 0)return a(o,s),s},set(o,s){o in n?n[o]=s:a(o,s)}}},G1="!",Y2=":",YK=[],X2=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),XK=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let s=0,c=0,f=0,h;const p=a.length;for(let x=0;xf?h-f:void 0;return X2(o,y,g,S)};if(t){const a=t+Y2,o=r;r=s=>s.startsWith(a)?o(s.slice(a.length)):X2(YK,!1,s,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},ZK=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(s)):a.push(s)}return a.length>0&&(a.sort(),r.push(...a)),r}},QK=e=>({cache:WK(e.cacheSize),parseClassName:XK(e),sortModifiers:ZK(e),...BK(e)}),JK=/\s+/,eW=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,s=[],c=e.trim().split(JK);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:m,modifiers:g,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:x}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let w=!!x,A=r(w?S.substring(0,x):S);if(!A){if(!w){f=p+(f.length>0?" "+f:f);continue}if(A=r(S),!A){f=p+(f.length>0?" "+f:f);continue}w=!1}const O=g.length===0?"":g.length===1?g[0]:o(g).join(":"),E=y?O+G1:O,N=E+A;if(s.indexOf(N)>-1)continue;s.push(N);const T=a(A,w);for(let C=0;C0?" "+f:f)}return f},tW=(...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 s=f=>{const h=t.reduce((p,m)=>m(p),e());return n=QK(h),r=n.cache.get,a=n.cache.set,o=c,c(f)},c=f=>{const h=r(f);if(h)return h;const p=eW(f,n);return a(f,p),p};return o=s,(...f)=>o(tW(...f))},rW=[],Vt=e=>{const t=n=>n[e]||rW;return t.isThemeGetter=!0,t},B4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,z4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aW=/^\d+\/\d+$/,iW=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oW=/\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$/,sW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cW=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xl=e=>aW.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),ro=e=>!!e&&Number.isInteger(Number(e)),dx=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),oi=e=>iW.test(e),uW=()=>!0,fW=e=>oW.test(e)&&!sW.test(e),q4=()=>!1,dW=e=>lW.test(e),hW=e=>cW.test(e),pW=e=>!Ae(e)&&!Oe(e),mW=e=>Nc(e,H4,q4),Ae=e=>B4.test(e),Vo=e=>Nc(e,V4,fW),hx=e=>Nc(e,xW,Ke),Z2=e=>Nc(e,U4,q4),vW=e=>Nc(e,F4,hW),sp=e=>Nc(e,G4,dW),Oe=e=>z4.test(e),Ku=e=>Cc(e,V4),gW=e=>Cc(e,wW),Q2=e=>Cc(e,U4),yW=e=>Cc(e,H4),bW=e=>Cc(e,F4),lp=e=>Cc(e,G4,!0),Nc=(e,t,n)=>{const r=B4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Cc=(e,t,n=!1)=>{const r=z4.exec(e);return r?r[1]?t(r[1]):n:!1},U4=e=>e==="position"||e==="percentage",F4=e=>e==="image"||e==="url",H4=e=>e==="length"||e==="size"||e==="bg-size",V4=e=>e==="length",xW=e=>e==="number",wW=e=>e==="family-name",G4=e=>e==="shadow",SW=()=>{const e=Vt("color"),t=Vt("font"),n=Vt("text"),r=Vt("font-weight"),a=Vt("tracking"),o=Vt("leading"),s=Vt("breakpoint"),c=Vt("container"),f=Vt("spacing"),h=Vt("radius"),p=Vt("shadow"),m=Vt("inset-shadow"),g=Vt("text-shadow"),y=Vt("drop-shadow"),S=Vt("blur"),x=Vt("perspective"),w=Vt("aspect"),A=Vt("ease"),O=Vt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...N(),Oe,Ae],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],M=()=>[Oe,Ae,f],k=()=>[xl,"full","auto",...M()],z=()=>[ro,"none","subgrid",Oe,Ae],L=()=>["auto",{span:["full",ro,Oe,Ae]},ro,Oe,Ae],B=()=>[ro,"auto",Oe,Ae],F=()=>["auto","min","max","fr",Oe,Ae],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...M()],V=()=>[xl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],H=()=>[e,Oe,Ae],ne=()=>[...N(),Q2,Z2,{position:[Oe,Ae]}],ee=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",yW,mW,{size:[Oe,Ae]}],q=()=>[dx,Ku,Vo],X=()=>["","none","full",h,Oe,Ae],te=()=>["",Ke,Ku,Vo],se=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[Ke,dx,Q2,Z2],ge=()=>["","none",S,Oe,Ae],re=()=>["none",Ke,Oe,Ae],pe=()=>["none",Ke,Oe,Ae],ye=()=>[Ke,Oe,Ae],le=()=>[xl,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oi],breakpoint:[oi],color:[uW],container:[oi],"drop-shadow":[oi],ease:["in","out","in-out"],font:[pW],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oi],shadow:[oi],spacing:["px",Ke],text:[oi],"text-shadow":[oi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xl,Ae,Oe,w]}],container:["container"],columns:[{columns:[Ke,Ae,Oe,c]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:T()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[ro,"auto",Oe,Ae]}],basis:[{basis:[xl,"full","auto",c,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,xl,"auto","initial","none",Ae]}],grow:[{grow:["",Ke,Oe,Ae]}],shrink:[{shrink:["",Ke,Oe,Ae]}],order:[{order:[ro,"first","last","none",Oe,Ae]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],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:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[c,"screen",...V()]}],"min-w":[{"min-w":[c,"screen","none",...V()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[s]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Ku,Vo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Oe,hx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dx,Ae]}],"font-family":[{font:[gW,Ae,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,Oe,Ae]}],"line-clamp":[{"line-clamp":[Ke,"none",Oe,hx]}],leading:[{leading:[o,...M()]}],"list-image":[{"list-image":["none",Oe,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Oe,Vo]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Ke,"auto",Oe,Ae]}],"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",Oe,Ae]}],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",Oe,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ro,Oe,Ae],radial:["",Oe,Ae],conic:[ro,Oe,Ae]},bW,vW]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Oe,Ae]}],"outline-w":[{outline:["",Ke,Ku,Vo]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,lp,sp]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",m,lp,sp]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Ke,Vo]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,lp,sp]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Ke,Oe,Ae]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Oe,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":N()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,Ae]}],filter:[{filter:["","none",Oe,Ae]}],blur:[{blur:ge()}],brightness:[{brightness:[Ke,Oe,Ae]}],contrast:[{contrast:[Ke,Oe,Ae]}],"drop-shadow":[{"drop-shadow":["","none",y,lp,sp]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Ke,Oe,Ae]}],"hue-rotate":[{"hue-rotate":[Ke,Oe,Ae]}],invert:[{invert:["",Ke,Oe,Ae]}],saturate:[{saturate:[Ke,Oe,Ae]}],sepia:[{sepia:["",Ke,Oe,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,Ae]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Oe,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Oe,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Oe,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Oe,Ae]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Oe,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Oe,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Oe,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Oe,Ae]}],"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",Oe,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Oe,Ae]}],ease:[{ease:["linear","initial",A,Oe,Ae]}],delay:[{delay:[Ke,Oe,Ae]}],animate:[{animate:["none",O,Oe,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Oe,Ae]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Oe,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"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:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Oe,Ae]}],"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",Oe,Ae]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Ke,Ku,Vo,hx]}],stroke:[{stroke:["none",...H()]}],"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"]}},_W=nW(SW);function we(...e){return _W(qe(e))}const mn=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:we("rounded-xl border bg-card text-card-foreground shadow",e),...t}));mn.displayName="Card";const vn=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:we("flex flex-col space-y-1.5 p-6",e),...t}));vn.displayName="CardHeader";const gn=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:we("font-semibold leading-none tracking-tight",e),...t}));gn.displayName="CardTitle";const li=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:we("text-sm text-muted-foreground",e),...t}));li.displayName="CardDescription";const yn=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:we("p-6 pt-0",e),...t}));yn.displayName="CardContent";const jW=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:we("flex items-center p-6 pt-0",e),...t}));jW.displayName="CardFooter";function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function AW(e,t){const n=_.createContext(t),r=o=>{const{children:s,...c}=o,f=_.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:f,children:s})};r.displayName=e+"Provider";function a(o){const s=_.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function Zr(e,t=[]){let n=[];function r(o,s){const c=_.createContext(s),f=n.length;n=[...n,s];const h=m=>{const{scope:g,children:y,...S}=m,x=g?.[e]?.[f]||c,w=_.useMemo(()=>S,Object.values(S));return u.jsx(x.Provider,{value:w,children:y})};h.displayName=o+"Provider";function p(m,g){const y=g?.[e]?.[f]||c,S=_.useContext(y);if(S)return S;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,p]}const a=()=>{const o=n.map(s=>_.createContext(s));return function(c){const f=c?.[e]||o;return _.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return a.scopeName=e,[r,OW(a,...t)]}function OW(...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 s=r.reduce((c,{useScope:f,scopeName:h})=>{const m=f(o)[`__scope${h}`];return{...c,...m}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function J2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yr(...e){return t=>{let n=!1;const r=e.map(a=>{const o=J2(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{const{children:o,...s}=r,c=_.Children.toArray(o),f=c.find(NW);if(f){const h=f.props.children,p=c.map(m=>m===f?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:m);return u.jsx(t,{...s,ref:a,children:_.isValidElement(h)?_.cloneElement(h,void 0,p):null})}return u.jsx(t,{...s,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function EW(e){const t=_.forwardRef((n,r)=>{const{children:a,...o}=n;if(_.isValidElement(a)){const s=RW(a),c=CW(o,a.props);return a.type!==_.Fragment&&(c.ref=r?Yr(r,s):s),_.cloneElement(a,c)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TW=Symbol("radix.slottable");function NW(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TW}function CW(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]=(...c)=>{const f=o(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function RW(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 Sv(e){const t=e+"CollectionProvider",[n,r]=Zr(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=x=>{const{scope:w,children:A}=x,O=K.useRef(null),E=K.useRef(new Map).current;return u.jsx(a,{scope:w,itemMap:E,collectionRef:O,children:A})};s.displayName=t;const c=e+"CollectionSlot",f=eR(c),h=K.forwardRef((x,w)=>{const{scope:A,children:O}=x,E=o(c,A),N=Ve(w,E.collectionRef);return u.jsx(f,{ref:N,children:O})});h.displayName=c;const p=e+"CollectionItemSlot",m="data-radix-collection-item",g=eR(p),y=K.forwardRef((x,w)=>{const{scope:A,children:O,...E}=x,N=K.useRef(null),T=Ve(w,N),C=o(p,A);return K.useEffect(()=>(C.itemMap.set(N,{ref:N,...E}),()=>void C.itemMap.delete(N))),u.jsx(g,{[m]:"",ref:T,children:O})});y.displayName=p;function S(x){const w=o(e+"CollectionConsumer",x);return K.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const E=Array.from(O.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((C,R)=>E.indexOf(C.ref.current)-E.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},S,r]}var nn=globalThis?.document?_.useLayoutEffect:()=>{},PW=$j[" useId ".trim().toString()]||(()=>{}),MW=0;function kn(e){const[t,n]=_.useState(PW());return nn(()=>{n(r=>r??String(MW++))},[e]),t?`radix-${t}`:""}function kW(e){const t=DW(e),n=_.forwardRef((r,a)=>{const{children:o,...s}=r,c=_.Children.toArray(o),f=c.find($W);if(f){const h=f.props.children,p=c.map(m=>m===f?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:m);return u.jsx(t,{...s,ref:a,children:_.isValidElement(h)?_.cloneElement(h,void 0,p):null})}return u.jsx(t,{...s,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function DW(e){const t=_.forwardRef((n,r)=>{const{children:a,...o}=n;if(_.isValidElement(a)){const s=BW(a),c=IW(o,a.props);return a.type!==_.Fragment&&(c.ref=r?Yr(r,s):s),_.cloneElement(a,c)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LW=Symbol("radix.slottable");function $W(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LW}function IW(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]=(...c)=>{const f=o(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function BW(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 zW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Me=zW.reduce((e,t)=>{const n=kW(`Primitive.${t}`),r=_.forwardRef((a,o)=>{const{asChild:s,...c}=a,f=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function K4(e,t){e&&Ts.flushSync(()=>e.dispatchEvent(t))}function Wt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}var qW=$j[" useInsertionEffect ".trim().toString()]||nn;function xi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,s]=UW({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:a;{const p=_.useRef(e!==void 0);_.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"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.`),p.current=c},[c,r])}const h=_.useCallback(p=>{if(c){const m=FW(p)?p(e):p;m!==e&&s.current?.(m)}else o(p)},[c,e,o,s]);return[f,h]}function UW({defaultProp:e,onChange:t}){const[n,r]=_.useState(e),a=_.useRef(n),o=_.useRef(t);return qW(()=>{o.current=t},[t]),_.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function FW(e){return typeof e=="function"}var HW=_.createContext(void 0);function gd(e){const t=_.useContext(HW);return e||t||"ltr"}var px="rovingFocusGroup.onEntryFocus",VW={bubbles:!1,cancelable:!0},yd="RovingFocusGroup",[K1,W4,GW]=Sv(yd),[KW,Y4]=Zr(yd,[GW]),[WW,YW]=KW(yd),X4=_.forwardRef((e,t)=>u.jsx(K1.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(K1.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(XW,{...e,ref:t})})}));X4.displayName=yd;var XW=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...m}=e,g=_.useRef(null),y=Ve(t,g),S=gd(o),[x,w]=xi({prop:s,defaultProp:c??null,onChange:f,caller:yd}),[A,O]=_.useState(!1),E=Wt(h),N=W4(n),T=_.useRef(!1),[C,R]=_.useState(0);return _.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(px,E),()=>M.removeEventListener(px,E)},[E]),u.jsx(WW,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:x,onItemFocus:_.useCallback(M=>w(M),[w]),onItemShiftTab:_.useCallback(()=>O(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(M=>M+1),[]),onFocusableItemRemove:_.useCallback(()=>R(M=>M-1),[]),children:u.jsx(Me.div,{tabIndex:A||C===0?-1:0,"data-orientation":r,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{T.current=!0}),onFocus:Ee(e.onFocus,M=>{const k=!T.current;if(M.target===M.currentTarget&&k&&!A){const z=new CustomEvent(px,VW);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const L=N().filter($=>$.focusable),B=L.find($=>$.active),F=L.find($=>$.id===x),W=[B,F,...L].filter(Boolean).map($=>$.ref.current);J4(W,p)}}T.current=!1}),onBlur:Ee(e.onBlur,()=>O(!1))})})}),Z4="RovingFocusGroupItem",Q4=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:s,...c}=e,f=kn(),h=o||f,p=YW(Z4,n),m=p.currentTabStopId===h,g=W4(n),{onFocusableItemAdd:y,onFocusableItemRemove:S,currentTabStopId:x}=p;return _.useEffect(()=>{if(r)return y(),()=>S()},[r,y,S]),u.jsx(K1.ItemSlot,{scope:n,id:h,focusable:r,active:a,children:u.jsx(Me.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:Ee(e.onMouseDown,w=>{r?p.onItemFocus(h):w.preventDefault()}),onFocus:Ee(e.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ee(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const A=JW(w,p.orientation,p.dir);if(A!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=g().filter(N=>N.focusable).map(N=>N.ref.current);if(A==="last")E.reverse();else if(A==="prev"||A==="next"){A==="prev"&&E.reverse();const N=E.indexOf(w.currentTarget);E=p.loop?eY(E,N+1):E.slice(N+1)}setTimeout(()=>J4(E))}}),children:typeof s=="function"?s({isCurrentTabStop:m,hasTabStop:x!=null}):s})})});Q4.displayName=Z4;var ZW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function QW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function JW(e,t,n){const r=QW(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ZW[r]}function J4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function eY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tY=X4,nY=Q4;function rY(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var Qr=e=>{const{present:t,children:n}=e,r=aY(t),a=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),o=Ve(r.ref,iY(a));return typeof n=="function"||r.isPresent?_.cloneElement(a,{ref:o}):null};Qr.displayName="Presence";function aY(e){const[t,n]=_.useState(),r=_.useRef(null),a=_.useRef(e),o=_.useRef("none"),s=e?"mounted":"unmounted",[c,f]=rY(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const h=cp(r.current);o.current=c==="mounted"?h:"none"},[c]),nn(()=>{const h=r.current,p=a.current;if(p!==e){const g=o.current,y=cp(h);e?f("MOUNT"):y==="none"||h?.display==="none"?f("UNMOUNT"):f(p&&g!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),nn(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,m=y=>{const x=cp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&x&&(f("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=y=>{y.target===t&&(o.current=cp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:_.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function cp(e){return e?.animationName||"none"}function iY(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 _v="Tabs",[oY]=Zr(_v,[Y4]),e3=Y4(),[sY,eA]=oY(_v),t3=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s="horizontal",dir:c,activationMode:f="automatic",...h}=e,p=gd(c),[m,g]=xi({prop:r,onChange:a,defaultProp:o??"",caller:_v});return u.jsx(sY,{scope:n,baseId:kn(),value:m,onValueChange:g,orientation:s,dir:p,activationMode:f,children:u.jsx(Me.div,{dir:p,"data-orientation":s,...h,ref:t})})});t3.displayName=_v;var n3="TabsList",r3=_.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=eA(n3,n),s=e3(n);return u.jsx(tY,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(Me.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});r3.displayName=n3;var a3="TabsTrigger",i3=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,s=eA(a3,n),c=e3(n),f=l3(s.baseId,r),h=c3(s.baseId,r),p=r===s.value;return u.jsx(nY,{asChild:!0,...c,focusable:!a,active:p,children:u.jsx(Me.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:f,...o,ref:t,onMouseDown:Ee(e.onMouseDown,m=>{!a&&m.button===0&&m.ctrlKey===!1?s.onValueChange(r):m.preventDefault()}),onKeyDown:Ee(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&s.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const m=s.activationMode!=="manual";!p&&!a&&m&&s.onValueChange(r)})})})});i3.displayName=a3;var o3="TabsContent",s3=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...s}=e,c=eA(o3,n),f=l3(c.baseId,r),h=c3(c.baseId,r),p=r===c.value,m=_.useRef(p);return _.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),u.jsx(Qr,{present:a||p,children:({present:g})=>u.jsx(Me.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":f,hidden:!g,id:h,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:g&&o})})});s3.displayName=o3;function l3(e,t){return`${e}-trigger-${t}`}function c3(e,t){return`${e}-content-${t}`}var lY=t3,u3=r3,f3=i3,d3=s3;const Yl=lY,ps=_.forwardRef(({className:e,...t},n)=>u.jsx(u3,{ref:n,className:we("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ps.displayName=u3.displayName;const St=_.forwardRef(({className:e,...t},n)=>u.jsx(f3,{ref:n,className:we("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));St.displayName=f3.displayName;const Rt=_.forwardRef(({className:e,...t},n)=>u.jsx(d3,{ref:n,className:we("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rt.displayName=d3.displayName;function Tf(e,[t,n]){return Math.min(n,Math.max(t,e))}function cY(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var tA="ScrollArea",[h3]=Zr(tA),[uY,Jr]=h3(tA),p3=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...s}=e,[c,f]=_.useState(null),[h,p]=_.useState(null),[m,g]=_.useState(null),[y,S]=_.useState(null),[x,w]=_.useState(null),[A,O]=_.useState(0),[E,N]=_.useState(0),[T,C]=_.useState(!1),[R,M]=_.useState(!1),k=Ve(t,L=>f(L)),z=gd(a);return u.jsx(uY,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:c,viewport:h,onViewportChange:p,content:m,onContentChange:g,scrollbarX:y,onScrollbarXChange:S,scrollbarXEnabled:T,onScrollbarXEnabledChange:C,scrollbarY:x,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:M,onCornerWidthChange:O,onCornerHeightChange:N,children:u.jsx(Me.div,{dir:z,...s,ref:k,style:{position:"relative","--radix-scroll-area-corner-width":A+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});p3.displayName=tA;var m3="ScrollAreaViewport",v3=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,s=Jr(m3,n),c=_.useRef(null),f=Ve(t,c,s.onViewportChange);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(Me.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});v3.displayName=m3;var $a="ScrollAreaScrollbar",nA=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Jr($a,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,c=e.orientation==="horizontal";return _.useEffect(()=>(c?o(!0):s(!0),()=>{c?o(!1):s(!1)}),[c,o,s]),a.type==="hover"?u.jsx(fY,{...r,ref:t,forceMount:n}):a.type==="scroll"?u.jsx(dY,{...r,ref:t,forceMount:n}):a.type==="auto"?u.jsx(g3,{...r,ref:t,forceMount:n}):a.type==="always"?u.jsx(rA,{...r,ref:t}):null});nA.displayName=$a;var fY=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Jr($a,e.__scopeScrollArea),[o,s]=_.useState(!1);return _.useEffect(()=>{const c=a.scrollArea;let f=0;if(c){const h=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",h),c.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",h),c.removeEventListener("pointerleave",p)}}},[a.scrollArea,a.scrollHideDelay]),u.jsx(Qr,{present:n||o,children:u.jsx(g3,{"data-state":o?"visible":"hidden",...r,ref:t})})}),dY=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Jr($a,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Av(()=>f("SCROLL_END"),100),[c,f]=cY("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 _.useEffect(()=>{if(c==="idle"){const h=window.setTimeout(()=>f("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(h)}},[c,a.scrollHideDelay,f]),_.useEffect(()=>{const h=a.viewport,p=o?"scrollLeft":"scrollTop";if(h){let m=h[p];const g=()=>{const y=h[p];m!==y&&(f("SCROLL"),s()),m=y};return h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[a.viewport,o,f,s]),u.jsx(Qr,{present:n||c!=="hidden",children:u.jsx(rA,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ee(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),g3=_.forwardRef((e,t)=>{const n=Jr($a,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,s]=_.useState(!1),c=e.orientation==="horizontal",f=Av(()=>{if(n.viewport){const h=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Jr($a,e.__scopeScrollArea),o=_.useRef(null),s=_.useRef(0),[c,f]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=S3(c.viewport,c.content),p={...r,sizes:c,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function m(g,y){return yY(g,s.current,c,y)}return n==="horizontal"?u.jsx(hY,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollLeft,y=tR(g,c,a.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=m(g,a.dir))}}):n==="vertical"?u.jsx(pY,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollTop,y=tR(g,c);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=m(g))}}):null}),hY=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Jr($a,e.__scopeScrollArea),[s,c]=_.useState(),f=_.useRef(null),h=Ve(t,f,o.onScrollbarXChange);return _.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),u.jsx(b3,{"data-orientation":"horizontal",...a,ref:h,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":jv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const g=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(g),j3(g,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:am(s.paddingLeft),paddingEnd:am(s.paddingRight)}})}})}),pY=_.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Jr($a,e.__scopeScrollArea),[s,c]=_.useState(),f=_.useRef(null),h=Ve(t,f,o.onScrollbarYChange);return _.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),u.jsx(b3,{"data-orientation":"vertical",...a,ref:h,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":jv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const g=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(g),j3(g,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:am(s.paddingTop),paddingEnd:am(s.paddingBottom)}})}})}),[mY,y3]=h3($a),b3=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:p,onResize:m,...g}=e,y=Jr($a,n),[S,x]=_.useState(null),w=Ve(t,k=>x(k)),A=_.useRef(null),O=_.useRef(""),E=y.viewport,N=r.content-r.viewport,T=Wt(p),C=Wt(f),R=Av(m,10);function M(k){if(A.current){const z=k.clientX-A.current.left,L=k.clientY-A.current.top;h({x:z,y:L})}}return _.useEffect(()=>{const k=z=>{const L=z.target;S?.contains(L)&&T(z,N)};return document.addEventListener("wheel",k,{passive:!1}),()=>document.removeEventListener("wheel",k,{passive:!1})},[E,S,N,T]),_.useEffect(C,[r,C]),Xl(S,R),Xl(y.content,R),u.jsx(mY,{scope:n,scrollbar:S,hasThumb:a,onThumbChange:Wt(o),onThumbPointerUp:Wt(s),onThumbPositionChange:C,onThumbPointerDown:Wt(c),children:u.jsx(Me.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Ee(e.onPointerDown,k=>{k.button===0&&(k.target.setPointerCapture(k.pointerId),A.current=S.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),M(k))}),onPointerMove:Ee(e.onPointerMove,M),onPointerUp:Ee(e.onPointerUp,k=>{const z=k.target;z.hasPointerCapture(k.pointerId)&&z.releasePointerCapture(k.pointerId),document.body.style.webkitUserSelect=O.current,y.viewport&&(y.viewport.style.scrollBehavior=""),A.current=null})})})}),rm="ScrollAreaThumb",x3=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=y3(rm,e.__scopeScrollArea);return u.jsx(Qr,{present:n||a.hasThumb,children:u.jsx(vY,{ref:t,...r})})}),vY=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Jr(rm,n),s=y3(rm,n),{onThumbPositionChange:c}=s,f=Ve(t,m=>s.onThumbChange(m)),h=_.useRef(void 0),p=Av(()=>{h.current&&(h.current(),h.current=void 0)},100);return _.useEffect(()=>{const m=o.viewport;if(m){const g=()=>{if(p(),!h.current){const y=bY(m,c);h.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,p,c]),u.jsx(Me.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ee(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),S=m.clientX-y.left,x=m.clientY-y.top;s.onThumbPointerDown({x:S,y:x})}),onPointerUp:Ee(e.onPointerUp,s.onThumbPointerUp)})});x3.displayName=rm;var aA="ScrollAreaCorner",w3=_.forwardRef((e,t)=>{const n=Jr(aA,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(gY,{...e,ref:t}):null});w3.displayName=aA;var gY=_.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Jr(aA,n),[o,s]=_.useState(0),[c,f]=_.useState(0),h=!!(o&&c);return Xl(a.scrollbarX,()=>{const p=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(p),f(p)}),Xl(a.scrollbarY,()=>{const p=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(p),s(p)}),h?u.jsx(Me.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function am(e){return e?parseInt(e,10):0}function S3(e,t){const n=e/t;return isNaN(n)?0:n}function jv(e){const t=S3(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function yY(e,t,n,r="ltr"){const a=jv(n),o=a/2,s=t||o,c=a-s,f=n.scrollbar.paddingStart+s,h=n.scrollbar.size-n.scrollbar.paddingEnd-c,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return _3([f,h],m)(e)}function tR(e,t,n="ltr"){const r=jv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,c=o-r,f=n==="ltr"?[0,s]:[s*-1,0],h=Tf(e,f);return _3([0,s],[0,c])(h)}function _3(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 j3(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},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Av(e,t){const n=Wt(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Xl(e,t){const n=Wt(t);nn(()=>{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 A3=p3,xY=v3,wY=w3;const pr=_.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(A3,{ref:r,className:we("relative overflow-hidden",e),...n,children:[u.jsx(xY,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(O3,{}),u.jsx(wY,{})]}));pr.displayName=A3.displayName;const O3=_.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx(nA,{ref:r,orientation:t,className:we("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:u.jsx(x3,{className:"relative flex-1 rounded-full bg-border"})}));O3.displayName=nA.displayName;var mx,nR;function Zn(){if(nR)return mx;nR=1;var e=Array.isArray;return mx=e,mx}var vx,rR;function E3(){if(rR)return vx;rR=1;var e=typeof ep=="object"&&ep&&ep.Object===Object&&ep;return vx=e,vx}var gx,aR;function Ia(){if(aR)return gx;aR=1;var e=E3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return gx=n,gx}var yx,iR;function bd(){if(iR)return yx;iR=1;var e=Ia(),t=e.Symbol;return yx=t,yx}var bx,oR;function SY(){if(oR)return bx;oR=1;var e=bd(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function o(s){var c=n.call(s,a),f=s[a];try{s[a]=void 0;var h=!0}catch{}var p=r.call(s);return h&&(c?s[a]=f:delete s[a]),p}return bx=o,bx}var xx,sR;function _Y(){if(sR)return xx;sR=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return xx=n,xx}var wx,lR;function Ei(){if(lR)return wx;lR=1;var e=bd(),t=SY(),n=_Y(),r="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function s(c){return c==null?c===void 0?a:r:o&&o in Object(c)?t(c):n(c)}return wx=s,wx}var Sx,cR;function Ti(){if(cR)return Sx;cR=1;function e(t){return t!=null&&typeof t=="object"}return Sx=e,Sx}var _x,uR;function Rc(){if(uR)return _x;uR=1;var e=Ei(),t=Ti(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return _x=r,_x}var jx,fR;function iA(){if(fR)return jx;fR=1;var e=Zn(),t=Rc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(o,s){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return jx=a,jx}var Ax,dR;function bo(){if(dR)return Ax;dR=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Ax=e,Ax}var Ox,hR;function oA(){if(hR)return Ox;hR=1;var e=Ei(),t=bo(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function s(c){if(!t(c))return!1;var f=e(c);return f==r||f==a||f==n||f==o}return Ox=s,Ox}var Ex,pR;function jY(){if(pR)return Ex;pR=1;var e=Ia(),t=e["__core-js_shared__"];return Ex=t,Ex}var Tx,mR;function AY(){if(mR)return Tx;mR=1;var e=jY(),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 Tx=n,Tx}var Nx,vR;function T3(){if(vR)return Nx;vR=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 Nx=n,Nx}var Cx,gR;function OY(){if(gR)return Cx;gR=1;var e=oA(),t=AY(),n=bo(),r=T3(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,c=Object.prototype,f=s.toString,h=c.hasOwnProperty,p=RegExp("^"+f.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!n(g)||t(g))return!1;var y=e(g)?p:o;return y.test(r(g))}return Cx=m,Cx}var Rx,yR;function EY(){if(yR)return Rx;yR=1;function e(t,n){return t?.[n]}return Rx=e,Rx}var Px,bR;function Cs(){if(bR)return Px;bR=1;var e=OY(),t=EY();function n(r,a){var o=t(r,a);return e(o)?o:void 0}return Px=n,Px}var Mx,xR;function Ov(){if(xR)return Mx;xR=1;var e=Cs(),t=e(Object,"create");return Mx=t,Mx}var kx,wR;function TY(){if(wR)return kx;wR=1;var e=Ov();function t(){this.__data__=e?e(null):{},this.size=0}return kx=t,kx}var Dx,SR;function NY(){if(SR)return Dx;SR=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Dx=e,Dx}var Lx,_R;function CY(){if(_R)return Lx;_R=1;var e=Ov(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(o){var s=this.__data__;if(e){var c=s[o];return c===t?void 0:c}return r.call(s,o)?s[o]:void 0}return Lx=a,Lx}var $x,jR;function RY(){if(jR)return $x;jR=1;var e=Ov(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var o=this.__data__;return e?o[a]!==void 0:n.call(o,a)}return $x=r,$x}var Ix,AR;function PY(){if(AR)return Ix;AR=1;var e=Ov(),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 Ix=n,Ix}var Bx,OR;function MY(){if(OR)return Bx;OR=1;var e=TY(),t=NY(),n=CY(),r=RY(),a=PY();function o(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c-1}return Vx=t,Vx}var Gx,MR;function IY(){if(MR)return Gx;MR=1;var e=Ev();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 Gx=t,Gx}var Kx,kR;function Tv(){if(kR)return Kx;kR=1;var e=kY(),t=DY(),n=LY(),r=$Y(),a=IY();function o(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c0?1:-1},Jo=function(t){return ms(t)&&t.indexOf("%")===t.length-1},xe=function(t){return sX(t)&&!xd(t)},lX=function(t){return ze(t)},Xt=function(t){return xe(t)||ms(t)},cX=0,Mc=function(t){var n=++cX;return"".concat(t||"").concat(n)},Pn=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(!xe(t)&&!ms(t))return r;var o;if(Jo(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return xd(o)&&(o=r),a&&o>n&&(o=n),o},oo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},uX=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 gX(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 Y1(e){"@babel/helpers - typeof";return Y1=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},Y1(e)}var lP={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"},gi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},cP=null,b0=null,hA=function e(t){if(t===cP&&Array.isArray(b0))return b0;var n=[];return _.Children.forEach(t,function(r){ze(r)||(rX.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),b0=n,cP=t,n};function wr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return gi(a)}):r=[gi(t)],hA(e).forEach(function(a){var o=xr(a,"type.displayName")||xr(a,"type.name");r.indexOf(o)!==-1&&n.push(a)}),n}function fr(e,t){var n=wr(e,t);return n&&n[0]}var uP=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!xe(r)||r<=0||!xe(a)||a<=0)},yX=["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"],bX=function(t){return t&&t.type&&ms(t.type)&&yX.indexOf(t.type)>=0},xX=function(t){return t&&Y1(t)==="object"&&"clipDot"in t},wX=function(t,n,r,a){var o,s=(o=y0?.[a])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!$e(t)&&(a&&s.includes(n)||hX.includes(n))||r&&dA.includes(n)},Pe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(_.isValidElement(t)&&(a=t.props),!Pc(a))return null;var o={};return Object.keys(a).forEach(function(s){var c;wX((c=a)===null||c===void 0?void 0:c[s],s,n,r)&&(o[s]=a[s])}),o},X1=function e(t,n){if(t===n)return!0;var r=_.Children.count(t);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return fP(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 OX(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 Q1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,o=e.className,s=e.style,c=e.title,f=e.desc,h=AX(e,jX),p=a||{width:n,height:r,x:0,y:0},m=qe("recharts-surface",o);return K.createElement("svg",Z1({},Pe(h,!0,"svg"),{className:m,width:n,height:r,style:s,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),K.createElement("title",null,c),K.createElement("desc",null,f),t)}var EX=["children","className"];function J1(){return J1=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 NX(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 at=K.forwardRef(function(e,t){var n=e.children,r=e.className,a=TX(e,EX),o=qe("recharts-layer",r);return K.createElement("g",J1({className:o},Pe(a,!0),{ref:t}),n)}),ua=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 s=Array(o);++a=o?n:e(n,r,a)}return w0=t,w0}var S0,mP;function k3(){if(mP)return S0;mP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",s="\\u200d",c=RegExp("["+s+e+a+o+"]");function f(h){return c.test(h)}return S0=f,S0}var _0,vP;function PX(){if(vP)return _0;vP=1;function e(t){return t.split("")}return _0=e,_0}var j0,gP;function MX(){if(gP)return j0;gP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",s="["+e+"]",c="["+a+"]",f="\\ud83c[\\udffb-\\udfff]",h="(?:"+c+"|"+f+")",p="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",S=h+"?",x="["+o+"]?",w="(?:"+y+"(?:"+[p,m,g].join("|")+")"+x+S+")*",A=x+S+w,O="(?:"+[p+c+"?",c,m,g,s].join("|")+")",E=RegExp(f+"(?="+f+")|"+O+A,"g");function N(T){return T.match(E)||[]}return j0=N,j0}var A0,yP;function kX(){if(yP)return A0;yP=1;var e=PX(),t=k3(),n=MX();function r(a){return t(a)?n(a):e(a)}return A0=r,A0}var O0,bP;function DX(){if(bP)return O0;bP=1;var e=RX(),t=k3(),n=kX(),r=C3();function a(o){return function(s){s=r(s);var c=t(s)?n(s):void 0,f=c?c[0]:s.charAt(0),h=c?e(c,1).join(""):s.slice(1);return f[o]()+h}}return O0=a,O0}var E0,xP;function LX(){if(xP)return E0;xP=1;var e=DX(),t=e("toUpperCase");return E0=t,E0}var $X=LX();const Rv=ut($X);function wt(e){return function(){return e}}const D3=Math.cos,sm=Math.sin,ma=Math.sqrt,lm=Math.PI,Pv=2*lm,e_=Math.PI,t_=2*e_,Yo=1e-6,IX=t_-Yo;function L3(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return L3;const n=10**t;return function(r){this._+=r[0];for(let a=1,o=r.length;aYo)if(!(Math.abs(m*f-h*p)>Yo)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-s,S=a-c,x=f*f+h*h,w=y*y+S*S,A=Math.sqrt(x),O=Math.sqrt(g),E=o*Math.tan((e_-Math.acos((x+g-w)/(2*A*O)))/2),N=E/O,T=E/A;Math.abs(N-1)>Yo&&this._append`L${t+N*p},${n+N*m}`,this._append`A${o},${o},0,0,${+(m*y>p*S)},${this._x1=t+T*f},${this._y1=n+T*h}`}}arc(t,n,r,a,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),f=r*Math.sin(a),h=t+c,p=n+f,m=1^s,g=s?a-o:o-a;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Yo||Math.abs(this._y1-p)>Yo)&&this._append`L${h},${p}`,r&&(g<0&&(g=g%t_+t_),g>IX?this._append`A${r},${r},0,1,${m},${t-c},${n-f}A${r},${r},0,1,${m},${this._x1=h},${this._y1=p}`:g>Yo&&this._append`A${r},${r},0,${+(g>=e_)},${m},${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 pA(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 zX(t)}function mA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $3(e){this._context=e}$3.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 Mv(e){return new $3(e)}function I3(e){return e[0]}function B3(e){return e[1]}function z3(e,t){var n=wt(!0),r=null,a=Mv,o=null,s=pA(c);e=typeof e=="function"?e:e===void 0?I3:wt(e),t=typeof t=="function"?t:t===void 0?B3:wt(t);function c(f){var h,p=(f=mA(f)).length,m,g=!1,y;for(r==null&&(o=a(y=s())),h=0;h<=p;++h)!(h=y;--S)c.point(E[S],N[S]);c.lineEnd(),c.areaEnd()}A&&(E[g]=+e(w,g,m),N[g]=+t(w,g,m),c.point(r?+r(w,g,m):E[g],n?+n(w,g,m):N[g]))}if(O)return c=null,O+""||null}function p(){return z3().defined(a).curve(s).context(o)}return h.x=function(m){return arguments.length?(e=typeof m=="function"?m:wt(+m),r=null,h):e},h.x0=function(m){return arguments.length?(e=typeof m=="function"?m:wt(+m),h):e},h.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:wt(+m),h):r},h.y=function(m){return arguments.length?(t=typeof m=="function"?m:wt(+m),n=null,h):t},h.y0=function(m){return arguments.length?(t=typeof m=="function"?m:wt(+m),h):t},h.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:wt(+m),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(m){return arguments.length?(a=typeof m=="function"?m:wt(!!m),h):a},h.curve=function(m){return arguments.length?(s=m,o!=null&&(c=s(o)),h):s},h.context=function(m){return arguments.length?(m==null?o=c=null:c=s(o=m),h):o},h}class q3{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 qX(e){return new q3(e,!0)}function UX(e){return new q3(e,!1)}const vA={draw(e,t){const n=ma(t/lm);e.moveTo(n,0),e.arc(0,0,n,0,Pv)}},FX={draw(e,t){const n=ma(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()}},U3=ma(1/3),HX=U3*2,VX={draw(e,t){const n=ma(t/HX),r=n*U3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},GX={draw(e,t){const n=ma(t),r=-n/2;e.rect(r,r,n,n)}},KX=.8908130915292852,F3=sm(lm/10)/sm(7*lm/10),WX=sm(Pv/10)*F3,YX=-D3(Pv/10)*F3,XX={draw(e,t){const n=ma(t*KX),r=WX*n,a=YX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let o=1;o<5;++o){const s=Pv*o/5,c=D3(s),f=sm(s);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*a,f*r+c*a)}e.closePath()}},T0=ma(3),ZX={draw(e,t){const n=-ma(t/(T0*3));e.moveTo(0,n*2),e.lineTo(-T0*n,-n),e.lineTo(T0*n,-n),e.closePath()}},Ur=-.5,Fr=ma(3)/2,n_=1/ma(12),QX=(n_/2+1)*3,JX={draw(e,t){const n=ma(t/QX),r=n/2,a=n*n_,o=r,s=n*n_+n,c=-o,f=s;e.moveTo(r,a),e.lineTo(o,s),e.lineTo(c,f),e.lineTo(Ur*r-Fr*a,Fr*r+Ur*a),e.lineTo(Ur*o-Fr*s,Fr*o+Ur*s),e.lineTo(Ur*c-Fr*f,Fr*c+Ur*f),e.lineTo(Ur*r+Fr*a,Ur*a-Fr*r),e.lineTo(Ur*o+Fr*s,Ur*s-Fr*o),e.lineTo(Ur*c+Fr*f,Ur*f-Fr*c),e.closePath()}};function eZ(e,t){let n=null,r=pA(a);e=typeof e=="function"?e:wt(e||vA),t=typeof t=="function"?t:wt(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:wt(o),a):e},a.size=function(o){return arguments.length?(t=typeof o=="function"?o:wt(+o),a):t},a.context=function(o){return arguments.length?(n=o??null,a):n},a}function cm(){}function um(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 H3(e){this._context=e}H3.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:um(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:um(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tZ(e){return new H3(e)}function V3(e){this._context=e}V3.prototype={areaStart:cm,areaEnd:cm,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:um(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nZ(e){return new V3(e)}function G3(e){this._context=e}G3.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:um(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rZ(e){return new G3(e)}function K3(e){this._context=e}K3.prototype={areaStart:cm,areaEnd:cm,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 aZ(e){return new K3(e)}function wP(e){return e<0?-1:1}function SP(e,t,n){var r=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(r||a<0&&-0),s=(n-e._y1)/(a||r<0&&-0),c=(o*a+s*r)/(r+a);return(wP(o)+wP(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(c))||0}function _P(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function N0(e,t,n){var r=e._x0,a=e._y0,o=e._x1,s=e._y1,c=(o-r)/3;e._context.bezierCurveTo(r+c,a+c*t,o-c,s-c*n,o,s)}function fm(e){this._context=e}fm.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:N0(this,this._t0,_P(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,N0(this,_P(this,n=SP(this,e,t)),n);break;default:N0(this,this._t0,n=SP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function W3(e){this._context=new Y3(e)}(W3.prototype=Object.create(fm.prototype)).point=function(e,t){fm.prototype.point.call(this,t,e)};function Y3(e){this._context=e}Y3.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 iZ(e){return new fm(e)}function oZ(e){return new W3(e)}function X3(e){this._context=e}X3.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=jP(e),a=jP(t),o=0,s=1;s=0;--t)a[t]=(s[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 lZ(e){return new kv(e,.5)}function cZ(e){return new kv(e,0)}function uZ(e){return new kv(e,1)}function Zl(e,t){if((s=e.length)>1)for(var n=1,r,a,o=e[t[0]],s,c=o.length;n=0;)n[t]=t;return n}function fZ(e,t){return e[t]}function dZ(e){const t=[];return t.key=e,t}function hZ(){var e=wt([]),t=r_,n=Zl,r=fZ;function a(o){var s=Array.from(e.apply(this,arguments),dZ),c,f=s.length,h=-1,p;for(const m of o)for(c=0,++h;c0){for(var n,r,a=0,o=e[0].length,s;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,s;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SZ(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 Z3={symbolCircle:vA,symbolCross:FX,symbolDiamond:VX,symbolSquare:GX,symbolStar:XX,symbolTriangle:ZX,symbolWye:JX},_Z=Math.PI/180,jZ=function(t){var n="symbol".concat(Rv(t));return Z3[n]||vA},AZ=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*_Z;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}},OZ=function(t,n){Z3["symbol".concat(Rv(t))]=n},gA=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,o=a===void 0?64:a,s=t.sizeType,c=s===void 0?"area":s,f=wZ(t,gZ),h=OP(OP({},f),{},{type:r,size:o,sizeType:c}),p=function(){var w=jZ(r),A=eZ().type(w).size(AZ(o,c,r));return A()},m=h.className,g=h.cx,y=h.cy,S=Pe(h,!0);return g===+g&&y===+y&&o===+o?K.createElement("path",a_({},S,{className:qe("recharts-symbols",m),transform:"translate(".concat(g,", ").concat(y,")"),d:p()})):null};gA.registerSymbol=OZ;function Ql(e){"@babel/helpers - typeof";return Ql=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},Ql(e)}function i_(){return i_=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=y.inactive?h:y.color;return K.createElement("li",i_({className:w,style:m,key:"legend-item-".concat(S)},vs(r.props,y,S)),K.createElement(Q1,{width:s,height:s,viewBox:p,style:g},r.renderIcon(y)),K.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},x?x(A,y,S):A))})}},{key:"render",value:function(){var r=this.props,a=r.payload,o=r.layout,s=r.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return K.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(_.PureComponent);Cf(yA,"displayName","Legend");Cf(yA,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var C0,TP;function LZ(){if(TP)return C0;TP=1;var e=Tv();function t(){this.__data__=new e,this.size=0}return C0=t,C0}var R0,NP;function $Z(){if(NP)return R0;NP=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return R0=e,R0}var P0,CP;function IZ(){if(CP)return P0;CP=1;function e(t){return this.__data__.get(t)}return P0=e,P0}var M0,RP;function BZ(){if(RP)return M0;RP=1;function e(t){return this.__data__.has(t)}return M0=e,M0}var k0,PP;function zZ(){if(PP)return k0;PP=1;var e=Tv(),t=lA(),n=cA(),r=200;function a(o,s){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthy))return!1;var x=m.get(s),w=m.get(c);if(x&&w)return x==c&&w==s;var A=-1,O=!0,E=f&a?new e:void 0;for(m.set(s,c),m.set(c,s);++A-1&&r%1==0&&r-1&&n%1==0&&n<=e}return nw=t,nw}var rw,nM;function JZ(){if(nM)return rw;nM=1;var e=Ei(),t=SA(),n=Ti(),r="[object Arguments]",a="[object Array]",o="[object Boolean]",s="[object Date]",c="[object Error]",f="[object Function]",h="[object Map]",p="[object Number]",m="[object Object]",g="[object RegExp]",y="[object Set]",S="[object String]",x="[object WeakMap]",w="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",T="[object Int16Array]",C="[object Int32Array]",R="[object Uint8Array]",M="[object Uint8ClampedArray]",k="[object Uint16Array]",z="[object Uint32Array]",L={};L[O]=L[E]=L[N]=L[T]=L[C]=L[R]=L[M]=L[k]=L[z]=!0,L[r]=L[a]=L[w]=L[o]=L[A]=L[s]=L[c]=L[f]=L[h]=L[p]=L[m]=L[g]=L[y]=L[S]=L[x]=!1;function B(F){return n(F)&&t(F.length)&&!!L[e(F)]}return rw=B,rw}var aw,rM;function sB(){if(rM)return aw;rM=1;function e(t){return function(n){return t(n)}}return aw=e,aw}var uf={exports:{}};uf.exports;var aM;function eQ(){return aM||(aM=1,(function(e,t){var n=E3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,s=o&&n.process,c=(function(){try{var f=a&&a.require&&a.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}})();e.exports=c})(uf,uf.exports)),uf.exports}var iw,iM;function lB(){if(iM)return iw;iM=1;var e=JZ(),t=sB(),n=eQ(),r=n&&n.isTypedArray,a=r?t(r):e;return iw=a,iw}var ow,oM;function tQ(){if(oM)return ow;oM=1;var e=XZ(),t=xA(),n=Zn(),r=oB(),a=wA(),o=lB(),s=Object.prototype,c=s.hasOwnProperty;function f(h,p){var m=n(h),g=!m&&t(h),y=!m&&!g&&r(h),S=!m&&!g&&!y&&o(h),x=m||g||y||S,w=x?e(h.length,String):[],A=w.length;for(var O in h)(p||c.call(h,O))&&!(x&&(O=="length"||y&&(O=="offset"||O=="parent")||S&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||a(O,A)))&&w.push(O);return w}return ow=f,ow}var sw,sM;function nQ(){if(sM)return sw;sM=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return sw=t,sw}var lw,lM;function cB(){if(lM)return lw;lM=1;function e(t,n){return function(r){return t(n(r))}}return lw=e,lw}var cw,cM;function rQ(){if(cM)return cw;cM=1;var e=cB(),t=e(Object.keys,Object);return cw=t,cw}var uw,uM;function aQ(){if(uM)return uw;uM=1;var e=nQ(),t=rQ(),n=Object.prototype,r=n.hasOwnProperty;function a(o){if(!e(o))return t(o);var s=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&s.push(c);return s}return uw=a,uw}var fw,fM;function wd(){if(fM)return fw;fM=1;var e=oA(),t=SA();function n(r){return r!=null&&t(r.length)&&!e(r)}return fw=n,fw}var dw,dM;function Dv(){if(dM)return dw;dM=1;var e=tQ(),t=aQ(),n=wd();function r(a){return n(a)?e(a):t(a)}return dw=r,dw}var hw,hM;function iQ(){if(hM)return hw;hM=1;var e=GZ(),t=YZ(),n=Dv();function r(a){return e(a,n,t)}return hw=r,hw}var pw,pM;function oQ(){if(pM)return pw;pM=1;var e=iQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(o,s,c,f,h,p){var m=c&t,g=e(o),y=g.length,S=e(s),x=S.length;if(y!=x&&!m)return!1;for(var w=y;w--;){var A=g[w];if(!(m?A in s:r.call(s,A)))return!1}var O=p.get(o),E=p.get(s);if(O&&E)return O==s&&E==o;var N=!0;p.set(o,s),p.set(s,o);for(var T=m;++w-1}return zw=t,zw}var qw,qM;function OQ(){if(qM)return qw;qM=1;function e(t,n,r){for(var a=-1,o=t==null?0:t.length;++a=s){var A=h?null:a(f);if(A)return o(A);S=!1,g=r,w=new e}else w=h?[]:x;e:for(;++m=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qQ(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 UQ(e){return e.value}function FQ(e,t){if(K.isValidElement(e))return K.cloneElement(e,t);if(typeof e=="function")return K.createElement(e,t);t.ref;var n=zQ(t,PQ);return K.createElement(yA,n)}var YM=1,ls=(function(e){function t(){var n;MQ(this,t);for(var r=arguments.length,a=new Array(r),o=0;oYM||Math.abs(a.height-this.lastBoundingBox.height)>YM)&&(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?si({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,o=a.layout,s=a.align,c=a.verticalAlign,f=a.margin,h=a.chartWidth,p=a.chartHeight,m,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var y=this.getBBoxSnapshot();m={left:((h||0)-y.width)/2}}else m=s==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var S=this.getBBoxSnapshot();g={top:((p||0)-S.height)/2}}else g=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return si(si({},m),g)}},{key:"render",value:function(){var r=this,a=this.props,o=a.content,s=a.width,c=a.height,f=a.wrapperStyle,h=a.payloadUniqBy,p=a.payload,m=si(si({position:"absolute",width:s||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return K.createElement("div",{className:"recharts-legend-wrapper",style:m,ref:function(y){r.wrapperNode=y}},FQ(o,si(si({},this.props),{},{payload:pB(p,h,UQ)})))}}],[{key:"getWithHeight",value:function(r,a){var o=si(si({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&xe(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||a}:null}}])})(_.PureComponent);Lv(ls,"displayName","Legend");Lv(ls,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Gw,XM;function HQ(){if(XM)return Gw;XM=1;var e=bd(),t=xA(),n=Zn(),r=e?e.isConcatSpreadable:void 0;function a(o){return n(o)||t(o)||!!(r&&o&&o[r])}return Gw=a,Gw}var Kw,ZM;function gB(){if(ZM)return Kw;ZM=1;var e=iB(),t=HQ();function n(r,a,o,s,c){var f=-1,h=r.length;for(o||(o=t),c||(c=[]);++f0&&o(p)?a>1?n(p,a-1,o,s,c):e(c,p):s||(c[c.length]=p)}return c}return Kw=n,Kw}var Ww,QM;function VQ(){if(QM)return Ww;QM=1;function e(t){return function(n,r,a){for(var o=-1,s=Object(n),c=a(n),f=c.length;f--;){var h=c[t?f:++o];if(r(s[h],h,s)===!1)break}return n}}return Ww=e,Ww}var Yw,JM;function GQ(){if(JM)return Yw;JM=1;var e=VQ(),t=e();return Yw=t,Yw}var Xw,ek;function yB(){if(ek)return Xw;ek=1;var e=GQ(),t=Dv();function n(r,a){return r&&e(r,a,t)}return Xw=n,Xw}var Zw,tk;function KQ(){if(tk)return Zw;tk=1;var e=wd();function t(n,r){return function(a,o){if(a==null)return a;if(!e(a))return n(a,o);for(var s=a.length,c=r?s:-1,f=Object(a);(r?c--:++cr||c&&f&&p&&!h&&!m||o&&f&&p||!a&&p||!s)return 1;if(!o&&!c&&!m&&n=h)return p;var m=a[o];return p*(m=="desc"?-1:1)}}return n.index-r.index}return nS=t,nS}var rS,sk;function ZQ(){if(sk)return rS;sk=1;var e=uA(),t=fA(),n=Ba(),r=bB(),a=WQ(),o=sB(),s=XQ(),c=kc(),f=Zn();function h(p,m,g){m.length?m=e(m,function(x){return f(x)?function(w){return t(w,x.length===1?x[0]:x)}:x}):m=[c];var y=-1;m=e(m,o(n));var S=r(p,function(x,w,A){var O=e(m,function(E){return E(x)});return{criteria:O,index:++y,value:x}});return a(S,function(x,w){return s(x,w,g)})}return rS=h,rS}var aS,lk;function QQ(){if(lk)return aS;lk=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 aS=e,aS}var iS,ck;function JQ(){if(ck)return iS;ck=1;var e=QQ(),t=Math.max;function n(r,a,o){return a=t(a===void 0?r.length-1:a,0),function(){for(var s=arguments,c=-1,f=t(s.length-a,0),h=Array(f);++c0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return cS=r,cS}var uS,pk;function rJ(){if(pk)return uS;pk=1;var e=tJ(),t=nJ(),n=t(e);return uS=n,uS}var fS,mk;function aJ(){if(mk)return fS;mk=1;var e=kc(),t=JQ(),n=rJ();function r(a,o){return n(t(a,o,e),a+"")}return fS=r,fS}var dS,vk;function $v(){if(vk)return dS;vk=1;var e=sA(),t=wd(),n=wA(),r=bo();function a(o,s,c){if(!r(c))return!1;var f=typeof s;return(f=="number"?t(c)&&n(s,c.length):f=="string"&&s in c)?e(c[s],o):!1}return dS=a,dS}var hS,gk;function iJ(){if(gk)return hS;gk=1;var e=gB(),t=ZQ(),n=aJ(),r=$v(),a=n(function(o,s){if(o==null)return[];var c=s.length;return c>1&&r(o,s[0],s[1])?s=[]:c>2&&r(s[0],s[1],s[2])&&(s=[s[0]]),t(o,e(s,1),[])});return hS=a,hS}var oJ=iJ();const AA=ut(oJ);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 l_(){return l_=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(Wu,"-left"),xe(n)&&t&&xe(t.x)&&n=t.y),"".concat(Wu,"-top"),xe(r)&&t&&xe(t.y)&&rx?Math.max(p,f[r]):Math.max(m,f[r])}function wJ(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 SJ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,h,p,m;return s.height>0&&s.width>0&&n?(p=xk({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),m=xk({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),h=wJ({translateX:p,translateY:m,useTranslate3d:c})):h=bJ,{cssProperties:h,cssClasses:xJ({translateX:p,translateY:m,coordinate:n})}}function ec(e){"@babel/helpers - typeof";return ec=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},ec(e)}function wk(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 Sk(e){for(var t=1;t_k||Math.abs(r.height-this.state.lastBoundingBox.height)>_k)&&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,s=a.allowEscapeViewBox,c=a.animationDuration,f=a.animationEasing,h=a.children,p=a.coordinate,m=a.hasPayload,g=a.isAnimationActive,y=a.offset,S=a.position,x=a.reverseDirection,w=a.useTranslate3d,A=a.viewBox,O=a.wrapperStyle,E=SJ({allowEscapeViewBox:s,coordinate:p,offsetTopLeft:y,position:S,reverseDirection:x,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:A}),N=E.cssClasses,T=E.cssProperties,C=Sk(Sk({transition:g&&o?"transform ".concat(c,"ms ").concat(f):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&m?"visible":"hidden",position:"absolute",top:0,left:0},O);return K.createElement("div",{tabIndex:-1,className:N,style:C,ref:function(M){r.wrapperNode=M}},h)}}])})(_.PureComponent),PJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Rs={isSsr:PJ()};function tc(e){"@babel/helpers - typeof";return tc=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},tc(e)}function jk(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 Ak(e){for(var t=1;t0;return K.createElement(RJ,{allowEscapeViewBox:s,animationDuration:c,animationEasing:f,isAnimationActive:g,active:o,coordinate:p,hasPayload:C,offset:y,position:w,reverseDirection:A,useTranslate3d:O,viewBox:E,wrapperStyle:N},UJ(h,Ak(Ak({},this.props),{},{payload:T})))}}])})(_.PureComponent);OA(Sa,"displayName","Tooltip");OA(Sa,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Rs.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 mS,Ok;function FJ(){if(Ok)return mS;Ok=1;var e=Ia(),t=function(){return e.Date.now()};return mS=t,mS}var vS,Ek;function HJ(){if(Ek)return vS;Ek=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return vS=t,vS}var gS,Tk;function VJ(){if(Tk)return gS;Tk=1;var e=HJ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return gS=n,gS}var yS,Nk;function AB(){if(Nk)return yS;Nk=1;var e=VJ(),t=bo(),n=Rc(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;function f(h){if(typeof h=="number")return h;if(n(h))return r;if(t(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=t(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var m=o.test(h);return m||s.test(h)?c(h.slice(2),m?2:8):a.test(h)?r:+h}return yS=f,yS}var bS,Ck;function GJ(){if(Ck)return bS;Ck=1;var e=bo(),t=FJ(),n=AB(),r="Expected a function",a=Math.max,o=Math.min;function s(c,f,h){var p,m,g,y,S,x,w=0,A=!1,O=!1,E=!0;if(typeof c!="function")throw new TypeError(r);f=n(f)||0,e(h)&&(A=!!h.leading,O="maxWait"in h,g=O?a(n(h.maxWait)||0,f):g,E="trailing"in h?!!h.trailing:E);function N(F){var U=p,W=m;return p=m=void 0,w=F,y=c.apply(W,U),y}function T(F){return w=F,S=setTimeout(M,f),A?N(F):y}function C(F){var U=F-x,W=F-w,$=f-U;return O?o($,g-W):$}function R(F){var U=F-x,W=F-w;return x===void 0||U>=f||U<0||O&&W>=g}function M(){var F=t();if(R(F))return k(F);S=setTimeout(M,C(F))}function k(F){return S=void 0,E&&p?N(F):(p=m=void 0,y)}function z(){S!==void 0&&clearTimeout(S),w=0,p=x=m=S=void 0}function L(){return S===void 0?y:k(t())}function B(){var F=t(),U=R(F);if(p=arguments,m=this,x=F,U){if(S===void 0)return T(x);if(O)return clearTimeout(S),S=setTimeout(M,f),N(x)}return S===void 0&&(S=setTimeout(M,f)),y}return B.cancel=z,B.flush=L,B}return bS=s,bS}var xS,Rk;function KJ(){if(Rk)return xS;Rk=1;var e=GJ(),t=bo(),n="Expected a function";function r(a,o,s){var c=!0,f=!0;if(typeof a!="function")throw new TypeError(n);return t(s)&&(c="leading"in s?!!s.leading:c,f="trailing"in s?!!s.trailing:f),e(a,o,{leading:c,maxWait:o,trailing:f})}return xS=r,xS}var WJ=KJ();const OB=ut(WJ);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 Pk(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 dp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(F=OB(F,x,{trailing:!0,leading:!1}));var U=new ResizeObserver(F),W=T.current.getBoundingClientRect(),$=W.width,V=W.height;return L($,V),U.observe(T.current),function(){U.disconnect()}},[L,x]);var B=_.useMemo(function(){var F=k.containerWidth,U=k.containerHeight;if(F<0||U<0)return null;ua(Jo(s)||Jo(f),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,s,f),ua(!n||n>0,"The aspect(%s) must be greater than zero.",n);var W=Jo(s)?F:s,$=Jo(f)?U:f;n&&n>0&&(W?$=W/n:$&&(W=$*n),g&&$>g&&($=g)),ua(W>0||$>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.`,W,$,s,f,p,m,n);var V=!Array.isArray(y)&&gi(y.type).endsWith("Chart");return K.Children.map(y,function(H){return K.isValidElement(H)?_.cloneElement(H,dp({width:W,height:$},V?{style:dp({height:"100%",width:"100%",maxHeight:$,maxWidth:W},H.props.style)}:{})):H})},[n,y,f,g,m,p,k,s]);return K.createElement("div",{id:w?"".concat(w):void 0,className:qe("recharts-responsive-container",A),style:dp(dp({},N),{},{width:s,height:f,minWidth:p,minHeight:m,maxHeight:g}),ref:T},B)}),Iv=function(t){return null};Iv.displayName="Cell";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 kk(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 d_(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Rs.isSsr)return{width:0,height:0};var r=cee(n),a=JSON.stringify({text:t,copyStyle:r});if(wl.widthCache[a])return wl.widthCache[a];try{var o=document.getElementById(Dk);o||(o=document.createElement("span"),o.setAttribute("id",Dk),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=d_(d_({},lee),r);Object.assign(o.style,s),o.textContent="".concat(t);var c=o.getBoundingClientRect(),f={width:c.width,height:c.height};return wl.widthCache[a]=f,++wl.cacheCount>see&&(wl.cacheCount=0,wl.widthCache={}),f}catch{return{width:0,height:0}}},uee=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Df(e){"@babel/helpers - typeof";return Df=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},Df(e)}function vm(e,t){return pee(e)||hee(e,t)||dee(e,t)||fee()}function fee(){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 dee(e,t){if(e){if(typeof e=="string")return Lk(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 Lk(e,t)}}function Lk(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 Tee(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 Uk(e,t){return Pee(e)||Ree(e,t)||Cee(e,t)||Nee()}function Nee(){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 Cee(e,t){if(e){if(typeof e=="string")return Fk(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 Fk(e,t)}}function Fk(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 W.reduce(function($,V){var H=V.word,ne=V.width,ee=$[$.length-1];if(ee&&(a==null||o||ee.width+ne+rV.width?$:V})};if(!p)return y;for(var x="…",w=function(W){var $=m.slice(0,W),V=CB({breakAll:h,style:f,children:$+x}).wordsWithComputedWidth,H=g(V),ne=H.length>s||S(H).width>Number(a);return[ne,H]},A=0,O=m.length-1,E=0,N;A<=O&&E<=m.length-1;){var T=Math.floor((A+O)/2),C=T-1,R=w(C),M=Uk(R,2),k=M[0],z=M[1],L=w(T),B=Uk(L,1),F=B[0];if(!k&&!F&&(A=T+1),k&&F&&(O=T-1),!k&&F){N=z;break}E++}return N||y},Hk=function(t){var n=ze(t)?[]:t.toString().split(NB);return[{words:n}]},kee=function(t){var n=t.width,r=t.scaleToFit,a=t.children,o=t.style,s=t.breakAll,c=t.maxLines;if((n||r)&&!Rs.isSsr){var f,h,p=CB({breakAll:s,children:a,style:o});if(p){var m=p.wordsWithComputedWidth,g=p.spaceWidth;f=m,h=g}else return Hk(a);return Mee({breakAll:s,children:a,maxLines:c,style:o},f,h,n,r)}return Hk(a)},Vk="#808080",gs=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,s=t.lineHeight,c=s===void 0?"1em":s,f=t.capHeight,h=f===void 0?"0.71em":f,p=t.scaleToFit,m=p===void 0?!1:p,g=t.textAnchor,y=g===void 0?"start":g,S=t.verticalAnchor,x=S===void 0?"end":S,w=t.fill,A=w===void 0?Vk:w,O=qk(t,Oee),E=_.useMemo(function(){return kee({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:m,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,m,O.style,O.width]),N=O.dx,T=O.dy,C=O.angle,R=O.className,M=O.breakAll,k=qk(O,Eee);if(!Xt(r)||!Xt(o))return null;var z=r+(xe(N)?N:0),L=o+(xe(T)?T:0),B;switch(x){case"start":B=wS("calc(".concat(h,")"));break;case"middle":B=wS("calc(".concat((E.length-1)/2," * -").concat(c," + (").concat(h," / 2))"));break;default:B=wS("calc(".concat(E.length-1," * -").concat(c,")"));break}var F=[];if(m){var U=E[0].width,W=O.width;F.push("scale(".concat((xe(W)?W/U:1)/U,")"))}return C&&F.push("rotate(".concat(C,", ").concat(z,", ").concat(L,")")),F.length&&(k.transform=F.join(" ")),K.createElement("text",h_({},Pe(k,!0),{x:z,y:L,className:qe("recharts-text",R),textAnchor:y,fill:A.includes("url")?Vk:A}),E.map(function($,V){var H=$.words.join(M?"":" ");return K.createElement("tspan",{x:z,dy:V===0?B:c,key:"".concat(H,"-").concat(V)},H)}))};function po(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Dee(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function EA(e){let t,n,r;e.length!==2?(t=po,n=(c,f)=>po(e(c),f),r=(c,f)=>e(c)-f):(t=e===po||e===Dee?e:Lee,n=e,r=e);function a(c,f,h=0,p=c.length){if(h>>1;n(c[m],f)<0?h=m+1:p=m}while(h>>1;n(c[m],f)<=0?h=m+1:p=m}while(hh&&r(c[m-1],f)>-r(c[m],f)?m-1:m}return{left:a,center:s,right:o}}function Lee(){return 0}function RB(e){return e===null?NaN:+e}function*$ee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Iee=EA(po),Sd=Iee.right;EA(RB).center;class Gk extends Map{constructor(t,n=qee){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(Kk(this,t))}has(t){return super.has(Kk(this,t))}set(t,n){return super.set(Bee(this,t),n)}delete(t){return super.delete(zee(this,t))}}function Kk({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Bee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function zee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Uee(e=po){if(e===po)return PB;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 PB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Fee=Math.sqrt(50),Hee=Math.sqrt(10),Vee=Math.sqrt(2);function gm(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),o=r/Math.pow(10,a),s=o>=Fee?10:o>=Hee?5:o>=Vee?2:1;let c,f,h;return a<0?(h=Math.pow(10,-a)/s,c=Math.round(e*h),f=Math.round(t*h),c/ht&&--f,h=-h):(h=Math.pow(10,a)*s,c=Math.round(e/h),f=Math.round(t/h),c*ht&&--f),f0))return[];if(e===t)return[e];const r=t=a))return[];const c=o-a+1,f=new Array(c);if(r)if(s<0)for(let h=0;h=r)&&(n=r);return n}function Yk(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function MB(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?PB:Uee(a);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,p=Math.log(f),m=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*m*(f-m)/f)*(h-f/2<0?-1:1),y=Math.max(n,Math.floor(t-h*m/f+g)),S=Math.min(r,Math.floor(t+(f-h)*m/f+g));MB(e,t,y,S,a)}const o=e[t];let s=n,c=r;for(Yu(e,n,t),a(e[r],o)>0&&Yu(e,n,r);s0;)--c}a(e[n],o)===0?Yu(e,n,c):(++c,Yu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Yu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Gee(e,t,n){if(e=Float64Array.from($ee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Yk(e);if(t>=1)return Wk(e);var r,a=(r-1)*t,o=Math.floor(a),s=Wk(MB(e,o).subarray(0,o+1)),c=Yk(e.subarray(o+1));return s+(c-s)*(a-o)}}function Kee(e,t,n=RB){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),s=+n(e[o],o,e),c=+n(e[o+1],o+1,e);return s+(c-s)*(a-o)}}function Wee(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?pp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pp(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=Xee.exec(e))?new Wn(t[1],t[2],t[3],1):(t=Zee.exec(e))?new Wn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qee.exec(e))?pp(t[1],t[2],t[3],t[4]):(t=Jee.exec(e))?pp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ete.exec(e))?nD(t[1],t[2]/100,t[3]/100,1):(t=tte.exec(e))?nD(t[1],t[2]/100,t[3]/100,t[4]):Xk.hasOwnProperty(e)?Jk(Xk[e]):e==="transparent"?new Wn(NaN,NaN,NaN,0):null}function Jk(e){return new Wn(e>>16&255,e>>8&255,e&255,1)}function pp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wn(e,t,n,r)}function ate(e){return e instanceof _d||(e=Bf(e)),e?(e=e.rgb(),new Wn(e.r,e.g,e.b,e.opacity)):new Wn}function y_(e,t,n,r){return arguments.length===1?ate(e):new Wn(e,t,n,r??1)}function Wn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}NA(Wn,y_,DB(_d,{brighter(e){return e=e==null?ym:Math.pow(ym,e),new Wn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new Wn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wn(cs(this.r),cs(this.g),cs(this.b),bm(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:eD,formatHex:eD,formatHex8:ite,formatRgb:tD,toString:tD}));function eD(){return`#${es(this.r)}${es(this.g)}${es(this.b)}`}function ite(){return`#${es(this.r)}${es(this.g)}${es(this.b)}${es((isNaN(this.opacity)?1:this.opacity)*255)}`}function tD(){const e=bm(this.opacity);return`${e===1?"rgb(":"rgba("}${cs(this.r)}, ${cs(this.g)}, ${cs(this.b)}${e===1?")":`, ${e})`}`}function bm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function es(e){return e=cs(e),(e<16?"0":"")+e.toString(16)}function nD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ca(e,t,n,r)}function LB(e){if(e instanceof ca)return new ca(e.h,e.s,e.l,e.opacity);if(e instanceof _d||(e=Bf(e)),!e)return new ca;if(e instanceof ca)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),s=NaN,c=o-a,f=(o+a)/2;return c?(t===o?s=(n-r)/c+(n0&&f<1?0:s,new ca(s,c,f,e.opacity)}function ote(e,t,n,r){return arguments.length===1?LB(e):new ca(e,t,n,r??1)}function ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}NA(ca,ote,DB(_d,{brighter(e){return e=e==null?ym:Math.pow(ym,e),new ca(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new ca(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 Wn(SS(e>=240?e-240:e+120,a,r),SS(e,a,r),SS(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new ca(rD(this.h),mp(this.s),mp(this.l),bm(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=bm(this.opacity);return`${e===1?"hsl(":"hsla("}${rD(this.h)}, ${mp(this.s)*100}%, ${mp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rD(e){return e=(e||0)%360,e<0?e+360:e}function mp(e){return Math.max(0,Math.min(1,e||0))}function SS(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 CA=e=>()=>e;function ste(e,t){return function(n){return e+n*t}}function lte(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 cte(e){return(e=+e)==1?$B:function(t,n){return n-t?lte(t,n,e):CA(isNaN(t)?n:t)}}function $B(e,t){var n=t-e;return n?ste(e,n):CA(isNaN(e)?t:e)}const aD=(function e(t){var n=cte(t);function r(a,o){var s=n((a=y_(a)).r,(o=y_(o)).r),c=n(a.g,o.g),f=n(a.b,o.b),h=$B(a.opacity,o.opacity);return function(p){return a.r=s(p),a.g=c(p),a.b=f(p),a.opacity=h(p),a+""}}return r.gamma=e,r})(1);function ute(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),c[s]?c[s]+=o:c[++s]=o),(r=r[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,f.push({i:s,x:xm(r,a)})),n=_S.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function wte(e,t,n){var r=e[0],a=e[1],o=t[0],s=t[1];return a2?Ste:wte,f=h=null,m}function m(g){return g==null||isNaN(g=+g)?o:(f||(f=c(e.map(r),t,n)))(r(s(g)))}return m.invert=function(g){return s(a((h||(h=c(t,e.map(r),xm)))(g)))},m.domain=function(g){return arguments.length?(e=Array.from(g,wm),p()):e.slice()},m.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},m.rangeRound=function(g){return t=Array.from(g),n=RA,p()},m.clamp=function(g){return arguments.length?(s=g?!0:Mn,p()):s!==Mn},m.interpolate=function(g){return arguments.length?(n=g,p()):n},m.unknown=function(g){return arguments.length?(o=g,m):o},function(g,y){return r=g,a=y,p()}}function PA(){return Bv()(Mn,Mn)}function _te(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Sm(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 nc(e){return e=Sm(Math.abs(e)),e?e[1]:NaN}function jte(e,t){return function(n,r){for(var a=n.length,o=[],s=0,c=e[0],f=0;a>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),o.push(n.substring(a-=c,a+c)),!((f+=c+1)>r));)c=e[s=(s+1)%e.length];return o.reverse().join(t)}}function Ate(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Ote=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zf(e){if(!(t=Ote.exec(e)))throw new Error("invalid format: "+e);var t;return new MA({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]})}zf.prototype=MA.prototype;function MA(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+""}MA.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 Ete(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 IB;function Tte(e,t){var n=Sm(e,t);if(!n)return e+"";var r=n[0],a=n[1],o=a-(IB=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Sm(e,Math.max(0,t+o-1))[0]}function oD(e,t){var n=Sm(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 sD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_te,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)=>oD(e*100,t),r:oD,s:Tte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lD(e){return e}var cD=Array.prototype.map,uD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nte(e){var t=e.grouping===void 0||e.thousands===void 0?lD:jte(cD.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?lD:Ate(cD.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(m){m=zf(m);var g=m.fill,y=m.align,S=m.sign,x=m.symbol,w=m.zero,A=m.width,O=m.comma,E=m.precision,N=m.trim,T=m.type;T==="n"?(O=!0,T="g"):sD[T]||(E===void 0&&(E=12),N=!0,T="g"),(w||g==="0"&&y==="=")&&(w=!0,g="0",y="=");var C=x==="$"?n:x==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",R=x==="$"?r:/[%p]/.test(T)?s:"",M=sD[T],k=/[defgprs%]/.test(T);E=E===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function z(L){var B=C,F=R,U,W,$;if(T==="c")F=M(L)+F,L="";else{L=+L;var V=L<0||1/L<0;if(L=isNaN(L)?f:M(Math.abs(L),E),N&&(L=Ete(L)),V&&+L==0&&S!=="+"&&(V=!1),B=(V?S==="("?S:c:S==="-"||S==="("?"":S)+B,F=(T==="s"?uD[8+IB/3]:"")+F+(V&&S==="("?")":""),k){for(U=-1,W=L.length;++U$||$>57){F=($===46?a+L.slice(U+1):L.slice(U))+F,L=L.slice(0,U);break}}}O&&!w&&(L=t(L,1/0));var H=B.length+L.length+F.length,ne=H>1)+B+L+F+ne.slice(H);break;default:L=ne+B+L+F;break}return o(L)}return z.toString=function(){return m+""},z}function p(m,g){var y=h((m=zf(m),m.type="f",m)),S=Math.max(-8,Math.min(8,Math.floor(nc(g)/3)))*3,x=Math.pow(10,-S),w=uD[8+S/3];return function(A){return y(x*A)+w}}return{format:h,formatPrefix:p}}var vp,kA,BB;Cte({thousands:",",grouping:[3],currency:["$",""]});function Cte(e){return vp=Nte(e),kA=vp.format,BB=vp.formatPrefix,vp}function Rte(e){return Math.max(0,-nc(Math.abs(e)))}function Pte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(nc(t)/3)))*3-nc(Math.abs(e)))}function Mte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,nc(t)-nc(e))+1}function zB(e,t,n,r){var a=v_(e,t,n),o;switch(r=zf(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Pte(a,s))&&(r.precision=o),BB(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Mte(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Rte(a))&&(r.precision=o-(r.type==="%")*2);break}}return kA(r)}function xo(e){var t=e.domain;return e.ticks=function(n){var r=t();return p_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return zB(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,s=r[a],c=r[o],f,h,p=10;for(c0;){if(h=m_(s,c,n),h===f)return r[a]=s,r[o]=c,t(r);if(h>0)s=Math.floor(s/h)*h,c=Math.ceil(c/h)*h;else if(h<0)s=Math.ceil(s*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function _m(){var e=PA();return e.copy=function(){return jd(e,_m())},ea.apply(e,arguments),xo(e)}function qB(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,wm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return qB(e).unknown(t)},e=arguments.length?Array.from(e,wm):[0,1],xo(n)}function UB(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],o=e[r],s;return oMath.pow(e,t)}function Ite(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 hD(e){return(t,n)=>-e(-t,n)}function DA(e){const t=e(fD,dD),n=t.domain;let r=10,a,o;function s(){return a=Ite(r),o=$te(r),n()[0]<0?(a=hD(a),o=hD(o),e(kte,Dte)):e(fD,dD),t}return t.base=function(c){return arguments.length?(r=+c,s()):r},t.domain=function(c){return arguments.length?(n(c),s()):n()},t.ticks=c=>{const f=n();let h=f[0],p=f[f.length-1];const m=p0){for(;g<=y;++g)for(S=1;Sp)break;A.push(x)}}else for(;g<=y;++g)for(S=r-1;S>=1;--S)if(x=g>0?S/o(-g):S*o(g),!(xp)break;A.push(x)}A.length*2{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=zf(f)).precision==null&&(f.trim=!0),f=kA(f)),c===1/0)return f;const h=Math.max(1,r*c/t.ticks().length);return p=>{let m=p/o(Math.round(a(p)));return m*rn(UB(n(),{floor:c=>o(Math.floor(a(c))),ceil:c=>o(Math.ceil(a(c)))})),t}function FB(){const e=DA(Bv()).domain([1,10]);return e.copy=()=>jd(e,FB()).base(e.base()),ea.apply(e,arguments),e}function pD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function mD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function LA(e){var t=1,n=e(pD(t),mD(t));return n.constant=function(r){return arguments.length?e(pD(t=+r),mD(t)):t},xo(n)}function HB(){var e=LA(Bv());return e.copy=function(){return jd(e,HB()).constant(e.constant())},ea.apply(e,arguments)}function vD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Bte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zte(e){return e<0?-e*e:e*e}function $A(e){var t=e(Mn,Mn),n=1;function r(){return n===1?e(Mn,Mn):n===.5?e(Bte,zte):e(vD(n),vD(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},xo(t)}function IA(){var e=$A(Bv());return e.copy=function(){return jd(e,IA()).exponent(e.exponent())},ea.apply(e,arguments),e}function qte(){return IA.apply(null,arguments).exponent(.5)}function gD(e){return Math.sign(e)*e*e}function Ute(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function VB(){var e=PA(),t=[0,1],n=!1,r;function a(o){var s=Ute(e(o));return isNaN(s)?r:n?Math.round(s):s}return a.invert=function(o){return e.invert(gD(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,wm)).map(gD)),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 VB(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ea.apply(a,arguments),xo(a)}function GB(){var e=[],t=[],n=[],r;function a(){var s=0,c=Math.max(1,t.length);for(n=new Array(c-1);++s0?n[c-1]:e[0],c=n?[r[n-1],t]:[r[h-1],r[h]]},s.unknown=function(f){return arguments.length&&(o=f),s},s.thresholds=function(){return r.slice()},s.copy=function(){return KB().domain([e,t]).range(a).unknown(o)},ea.apply(xo(s),arguments)}function WB(){var e=[.5],t=[0,1],n,r=1;function a(o){return o!=null&&o<=o?t[Sd(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 s=t.indexOf(o);return[e[s-1],e[s]]},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return WB().domain(e).range(t).unknown(n)},ea.apply(a,arguments)}const jS=new Date,AS=new Date;function Zt(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 s=a(o),c=a.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),a.range=(o,s,c)=>{const f=[];if(o=a.ceil(o),c=c==null?1:Math.floor(c),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,c),e(o);while(hZt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,c)=>{if(s>=s)if(c<0)for(;++c<=0;)for(;t(s,-1),!o(s););else for(;--c>=0;)for(;t(s,1),!o(s););}),n&&(a.count=(o,s)=>(jS.setTime(+o),AS.setTime(+s),e(jS),e(AS),Math.floor(n(jS,AS))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(r?s=>r(s)%o===0:s=>a.count(0,s)%o===0):a)),a}const jm=Zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);jm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):jm);jm.range;const di=1e3,Kr=di*60,hi=Kr*60,wi=hi*24,BA=wi*7,yD=wi*30,OS=wi*365,ts=Zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*di)},(e,t)=>(t-e)/di,e=>e.getUTCSeconds());ts.range;const zA=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*di)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getMinutes());zA.range;const qA=Zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCMinutes());qA.range;const UA=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*di-e.getMinutes()*Kr)},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getHours());UA.range;const FA=Zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getUTCHours());FA.range;const Ad=Zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kr)/wi,e=>e.getDate()-1);Ad.range;const zv=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>e.getUTCDate()-1);zv.range;const YB=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wi,e=>Math.floor(e/wi));YB.range;function Ps(e){return Zt(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())*Kr)/BA)}const qv=Ps(0),Am=Ps(1),Fte=Ps(2),Hte=Ps(3),rc=Ps(4),Vte=Ps(5),Gte=Ps(6);qv.range;Am.range;Fte.range;Hte.range;rc.range;Vte.range;Gte.range;function Ms(e){return Zt(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)/BA)}const Uv=Ms(0),Om=Ms(1),Kte=Ms(2),Wte=Ms(3),ac=Ms(4),Yte=Ms(5),Xte=Ms(6);Uv.range;Om.range;Kte.range;Wte.range;ac.range;Yte.range;Xte.range;const HA=Zt(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());HA.range;const VA=Zt(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());VA.range;const Si=Zt(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());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)});Si.range;const _i=Zt(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());_i.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)});_i.range;function XB(e,t,n,r,a,o){const s=[[ts,1,di],[ts,5,5*di],[ts,15,15*di],[ts,30,30*di],[o,1,Kr],[o,5,5*Kr],[o,15,15*Kr],[o,30,30*Kr],[a,1,hi],[a,3,3*hi],[a,6,6*hi],[a,12,12*hi],[r,1,wi],[r,2,2*wi],[n,1,BA],[t,1,yD],[t,3,3*yD],[e,1,OS]];function c(h,p,m){const g=pw).right(s,g);if(y===s.length)return e.every(v_(h/OS,p/OS,m));if(y===0)return jm.every(Math.max(v_(h,p,m),1));const[S,x]=s[g/s[y-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(be=TS(Xu(le.y,0,1)),et=be.getUTCDay(),be=et>4||et===0?Om.ceil(be):Om(be),be=zv.offset(be,(le.V-1)*7),le.y=be.getUTCFullYear(),le.m=be.getUTCMonth(),le.d=be.getUTCDate()+(le.w+6)%7):(be=ES(Xu(le.y,0,1)),et=be.getDay(),be=et>4||et===0?Am.ceil(be):Am(be),be=Ad.offset(be,(le.V-1)*7),le.y=be.getFullYear(),le.m=be.getMonth(),le.d=be.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),et="Z"in le?TS(Xu(le.y,0,1)).getUTCDay():ES(Xu(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(et+5)%7:le.w+le.U*7-(et+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,TS(le)):ES(le)}}function M(re,pe,ye,le){for(var Le=0,be=pe.length,et=ye.length,Te,st;Le=et)return-1;if(Te=pe.charCodeAt(Le++),Te===37){if(Te=pe.charAt(Le++),st=T[Te in bD?pe.charAt(Le++):Te],!st||(le=st(re,ye,le))<0)return-1}else if(Te!=ye.charCodeAt(le++))return-1}return le}function k(re,pe,ye){var le=h.exec(pe.slice(ye));return le?(re.p=p.get(le[0].toLowerCase()),ye+le[0].length):-1}function z(re,pe,ye){var le=y.exec(pe.slice(ye));return le?(re.w=S.get(le[0].toLowerCase()),ye+le[0].length):-1}function L(re,pe,ye){var le=m.exec(pe.slice(ye));return le?(re.w=g.get(le[0].toLowerCase()),ye+le[0].length):-1}function B(re,pe,ye){var le=A.exec(pe.slice(ye));return le?(re.m=O.get(le[0].toLowerCase()),ye+le[0].length):-1}function F(re,pe,ye){var le=x.exec(pe.slice(ye));return le?(re.m=w.get(le[0].toLowerCase()),ye+le[0].length):-1}function U(re,pe,ye){return M(re,t,pe,ye)}function W(re,pe,ye){return M(re,n,pe,ye)}function $(re,pe,ye){return M(re,r,pe,ye)}function V(re){return s[re.getDay()]}function H(re){return o[re.getDay()]}function ne(re){return f[re.getMonth()]}function ee(re){return c[re.getMonth()]}function I(re){return a[+(re.getHours()>=12)]}function q(re){return 1+~~(re.getMonth()/3)}function X(re){return s[re.getUTCDay()]}function te(re){return o[re.getUTCDay()]}function se(re){return f[re.getUTCMonth()]}function Q(re){return c[re.getUTCMonth()]}function G(re){return a[+(re.getUTCHours()>=12)]}function ge(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var pe=C(re+="",E);return pe.toString=function(){return re},pe},parse:function(re){var pe=R(re+="",!1);return pe.toString=function(){return re},pe},utcFormat:function(re){var pe=C(re+="",N);return pe.toString=function(){return re},pe},utcParse:function(re){var pe=R(re+="",!0);return pe.toString=function(){return re},pe}}}var bD={"-":"",_:" ",0:"0"},rn=/^\s*\d+/,nne=/^%/,rne=/[\\^$*+?|[\]().{}]/g;function it(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",o=a.length;return r+(o[t.toLowerCase(),n]))}function ine(e,t,n){var r=rn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function one(e,t,n){var r=rn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function sne(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function lne(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function cne(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function xD(e,t,n){var r=rn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wD(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function une(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 fne(e,t,n){var r=rn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dne(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function SD(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function hne(e,t,n){var r=rn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function _D(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function pne(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function mne(e,t,n){var r=rn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function vne(e,t,n){var r=rn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function gne(e,t,n){var r=rn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yne(e,t,n){var r=nne.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function bne(e,t,n){var r=rn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function xne(e,t,n){var r=rn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function jD(e,t){return it(e.getDate(),t,2)}function wne(e,t){return it(e.getHours(),t,2)}function Sne(e,t){return it(e.getHours()%12||12,t,2)}function _ne(e,t){return it(1+Ad.count(Si(e),e),t,3)}function ZB(e,t){return it(e.getMilliseconds(),t,3)}function jne(e,t){return ZB(e,t)+"000"}function Ane(e,t){return it(e.getMonth()+1,t,2)}function One(e,t){return it(e.getMinutes(),t,2)}function Ene(e,t){return it(e.getSeconds(),t,2)}function Tne(e){var t=e.getDay();return t===0?7:t}function Nne(e,t){return it(qv.count(Si(e)-1,e),t,2)}function QB(e){var t=e.getDay();return t>=4||t===0?rc(e):rc.ceil(e)}function Cne(e,t){return e=QB(e),it(rc.count(Si(e),e)+(Si(e).getDay()===4),t,2)}function Rne(e){return e.getDay()}function Pne(e,t){return it(Am.count(Si(e)-1,e),t,2)}function Mne(e,t){return it(e.getFullYear()%100,t,2)}function kne(e,t){return e=QB(e),it(e.getFullYear()%100,t,2)}function Dne(e,t){return it(e.getFullYear()%1e4,t,4)}function Lne(e,t){var n=e.getDay();return e=n>=4||n===0?rc(e):rc.ceil(e),it(e.getFullYear()%1e4,t,4)}function $ne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+it(t/60|0,"0",2)+it(t%60,"0",2)}function AD(e,t){return it(e.getUTCDate(),t,2)}function Ine(e,t){return it(e.getUTCHours(),t,2)}function Bne(e,t){return it(e.getUTCHours()%12||12,t,2)}function zne(e,t){return it(1+zv.count(_i(e),e),t,3)}function JB(e,t){return it(e.getUTCMilliseconds(),t,3)}function qne(e,t){return JB(e,t)+"000"}function Une(e,t){return it(e.getUTCMonth()+1,t,2)}function Fne(e,t){return it(e.getUTCMinutes(),t,2)}function Hne(e,t){return it(e.getUTCSeconds(),t,2)}function Vne(e){var t=e.getUTCDay();return t===0?7:t}function Gne(e,t){return it(Uv.count(_i(e)-1,e),t,2)}function ez(e){var t=e.getUTCDay();return t>=4||t===0?ac(e):ac.ceil(e)}function Kne(e,t){return e=ez(e),it(ac.count(_i(e),e)+(_i(e).getUTCDay()===4),t,2)}function Wne(e){return e.getUTCDay()}function Yne(e,t){return it(Om.count(_i(e)-1,e),t,2)}function Xne(e,t){return it(e.getUTCFullYear()%100,t,2)}function Zne(e,t){return e=ez(e),it(e.getUTCFullYear()%100,t,2)}function Qne(e,t){return it(e.getUTCFullYear()%1e4,t,4)}function Jne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ac(e):ac.ceil(e),it(e.getUTCFullYear()%1e4,t,4)}function ere(){return"+0000"}function OD(){return"%"}function ED(e){return+e}function TD(e){return Math.floor(+e/1e3)}var Sl,tz,nz;tre({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 tre(e){return Sl=tne(e),tz=Sl.format,Sl.parse,nz=Sl.utcFormat,Sl.utcParse,Sl}function nre(e){return new Date(e)}function rre(e){return e instanceof Date?+e:+new Date(+e)}function GA(e,t,n,r,a,o,s,c,f,h){var p=PA(),m=p.invert,g=p.domain,y=h(".%L"),S=h(":%S"),x=h("%I:%M"),w=h("%I %p"),A=h("%a %d"),O=h("%b %d"),E=h("%B"),N=h("%Y");function T(C){return(f(C)t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,o)=>Gee(e,o/r))},n.copy=function(){return oz(t).domain(e)},Ni.apply(n,arguments)}function Hv(){var e=0,t=.5,n=1,r=1,a,o,s,c,f,h=Mn,p,m=!1,g;function y(x){return isNaN(x=+x)?g:(x=.5+((x=+p(x))-o)*(r*xn}return CS=e,CS}var RS,PD;function lre(){if(PD)return RS;PD=1;var e=Vv(),t=uz(),n=kc();function r(a){return a&&a.length?e(a,n,t):void 0}return RS=r,RS}var cre=lre();const Gv=ut(cre);var PS,MD;function fz(){if(MD)return PS;MD=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};_e.decimalPlaces=_e.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Tt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};_e.dividedBy=_e.div=function(e){return yi(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var t=this,n=t.constructor;return bt(yi(t,new n(e),0,1),n.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return Ft(this)};_e.greaterThan=_e.gt=function(e){return this.cmp(e)>0};_e.greaterThanOrEqualTo=_e.gte=function(e){return this.cmp(e)>=0};_e.isInteger=_e.isint=function(){return this.e>this.d.length-2};_e.isNegative=_e.isneg=function(){return this.s<0};_e.isPositive=_e.ispos=function(){return this.s>0};_e.isZero=function(){return this.s===0};_e.lessThan=_e.lt=function(e){return this.cmp(e)<0};_e.lessThanOrEqualTo=_e.lte=function(e){return this.cmp(e)<1};_e.logarithm=_e.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(br))throw Error(Xr+"NaN");if(n.s<1)throw Error(Xr+(n.s?"NaN":"-Infinity"));return n.eq(br)?new r(0):(Ct=!1,t=yi(qf(n,o),qf(e,o),o),Ct=!0,bt(t,a))};_e.minus=_e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?mz(t,e):hz(t,(e.s=-e.s,e))};_e.modulo=_e.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Xr+"NaN");return n.s?(Ct=!1,t=yi(n,e,0,1).times(e),Ct=!0,n.minus(t)):bt(new r(n),a)};_e.naturalExponential=_e.exp=function(){return pz(this)};_e.naturalLogarithm=_e.ln=function(){return qf(this)};_e.negated=_e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_e.plus=_e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?hz(t,e):mz(t,(e.s=-e.s,e))};_e.precision=_e.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(us+e);if(t=Ft(a)+1,r=a.d.length-1,n=r*Tt+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};_e.squareRoot=_e.sqrt=function(){var e,t,n,r,a,o,s,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(Xr+"NaN")}for(e=Ft(c),Ct=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=Aa(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=$c((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 f(t)):r=new f(a.toString()),n=f.precision,a=s=n+3;;)if(o=r,r=o.plus(yi(c,o,s+2)).times(.5),Aa(o.d).slice(0,s)===(t=Aa(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(bt(o,n+1,0),o.times(o).eq(c)){r=o;break}}else if(t!="9999")break;s+=4}return Ct=!0,bt(r,n)};_e.times=_e.mul=function(e){var t,n,r,a,o,s,c,f,h,p=this,m=p.constructor,g=p.d,y=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,f=g.length,h=y.length,f=0;){for(t=0,a=f+r;a>r;)c=o[a]+y[r]*g[a-r-1]+t,o[a--]=c%en|0,t=c/en|0;o[a]=(o[a]+t)%en|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Ct?bt(e,m.precision):e};_e.toDecimalPlaces=_e.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ka(e,0,Lc),t===void 0?t=r.rounding:ka(t,0,8),bt(n,e+Ft(n)+1,t))};_e.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=ys(r,!0):(ka(e,0,Lc),t===void 0?t=a.rounding:ka(t,0,8),r=bt(new a(r),e+1,t),n=ys(r,!0,e+1)),n};_e.toFixed=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?ys(a):(ka(e,0,Lc),t===void 0?t=o.rounding:ka(t,0,8),r=bt(new o(a),e+Ft(a)+1,t),n=ys(r.abs(),!1,e+Ft(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};_e.toInteger=_e.toint=function(){var e=this,t=e.constructor;return bt(new t(e),Ft(e)+1,t.rounding)};_e.toNumber=function(){return+this};_e.toPower=_e.pow=function(e){var t,n,r,a,o,s,c=this,f=c.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(br);if(c=new f(c),!c.s){if(e.s<1)throw Error(Xr+"Infinity");return c}if(c.eq(br))return c;if(r=f.precision,e.eq(br))return bt(c,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=c.s,s){if((n=p<0?-p:p)<=dz){for(a=new f(br),t=Math.ceil(r/Tt+4),Ct=!1;n%2&&(a=a.times(c),BD(a.d,t)),n=$c(n/2),n!==0;)c=c.times(c),BD(c.d,t);return Ct=!0,e.s<0?new f(br).div(a):bt(a,r)}}else if(o<0)throw Error(Xr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Ct=!1,a=e.times(qf(c,r+h)),Ct=!0,a=pz(a),a.s=o,a};_e.toPrecision=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?(n=Ft(a),r=ys(a,n<=o.toExpNeg||n>=o.toExpPos)):(ka(e,1,Lc),t===void 0?t=o.rounding:ka(t,0,8),a=bt(new o(a),e,t),n=Ft(a),r=ys(a,e<=n||n<=o.toExpNeg,e)),r};_e.toSignificantDigits=_e.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ka(e,1,Lc),t===void 0?t=r.rounding:ka(t,0,8)),bt(new r(n),e,t)};_e.toString=_e.valueOf=_e.val=_e.toJSON=_e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ft(e),n=e.constructor;return ys(e,t<=n.toExpNeg||t>=n.toExpPos)};function hz(e,t){var n,r,a,o,s,c,f,h,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Ct?bt(t,m):t;if(f=e.d,h=t.d,s=e.e,a=t.e,f=f.slice(),o=s-a,o){for(o<0?(r=f,o=-o,c=h.length):(r=h,a=s,c=f.length),s=Math.ceil(m/Tt),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=f.length,o=h.length,c-o<0&&(o=c,r=h,h=f,f=r),n=0;o;)n=(f[--o]=f[o]+h[o]+n)/en|0,f[o]%=en;for(n&&(f.unshift(n),++a),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=a,Ct?bt(t,m):t}function ka(e,t,n){if(e!==~~e||en)throw Error(us+e)}function Aa(e){var t,n,r,a=e.length-1,o="",s=e[0];if(a>0){for(o+=s,t=1;ts?1:-1;else for(c=f=0;ca[c]?1:-1;break}return f}function n(r,a,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,a,o,s){var c,f,h,p,m,g,y,S,x,w,A,O,E,N,T,C,R,M,k=r.constructor,z=r.s==a.s?1:-1,L=r.d,B=a.d;if(!r.s)return new k(r);if(!a.s)throw Error(Xr+"Division by zero");for(f=r.e-a.e,R=B.length,T=L.length,y=new k(z),S=y.d=[],h=0;B[h]==(L[h]||0);)++h;if(B[h]>(L[h]||0)&&--f,o==null?O=o=k.precision:s?O=o+(Ft(r)-Ft(a))+1:O=o,O<0)return new k(0);if(O=O/Tt+2|0,h=0,R==1)for(p=0,B=B[0],O++;(h1&&(B=e(B,p),L=e(L,p),R=B.length,T=L.length),N=R,x=L.slice(0,R),w=x.length;w=en/2&&++C;do p=0,c=t(B,x,R,w),c<0?(A=x[0],R!=w&&(A=A*en+(x[1]||0)),p=A/C|0,p>1?(p>=en&&(p=en-1),m=e(B,p),g=m.length,w=x.length,c=t(m,x,g,w),c==1&&(p--,n(m,R16)throw Error(YA+Ft(e));if(!e.s)return new p(br);for(Ct=!1,c=m,s=new p(.03125);e.abs().gte(.1);)e=e.times(s),h+=5;for(r=Math.log(Xo(2,h))/Math.LN10*2+5|0,c+=r,n=a=o=new p(br),p.precision=c;;){if(a=bt(a.times(e),c),n=n.times(++f),s=o.plus(yi(a,n,c)),Aa(s.d).slice(0,c)===Aa(o.d).slice(0,c)){for(;h--;)o=bt(o.times(o),c);return p.precision=m,t==null?(Ct=!0,bt(o,m)):o}o=s}}function Ft(e){for(var t=e.e*Tt,n=e.d[0];n>=10;n/=10)t++;return t}function $S(e,t,n){if(t>e.LN10.sd())throw Ct=!0,n&&(e.precision=n),Error(Xr+"LN10 precision limit exceeded");return bt(new e(e.LN10),t)}function io(e){for(var t="";e--;)t+="0";return t}function qf(e,t){var n,r,a,o,s,c,f,h,p,m=1,g=10,y=e,S=y.d,x=y.constructor,w=x.precision;if(y.s<1)throw Error(Xr+(y.s?"NaN":"-Infinity"));if(y.eq(br))return new x(0);if(t==null?(Ct=!1,h=w):h=t,y.eq(10))return t==null&&(Ct=!0),$S(x,h);if(h+=g,x.precision=h,n=Aa(S),r=n.charAt(0),o=Ft(y),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=Aa(y.d),r=n.charAt(0),m++;o=Ft(y),r>1?(y=new x("0."+n),o++):y=new x(r+"."+n.slice(1))}else return f=$S(x,h+2,w).times(o+""),y=qf(new x(r+"."+n.slice(1)),h-g).plus(f),x.precision=w,t==null?(Ct=!0,bt(y,w)):y;for(c=s=y=yi(y.minus(br),y.plus(br),h),p=bt(y.times(y),h),a=3;;){if(s=bt(s.times(p),h),f=c.plus(yi(s,new x(a),h)),Aa(f.d).slice(0,h)===Aa(c.d).slice(0,h))return c=c.times(2),o!==0&&(c=c.plus($S(x,h+2,w).times(o+""))),c=yi(c,new x(m),h),x.precision=w,t==null?(Ct=!0,bt(c,w)):c;c=f,a+=2}}function ID(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=$c(n/Tt),e.d=[],r=(n+1)%Tt,n<0&&(r+=Tt),rEm||e.e<-Em))throw Error(YA+n)}else e.s=0,e.e=0,e.d=[0];return e}function bt(e,t,n){var r,a,o,s,c,f,h,p,m=e.d;for(s=1,o=m[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=Tt,a=t,h=m[p=0];else{if(p=Math.ceil((r+1)/Tt),o=m.length,p>=o)return e;for(h=o=m[p],s=1;o>=10;o/=10)s++;r%=Tt,a=r-Tt+s}if(n!==void 0&&(o=Xo(10,s-a-1),c=h/o%10|0,f=t<0||m[p+1]!==void 0||h%o,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?a>0?h/Xo(10,s-a):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return f?(o=Ft(e),m.length=1,t=t-o-1,m[0]=Xo(10,(Tt-t%Tt)%Tt),e.e=$c(-t/Tt)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,o=1,p--):(m.length=p+1,o=Xo(10,Tt-r),m[p]=a>0?(h/Xo(10,s-a)%Xo(10,a)|0)*o:0),f)for(;;)if(p==0){(m[0]+=o)==en&&(m[0]=1,++e.e);break}else{if(m[p]+=o,m[p]!=en)break;m[p--]=0,o=1}for(r=m.length;m[--r]===0;)m.pop();if(Ct&&(e.e>Em||e.e<-Em))throw Error(YA+Ft(e));return e}function mz(e,t){var n,r,a,o,s,c,f,h,p,m,g=e.constructor,y=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Ct?bt(t,y):t;if(f=e.d,m=t.d,r=t.e,h=e.e,f=f.slice(),s=h-r,s){for(p=s<0,p?(n=f,s=-s,c=m.length):(n=m,r=h,c=f.length),a=Math.max(Math.ceil(y/Tt),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=f.length,c=m.length,p=a0;--a)f[c++]=0;for(a=m.length;a>s;){if(f[--a]0?o=o.charAt(0)+"."+o.slice(1)+io(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+io(-a-1)+o,n&&(r=n-s)>0&&(o+=io(r))):a>=s?(o+=io(a+1-s),n&&(r=n-a-1)>0&&(o=o+"."+io(r))):((r=a+1)0&&(a+1===s&&(o+="."),o+=io(r))),e.s<0?"-"+o:o}function BD(e,t){if(e.length>t)return e.length=t,!0}function vz(e){var t,n,r;function a(o){var s=this;if(!(s instanceof a))return new a(o);if(s.constructor=a,o instanceof a){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(us+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return ID(s,o.toString())}else if(typeof o!="string")throw Error(us+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,bre.test(o))ID(s,o);else throw Error(us+o)}if(a.prototype=_e,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=vz,a.config=a.set=xre,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(us+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(us+n+": "+r);return this}var XA=vz(yre);br=new XA(1);const gt=XA;function wre(e){return Are(e)||jre(e)||_re(e)||Sre()}function Sre(){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 _re(e,t){if(e){if(typeof e=="string")return w_(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 w_(e,t)}}function jre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Are(e){if(Array.isArray(e))return w_(e)}function w_(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-s,zD(function(){for(var c=arguments.length,f=new Array(c),h=0;he.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 s=e[Symbol.iterator](),c;!(r=(c=s.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(f){a=!0,o=f}finally{try{!r&&s.return!=null&&s.return()}finally{if(a)throw o}}return n}}function zre(e){if(Array.isArray(e))return e}function wz(e){var t=Uf(e,2),n=t[0],r=t[1],a=n,o=r;return n>r&&(a=r,o=n),[a,o]}function Sz(e,t,n){if(e.lte(0))return new gt(0);var r=Yv.getDigitCount(e.toNumber()),a=new gt(10).pow(r),o=e.div(a),s=r!==1?.05:.1,c=new gt(Math.ceil(o.div(s).toNumber())).add(n).mul(s),f=c.mul(a);return t?f:new gt(Math.ceil(f))}function qre(e,t,n){var r=1,a=new gt(e);if(!a.isint()&&n){var o=Math.abs(e);o<1?(r=new gt(10).pow(Yv.getDigitCount(e)-1),a=new gt(Math.floor(a.div(r).toNumber())).mul(r)):o>1&&(a=new gt(Math.floor(e)))}else e===0?a=new gt(Math.floor((t-1)/2)):n||(a=new gt(Math.floor(e)));var s=Math.floor((t-1)/2),c=Nre(Tre(function(f){return a.add(new gt(f-s).mul(r)).toNumber()}),S_);return c(0,t)}function _z(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 gt(0),tickMin:new gt(0),tickMax:new gt(0)};var o=Sz(new gt(t).sub(e).div(n-1),r,a),s;e<=0&&t>=0?s=new gt(0):(s=new gt(e).add(t).div(2),s=s.sub(new gt(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),f=Math.ceil(new gt(t).sub(s).div(o).toNumber()),h=c+f+1;return h>n?_z(e,t,n,r,a+1):(h0?f+(n-h):f,c=t>0?c:c+(n-h)),{step:o,tickMin:s.sub(new gt(c).mul(o)),tickMax:s.add(new gt(f).mul(o))})}function Ure(e){var t=Uf(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,s=Math.max(a,2),c=wz([n,r]),f=Uf(c,2),h=f[0],p=f[1];if(h===-1/0||p===1/0){var m=p===1/0?[h].concat(j_(S_(0,a-1).map(function(){return 1/0}))):[].concat(j_(S_(0,a-1).map(function(){return-1/0})),[p]);return n>r?__(m):m}if(h===p)return qre(h,a,o);var g=_z(h,p,s,o),y=g.step,S=g.tickMin,x=g.tickMax,w=Yv.rangeStep(S,x.add(new gt(.1).mul(y)),y);return n>r?__(w):w}function Fre(e,t){var n=Uf(e,2),r=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=wz([r,a]),c=Uf(s,2),f=c[0],h=c[1];if(f===-1/0||h===1/0)return[r,a];if(f===h)return[f];var p=Math.max(t,2),m=Sz(new gt(h).sub(f).div(p-1),o,0),g=[].concat(j_(Yv.rangeStep(new gt(f),new gt(h).sub(new gt(.99).mul(m)),m)),[h]);return r>a?__(g):g}var Hre=bz(Ure),Vre=bz(Fre),Gre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ic(e){"@babel/helpers - typeof";return ic=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},ic(e)}function Tm(){return Tm=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 Jre(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 eae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tae(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,s=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var f=o.range,h=0;h0?a[h-1].coordinate:a[c-1].coordinate,m=a[h].coordinate,g=h>=c-1?a[0].coordinate:a[h+1].coordinate,y=void 0;if(Rn(m-p)!==Rn(g-m)){var S=[];if(Rn(g-m)===Rn(f[1]-f[0])){y=g;var x=m+f[1]-f[0];S[0]=Math.min(x,(x+p)/2),S[1]=Math.max(x,(x+p)/2)}else{y=p;var w=g+f[1]-f[0];S[0]=Math.min(m,(w+m)/2),S[1]=Math.max(m,(w+m)/2)}var A=[Math.min(m,(y+m)/2),Math.max(m,(y+m)/2)];if(t>A[0]&&t<=A[1]||t>=S[0]&&t<=S[1]){s=a[h].index;break}}else{var O=Math.min(p,g),E=Math.max(p,g);if(t>(O+m)/2&&t<=(E+m)/2){s=a[h].index;break}}}else for(var N=0;N0&&N(r[N].coordinate+r[N-1].coordinate)/2&&t<=(r[N].coordinate+r[N+1].coordinate)/2||N===c-1&&t>(r[N].coordinate+r[N-1].coordinate)/2){s=r[N].index;break}return s},ZA=function(t){var n,r=t,a=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?kt(kt({},t.type.defaultProps),t.props):t.props,s=o.stroke,c=o.fill,f;switch(a){case"Line":f=s;break;case"Area":case"Radar":f=s&&s!=="none"?s:c;break;default:f=c;break}return f},yae=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,o=a===void 0?{}:a;if(!o)return{};for(var s={},c=Object.keys(o),f=0,h=c.length;f=0});if(A&&A.length){var O=A[0].type.defaultProps,E=O!==void 0?kt(kt({},O),A[0].props):A[0].props,N=E.barSize,T=E[w];s[T]||(s[T]=[]);var C=ze(N)?n:N;s[T].push({item:A[0],stackList:A.slice(1),barSize:ze(C)?void 0:Pn(C,r,0)})}}return s},bae=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,c=t.maxBarSize,f=s.length;if(f<1)return null;var h=Pn(n,a,0,!0),p,m=[];if(s[0].barSize===+s[0].barSize){var g=!1,y=a/f,S=s.reduce(function(N,T){return N+T.barSize||0},0);S+=(f-1)*h,S>=a&&(S-=(f-1)*h,h=0),S>=a&&y>0&&(g=!0,y*=.9,S=f*y);var x=(a-S)/2>>0,w={offset:x-h,size:0};p=s.reduce(function(N,T){var C={item:T.item,position:{offset:w.offset+w.size+h,size:g?y:T.barSize}},R=[].concat(FD(N),[C]);return w=R[R.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(M){R.push({item:M,position:w})}),R},m)}else{var A=Pn(r,a,0,!0);a-2*A-(f-1)*h<=0&&(h=0);var O=(a-2*A-(f-1)*h)/f;O>1&&(O>>=0);var E=c===+c?Math.min(O,c):O;p=s.reduce(function(N,T,C){var R=[].concat(FD(N),[{item:T.item,position:{offset:A+(O+h)*C+(O-E)/2,size:E}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(M){R.push({item:M,position:R[R.length-1].position})}),R},m)}return p},xae=function(t,n,r,a){var o=r.children,s=r.width,c=r.margin,f=s-(c.left||0)-(c.right||0),h=Ez({children:o,legendWidth:f});if(h){var p=a||{},m=p.width,g=p.height,y=h.align,S=h.verticalAlign,x=h.layout;if((x==="vertical"||x==="horizontal"&&S==="middle")&&y!=="center"&&xe(t[y]))return kt(kt({},t),{},zl({},y,t[y]+(m||0)));if((x==="horizontal"||x==="vertical"&&y==="center")&&S!=="middle"&&xe(t[S]))return kt(kt({},t),{},zl({},S,t[S]+(g||0)))}return t},wae=function(t,n,r){return ze(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Tz=function(t,n,r,a,o){var s=n.props.children,c=wr(s,Ed).filter(function(h){return wae(a,o,h.props.direction)});if(c&&c.length){var f=c.map(function(h){return h.props.dataKey});return t.reduce(function(h,p){var m=Yt(p,r);if(ze(m))return h;var g=Array.isArray(m)?[Kv(m),Gv(m)]:[m,m],y=f.reduce(function(S,x){var w=Yt(p,x,0),A=g[0]-Math.abs(Array.isArray(w)?w[0]:w),O=g[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(A,S[0]),Math.max(O,S[1])]},[1/0,-1/0]);return[Math.min(y[0],h[0]),Math.max(y[1],h[1])]},[1/0,-1/0])}return null},Sae=function(t,n,r,a,o){var s=n.map(function(c){return Tz(t,c,r,o,a)}).filter(function(c){return!ze(c)});return s&&s.length?s.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]):null},Nz=function(t,n,r,a,o){var s=n.map(function(f){var h=f.props.dataKey;return r==="number"&&h&&Tz(t,f,h,a)||bf(t,h,r,o)});if(r==="number")return s.reduce(function(f,h){return[Math.min(f[0],h[0]),Math.max(f[1],h[1])]},[1/0,-1/0]);var c={};return s.reduce(function(f,h){for(var p=0,m=h.length;p=2?Rn(c[0]-c[1])*2*h:h,n&&(t.ticks||t.niceTicks)){var p=(t.ticks||t.niceTicks).map(function(m){var g=o?o.indexOf(m):m;return{coordinate:a(g)+h,value:m,offset:h}});return p.filter(function(m){return!xd(m.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(m,g){return{coordinate:a(m)+h,value:m,index:g,offset:h}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(m){return{coordinate:a(m)+h,value:m,offset:h}}):a.domain().map(function(m,g){return{coordinate:a(m)+h,value:o?o[m]:m,index:g,offset:h}})},IS=new WeakMap,gp=function(t,n){if(typeof n!="function")return t;IS.has(t)||IS.set(t,new WeakMap);var r=IS.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},Pz=function(t,n,r){var a=t.scale,o=t.type,s=t.layout,c=t.axisType;if(a==="auto")return s==="radial"&&c==="radiusAxis"?{scale:Lf(),realScaleType:"band"}:s==="radial"&&c==="angleAxis"?{scale:_m(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:yf(),realScaleType:"point"}:o==="category"?{scale:Lf(),realScaleType:"band"}:{scale:_m(),realScaleType:"linear"};if(ms(a)){var f="scale".concat(Rv(a));return{scale:(ND[f]||yf)(),realScaleType:ND[f]?f:"point"}}return $e(a)?{scale:a}:{scale:yf(),realScaleType:"point"}},VD=1e-4,Mz=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])-VD,s=Math.max(a[0],a[1])+VD,c=t(n[0]),f=t(n[r-1]);(cs||fs)&&t.domain([n[0],n[r-1]])}},_ae=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[c][r][0]=o,t[c][r][1]=o+f,o=t[c][r][1]):(t[c][r][0]=s,t[c][r][1]=s+f,s=t[c][r][1])}},Oae=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r=0?(t[s][r][0]=o,t[s][r][1]=o+c,o=t[s][r][1]):(t[s][r][0]=0,t[s][r][1]=0)}},Eae={sign:Aae,expand:pZ,none:Zl,silhouette:mZ,wiggle:vZ,positive:Oae},Tae=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),o=Eae[r],s=hZ().keys(a).value(function(c,f){return+Yt(c,f,0)}).order(r_).offset(o);return s(t)},Nae=function(t,n,r,a,o,s){if(!t)return null;var c=s?n.reverse():n,f={},h=c.reduce(function(m,g){var y,S=(y=g.type)!==null&&y!==void 0&&y.defaultProps?kt(kt({},g.type.defaultProps),g.props):g.props,x=S.stackId,w=S.hide;if(w)return m;var A=S[r],O=m[A]||{hasStack:!1,stackGroups:{}};if(Xt(x)){var E=O.stackGroups[x]||{numericAxisId:r,cateAxisId:a,items:[]};E.items.push(g),O.hasStack=!0,O.stackGroups[x]=E}else O.stackGroups[Mc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return kt(kt({},m),{},zl({},A,O))},f),p={};return Object.keys(h).reduce(function(m,g){var y=h[g];if(y.hasStack){var S={};y.stackGroups=Object.keys(y.stackGroups).reduce(function(x,w){var A=y.stackGroups[w];return kt(kt({},x),{},zl({},w,{numericAxisId:r,cateAxisId:a,items:A.items,stackedData:Tae(t,A.items,o)}))},S)}return kt(kt({},m),{},zl({},g,y))},p)},kz=function(t,n){var r=n.realScaleType,a=n.type,o=n.tickCount,s=n.originalDomain,c=n.allowDecimals,f=r||n.scale;if(f!=="auto"&&f!=="linear")return null;if(o&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var h=t.domain();if(!h.length)return null;var p=Hre(h,o,c);return t.domain([Kv(p),Gv(p)]),{niceTicks:p}}if(o&&a==="number"){var m=t.domain(),g=Vre(m,o,c);return{niceTicks:g}}return null};function GD(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ze(a[t.dataKey])){var c=im(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var f=Yt(a,ze(s)?t.dataKey:s);return ze(f)?null:t.scale(f)}var KD=function(t){var n=t.axis,r=t.ticks,a=t.offset,o=t.bandSize,s=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+a:null;var f=Yt(s,n.dataKey,n.domain[c]);return ze(f)?null:n.scale(f)-o/2+a},Cae=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]},Rae=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?kt(kt({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(Xt(o)){var s=n[o];if(s){var c=s.items.indexOf(t);return c>=0?s.stackedData[c]:null}}return null},Pae=function(t){return t.reduce(function(n,r){return[Kv(r.concat([n[0]]).filter(xe)),Gv(r.concat([n[1]]).filter(xe))]},[1/0,-1/0])},Dz=function(t,n,r){return Object.keys(t).reduce(function(a,o){var s=t[o],c=s.stackedData,f=c.reduce(function(h,p){var m=Pae(p.slice(n,r+1));return[Math.min(h[0],m[0]),Math.max(h[1],m[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},WD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,YD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,T_=function(t,n,r){if($e(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(xe(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(WD.test(t[0])){var o=+WD.exec(t[0])[1];a[0]=n[0]-o}else $e(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(xe(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(YD.test(t[1])){var s=+YD.exec(t[1])[1];a[1]=n[1]+s}else $e(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Cm=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=AA(n,function(m){return m.coordinate}),s=1/0,c=1,f=o.length;ce.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},qae=function(t,n,r,a,o){var s=t.width,c=t.height,f=t.startAngle,h=t.endAngle,p=Pn(t.cx,s,s/2),m=Pn(t.cy,c,c/2),g=Iz(s,c,r),y=Pn(t.innerRadius,g,0),S=Pn(t.outerRadius,g,g*.8),x=Object.keys(n);return x.reduce(function(w,A){var O=n[A],E=O.domain,N=O.reversed,T;if(ze(O.range))a==="angleAxis"?T=[f,h]:a==="radiusAxis"&&(T=[y,S]),N&&(T=[T[1],T[0]]);else{T=O.range;var C=T,R=Dae(C,2);f=R[0],h=R[1]}var M=Pz(O,o),k=M.realScaleType,z=M.scale;z.domain(E).range(T),Mz(z);var L=kz(z,ci(ci({},O),{},{realScaleType:k})),B=ci(ci(ci({},O),L),{},{range:T,radius:S,realScaleType:k,scale:z,cx:p,cy:m,innerRadius:y,outerRadius:S,startAngle:f,endAngle:h});return ci(ci({},w),{},$z({},A,B))},{})},Uae=function(t,n){var r=t.x,a=t.y,o=n.x,s=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(a-s,2))},Fae=function(t,n){var r=t.x,a=t.y,o=n.cx,s=n.cy,c=Uae({x:r,y:a},{x:o,y:s});if(c<=0)return{radius:c};var f=(r-o)/c,h=Math.acos(f);return a>s&&(h=2*Math.PI-h),{radius:c,angle:zae(h),angleInRadian:h}},Hae=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(a,o);return{startAngle:n-s*360,endAngle:r-s*360}},Vae=function(t,n){var r=n.startAngle,a=n.endAngle,o=Math.floor(r/360),s=Math.floor(a/360),c=Math.min(o,s);return t+c*360},JD=function(t,n){var r=t.x,a=t.y,o=Fae({x:r,y:a},n),s=o.radius,c=o.angle,f=n.innerRadius,h=n.outerRadius;if(sh)return!1;if(s===0)return!0;var p=Hae(n),m=p.startAngle,g=p.endAngle,y=c,S;if(m<=g){for(;y>g;)y-=360;for(;y=m&&y<=g}else{for(;y>m;)y-=360;for(;y=g&&y<=m}return S?ci(ci({},n),{},{radius:s,angle:Vae(y,n)}):null},Bz=function(t){return!_.isValidElement(t)&&!$e(t)&&typeof t!="boolean"?t.className:""};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 Gae=["offset"];function Kae(e){return Zae(e)||Xae(e)||Yae(e)||Wae()}function Wae(){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 Yae(e,t){if(e){if(typeof e=="string")return N_(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 N_(e,t)}}function Xae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zae(e){if(Array.isArray(e))return N_(e)}function N_(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 Jae(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 eL(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 Kt(e){for(var t=1;t=0?1:-1,E,N;a==="insideStart"?(E=y+O*s,N=x):a==="insideEnd"?(E=S-O*s,N=!x):a==="end"&&(E=S+O*s,N=x),N=A<=0?N:!N;var T=jt(h,p,w,E),C=jt(h,p,w,E+(N?1:-1)*359),R="M".concat(T.x,",").concat(T.y,` A`).concat(w,",").concat(w,",0,1,").concat(N?0:1,`, `).concat(C.x,",").concat(C.y),M=ze(t.id)?Mc("recharts-radial-line-"):t.id;return K.createElement("text",Kf({},r,{dominantBaseline:"central",className:qe("recharts-radial-bar-label",c)}),K.createElement("defs",null,K.createElement("path",{id:M,d:R})),K.createElement("textPath",{xlinkHref:"#".concat(M)},n))},oie=function(t){var n=t.viewBox,r=t.offset,a=t.position,o=n,s=o.cx,c=o.cy,f=o.innerRadius,h=o.outerRadius,p=o.startAngle,m=o.endAngle,g=(p+m)/2;if(a==="outside"){var y=jt(s,c,h+r,g),S=y.x,x=y.y;return{x:S,y:x,textAnchor:S>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:c,textAnchor:"middle",verticalAnchor:"end"};var w=(f+h)/2,A=jt(s,c,w,g),O=A.x,E=A.y;return{x:O,y:E,textAnchor:"middle",verticalAnchor:"middle"}},sie=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,o=t.position,s=n,c=s.x,f=s.y,h=s.width,p=s.height,m=p>=0?1:-1,g=m*a,y=m>0?"end":"start",S=m>0?"start":"end",x=h>=0?1:-1,w=x*a,A=x>0?"end":"start",O=x>0?"start":"end";if(o==="top"){var E={x:c+h/2,y:f-m*a,textAnchor:"middle",verticalAnchor:y};return Kt(Kt({},E),r?{height:Math.max(f-r.y,0),width:h}:{})}if(o==="bottom"){var N={x:c+h/2,y:f+p+g,textAnchor:"middle",verticalAnchor:S};return Kt(Kt({},N),r?{height:Math.max(r.y+r.height-(f+p),0),width:h}:{})}if(o==="left"){var T={x:c-w,y:f+p/2,textAnchor:A,verticalAnchor:"middle"};return Kt(Kt({},T),r?{width:Math.max(T.x-r.x,0),height:p}:{})}if(o==="right"){var C={x:c+h+w,y:f+p/2,textAnchor:O,verticalAnchor:"middle"};return Kt(Kt({},C),r?{width:Math.max(r.x+r.width-C.x,0),height:p}:{})}var R=r?{width:h,height:p}:{};return o==="insideLeft"?Kt({x:c+w,y:f+p/2,textAnchor:O,verticalAnchor:"middle"},R):o==="insideRight"?Kt({x:c+h-w,y:f+p/2,textAnchor:A,verticalAnchor:"middle"},R):o==="insideTop"?Kt({x:c+h/2,y:f+g,textAnchor:"middle",verticalAnchor:S},R):o==="insideBottom"?Kt({x:c+h/2,y:f+p-g,textAnchor:"middle",verticalAnchor:y},R):o==="insideTopLeft"?Kt({x:c+w,y:f+g,textAnchor:O,verticalAnchor:S},R):o==="insideTopRight"?Kt({x:c+h-w,y:f+g,textAnchor:A,verticalAnchor:S},R):o==="insideBottomLeft"?Kt({x:c+w,y:f+p-g,textAnchor:O,verticalAnchor:y},R):o==="insideBottomRight"?Kt({x:c+h-w,y:f+p-g,textAnchor:A,verticalAnchor:y},R):Pc(o)&&(xe(o.x)||Jo(o.x))&&(xe(o.y)||Jo(o.y))?Kt({x:c+Pn(o.x,h),y:f+Pn(o.y,p),textAnchor:"end",verticalAnchor:"end"},R):Kt({x:c+h/2,y:f+p/2,textAnchor:"middle",verticalAnchor:"middle"},R)},lie=function(t){return"cx"in t&&xe(t.cx)};function tn(e){var t=e.offset,n=t===void 0?5:t,r=Qae(e,Gae),a=Kt({offset:n},r),o=a.viewBox,s=a.position,c=a.value,f=a.children,h=a.content,p=a.className,m=p===void 0?"":p,g=a.textBreakAll;if(!o||ze(c)&&ze(f)&&!_.isValidElement(h)&&!$e(h))return null;if(_.isValidElement(h))return _.cloneElement(h,a);var y;if($e(h)){if(y=_.createElement(h,a),_.isValidElement(y))return y}else y=rie(a);var S=lie(o),x=Pe(a,!0);if(S&&(s==="insideStart"||s==="insideEnd"||s==="end"))return iie(a,y,x);var w=S?oie(a):sie(a);return K.createElement(gs,Kf({className:qe("recharts-label",m)},x,w,{breakAll:g}),y)}tn.displayName="Label";var zz=function(t){var n=t.cx,r=t.cy,a=t.angle,o=t.startAngle,s=t.endAngle,c=t.r,f=t.radius,h=t.innerRadius,p=t.outerRadius,m=t.x,g=t.y,y=t.top,S=t.left,x=t.width,w=t.height,A=t.clockWise,O=t.labelViewBox;if(O)return O;if(xe(x)&&xe(w)){if(xe(m)&&xe(g))return{x:m,y:g,width:x,height:w};if(xe(y)&&xe(S))return{x:y,y:S,width:x,height:w}}return xe(m)&&xe(g)?{x:m,y:g,width:0,height:0}:xe(n)&&xe(r)?{cx:n,cy:r,startAngle:o||a||0,endAngle:s||a||0,innerRadius:h||0,outerRadius:p||f||c||0,clockWise:A}:t.viewBox?t.viewBox:{}},cie=function(t,n){return t?t===!0?K.createElement(tn,{key:"label-implicit",viewBox:n}):Xt(t)?K.createElement(tn,{key:"label-implicit",viewBox:n,value:t}):_.isValidElement(t)?t.type===tn?_.cloneElement(t,{key:"label-implicit",viewBox:n}):K.createElement(tn,{key:"label-implicit",content:t,viewBox:n}):$e(t)?K.createElement(tn,{key:"label-implicit",content:t,viewBox:n}):Pc(t)?K.createElement(tn,Kf({viewBox:n},t,{key:"label-implicit"})):null:null},uie=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=zz(t),s=wr(a,tn).map(function(f,h){return _.cloneElement(f,{viewBox:n||o,key:"label-".concat(h)})});if(!r)return s;var c=cie(t.label,n||o);return[c].concat(Kae(s))};tn.parseViewBox=zz;tn.renderCallByParent=uie;var BS,tL;function fie(){if(tL)return BS;tL=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return BS=e,BS}var die=fie();const hie=ut(die);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 pie=["valueAccessor"],mie=["data","dataKey","clockWise","id","textBreakAll"];function vie(e){return xie(e)||bie(e)||yie(e)||gie()}function gie(){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 yie(e,t){if(e){if(typeof e=="string")return C_(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 C_(e,t)}}function bie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xie(e){if(Array.isArray(e))return C_(e)}function C_(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 jie(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 Aie=function(t){return Array.isArray(t.value)?hie(t.value):t.value};function bi(e){var t=e.valueAccessor,n=t===void 0?Aie:t,r=aL(e,pie),a=r.data,o=r.dataKey,s=r.clockWise,c=r.id,f=r.textBreakAll,h=aL(r,mie);return!a||!a.length?null:K.createElement(at,{className:"recharts-label-list"},a.map(function(p,m){var g=ze(o)?n(p,m):Yt(p&&p.payload,o),y=ze(c)?{}:{id:"".concat(c,"-").concat(m)};return K.createElement(tn,Pm({},Pe(p,!0),h,y,{parentViewBox:p.parentViewBox,value:g,textBreakAll:f,viewBox:tn.parseViewBox(ze(s)?p:rL(rL({},p),{},{clockWise:s})),key:"label-".concat(m),index:m}))}))}bi.displayName="LabelList";function Oie(e,t){return e?e===!0?K.createElement(bi,{key:"labelList-implicit",data:t}):K.isValidElement(e)||$e(e)?K.createElement(bi,{key:"labelList-implicit",data:t,content:e}):Pc(e)?K.createElement(bi,Pm({data:t},e,{key:"labelList-implicit"})):null:null}function Eie(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=wr(r,bi).map(function(s,c){return _.cloneElement(s,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var o=Oie(e.label,t);return[o].concat(vie(a))}bi.renderCallByParent=Eie;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 R_(){return R_=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>h),`, `).concat(m.x,",").concat(m.y,` `);if(a>0){var y=jt(n,r,a,s),S=jt(n,r,a,h);g+="L ".concat(S.x,",").concat(S.y,` A `).concat(a,",").concat(a,`,0, `).concat(+(Math.abs(f)>180),",").concat(+(s<=h),`, `).concat(y.x,",").concat(y.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},Pie=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,p=t.endAngle,m=Rn(p-h),g=yp({cx:n,cy:r,radius:o,angle:h,sign:m,cornerRadius:s,cornerIsExternal:f}),y=g.circleTangency,S=g.lineTangency,x=g.theta,w=yp({cx:n,cy:r,radius:o,angle:p,sign:-m,cornerRadius:s,cornerIsExternal:f}),A=w.circleTangency,O=w.lineTangency,E=w.theta,N=f?Math.abs(h-p):Math.abs(h-p)-x-E;if(N<0)return c?"M ".concat(S.x,",").concat(S.y,` a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 `):qz({cx:n,cy:r,innerRadius:a,outerRadius:o,startAngle:h,endAngle:p});var T="M ".concat(S.x,",").concat(S.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(m<0),",").concat(y.x,",").concat(y.y,` A`).concat(o,",").concat(o,",0,").concat(+(N>180),",").concat(+(m<0),",").concat(A.x,",").concat(A.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(m<0),",").concat(O.x,",").concat(O.y,` `);if(a>0){var C=yp({cx:n,cy:r,radius:a,angle:h,sign:m,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),R=C.circleTangency,M=C.lineTangency,k=C.theta,z=yp({cx:n,cy:r,radius:a,angle:p,sign:-m,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),L=z.circleTangency,B=z.lineTangency,F=z.theta,U=f?Math.abs(h-p):Math.abs(h-p)-k-F;if(U<0&&s===0)return"".concat(T,"L").concat(n,",").concat(r,"Z");T+="L".concat(B.x,",").concat(B.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(m<0),",").concat(L.x,",").concat(L.y,` A`).concat(a,",").concat(a,",0,").concat(+(U>180),",").concat(+(m>0),",").concat(R.x,",").concat(R.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(m<0),",").concat(M.x,",").concat(M.y,"Z")}else T+="L".concat(n,",").concat(r,"Z");return T},Mie={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Uz=function(t){var n=oL(oL({},Mie),t),r=n.cx,a=n.cy,o=n.innerRadius,s=n.outerRadius,c=n.cornerRadius,f=n.forceCornerRadius,h=n.cornerIsExternal,p=n.startAngle,m=n.endAngle,g=n.className;if(s0&&Math.abs(p-m)<360?w=Pie({cx:r,cy:a,innerRadius:o,outerRadius:s,cornerRadius:Math.min(x,S/2),forceCornerRadius:f,cornerIsExternal:h,startAngle:p,endAngle:m}):w=qz({cx:r,cy:a,innerRadius:o,outerRadius:s,startAngle:p,endAngle:m}),K.createElement("path",R_({},Pe(n,!0),{className:y,d:w,role:"img"}))};function Xf(e){"@babel/helpers - typeof";return Xf=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},Xf(e)}function P_(){return P_=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 Qie(e,t){return ks(e.getTime(),t.getTime())}function Jie(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function eoe(e,t){return e===t}function gL(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(),s,c,f=0;(s=o.next())&&!s.done;){for(var h=t.entries(),p=!1,m=0;(c=h.next())&&!c.done;){if(a[m]){m++;continue}var g=s.value,y=c.value;if(n.equals(g[0],y[0],f,m,e,t,n)&&n.equals(g[1],y[1],g[0],y[0],e,t,n)){p=a[m]=!0;break}m++}if(!p)return!1;f++}return!0}var toe=ks;function noe(e,t,n){var r=vL(e),a=r.length;if(vL(t).length!==a)return!1;for(;a-- >0;)if(!Fz(e,t,n,r[a]))return!1;return!0}function tf(e,t,n){var r=pL(e),a=r.length;if(pL(t).length!==a)return!1;for(var o,s,c;a-- >0;)if(o=r[a],!Fz(e,t,n,o)||(s=mL(e,o),c=mL(t,o),(s||c)&&(!s||!c||s.configurable!==c.configurable||s.enumerable!==c.enumerable||s.writable!==c.writable)))return!1;return!0}function roe(e,t){return ks(e.valueOf(),t.valueOf())}function aoe(e,t){return e.source===t.source&&e.flags===t.flags}function yL(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(),s,c;(s=o.next())&&!s.done;){for(var f=t.values(),h=!1,p=0;(c=f.next())&&!c.done;){if(!a[p]&&n.equals(s.value,c.value,s.value,c.value,e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1}return!0}function ioe(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 ooe(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 Fz(e,t,n,r){return(r===Xie||r===Yie||r===Wie)&&(e.$$typeof||t.$$typeof)?!0:Kie(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var soe="[object Arguments]",loe="[object Boolean]",coe="[object Date]",uoe="[object Error]",foe="[object Map]",doe="[object Number]",hoe="[object Object]",poe="[object RegExp]",moe="[object Set]",voe="[object String]",goe="[object URL]",yoe=Array.isArray,bL=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,xL=Object.assign,boe=Object.prototype.toString.call.bind(Object.prototype.toString);function xoe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,o=e.areMapsEqual,s=e.areNumbersEqual,c=e.areObjectsEqual,f=e.arePrimitiveWrappersEqual,h=e.areRegExpsEqual,p=e.areSetsEqual,m=e.areTypedArraysEqual,g=e.areUrlsEqual,y=e.unknownTagComparators;return function(x,w,A){if(x===w)return!0;if(x==null||w==null)return!1;var O=typeof x;if(O!==typeof w)return!1;if(O!=="object")return O==="number"?s(x,w,A):O==="function"?a(x,w,A):!1;var E=x.constructor;if(E!==w.constructor)return!1;if(E===Object)return c(x,w,A);if(yoe(x))return t(x,w,A);if(bL!=null&&bL(x))return m(x,w,A);if(E===Date)return n(x,w,A);if(E===RegExp)return h(x,w,A);if(E===Map)return o(x,w,A);if(E===Set)return p(x,w,A);var N=boe(x);if(N===coe)return n(x,w,A);if(N===poe)return h(x,w,A);if(N===foe)return o(x,w,A);if(N===moe)return p(x,w,A);if(N===hoe)return typeof x.then!="function"&&typeof w.then!="function"&&c(x,w,A);if(N===goe)return g(x,w,A);if(N===uoe)return r(x,w,A);if(N===soe)return c(x,w,A);if(N===loe||N===doe||N===voe)return f(x,w,A);if(y){var T=y[N];if(!T){var C=Gie(x);C&&(T=y[C])}if(T)return T(x,w,A)}return!1}}function woe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?tf:Zie,areDatesEqual:Qie,areErrorsEqual:Jie,areFunctionsEqual:eoe,areMapsEqual:r?hL(gL,tf):gL,areNumbersEqual:toe,areObjectsEqual:r?tf:noe,arePrimitiveWrappersEqual:roe,areRegExpsEqual:aoe,areSetsEqual:r?hL(yL,tf):yL,areTypedArraysEqual:r?tf:ioe,areUrlsEqual:ooe,unknownTagComparators:void 0};if(n&&(a=xL({},a,n(a))),t){var o=xp(a.areArraysEqual),s=xp(a.areMapsEqual),c=xp(a.areObjectsEqual),f=xp(a.areSetsEqual);a=xL({},a,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:c,areSetsEqual:f})}return a}function Soe(e){return function(t,n,r,a,o,s,c){return e(t,n,c)}}function _oe(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,o=e.strict;if(r)return function(f,h){var p=r(),m=p.cache,g=m===void 0?t?new WeakMap:void 0:m,y=p.meta;return n(f,h,{cache:g,equals:a,meta:y,strict:o})};if(t)return function(f,h){return n(f,h,{cache:new WeakMap,equals:a,meta:void 0,strict:o})};var s={cache:void 0,equals:a,meta:void 0,strict:o};return function(f,h){return n(f,h,s)}}var joe=So();So({strict:!0});So({circular:!0});So({circular:!0,strict:!0});So({createInternalComparator:function(){return ks}});So({strict:!0,createInternalComparator:function(){return ks}});So({circular:!0,createInternalComparator:function(){return ks}});So({circular:!0,createInternalComparator:function(){return ks},strict:!0});function So(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,o=e.strict,s=o===void 0?!1:o,c=woe(e),f=xoe(c),h=r?r(f):Soe(f);return _oe({circular:n,comparator:f,createState:a,equals:h,strict:s})}function Aoe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function wL(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):Aoe(a)};requestAnimationFrame(r)}function M_(e){"@babel/helpers - typeof";return M_=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},M_(e)}function Ooe(e){return Coe(e)||Noe(e)||Toe(e)||Eoe()}function Eoe(){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 Toe(e,t){if(e){if(typeof e=="string")return SL(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 SL(e,t)}}function SL(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:A<0?0:A},x=function(A){for(var O=A>1?1:A,E=O,N=0;N<8;++N){var T=m(E)-O,C=y(E);if(Math.abs(T-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,s=t.dt,c=s===void 0?17:s,f=function(p,m,g){var y=-(p-m)*r,S=g*o,x=g+(y-S)*c/1e3,w=g*c/1e3+p;return Math.abs(w-m)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 sse(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 FS(e){return fse(e)||use(e)||cse(e)||lse()}function lse(){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 cse(e,t){if(e){if(typeof e=="string")return I_(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 I_(e,t)}}function use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fse(e){if(Array.isArray(e))return I_(e)}function I_(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 Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(e)}var Da=(function(e){vse(n,e);var t=gse(n);function n(r,a){var o;dse(this,n),o=t.call(this,r,a);var s=o.props,c=s.isActive,f=s.attributeName,h=s.from,p=s.to,m=s.steps,g=s.children,y=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(q_(o)),o.changeStyle=o.changeStyle.bind(q_(o)),!c||y<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:p}),z_(o);if(m&&m.length)o.state={style:m[0].style};else if(h){if(typeof g=="function")return o.state={style:h},z_(o);o.state={style:f?ff({},f,h):h}}else o.state={style:{}};return o}return pse(n,[{key:"componentDidMount",value:function(){var a=this.props,o=a.isActive,s=a.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var o=this.props,s=o.isActive,c=o.canBegin,f=o.attributeName,h=o.shouldReAnimate,p=o.to,m=o.from,g=this.state.style;if(c){if(!s){var y={style:f?ff({},f,p):p};this.state&&g&&(f&&g[f]!==p||!f&&g!==p)&&this.setState(y);return}if(!(joe(a.to,p)&&a.canBegin&&a.isActive)){var S=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var x=S||h?m:a.to;if(this.state&&g){var w={style:f?ff({},f,x):x};(f&&g[f]!==x||!f&&g!==x)&&this.setState(w)}this.runAnimation(aa(aa({},this.props),{},{from:x,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,s=a.from,c=a.to,f=a.duration,h=a.easing,p=a.begin,m=a.onAnimationEnd,g=a.onAnimationStart,y=ase(s,c,Koe(h),f,this.changeStyle),S=function(){o.stopJSAnimation=y()};this.manager.start([g,p,S,f,m])}},{key:"runStepAnimation",value:function(a){var o=this,s=a.steps,c=a.begin,f=a.onAnimationStart,h=s[0],p=h.style,m=h.duration,g=m===void 0?0:m,y=function(x,w,A){if(A===0)return x;var O=w.duration,E=w.easing,N=E===void 0?"ease":E,T=w.style,C=w.properties,R=w.onAnimationEnd,M=A>0?s[A-1]:w,k=C||Object.keys(T);if(typeof N=="function"||N==="spring")return[].concat(FS(x),[o.runJSAnimation.bind(o,{from:M.style,to:T,duration:O,easing:N}),O]);var z=AL(k,O,N),L=aa(aa(aa({},M.style),T),{},{transition:z});return[].concat(FS(x),[L,O,R]).filter(Doe)};return this.manager.start([f].concat(FS(s.reduce(y,[p,Math.max(g,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Roe());var o=a.begin,s=a.duration,c=a.attributeName,f=a.to,h=a.easing,p=a.onAnimationStart,m=a.onAnimationEnd,g=a.steps,y=a.children,S=this.manager;if(this.unSubscribe=S.subscribe(this.handleStyleChange),typeof h=="function"||typeof y=="function"||h==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var x=c?ff({},c,f):f,w=AL(Object.keys(x),s,h);S.start([p,o,aa(aa({},x),{},{transition:w}),s,m])}},{key:"render",value:function(){var a=this.props,o=a.children;a.begin;var s=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var f=ose(a,ise),h=_.Children.count(o),p=this.state.style;if(typeof o=="function")return o(p);if(!c||h===0||s<=0)return o;var m=function(y){var S=y.props,x=S.style,w=x===void 0?{}:x,A=S.className,O=_.cloneElement(y,aa(aa({},f),{},{style:aa(aa({},w),p),className:A}));return O};return h===1?m(_.Children.only(o)):K.createElement("div",null,_.Children.map(o,function(g){return m(g)}))}}]),n})(_.PureComponent);Da.displayName="Animate";Da.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Da.propTypes={from:ct.oneOfType([ct.object,ct.string]),to:ct.oneOfType([ct.object,ct.string]),attributeName:ct.string,duration:ct.number,begin:ct.number,easing:ct.oneOfType([ct.string,ct.func]),steps:ct.arrayOf(ct.shape({duration:ct.number.isRequired,style:ct.object.isRequired,easing:ct.oneOfType([ct.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ct.func]),properties:ct.arrayOf("string"),onAnimationEnd:ct.func})),children:ct.oneOfType([ct.node,ct.func]),isActive:ct.bool,canBegin:ct.bool,onAnimationEnd:ct.func,shouldReAnimate:ct.bool,onAnimationStart:ct.func,onAnimationReStart:ct.func};function Jf(e){"@babel/helpers - typeof";return Jf=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},Jf(e)}function $m(){return $m=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,f=r>=0?1:-1,h=a>=0&&r>=0||a<0&&r<0?1:0,p;if(s>0&&o instanceof Array){for(var m=[0,0,0,0],g=0,y=4;gs?s:o[g];p="M".concat(t,",").concat(n+c*m[0]),m[0]>0&&(p+="A ".concat(m[0],",").concat(m[0],",0,0,").concat(h,",").concat(t+f*m[0],",").concat(n)),p+="L ".concat(t+r-f*m[1],",").concat(n),m[1]>0&&(p+="A ".concat(m[1],",").concat(m[1],",0,0,").concat(h,`, `).concat(t+r,",").concat(n+c*m[1])),p+="L ".concat(t+r,",").concat(n+a-c*m[2]),m[2]>0&&(p+="A ".concat(m[2],",").concat(m[2],",0,0,").concat(h,`, `).concat(t+r-f*m[2],",").concat(n+a)),p+="L ".concat(t+f*m[3],",").concat(n+a),m[3]>0&&(p+="A ".concat(m[3],",").concat(m[3],",0,0,").concat(h,`, `).concat(t,",").concat(n+a-c*m[3])),p+="Z"}else if(s>0&&o===+o&&o>0){var S=Math.min(s,o);p="M ".concat(t,",").concat(n+c*S,` A `).concat(S,",").concat(S,",0,0,").concat(h,",").concat(t+f*S,",").concat(n,` L `).concat(t+r-f*S,",").concat(n,` A `).concat(S,",").concat(S,",0,0,").concat(h,",").concat(t+r,",").concat(n+c*S,` L `).concat(t+r,",").concat(n+a-c*S,` A `).concat(S,",").concat(S,",0,0,").concat(h,",").concat(t+r-f*S,",").concat(n+a,` L `).concat(t+f*S,",").concat(n+a,` A `).concat(S,",").concat(S,",0,0,").concat(h,",").concat(t,",").concat(n+a-c*S," Z")}else p="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return p},Ese=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,o=n.x,s=n.y,c=n.width,f=n.height;if(Math.abs(c)>0&&Math.abs(f)>0){var h=Math.min(o,o+c),p=Math.max(o,o+c),m=Math.min(s,s+f),g=Math.max(s,s+f);return r>=h&&r<=p&&a>=m&&a<=g}return!1},Tse={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},QA=function(t){var n=ML(ML({},Tse),t),r=_.useRef(),a=_.useState(-1),o=bse(a,2),s=o[0],c=o[1];_.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&c(N)}catch{}},[]);var f=n.x,h=n.y,p=n.width,m=n.height,g=n.radius,y=n.className,S=n.animationEasing,x=n.animationDuration,w=n.animationBegin,A=n.isAnimationActive,O=n.isUpdateAnimationActive;if(f!==+f||h!==+h||p!==+p||m!==+m||p===0||m===0)return null;var E=qe("recharts-rectangle",y);return O?K.createElement(Da,{canBegin:s>0,from:{width:p,height:m,x:f,y:h},to:{width:p,height:m,x:f,y:h},duration:x,animationEasing:S,isActive:O},function(N){var T=N.width,C=N.height,R=N.x,M=N.y;return K.createElement(Da,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:x,isActive:A,easing:S},K.createElement("path",$m({},Pe(n,!0),{className:E,d:kL(R,M,T,C,g),ref:r})))}):K.createElement("path",$m({},Pe(n,!0),{className:E,d:kL(f,h,p,m,g)}))},Nse=["points","className","baseLinePoints","connectNulls"];function kl(){return kl=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 Rse(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 DL(e){return Dse(e)||kse(e)||Mse(e)||Pse()}function Pse(){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 Mse(e,t){if(e){if(typeof e=="string")return U_(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 U_(e,t)}}function kse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dse(e){if(Array.isArray(e))return U_(e)}function U_(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){LL(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),LL(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},wf=function(t,n){var r=Lse(t);n&&(r=[r.reduce(function(o,s){return[].concat(DL(o),DL(s))},[])]);var a=r.map(function(o){return o.reduce(function(s,c,f){return"".concat(s).concat(f===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},$se=function(t,n,r){var a=wf(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(wf(n.reverse(),r).slice(1))},Ise=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,o=t.connectNulls,s=Cse(t,Nse);if(!n||!n.length)return null;var c=qe("recharts-polygon",r);if(a&&a.length){var f=s.stroke&&s.stroke!=="none",h=$se(n,a,o);return K.createElement("g",{className:c},K.createElement("path",kl({},Pe(s,!0),{fill:h.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:h})),f?K.createElement("path",kl({},Pe(s,!0),{fill:"none",d:wf(n,o)})):null,f?K.createElement("path",kl({},Pe(s,!0),{fill:"none",d:wf(a,o)})):null)}var p=wf(n,o);return K.createElement("path",kl({},Pe(s,!0),{fill:p.slice(-1)==="Z"?s.fill:"none",className:c,d:p}))};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 Vse(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 Gse=function(t,n,r,a,o,s){return"M".concat(t,",").concat(o,"v").concat(a,"M").concat(s,",").concat(n,"h").concat(r)},Kse=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,s=t.top,c=s===void 0?0:s,f=t.left,h=f===void 0?0:f,p=t.width,m=p===void 0?0:p,g=t.height,y=g===void 0?0:g,S=t.className,x=Hse(t,Bse),w=zse({x:r,y:o,top:c,left:h,width:m,height:y},x);return!xe(r)||!xe(o)||!xe(m)||!xe(y)||!xe(c)||!xe(h)?null:K.createElement("path",H_({},Pe(w,!0),{className:qe("recharts-cross",S),d:Gse(r,o,m,y,c,h)}))},HS,IL;function Wse(){if(IL)return HS;IL=1;var e=Vv(),t=uz(),n=Ba();function r(a,o){return a&&a.length?e(a,n(o,2),t):void 0}return HS=r,HS}var Yse=Wse();const Xse=ut(Yse);var VS,BL;function Zse(){if(BL)return VS;BL=1;var e=Vv(),t=Ba(),n=fz();function r(a,o){return a&&a.length?e(a,t(o,2),n):void 0}return VS=r,VS}var Qse=Zse();const Jse=ut(Qse);var ele=["cx","cy","angle","ticks","axisLine"],tle=["ticks","tick","angle","tickFormatter","stroke"];function sc(e){"@babel/helpers - typeof";return sc=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},sc(e)}function Sf(){return Sf=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 nle(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 rle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UL(e,t){for(var n=0;nVL?s=a==="outer"?"start":"end":o<-VL?s=a==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,o=r.cy,s=r.radius,c=r.axisLine,f=r.axisLineType,h=Wo(Wo({},Pe(this.props,!1)),{},{fill:"none"},Pe(c,!1));if(f==="circle")return K.createElement(Xv,Zo({className:"recharts-polar-angle-axis-line"},h,{cx:a,cy:o,r:s}));var p=this.props.ticks,m=p.map(function(g){return jt(a,o,s,g.coordinate)});return K.createElement(Ise,Zo({className:"recharts-polar-angle-axis-line"},h,{points:m}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,o=a.ticks,s=a.tick,c=a.tickLine,f=a.tickFormatter,h=a.stroke,p=Pe(this.props,!1),m=Pe(s,!1),g=Wo(Wo({},p),{},{fill:"none"},Pe(c,!1)),y=o.map(function(S,x){var w=r.getTickLineCoord(S),A=r.getTickTextAnchor(S),O=Wo(Wo(Wo({textAnchor:A},p),{},{stroke:"none",fill:h},m),{},{index:x,payload:S,x:w.x2,y:w.y2});return K.createElement(at,Zo({className:qe("recharts-polar-angle-axis-tick",Bz(s)),key:"tick-".concat(S.coordinate)},vs(r.props,S,x)),c&&K.createElement("line",Zo({className:"recharts-polar-angle-axis-tick-line"},g,w)),s&&t.renderTickItem(s,O,f?f(S.value,x):S.value))});return K.createElement(at,{className:"recharts-polar-angle-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,a=r.ticks,o=r.radius,s=r.axisLine;return o<=0||!a||!a.length?null:K.createElement(at,{className:qe("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,o){var s;return K.isValidElement(r)?s=K.cloneElement(r,a):$e(r)?s=r(a):s=K.createElement(gs,Zo({},a,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])})(_.PureComponent);Jv(eg,"displayName","PolarAngleAxis");Jv(eg,"axisType","angleAxis");Jv(eg,"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 GS,GL;function yle(){if(GL)return GS;GL=1;var e=cB(),t=e(Object.getPrototypeOf,Object);return GS=t,GS}var KS,KL;function ble(){if(KL)return KS;KL=1;var e=Ei(),t=yle(),n=Ti(),r="[object Object]",a=Function.prototype,o=Object.prototype,s=a.toString,c=o.hasOwnProperty,f=s.call(Object);function h(p){if(!n(p)||e(p)!=r)return!1;var m=t(p);if(m===null)return!0;var g=c.call(m,"constructor")&&m.constructor;return typeof g=="function"&&g instanceof g&&s.call(g)==f}return KS=h,KS}var xle=ble();const wle=ut(xle);var WS,WL;function Sle(){if(WL)return WS;WL=1;var e=Ei(),t=Ti(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return WS=r,WS}var _le=Sle();const jle=ut(_le);function td(e){"@babel/helpers - typeof";return td=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},td(e)}function zm(){return zm=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:f,y:h},to:{upperWidth:p,lowerWidth:m,height:g,x:f,y:h},duration:x,animationEasing:S,isActive:A},function(E){var N=E.upperWidth,T=E.lowerWidth,C=E.height,R=E.x,M=E.y;return K.createElement(Da,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:x,easing:S},K.createElement("path",zm({},Pe(n,!0),{className:O,d:QL(R,M,N,T,C),ref:r})))}):K.createElement("g",null,K.createElement("path",zm({},Pe(n,!0),{className:O,d:QL(f,h,p,m,g)})))},Dle=["option","shapeType","propTransformer","activeClassName","isActive"];function nd(e){"@babel/helpers - typeof";return nd=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},nd(e)}function Lle(e,t){if(e==null)return{};var n=$le(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 $le(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 JL(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 qm(e){for(var t=1;t0?xr(E,"paddingAngle",0):0;if(T){var R=mr(T.endAngle-T.startAngle,E.endAngle-E.startAngle),M=xt(xt({},E),{},{startAngle:O+C,endAngle:O+R(x)+C});w.push(M),O=M.endAngle}else{var k=E.endAngle,z=E.startAngle,L=mr(0,k-z),B=L(x),F=xt(xt({},E),{},{startAngle:O+C,endAngle:O+B+C});w.push(F),O=F.endAngle}}),K.createElement(at,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 s=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});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,s=this.state.prevSectors;return o&&a&&a.length&&(!s||!Od(s,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,s=a.sectors,c=a.className,f=a.label,h=a.cx,p=a.cy,m=a.innerRadius,g=a.outerRadius,y=a.isAnimationActive,S=this.state.isAnimationFinished;if(o||!s||!s.length||!xe(h)||!xe(p)||!xe(m)||!xe(g))return null;var x=qe("recharts-pie",c);return K.createElement(at,{tabIndex:this.props.rootTabIndex,className:x,ref:function(A){r.pieRef=A}},this.renderSectors(),f&&this.renderLabels(s),tn.renderCallByParent(this.props,null,!1),(!y||S)&&bi.renderCallByParent(this.props,s,!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)*f,N=w-O*y-E,T=a.reduce(function(M,k){var z=Yt(k,A,0);return M+(xe(z)?z:0)},0),C;if(T>0){var R;C=a.map(function(M,k){var z=Yt(M,A,0),L=Yt(M,p,k),B=(xe(z)?z:0)/T,F;k?F=R.endAngle+Rn(x)*f*(z!==0?1:0):F=s;var U=F+Rn(x)*((z!==0?y:0)+B*N),W=(F+U)/2,$=(S.innerRadius+S.outerRadius)/2,V=[{name:L,value:z,payload:M,dataKey:A,type:g}],H=jt(S.cx,S.cy,$,W);return R=xt(xt(xt({percent:B,cornerRadius:o,name:L,tooltipPayload:V,midAngle:W,middleRadius:$,tooltipPosition:H},M),S),{},{value:Yt(M,A),startAngle:F,endAngle:U,payload:M,paddingAngle:Rn(x)*f}),R})}return xt(xt({},S),{},{sectors:C,data:a})});var YS,r$;function ace(){if(r$)return YS;r$=1;var e=Math.ceil,t=Math.max;function n(r,a,o,s){for(var c=-1,f=t(e((a-r)/(o||1)),0),h=Array(f);f--;)h[s?f:++c]=r,r+=o;return h}return YS=n,YS}var XS,a$;function r5(){if(a$)return XS;a$=1;var e=AB(),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 XS=r,XS}var ZS,i$;function ice(){if(i$)return ZS;i$=1;var e=ace(),t=$v(),n=r5();function r(a){return function(o,s,c){return c&&typeof c!="number"&&t(o,s,c)&&(s=c=void 0),o=n(o),s===void 0?(s=o,o=0):s=n(s),c=c===void 0?o0&&r.handleDrag(a.changedTouches[0])}),ur(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,o=a.endIndex,s=a.onDragEnd,c=a.startIndex;s?.({endIndex:o,startIndex:c})}),r.detachDragEndListener()}),ur(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),ur(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),ur(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),ur(r,"handleSlideDragStart",function(a){var o=f$(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 gce(t,e),hce(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,s=this.state.scaleValues,c=this.props,f=c.gap,h=c.data,p=h.length-1,m=Math.min(a,o),g=Math.max(a,o),y=t.getIndexInRange(s,m),S=t.getIndexInRange(s,g);return{startIndex:y-y%f,endIndex:S===p?p:S-S%f}}},{key:"getTextOfTick",value:function(r){var a=this.props,o=a.data,s=a.tickFormatter,c=a.dataKey,f=Yt(o[r],c,r);return $e(s)?s(f,r):f}},{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,s=a.startX,c=a.endX,f=this.props,h=f.x,p=f.width,m=f.travellerWidth,g=f.startIndex,y=f.endIndex,S=f.onChange,x=r.pageX-o;x>0?x=Math.min(x,h+p-m-c,h+p-m-s):x<0&&(x=Math.max(x,h-s,h-c));var w=this.getIndex({startX:s+x,endX:c+x});(w.startIndex!==g||w.endIndex!==y)&&S&&S(w),this.setState({startX:s+x,endX:c+x,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var o=f$(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,s=a.movingTravellerId,c=a.endX,f=a.startX,h=this.state[s],p=this.props,m=p.x,g=p.width,y=p.travellerWidth,S=p.onChange,x=p.gap,w=p.data,A={startX:this.state.startX,endX:this.state.endX},O=r.pageX-o;O>0?O=Math.min(O,m+g-y-h):O<0&&(O=Math.max(O,m-h)),A[s]=h+O;var E=this.getIndex(A),N=E.startIndex,T=E.endIndex,C=function(){var M=w.length-1;return s==="startX"&&(c>f?N%x===0:T%x===0)||cf?T%x===0:N%x===0)||c>f&&T===M};this.setState(ur(ur({},s,h+O),"brushMoveStartX",r.pageX),function(){S&&C()&&S(E)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var o=this,s=this.state,c=s.scaleValues,f=s.startX,h=s.endX,p=this.state[a],m=c.indexOf(p);if(m!==-1){var g=m+r;if(!(g===-1||g>=c.length)){var y=c[g];a==="startX"&&y>=h||a==="endX"&&y<=f||this.setState(ur({},a,y),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,s=r.width,c=r.height,f=r.fill,h=r.stroke;return K.createElement("rect",{stroke:h,fill:f,x:a,y:o,width:s,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,o=r.y,s=r.width,c=r.height,f=r.data,h=r.children,p=r.padding,m=_.Children.only(h);return m?K.cloneElement(m,{x:a,y:o,width:s,height:c,margin:p,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(r,a){var o,s,c=this,f=this.props,h=f.y,p=f.travellerWidth,m=f.height,g=f.traveller,y=f.ariaLabel,S=f.data,x=f.startIndex,w=f.endIndex,A=Math.max(r,this.props.x),O=JS(JS({},Pe(this.props,!1)),{},{x:A,y:h,width:p,height:m}),E=y||"Min value: ".concat((o=S[x])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=S[w])===null||s===void 0?void 0:s.name);return K.createElement(at,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),c.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,O))}},{key:"renderSlide",value:function(r,a){var o=this.props,s=o.y,c=o.height,f=o.stroke,h=o.travellerWidth,p=Math.min(r,a)+h,m=Math.max(Math.abs(a-r)-h,0);return K.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:p,y:s,width:m,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,o=r.endIndex,s=r.y,c=r.height,f=r.travellerWidth,h=r.stroke,p=this.state,m=p.startX,g=p.endX,y=5,S={pointerEvents:"none",fill:h};return K.createElement(at,{className:"recharts-brush-texts"},K.createElement(gs,Hm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(m,g)-y,y:s+c/2},S),this.getTextOfTick(a)),K.createElement(gs,Hm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(m,g)+f+y,y:s+c/2},S),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,a=r.data,o=r.className,s=r.children,c=r.x,f=r.y,h=r.width,p=r.height,m=r.alwaysShowText,g=this.state,y=g.startX,S=g.endX,x=g.isTextActive,w=g.isSlideMoving,A=g.isTravellerMoving,O=g.isTravellerFocused;if(!a||!a.length||!xe(c)||!xe(f)||!xe(h)||!xe(p)||h<=0||p<=0)return null;var E=qe("recharts-brush",o),N=K.Children.count(s)===1,T=fce("userSelect","none");return K.createElement(at,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(y,S),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(S,"endX"),(x||w||A||O||m)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,o=r.y,s=r.width,c=r.height,f=r.stroke,h=Math.floor(o+c/2)-1;return K.createElement(K.Fragment,null,K.createElement("rect",{x:a,y:o,width:s,height:c,fill:f,stroke:"none"}),K.createElement("line",{x1:a+1,y1:h,x2:a+s-1,y2:h,fill:"none",stroke:"#fff"}),K.createElement("line",{x1:a+1,y1:h+2,x2:a+s-1,y2:h+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var o;return K.isValidElement(r)?o=K.cloneElement(r,a):$e(r)?o=r(a):o=t.renderDefaultTraveller(a),o}},{key:"getDerivedStateFromProps",value:function(r,a){var o=r.data,s=r.width,c=r.x,f=r.travellerWidth,h=r.updateId,p=r.startIndex,m=r.endIndex;if(o!==a.prevData||h!==a.prevUpdateId)return JS({prevData:o,prevTravellerWidth:f,prevUpdateId:h,prevX:c,prevWidth:s},o&&o.length?bce({data:o,width:s,x:c,travellerWidth:f,startIndex:p,endIndex:m}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||c!==a.prevX||f!==a.prevTravellerWidth)){a.scale.range([c,c+s-f]);var g=a.scale.domain().map(function(y){return a.scale(y)});return{prevData:o,prevTravellerWidth:f,prevUpdateId:h,prevX:c,prevWidth:s,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,s=0,c=o-1;c-s>1;){var f=Math.floor((s+c)/2);r[f]>a?c=f:s=f}return a>=r[c]?c:s}}])})(_.PureComponent);ur(fc,"displayName","Brush");ur(fc,"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 e1,d$;function xce(){if(d$)return e1;d$=1;var e=jA();function t(n,r){var a;return e(n,function(o,s,c){return a=r(o,s,c),!a}),!!a}return e1=t,e1}var t1,h$;function wce(){if(h$)return t1;h$=1;var e=nB(),t=Ba(),n=xce(),r=Zn(),a=$v();function o(s,c,f){var h=r(s)?e:n;return f&&a(s,c,f)&&(c=void 0),h(s,t(c,3))}return t1=o,t1}var Sce=wce();const _ce=ut(Sce);var Ca=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},n1,p$;function jce(){if(p$)return n1;p$=1;var e=xB();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return n1=t,n1}var r1,m$;function Ace(){if(m$)return r1;m$=1;var e=jce(),t=yB(),n=Ba();function r(a,o){var s={};return o=n(o,3),t(a,function(c,f,h){e(s,f,o(c,f,h))}),s}return r1=r,r1}var Oce=Ace();const Ece=ut(Oce);var a1,v$;function Tce(){if(v$)return a1;v$=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 $ce(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 Ice(e,t){var n=e.x,r=e.y,a=Lce(e,Pce),o="".concat(n),s=parseInt(o,10),c="".concat(r),f=parseInt(c,10),h="".concat(t.height||a.height),p=parseInt(h,10),m="".concat(t.width||a.width),g=parseInt(m,10);return nf(nf(nf(nf(nf({},t),a),s?{x:s}:{}),f?{y:f}:{}),{},{height:p,width:g,name:t.name,radius:t.radius})}function x$(e){return K.createElement(e5,Y_({shapeType:"rectangle",propTransformer:Ice,activeClassName:"recharts-active-bar"},e))}var Bce=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=xe(r)||lX(r);return o?t(r,a):(o||On(!1),n)}},zce=["value","background"],l5;function dc(e){"@babel/helpers - typeof";return dc=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},dc(e)}function qce(e,t){if(e==null)return{};var n=Uce(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 Uce(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 Gm(){return Gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(W)0&&Math.abs(U)0&&(F=Math.min((te||0)-(U[se-1]||0),F))}),Number.isFinite(F)){var W=F/B,$=x.layout==="vertical"?r.height:r.width;if(x.padding==="gap"&&(R=W*$/2),x.padding==="no-gap"){var V=Pn(t.barCategoryGap,W*$),H=W*$/2;R=H-V-(H-V)/$*V}}}a==="xAxis"?M=[r.left+(E.left||0)+(R||0),r.left+r.width-(E.right||0)-(R||0)]:a==="yAxis"?M=f==="horizontal"?[r.top+r.height-(E.bottom||0),r.top+(E.top||0)]:[r.top+(E.top||0)+(R||0),r.top+r.height-(E.bottom||0)-(R||0)]:M=x.range,T&&(M=[M[1],M[0]]);var ne=Pz(x,o,g),ee=ne.scale,I=ne.realScaleType;ee.domain(A).range(M),Mz(ee);var q=kz(ee,sa(sa({},x),{},{realScaleType:I}));a==="xAxis"?(L=w==="top"&&!N||w==="bottom"&&N,k=r.left,z=m[C]-L*x.height):a==="yAxis"&&(L=w==="left"&&!N||w==="right"&&N,k=m[C]-L*x.width,z=r.top);var X=sa(sa(sa({},x),q),{},{realScaleType:I,x:k,y:z,scale:ee,width:a==="xAxis"?r.width:x.width,height:a==="yAxis"?r.height:x.height});return X.bandSize=Cm(X,q),!x.hide&&a==="xAxis"?m[C]+=(L?-1:1)*X.height:x.hide||(m[C]+=(L?-1:1)*X.width),sa(sa({},y),{},rg({},S,X))},{})},h5=function(t,n){var r=t.x,a=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(a,s),width:Math.abs(o-r),height:Math.abs(s-a)}},Jce=function(t){var n=t.x1,r=t.y1,a=t.x2,o=t.y2;return h5({x:n,y:r},{x:a,y:o})},p5=(function(){function e(t){Xce(this,e),this.scale=t}return Zce(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 s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+f}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)}}])})();rg(p5,"EPS",1e-4);var JA=function(t){var n=Object.keys(t).reduce(function(r,a){return sa(sa({},r),{},rg({},a,p5.create(t[a])))},{});return sa(sa({},n),{},{apply:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,c=o.position;return Ece(a,function(f,h){return n[h].apply(f,{bandAware:s,position:c})})},isInRange:function(a){return s5(a,function(o,s){return n[s].isInRange(o)})}})};function eue(e){return(e%180+180)%180}var tue=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=eue(a),s=o*Math.PI/180,c=Math.atan(r/n),f=s>c&&s-1?f[h?o[p]:p]:void 0}}return s1=r,s1}var l1,O$;function rue(){if(O$)return l1;O$=1;var e=r5();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return l1=t,l1}var c1,E$;function aue(){if(E$)return c1;E$=1;var e=hB(),t=Ba(),n=rue(),r=Math.max;function a(o,s,c){var f=o==null?0:o.length;if(!f)return-1;var h=c==null?0:n(c);return h<0&&(h=r(f+h,0)),e(o,t(s,3),h)}return c1=a,c1}var u1,T$;function iue(){if(T$)return u1;T$=1;var e=nue(),t=aue(),n=e(t);return u1=n,u1}var oue=iue();const sue=ut(oue);var lue=N3();const cue=ut(lue);var uue=cue(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("")}),eO=_.createContext(void 0),tO=_.createContext(void 0),m5=_.createContext(void 0),v5=_.createContext({}),g5=_.createContext(void 0),y5=_.createContext(0),b5=_.createContext(0),N$=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,o=n.offset,s=t.clipPathId,c=t.children,f=t.width,h=t.height,p=uue(o);return K.createElement(eO.Provider,{value:r},K.createElement(tO.Provider,{value:a},K.createElement(v5.Provider,{value:o},K.createElement(m5.Provider,{value:p},K.createElement(g5.Provider,{value:s},K.createElement(y5.Provider,{value:h},K.createElement(b5.Provider,{value:f},c)))))))},fue=function(){return _.useContext(g5)},x5=function(t){var n=_.useContext(eO);n==null&&On(!1);var r=n[t];return r==null&&On(!1),r},due=function(){var t=_.useContext(eO);return oo(t)},hue=function(){var t=_.useContext(tO),n=sue(t,function(r){return s5(r.domain,Number.isFinite)});return n||oo(t)},w5=function(t){var n=_.useContext(tO);n==null&&On(!1);var r=n[t];return r==null&&On(!1),r},pue=function(){var t=_.useContext(m5);return t},mue=function(){return _.useContext(v5)},nO=function(){return _.useContext(b5)},rO=function(){return _.useContext(y5)};function hc(e){"@babel/helpers - typeof";return hc=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},hc(e)}function vue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gue(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 Que(e,t){return T5(e,t+1)}function Jue(e,t,n,r,a){for(var o=(r||[]).slice(),s=t.start,c=t.end,f=0,h=1,p=s,m=function(){var S=r?.[f];if(S===void 0)return{v:T5(r,h)};var x=f,w,A=function(){return w===void 0&&(w=n(S,x)),w},O=S.coordinate,E=f===0||Zm(e,O,A,p,c);E||(f=0,p=s,h+=1),E&&(p=O+e*(A()/2+a),f+=h)},g;h<=o.length;)if(g=m(),g)return g.v;return[]}function sd(e){"@babel/helpers - typeof";return sd=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},sd(e)}function $$(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 bn(e){for(var t=1;t0?y.coordinate-w*e:y.coordinate})}else o[g]=y=bn(bn({},y),{},{tickCoord:y.coordinate});var A=Zm(e,y.tickCoord,x,c,f);A&&(f=y.tickCoord-e*(x()/2+a),o[g]=bn(bn({},y),{},{isShow:!0}))},p=s-1;p>=0;p--)h(p);return o}function afe(e,t,n,r,a,o){var s=(r||[]).slice(),c=s.length,f=t.start,h=t.end;if(o){var p=r[c-1],m=n(p,c-1),g=e*(p.coordinate+e*m/2-h);s[c-1]=p=bn(bn({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate});var y=Zm(e,p.tickCoord,function(){return m},f,h);y&&(h=p.tickCoord-e*(m/2+a),s[c-1]=bn(bn({},p),{},{isShow:!0}))}for(var S=o?c-1:c,x=function(O){var E=s[O],N,T=function(){return N===void 0&&(N=n(E,O)),N};if(O===0){var C=e*(E.coordinate-e*T()/2-f);s[O]=E=bn(bn({},E),{},{tickCoord:C<0?E.coordinate-C*e:E.coordinate})}else s[O]=E=bn(bn({},E),{},{tickCoord:E.coordinate});var R=Zm(e,E.tickCoord,T,f,h);R&&(f=E.tickCoord+e*(T()/2+a),s[O]=bn(bn({},E),{},{isShow:!0}))},w=0;w=2?Rn(a[1].coordinate-a[0].coordinate):1,A=Zue(o,w,y);return f==="equidistantPreserveStart"?Jue(w,A,x,a,s):(f==="preserveStart"||f==="preserveStartEnd"?g=afe(w,A,x,a,s,f==="preserveStartEnd"):g=rfe(w,A,x,a,s),g.filter(function(O){return O.isShow}))}var ife=["viewBox"],ofe=["viewBox"],sfe=["ticks"];function vc(e){"@babel/helpers - typeof";return vc=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},vc(e)}function Ll(){return Ll=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 lfe(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 cfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B$(e,t){for(var n=0;n0?f(this.props):f(y)),s<=0||c<=0||!S||!S.length?null:K.createElement(at,{className:qe("recharts-cartesian-axis",h),ref:function(w){r.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(S,this.state.fontSize,this.state.letterSpacing),tn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,o){var s,c=qe(a.className,"recharts-cartesian-axis-tick-value");return K.isValidElement(r)?s=K.cloneElement(r,Gt(Gt({},a),{},{className:c})):$e(r)?s=r(Gt(Gt({},a),{},{className:c})):s=K.createElement(gs,Ll({},a,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])})(_.Component);sO(Ic,"displayName","CartesianAxis");sO(Ic,"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 vfe=["x1","y1","x2","y2","key"],gfe=["offset"];function bs(e){"@babel/helpers - typeof";return bs=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},bs(e)}function z$(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 xn(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wfe(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 Sfe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,o=t.y,s=t.width,c=t.height,f=t.ry;return K.createElement("rect",{x:a,y:o,ry:f,width:s,height:c,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function R5(e,t){var n;if(K.isValidElement(e))n=K.cloneElement(e,t);else if($e(e))n=e(t);else{var r=t.x1,a=t.y1,o=t.x2,s=t.y2,c=t.key,f=q$(t,vfe),h=Pe(f,!1);h.offset;var p=q$(h,gfe);n=K.createElement("line",ns({},p,{x1:r,y1:a,x2:o,y2:s,fill:"none",key:c}))}return n}function _fe(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 s=o.map(function(c,f){var h=xn(xn({},e),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return R5(a,h)});return K.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function jfe(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 s=o.map(function(c,f){var h=xn(xn({},e),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return R5(a,h)});return K.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Afe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,o=e.width,s=e.height,c=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length)return null;var p=c.map(function(g){return Math.round(g+a-a)}).sort(function(g,y){return g-y});a!==p[0]&&p.unshift(0);var m=p.map(function(g,y){var S=!p[y+1],x=S?a+s-g:p[y+1]-g;if(x<=0)return null;var w=y%t.length;return K.createElement("rect",{key:"react-".concat(y),y:g,x:r,height:x,width:o,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return K.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function Ofe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,o=e.x,s=e.y,c=e.width,f=e.height,h=e.verticalPoints;if(!n||!r||!r.length)return null;var p=h.map(function(g){return Math.round(g+o-o)}).sort(function(g,y){return g-y});o!==p[0]&&p.unshift(0);var m=p.map(function(g,y){var S=!p[y+1],x=S?o+c-g:p[y+1]-g;if(x<=0)return null;var w=y%r.length;return K.createElement("rect",{key:"react-".concat(y),x:g,y:s,width:x,height:f,stroke:"none",fill:r[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return K.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var Efe=function(t,n){var r=t.xAxis,a=t.width,o=t.height,s=t.offset;return Rz(oO(xn(xn(xn({},Ic.defaultProps),r),{},{ticks:pi(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),s.left,s.left+s.width,n)},Tfe=function(t,n){var r=t.yAxis,a=t.width,o=t.height,s=t.offset;return Rz(oO(xn(xn(xn({},Ic.defaultProps),r),{},{ticks:pi(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),s.top,s.top+s.height,n)},_l={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function df(e){var t,n,r,a,o,s,c=nO(),f=rO(),h=mue(),p=xn(xn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:_l.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:_l.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:_l.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:_l.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:_l.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:_l.verticalFill,x:xe(e.x)?e.x:h.left,y:xe(e.y)?e.y:h.top,width:xe(e.width)?e.width:h.width,height:xe(e.height)?e.height:h.height}),m=p.x,g=p.y,y=p.width,S=p.height,x=p.syncWithTicks,w=p.horizontalValues,A=p.verticalValues,O=due(),E=hue();if(!xe(y)||y<=0||!xe(S)||S<=0||!xe(m)||m!==+m||!xe(g)||g!==+g)return null;var N=p.verticalCoordinatesGenerator||Efe,T=p.horizontalCoordinatesGenerator||Tfe,C=p.horizontalPoints,R=p.verticalPoints;if((!C||!C.length)&&$e(T)){var M=w&&w.length,k=T({yAxis:E?xn(xn({},E),{},{ticks:M?w:E.ticks}):void 0,width:c,height:f,offset:h},M?!0:x);ua(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(bs(k),"]")),Array.isArray(k)&&(C=k)}if((!R||!R.length)&&$e(N)){var z=A&&A.length,L=N({xAxis:O?xn(xn({},O),{},{ticks:z?A:O.ticks}):void 0,width:c,height:f,offset:h},z?!0:x);ua(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(bs(L),"]")),Array.isArray(L)&&(R=L)}return K.createElement("g",{className:"recharts-cartesian-grid"},K.createElement(Sfe,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),K.createElement(_fe,ns({},p,{offset:h,horizontalPoints:C,xAxis:O,yAxis:E})),K.createElement(jfe,ns({},p,{offset:h,verticalPoints:R,xAxis:O,yAxis:E})),K.createElement(Afe,ns({},p,{horizontalPoints:C})),K.createElement(Ofe,ns({},p,{verticalPoints:R})))}df.displayName="CartesianGrid";var Nfe=["type","layout","connectNulls","ref"],Cfe=["key"];function gc(e){"@babel/helpers - typeof";return gc=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},gc(e)}function U$(e,t){if(e==null)return{};var n=Rfe(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 Rfe(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 _f(){return _f=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nm){y=[].concat(jl(f.slice(0,S)),[m-x]);break}var w=y.length%2===0?[0,g]:[g];return[].concat(jl(t.repeat(f,p)),jl(y),w).map(function(A){return"".concat(A,"px")}).join(", ")}),la(n,"id",Mc("recharts-line-")),la(n,"pathRef",function(s){n.mainCurve=s}),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 qfe(t,e),$fe(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,s=o.points,c=o.xAxis,f=o.yAxis,h=o.layout,p=o.children,m=wr(p,Ed);if(!m)return null;var g=function(x,w){return{x:x.x,y:x.y,value:x.value,errorVal:Yt(x.payload,w)}},y={clipPath:r?"url(#clipPath-".concat(a,")"):null};return K.createElement(at,y,m.map(function(S){return K.cloneElement(S,{key:"bar-".concat(S.props.dataKey),data:s,xAxis:c,yAxis:f,layout:h,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var c=this.props,f=c.dot,h=c.points,p=c.dataKey,m=Pe(this.props,!1),g=Pe(f,!0),y=h.map(function(x,w){var A=cr(cr(cr({key:"dot-".concat(w),r:3},m),g),{},{index:w,cx:x.x,cy:x.y,value:x.value,dataKey:p,payload:x.payload,points:h});return t.renderDotItem(f,A)}),S={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(o,")"):null};return K.createElement(at,_f({className:"recharts-line-dots",key:"dots"},S),y)}},{key:"renderCurveStatically",value:function(r,a,o,s){var c=this.props,f=c.type,h=c.layout,p=c.connectNulls;c.ref;var m=U$(c,Nfe),g=cr(cr(cr({},Pe(m,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:f,layout:h,connectNulls:p});return K.createElement(Mm,_f({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var o=this,s=this.props,c=s.points,f=s.strokeDasharray,h=s.isAnimationActive,p=s.animationBegin,m=s.animationDuration,g=s.animationEasing,y=s.animationId,S=s.animateNewValues,x=s.width,w=s.height,A=this.state,O=A.prevPoints,E=A.totalLength;return K.createElement(Da,{begin:p,duration:m,isActive:h,easing:g,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var T=N.t;if(O){var C=O.length/c.length,R=c.map(function(B,F){var U=Math.floor(F*C);if(O[U]){var W=O[U],$=mr(W.x,B.x),V=mr(W.y,B.y);return cr(cr({},B),{},{x:$(T),y:V(T)})}if(S){var H=mr(x*2,B.x),ne=mr(w/2,B.y);return cr(cr({},B),{},{x:H(T),y:ne(T)})}return cr(cr({},B),{},{x:B.x,y:B.y})});return o.renderCurveStatically(R,r,a)}var M=mr(0,E),k=M(T),z;if(f){var L="".concat(f).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});z=o.getStrokeDasharray(k,E,L)}else z=o.generateSimpleStrokeDasharray(E,k);return o.renderCurveStatically(c,r,a,{strokeDasharray:z})})}},{key:"renderCurve",value:function(r,a){var o=this.props,s=o.points,c=o.isAnimationActive,f=this.state,h=f.prevPoints,p=f.totalLength;return c&&s&&s.length&&(!h&&p>0||!Od(h,s))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(s,r,a)}},{key:"render",value:function(){var r,a=this.props,o=a.hide,s=a.dot,c=a.points,f=a.className,h=a.xAxis,p=a.yAxis,m=a.top,g=a.left,y=a.width,S=a.height,x=a.isAnimationActive,w=a.id;if(o||!c||!c.length)return null;var A=this.state.isAnimationFinished,O=c.length===1,E=qe("recharts-line",f),N=h&&h.allowDataOverflow,T=p&&p.allowDataOverflow,C=N||T,R=ze(w)?this.id:w,M=(r=Pe(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=M.r,z=k===void 0?3:k,L=M.strokeWidth,B=L===void 0?2:L,F=xX(s)?s:{},U=F.clipDot,W=U===void 0?!0:U,$=z*2+B;return K.createElement(at,{className:E},N||T?K.createElement("defs",null,K.createElement("clipPath",{id:"clipPath-".concat(R)},K.createElement("rect",{x:N?g:g-y/2,y:T?m:m-S/2,width:N?y:y*2,height:T?S:S*2})),!W&&K.createElement("clipPath",{id:"clipPath-dots-".concat(R)},K.createElement("rect",{x:g-$/2,y:m-$/2,width:y+$,height:S+$}))):null,!O&&this.renderCurve(C,R),this.renderErrorBar(C,R),(O||s)&&this.renderDots(C,W,R),(!x||A)&&bi.renderCallByParent(this.props,c))}}],[{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(jl(r),[0]):r,s=[],c=0;ce.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 Rde(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 Pde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mde(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?s:t&&t.length&&xe(a)&&xe(o)?t.slice(a,o+1):[]};function G5(e){return e==="number"?[0,"auto"]:void 0}var pj=function(t,n,r,a){var o=t.graphicalItems,s=t.tooltipAxis,c=lg(n,t);return r<0||!o||!o.length||r>=c.length?null:o.reduce(function(f,h){var p,m=(p=h.props.data)!==null&&p!==void 0?p:n;m&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(m=m.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(s.dataKey&&!s.allowDuplicatedCategory){var y=m===void 0?c:m;g=im(y,s.dataKey,a)}else g=m&&m[r]||c[r];return g?[].concat(wc(f),[Lz(h,g)]):f},[])},Z$=function(t,n,r,a){var o=a||{x:t.chartX,y:t.chartY},s=Vde(o,r),c=t.orderedTooltipTicks,f=t.tooltipAxis,h=t.tooltipTicks,p=gae(s,c,h,f);if(p>=0&&h){var m=h[p]&&h[p].value,g=pj(t,n,p,m),y=Gde(r,c,p,o);return{activeTooltipIndex:p,activeLabel:m,activePayload:g,activeCoordinate:y}}return null},Kde=function(t,n){var r=n.axes,a=n.graphicalItems,o=n.axisType,s=n.axisIdKey,c=n.stackGroups,f=n.dataStartIndex,h=n.dataEndIndex,p=t.layout,m=t.children,g=t.stackOffset,y=Cz(p,o);return r.reduce(function(S,x){var w,A=x.type.defaultProps!==void 0?de(de({},x.type.defaultProps),x.props):x.props,O=A.type,E=A.dataKey,N=A.allowDataOverflow,T=A.allowDuplicatedCategory,C=A.scale,R=A.ticks,M=A.includeHidden,k=A[s];if(S[k])return S;var z=lg(t.data,{graphicalItems:a.filter(function(q){var X,te=s in q.props?q.props[s]:(X=q.type.defaultProps)===null||X===void 0?void 0:X[s];return te===k}),dataStartIndex:f,dataEndIndex:h}),L=z.length,B,F,U;bde(A.domain,N,O)&&(B=T_(A.domain,null,N),y&&(O==="number"||C!=="auto")&&(U=bf(z,E,"category")));var W=G5(O);if(!B||B.length===0){var $,V=($=A.domain)!==null&&$!==void 0?$:W;if(E){if(B=bf(z,E,O),O==="category"&&y){var H=uX(B);T&&H?(F=B,B=Fm(0,L)):T||(B=XD(V,B,x).reduce(function(q,X){return q.indexOf(X)>=0?q:[].concat(wc(q),[X])},[]))}else if(O==="category")T?B=B.filter(function(q){return q!==""&&!ze(q)}):B=XD(V,B,x).reduce(function(q,X){return q.indexOf(X)>=0||X===""||ze(X)?q:[].concat(wc(q),[X])},[]);else if(O==="number"){var ne=Sae(z,a.filter(function(q){var X,te,se=s in q.props?q.props[s]:(X=q.type.defaultProps)===null||X===void 0?void 0:X[s],Q="hide"in q.props?q.props.hide:(te=q.type.defaultProps)===null||te===void 0?void 0:te.hide;return se===k&&(M||!Q)}),E,o,p);ne&&(B=ne)}y&&(O==="number"||C!=="auto")&&(U=bf(z,E,"category"))}else y?B=Fm(0,L):c&&c[k]&&c[k].hasStack&&O==="number"?B=g==="expand"?[0,1]:Dz(c[k].stackGroups,f,h):B=Nz(z,a.filter(function(q){var X=s in q.props?q.props[s]:q.type.defaultProps[s],te="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return X===k&&(M||!te)}),O,p,!0);if(O==="number")B=fj(m,B,k,o,R),V&&(B=T_(V,B,N));else if(O==="category"&&V){var ee=V,I=B.every(function(q){return ee.indexOf(q)>=0});I&&(B=ee)}}return de(de({},S),{},De({},k,de(de({},A),{},{axisType:o,domain:B,categoricalDomain:U,duplicateDomain:F,originalDomain:(w=A.domain)!==null&&w!==void 0?w:W,isCategorical:y,layout:p})))},{})},Wde=function(t,n){var r=n.graphicalItems,a=n.Axis,o=n.axisType,s=n.axisIdKey,c=n.stackGroups,f=n.dataStartIndex,h=n.dataEndIndex,p=t.layout,m=t.children,g=lg(t.data,{graphicalItems:r,dataStartIndex:f,dataEndIndex:h}),y=g.length,S=Cz(p,o),x=-1;return r.reduce(function(w,A){var O=A.type.defaultProps!==void 0?de(de({},A.type.defaultProps),A.props):A.props,E=O[s],N=G5("number");if(!w[E]){x++;var T;return S?T=Fm(0,y):c&&c[E]&&c[E].hasStack?(T=Dz(c[E].stackGroups,f,h),T=fj(m,T,E,o)):(T=T_(N,Nz(g,r.filter(function(C){var R,M,k=s in C.props?C.props[s]:(R=C.type.defaultProps)===null||R===void 0?void 0:R[s],z="hide"in C.props?C.props.hide:(M=C.type.defaultProps)===null||M===void 0?void 0:M.hide;return k===E&&!z}),"number",p),a.defaultProps.allowDataOverflow),T=fj(m,T,E,o)),de(de({},w),{},De({},E,de(de({axisType:o},a.defaultProps),{},{hide:!0,orientation:xr(Fde,"".concat(o,".").concat(x%2),null),domain:T,originalDomain:N,isCategorical:S,layout:p})))}return w},{})},Yde=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,c=n.stackGroups,f=n.dataStartIndex,h=n.dataEndIndex,p=t.children,m="".concat(a,"Id"),g=wr(p,o),y={};return g&&g.length?y=Kde(t,{axes:g,graphicalItems:s,axisType:a,axisIdKey:m,stackGroups:c,dataStartIndex:f,dataEndIndex:h}):s&&s.length&&(y=Wde(t,{Axis:o,graphicalItems:s,axisType:a,axisIdKey:m,stackGroups:c,dataStartIndex:f,dataEndIndex:h})),y},Xde=function(t){var n=oo(t),r=pi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:AA(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Cm(n,r)}},Q$=function(t){var n=t.children,r=t.defaultShowTooltip,a=fr(n,fc),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(o=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},Zde=function(t){return!t||!t.length?!1:t.some(function(n){var r=gi(n&&n.type);return r&&r.indexOf("Bar")>=0})},J$=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"}},Qde=function(t,n){var r=t.props,a=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,c=t.yAxisMap,f=c===void 0?{}:c,h=r.width,p=r.height,m=r.children,g=r.margin||{},y=fr(m,fc),S=fr(m,ls),x=Object.keys(f).reduce(function(T,C){var R=f[C],M=R.orientation;return!R.mirror&&!R.hide?de(de({},T),{},De({},M,T[M]+R.width)):T},{left:g.left||0,right:g.right||0}),w=Object.keys(s).reduce(function(T,C){var R=s[C],M=R.orientation;return!R.mirror&&!R.hide?de(de({},T),{},De({},M,xr(T,"".concat(M))+R.height)):T},{top:g.top||0,bottom:g.bottom||0}),A=de(de({},w),x),O=A.bottom;y&&(A.bottom+=y.props.height||fc.defaultProps.height),S&&n&&(A=xae(A,a,r,n));var E=h-A.left-A.right,N=p-A.top-A.bottom;return de(de({brushBottom:O},A),{},{width:Math.max(E,0),height:Math.max(N,0)})},Jde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},lO=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,o=a===void 0?"axis":a,s=t.validateTooltipEventTypes,c=s===void 0?["axis"]:s,f=t.axisComponents,h=t.legendContent,p=t.formatAxisMap,m=t.defaultProps,g=function(A,O){var E=O.graphicalItems,N=O.stackGroups,T=O.offset,C=O.updateId,R=O.dataStartIndex,M=O.dataEndIndex,k=A.barSize,z=A.layout,L=A.barGap,B=A.barCategoryGap,F=A.maxBarSize,U=J$(z),W=U.numericAxisName,$=U.cateAxisName,V=Zde(E),H=[];return E.forEach(function(ne,ee){var I=lg(A.data,{graphicalItems:[ne],dataStartIndex:R,dataEndIndex:M}),q=ne.type.defaultProps!==void 0?de(de({},ne.type.defaultProps),ne.props):ne.props,X=q.dataKey,te=q.maxBarSize,se=q["".concat(W,"Id")],Q=q["".concat($,"Id")],G={},ge=f.reduce(function(In,Rr){var tt=O["".concat(Rr.axisType,"Map")],Je=q["".concat(Rr.axisType,"Id")];tt&&tt[Je]||Rr.axisType==="zAxis"||On(!1);var hn=tt[Je];return de(de({},In),{},De(De({},Rr.axisType,hn),"".concat(Rr.axisType,"Ticks"),pi(hn)))},G),re=ge[$],pe=ge["".concat($,"Ticks")],ye=N&&N[se]&&N[se].hasStack&&Rae(ne,N[se].stackGroups),le=gi(ne.type).indexOf("Bar")>=0,Le=Cm(re,pe),be=[],et=V&&yae({barSize:k,stackGroups:N,totalSize:Jde(ge,$)});if(le){var Te,st,En=ze(te)?F:te,Tn=(Te=(st=Cm(re,pe,!0))!==null&&st!==void 0?st:En)!==null&&Te!==void 0?Te:0;be=bae({barGap:L,barCategoryGap:B,bandSize:Tn!==Le?Tn:Le,sizeList:et[Q],maxBarSize:En}),Tn!==Le&&(be=be.map(function(In){return de(de({},In),{},{position:de(de({},In.position),{},{offset:In.position.offset-Tn/2})})}))}var Jn=ne&&ne.type&&ne.type.getComposedData;Jn&&H.push({props:de(de({},Jn(de(de({},ge),{},{displayedData:I,props:A,dataKey:X,item:ne,bandSize:Le,barPosition:be,offset:T,stackedData:ye,layout:z,dataStartIndex:R,dataEndIndex:M}))),{},De(De(De({key:ne.key||"item-".concat(ee)},W,ge[W]),$,ge[$]),"animationId",C)),childIndex:_X(ne,A.children),item:ne})}),H},y=function(A,O){var E=A.props,N=A.dataStartIndex,T=A.dataEndIndex,C=A.updateId;if(!uP({props:E}))return null;var R=E.children,M=E.layout,k=E.stackOffset,z=E.data,L=E.reverseStackOrder,B=J$(M),F=B.numericAxisName,U=B.cateAxisName,W=wr(R,r),$=Nae(z,W,"".concat(F,"Id"),"".concat(U,"Id"),k,L),V=f.reduce(function(q,X){var te="".concat(X.axisType,"Map");return de(de({},q),{},De({},te,Yde(E,de(de({},X),{},{graphicalItems:W,stackGroups:X.axisType===F&&$,dataStartIndex:N,dataEndIndex:T}))))},{}),H=Qde(de(de({},V),{},{props:E,graphicalItems:W}),O?.legendBBox);Object.keys(V).forEach(function(q){V[q]=p(E,V[q],H,q.replace("Map",""),n)});var ne=V["".concat(U,"Map")],ee=Xde(ne),I=g(E,de(de({},V),{},{dataStartIndex:N,dataEndIndex:T,updateId:C,graphicalItems:W,stackGroups:$,offset:H}));return de(de({formattedGraphicalItems:I,graphicalItems:W,offset:H,stackGroups:$},ee),V)},S=(function(w){function A(O){var E,N,T;return Pde(this,A),T=Dde(this,A,[O]),De(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),De(T,"accessibilityManager",new yde),De(T,"handleLegendBBoxUpdate",function(C){if(C){var R=T.state,M=R.dataStartIndex,k=R.dataEndIndex,z=R.updateId;T.setState(de({legendBBox:C},y({props:T.props,dataStartIndex:M,dataEndIndex:k,updateId:z},de(de({},T.state),{},{legendBBox:C}))))}}),De(T,"handleReceiveSyncEvent",function(C,R,M){if(T.props.syncId===C){if(M===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(R)}}),De(T,"handleBrushChange",function(C){var R=C.startIndex,M=C.endIndex;if(R!==T.state.dataStartIndex||M!==T.state.dataEndIndex){var k=T.state.updateId;T.setState(function(){return de({dataStartIndex:R,dataEndIndex:M},y({props:T.props,dataStartIndex:R,dataEndIndex:M,updateId:k},T.state))}),T.triggerSyncEvent({dataStartIndex:R,dataEndIndex:M})}}),De(T,"handleMouseEnter",function(C){var R=T.getMouseInfo(C);if(R){var M=de(de({},R),{},{isTooltipActive:!0});T.setState(M),T.triggerSyncEvent(M);var k=T.props.onMouseEnter;$e(k)&&k(M,C)}}),De(T,"triggeredAfterMouseMove",function(C){var R=T.getMouseInfo(C),M=R?de(de({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(M),T.triggerSyncEvent(M);var k=T.props.onMouseMove;$e(k)&&k(M,C)}),De(T,"handleItemMouseEnter",function(C){T.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),De(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),De(T,"handleMouseMove",function(C){C.persist(),T.throttleTriggeredAfterMouseMove(C)}),De(T,"handleMouseLeave",function(C){T.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};T.setState(R),T.triggerSyncEvent(R);var M=T.props.onMouseLeave;$e(M)&&M(R,C)}),De(T,"handleOuterEvent",function(C){var R=SX(C),M=xr(T.props,"".concat(R));if(R&&$e(M)){var k,z;/.*touch.*/i.test(R)?z=T.getMouseInfo(C.changedTouches[0]):z=T.getMouseInfo(C),M((k=z)!==null&&k!==void 0?k:{},C)}}),De(T,"handleClick",function(C){var R=T.getMouseInfo(C);if(R){var M=de(de({},R),{},{isTooltipActive:!0});T.setState(M),T.triggerSyncEvent(M);var k=T.props.onClick;$e(k)&&k(M,C)}}),De(T,"handleMouseDown",function(C){var R=T.props.onMouseDown;if($e(R)){var M=T.getMouseInfo(C);R(M,C)}}),De(T,"handleMouseUp",function(C){var R=T.props.onMouseUp;if($e(R)){var M=T.getMouseInfo(C);R(M,C)}}),De(T,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),De(T,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseDown(C.changedTouches[0])}),De(T,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseUp(C.changedTouches[0])}),De(T,"handleDoubleClick",function(C){var R=T.props.onDoubleClick;if($e(R)){var M=T.getMouseInfo(C);R(M,C)}}),De(T,"handleContextMenu",function(C){var R=T.props.onContextMenu;if($e(R)){var M=T.getMouseInfo(C);R(M,C)}}),De(T,"triggerSyncEvent",function(C){T.props.syncId!==void 0&&h1.emit(p1,T.props.syncId,C,T.eventEmitterSymbol)}),De(T,"applySyncEvent",function(C){var R=T.props,M=R.layout,k=R.syncMethod,z=T.state.updateId,L=C.dataStartIndex,B=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)T.setState(de({dataStartIndex:L,dataEndIndex:B},y({props:T.props,dataStartIndex:L,dataEndIndex:B,updateId:z},T.state)));else if(C.activeTooltipIndex!==void 0){var F=C.chartX,U=C.chartY,W=C.activeTooltipIndex,$=T.state,V=$.offset,H=$.tooltipTicks;if(!V)return;if(typeof k=="function")W=k(H,C);else if(k==="value"){W=-1;for(var ne=0;ne=0){var ye,le;if(F.dataKey&&!F.allowDuplicatedCategory){var Le=typeof F.dataKey=="function"?pe:"payload.".concat(F.dataKey.toString());ye=im(ne,Le,W),le=ee&&I&&im(I,Le,W)}else ye=ne?.[U],le=ee&&I&&I[U];if(Q||se){var be=C.props.activeIndex!==void 0?C.props.activeIndex:U;return[_.cloneElement(C,de(de(de({},k.props),ge),{},{activeIndex:be})),null,null]}if(!ze(ye))return[re].concat(wc(T.renderActivePoints({item:k,activePoint:ye,basePoint:le,childIndex:U,isRange:ee})))}else{var et,Te=(et=T.getItemByXY(T.state.activeCoordinate))!==null&&et!==void 0?et:{graphicalItem:re},st=Te.graphicalItem,En=st.item,Tn=En===void 0?C:En,Jn=st.childIndex,In=de(de(de({},k.props),ge),{},{activeIndex:Jn});return[_.cloneElement(Tn,In),null,null]}return ee?[re,null,null]:[re,null]}),De(T,"renderCustomized",function(C,R,M){return _.cloneElement(C,de(de({key:"recharts-customized-".concat(M)},T.props),T.state))}),De(T,"renderMap",{CartesianGrid:{handler:Sp,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:Sp},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:Sp},YAxis:{handler:Sp},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((E=O.id)!==null&&E!==void 0?E:Mc("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=OB(T.triggeredAfterMouseMove,(N=O.throttleDelay)!==null&&N!==void 0?N:1e3/60),T.state={},T}return Ide(A,w),kde(A,[{key:"componentDidMount",value:function(){var E,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,N=E.children,T=E.data,C=E.height,R=E.layout,M=fr(N,Sa);if(M){var k=M.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,L=pj(this.state,T,k,z),B=this.state.tooltipTicks[k].coordinate,F=(this.state.offset.top+C)/2,U=R==="horizontal",W=U?{x:B,y:F}:{y:B,x:F},$=this.state.formattedGraphicalItems.find(function(H){var ne=H.item;return ne.type.name==="Scatter"});$&&(W=de(de({},W),$.props.points[k].tooltipPosition),L=$.props.points[k].tooltipPayload);var V={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:z,activePayload:L,activeCoordinate:W};this.setState(V),this.renderCursor(M),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var T,C;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(E){X1([fr(E.children,Sa)],[fr(this.props.children,Sa)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=fr(this.props.children,Sa);if(E&&typeof E.props.shared=="boolean"){var N=E.props.shared?"axis":"item";return c.indexOf(N)>=0?N:o}return o}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var N=this.container,T=N.getBoundingClientRect(),C=uee(T),R={chartX:Math.round(E.pageX-C.left),chartY:Math.round(E.pageY-C.top)},M=T.width/N.offsetWidth||1,k=this.inRange(R.chartX,R.chartY,M);if(!k)return null;var z=this.state,L=z.xAxisMap,B=z.yAxisMap,F=this.getTooltipEventType(),U=Z$(this.state,this.props.data,this.props.layout,k);if(F!=="axis"&&L&&B){var W=oo(L).scale,$=oo(B).scale,V=W&&W.invert?W.invert(R.chartX):null,H=$&&$.invert?$.invert(R.chartY):null;return de(de({},R),{},{xValue:V,yValue:H},U)}return U?de(de({},R),U):null}},{key:"inRange",value:function(E,N){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,R=E/T,M=N/T;if(C==="horizontal"||C==="vertical"){var k=this.state.offset,z=R>=k.left&&R<=k.left+k.width&&M>=k.top&&M<=k.top+k.height;return z?{x:R,y:M}:null}var L=this.state,B=L.angleAxisMap,F=L.radiusAxisMap;if(B&&F){var U=oo(B);return JD({x:R,y:M},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,N=this.getTooltipEventType(),T=fr(E,Sa),C={};T&&N==="axis"&&(T.props.trigger==="click"?C={onClick:this.handleClick}:C={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 R=om(this.props,this.handleOuterEvent);return de(de({},R),C)}},{key:"addListener",value:function(){h1.on(p1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){h1.removeListener(p1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,N,T){for(var C=this.state.formattedGraphicalItems,R=0,M=C.length;R");return e}const Nl=_.forwardRef(({id:e,className:t,children:n,config:r,...a},o)=>{const s=_.useId(),c=`chart-${e||s.replace(/:/g,"")}`;return u.jsx(K5.Provider,{value:{config:r},children:u.jsxs("div",{"data-chart":c,ref:o,className:we("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:[u.jsx(rhe,{id:c,config:r}),u.jsx(ree,{children:n})]})})});Nl.displayName="Chart";const rhe=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?u.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(nhe).map(([r,a])=>` ${a} [data-chart=${e}] { ${n.map(([o,s])=>{const c=s.theme?.[r]||s.color;return c?` --color-${o}: ${c};`:null}).join(` `)} } `).join(` `)}}):null},rf=Sa,Cl=_.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:o=!1,label:s,labelFormatter:c,labelClassName:f,formatter:h,color:p,nameKey:m,labelKey:g},y)=>{const{config:S}=W5(),x=_.useMemo(()=>{if(a||!t?.length)return null;const[A]=t,O=`${g||A?.dataKey||A?.name||"value"}`,E=mj(S,A,O),N=!g&&typeof s=="string"?S[s]?.label||s:E?.label;return c?u.jsx("div",{className:we("font-medium",f),children:c(N,t)}):N?u.jsx("div",{className:we("font-medium",f),children:N}):null},[s,c,t,a,f,S,g]);if(!e||!t?.length)return null;const w=t.length===1&&r!=="dot";return u.jsxs("div",{ref:y,className:we("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:x,u.jsx("div",{className:"grid gap-1.5",children:t.filter(A=>A.type!=="none").map((A,O)=>{const E=`${m||A.name||A.dataKey||"value"}`,N=mj(S,A,E),T=p||A.payload.fill||A.color;return u.jsx("div",{className:we("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:h&&A?.value!==void 0&&A.name?h(A.value,A.name,A,O,A.payload):u.jsxs(u.Fragment,{children:[N?.icon?u.jsx(N.icon,{}):!o&&u.jsx("div",{className:we("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":T,"--color-border":T}}),u.jsxs("div",{className:we("flex flex-1 justify-between leading-none",w?"items-end":"items-center"),children:[u.jsxs("div",{className:"grid gap-1.5",children:[w?x:null,u.jsx("span",{className:"text-muted-foreground",children:N?.label||A.name})]}),A.value&&u.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:A.value.toLocaleString()})]})]})},A.dataKey)})})]})});Cl.displayName="ChartTooltip";const ahe=ls,Y5=_.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:a},o)=>{const{config:s}=W5();return n?.length?u.jsx("div",{ref:o,className:we("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.filter(c=>c.type!=="none").map(c=>{const f=`${a||c.dataKey||"value"}`,h=mj(s,c,f);return u.jsxs("div",{className:we("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[h?.icon&&!t?u.jsx(h.icon,{}):u.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),h?.label]},c.value)})}):null});Y5.displayName="ChartLegend";function mj(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 ihe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ohe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),eI=e=>{const t=ohe(e);return t.charAt(0).toUpperCase()+t.slice(1)},X5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),she=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var lhe={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 che=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:s,...c},f)=>_.createElement("svg",{ref:f,...lhe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:X5("lucide",a),...!o&&!she(c)&&{"aria-hidden":"true"},...c},[...s.map(([h,p])=>_.createElement(h,p)),...Array.isArray(o)?o:[o]]));const Ie=(e,t)=>{const n=_.forwardRef(({className:r,...a},o)=>_.createElement(che,{ref:o,iconNode:t,className:X5(`lucide-${ihe(eI(e))}`,`lucide-${e}`,r),...a}));return n.displayName=eI(e),n};const uhe=[["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"}]],fhe=Ie("activity",uhe);const dhe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],hhe=Ie("arrow-left",dhe);const phe=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],mhe=Ie("bell",phe);const vhe=[["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"}]],ghe=Ie("boxes",vhe);const yhe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jf=Ie("check",yhe);const bhe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Z5=Ie("chevron-down",bhe);const xhe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],whe=Ie("chevron-left",xhe);const She=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_he=Ie("chevron-up",She);const jhe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Ahe=Ie("chevrons-up-down",jhe);const Ohe=[["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"}]],tI=Ie("circle-alert",Ohe);const Ehe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],The=Ie("circle-check",Ehe);const Nhe=[["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"}]],Che=Ie("circle-question-mark",Nhe);const Rhe=[["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"}]],Phe=Ie("circle-x",Rhe);const Mhe=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Q5=Ie("clock",Mhe);const khe=[["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"}]],vj=Ie("copy",khe);const Dhe=[["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"}]],Lhe=Ie("database",Dhe);const $he=[["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"}]],Ihe=Ie("dollar-sign",$he);const Bhe=[["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"}]],gj=Ie("eye-off",Bhe);const zhe=[["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"}]],xs=Ie("eye",zhe);const qhe=[["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"}]],J5=Ie("file-search",qhe);const Uhe=[["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"}]],eq=Ie("file-text",Uhe);const Fhe=[["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"}]],tq=Ie("house",Fhe);const Hhe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vhe=Ie("info",Hhe);const Ghe=[["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"}]],Khe=Ie("key",Ghe);const Whe=[["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"}]],nI=Ie("lock",Whe);const Yhe=[["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"}]],Xhe=Ie("log-out",Yhe);const Zhe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Qhe=Ie("menu",Zhe);const Jhe=[["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"}]],nq=Ie("message-square",Jhe);const epe=[["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"}]],rq=Ie("moon",epe);const tpe=[["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"}]],rv=Ie("pencil",tpe);const npe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Dn=Ie("plus",npe);const rpe=[["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"}]],$p=Ie("refresh-cw",rpe);const ape=[["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"}]],cO=Ie("save",ape);const ipe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cg=Ie("search",ipe);const ope=[["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"}]],spe=Ie("server",ope);const lpe=[["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"}]],aq=Ie("settings",lpe);const cpe=[["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"}]],upe=Ie("shield",cpe);const fpe=[["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"}]],dpe=Ie("smile",fpe);const hpe=[["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"}]],iq=Ie("sun",hpe);const ppe=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],mpe=Ie("terminal",ppe);const vpe=[["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"}]],dn=Ie("trash-2",vpe);const gpe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ype=Ie("trending-up",gpe);const bpe=[["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"}]],rI=Ie("triangle-alert",bpe);const xpe=[["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"}]],wpe=Ie("users",xpe);const Spe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uO=Ie("x",Spe);const _pe=[["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"}]],jpe=Ie("zap",_pe);var Ape=Symbol.for("react.lazy"),av=$j[" use ".trim().toString()];function Ope(e){return typeof e=="object"&&e!==null&&"then"in e}function oq(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ape&&"_payload"in e&&Ope(e._payload)}function fO(e){const t=Tpe(e),n=_.forwardRef((r,a)=>{let{children:o,...s}=r;oq(o)&&typeof av=="function"&&(o=av(o._payload));const c=_.Children.toArray(o),f=c.find(Cpe);if(f){const h=f.props.children,p=c.map(m=>m===f?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:m);return u.jsx(t,{...s,ref:a,children:_.isValidElement(h)?_.cloneElement(h,void 0,p):null})}return u.jsx(t,{...s,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var Epe=fO("Slot");function Tpe(e){const t=_.forwardRef((n,r)=>{let{children:a,...o}=n;if(oq(a)&&typeof av=="function"&&(a=av(a._payload)),_.isValidElement(a)){const s=Ppe(a),c=Rpe(o,a.props);return a.type!==_.Fragment&&(c.ref=r?Yr(r,s):s),_.cloneElement(a,c)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Npe=Symbol("radix.slottable");function Cpe(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Npe}function Rpe(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]=(...c)=>{const f=o(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Ppe(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 aI=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iI=qe,ug=(e,t)=>n=>{var r;if(t?.variants==null)return iI(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(h=>{const p=n?.[h],m=o?.[h];if(p===null)return null;const g=aI(p)||aI(m);return a[h][g]}),c=n&&Object.entries(n).reduce((h,p)=>{let[m,g]=p;return g===void 0||(h[m]=g),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:m,className:g,...y}=p;return Object.entries(y).every(S=>{let[x,w]=S;return Array.isArray(w)?w.includes({...o,...c}[x]):{...o,...c}[x]===w})?[...h,m,g]:h},[]);return iI(e,s,f,n?.class,n?.className)},dO=ug("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"}}),Se=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const s=r?Epe:"button";return u.jsx(s,{className:we(dO({variant:t,size:n,className:e})),ref:o,...a})});Se.displayName="Button";function Mpe(){const[e,t]=_.useState(null),[n,r]=_.useState(!0),[a,o]=_.useState(24),[s,c]=_.useState(!0),f=_.useCallback(async()=>{try{const O=localStorage.getItem("token"),E=await $t.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${O}`}});t(E.data),r(!1)}catch(O){console.error("Failed to fetch dashboard data:",O),r(!1)}},[a]);if(_.useEffect(()=>{f()},[f]),_.useEffect(()=>{if(!s)return;const O=setInterval(()=>{f()},3e4);return()=>clearInterval(O)},[s,f]),n||!e)return u.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:u.jsxs("div",{className:"text-center space-y-4",children:[u.jsx($p,{className:"h-12 w-12 animate-spin mx-auto text-muted-foreground"}),u.jsx("p",{className:"text-muted-foreground",children:"加载统计数据中..."})]})});const{summary:h,model_stats:p,hourly_data:m,daily_data:g,recent_activity:y}=e,S=O=>{const E=Math.floor(O/3600),N=Math.floor(O%3600/60);return`${E}小时${N}分钟`},x=O=>new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),w=p.slice(0,6).map(O=>({name:O.model_name,value:O.request_count,fill:`hsl(var(--chart-${p.indexOf(O)%5+1}))`})),A={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return u.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Yl,{value:a.toString(),onValueChange:O=>o(Number(O)),children:u.jsxs(ps,{className:"grid grid-cols-3 w-full sm:w-auto",children:[u.jsx(St,{value:"24",children:"24小时"}),u.jsx(St,{value:"168",children:"7天"}),u.jsx(St,{value:"720",children:"30天"})]})}),u.jsxs(Se,{variant:s?"default":"outline",size:"sm",onClick:()=>c(!s),className:"gap-2",children:[u.jsx($p,{className:`h-4 w-4 ${s?"animate-spin":""}`}),u.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),u.jsx(Se,{variant:"outline",size:"sm",onClick:f,children:u.jsx($p,{className:"h-4 w-4"})})]})]}),u.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"总请求数"}),u.jsx(fhe,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsxs(yn,{children:[u.jsx("div",{className:"text-2xl font-bold",children:h.total_requests.toLocaleString()}),u.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"总花费"}),u.jsx(Ihe,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsxs(yn,{children:[u.jsxs("div",{className:"text-2xl font-bold",children:["¥",h.total_cost.toFixed(2)]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h.cost_per_hour>0?`¥${h.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"Token消耗"}),u.jsx(Lhe,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsxs(yn,{children:[u.jsxs("div",{className:"text-2xl font-bold",children:[(h.total_tokens/1e3).toFixed(1),"K"]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h.tokens_per_hour>0?`${(h.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"平均响应"}),u.jsx(jpe,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsxs(yn,{children:[u.jsxs("div",{className:"text-2xl font-bold",children:[h.avg_response_time.toFixed(2),"s"]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),u.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"在线时长"}),u.jsx(Q5,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsx(yn,{children:u.jsx("div",{className:"text-xl font-bold",children:S(h.online_time)})})]}),u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"消息处理"}),u.jsx(nq,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsxs(yn,{children:[u.jsx("div",{className:"text-xl font-bold",children:h.total_messages.toLocaleString()}),u.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",h.total_replies.toLocaleString()," 条"]})]})]}),u.jsxs(mn,{children:[u.jsxs(vn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[u.jsx(gn,{className:"text-sm font-medium",children:"成本效率"}),u.jsx(ype,{className:"h-4 w-4 text-muted-foreground"})]}),u.jsxs(yn,{children:[u.jsx("div",{className:"text-xl font-bold",children:h.total_messages>0?`¥${(h.total_cost/h.total_messages*100).toFixed(2)}`:"¥0.00"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),u.jsxs(Yl,{defaultValue:"trends",className:"space-y-4",children:[u.jsxs(ps,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[u.jsx(St,{value:"trends",children:"趋势"}),u.jsx(St,{value:"models",children:"模型"}),u.jsx(St,{value:"activity",children:"活动"}),u.jsx(St,{value:"daily",children:"日统计"})]}),u.jsxs(Rt,{value:"trends",className:"space-y-4",children:[u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"请求趋势"}),u.jsxs(li,{children:["最近",a,"小时的请求量变化"]})]}),u.jsx(yn,{children:u.jsx(Nl,{config:A,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:u.jsxs(ehe,{data:m,children:[u.jsx(df,{strokeDasharray:"3 3"}),u.jsx(co,{dataKey:"timestamp",tickFormatter:O=>x(O),angle:-45,textAnchor:"end",height:60}),u.jsx(ui,{}),u.jsx(rf,{content:u.jsx(Cl,{labelFormatter:O=>x(O)})}),u.jsx(Td,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),u.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"花费趋势"}),u.jsx(li,{children:"API调用成本变化"})]}),u.jsx(yn,{children:u.jsx(Nl,{config:A,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:u.jsxs(v1,{data:m,children:[u.jsx(df,{strokeDasharray:"3 3"}),u.jsx(co,{dataKey:"timestamp",tickFormatter:O=>x(O),angle:-45,textAnchor:"end",height:60}),u.jsx(ui,{}),u.jsx(rf,{content:u.jsx(Cl,{labelFormatter:O=>x(O)})}),u.jsx(Oa,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"Token消耗"}),u.jsx(li,{children:"Token使用量变化"})]}),u.jsx(yn,{children:u.jsx(Nl,{config:A,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:u.jsxs(v1,{data:m,children:[u.jsx(df,{strokeDasharray:"3 3"}),u.jsx(co,{dataKey:"timestamp",tickFormatter:O=>x(O),angle:-45,textAnchor:"end",height:60}),u.jsx(ui,{}),u.jsx(rf,{content:u.jsx(Cl,{labelFormatter:O=>x(O)})}),u.jsx(Oa,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),u.jsx(Rt,{value:"models",className:"space-y-4",children:u.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"模型请求分布"}),u.jsx(li,{children:"各模型使用占比"})]}),u.jsx(yn,{children:u.jsx(Nl,{config:Object.fromEntries(p.slice(0,6).map((O,E)=>[O.model_name,{label:O.model_name,color:`hsl(var(--chart-${E%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:u.jsxs(the,{children:[u.jsx(rf,{content:u.jsx(Cl,{})}),u.jsx(Ci,{data:w,cx:"50%",cy:"50%",labelLine:!1,label:({name:O,percent:E})=>`${O} ${E?(E*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:w.map((O,E)=>u.jsx(Iv,{fill:O.fill},`cell-${E}`))})]})})})]}),u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"模型详细统计"}),u.jsx(li,{children:"请求数、花费和性能"})]}),u.jsx(yn,{children:u.jsx(pr,{className:"h-[300px] sm:h-[400px]",children:u.jsx("div",{className:"space-y-3",children:p.map((O,E)=>u.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:O.model_name}),u.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${E%5+1}))`}})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),u.jsx("span",{className:"ml-1 font-medium",children:O.request_count.toLocaleString()})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"花费:"}),u.jsxs("span",{className:"ml-1 font-medium",children:["¥",O.total_cost.toFixed(2)]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),u.jsxs("span",{className:"ml-1 font-medium",children:[(O.total_tokens/1e3).toFixed(1),"K"]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),u.jsxs("span",{className:"ml-1 font-medium",children:[O.avg_response_time.toFixed(2),"s"]})]})]})]},E))})})})]})]})}),u.jsx(Rt,{value:"activity",children:u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"最近活动"}),u.jsx(li,{children:"最新的API调用记录"})]}),u.jsx(yn,{children:u.jsx(pr,{className:"h-[400px] sm:h-[500px]",children:u.jsx("div",{className:"space-y-2",children:y.map((O,E)=>u.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"font-medium text-sm truncate",children:O.model}),u.jsx("div",{className:"text-xs text-muted-foreground",children:O.request_type})]}),u.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:x(O.timestamp)})]}),u.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),u.jsx("span",{className:"ml-1",children:O.tokens})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"花费:"}),u.jsxs("span",{className:"ml-1",children:["¥",O.cost.toFixed(4)]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),u.jsxs("span",{className:"ml-1",children:[O.time_cost.toFixed(2),"s"]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground",children:"状态:"}),u.jsx("span",{className:`ml-1 ${O.status==="success"?"text-green-600":"text-red-600"}`,children:O.status})]})]})]},E))})})})]})}),u.jsx(Rt,{value:"daily",children:u.jsxs(mn,{children:[u.jsxs(vn,{children:[u.jsx(gn,{children:"每日统计"}),u.jsx(li,{children:"最近7天的数据汇总"})]}),u.jsx(yn,{children:u.jsx(Nl,{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:u.jsxs(v1,{data:g,children:[u.jsx(df,{strokeDasharray:"3 3"}),u.jsx(co,{dataKey:"timestamp",tickFormatter:O=>{const E=new Date(O);return`${E.getMonth()+1}/${E.getDate()}`}}),u.jsx(ui,{yAxisId:"left"}),u.jsx(ui,{yAxisId:"right",orientation:"right"}),u.jsx(rf,{content:u.jsx(Cl,{labelFormatter:O=>new Date(O).toLocaleDateString("zh-CN")})}),u.jsx(ahe,{content:u.jsx(Y5,{})}),u.jsx(Oa,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),u.jsx(Oa,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})}const kpe={theme:"system",setTheme:()=>null},sq=_.createContext(kpe),hO=()=>{const e=_.useContext(sq);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Dpe=(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,s=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(${s}px at ${a}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},lq=_.createContext(void 0),cq=()=>{const e=_.useContext(lq);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};function pO(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function mO(e){const[t,n]=_.useState(void 0);return nn(()=>{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 s,c;if("borderBoxSize"in o){const f=o.borderBoxSize,h=Array.isArray(f)?f[0]:f;s=h.inlineSize,c=h.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var fg="Switch",[Lpe]=Zr(fg),[$pe,Ipe]=Lpe(fg),uq=_.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:s,disabled:c,value:f="on",onCheckedChange:h,form:p,...m}=e,[g,y]=_.useState(null),S=Ve(t,E=>y(E)),x=_.useRef(!1),w=g?p||!!g.closest("form"):!0,[A,O]=xi({prop:a,defaultProp:o??!1,onChange:h,caller:fg});return u.jsxs($pe,{scope:n,checked:A,disabled:c,children:[u.jsx(Me.button,{type:"button",role:"switch","aria-checked":A,"aria-required":s,"data-state":pq(A),"data-disabled":c?"":void 0,disabled:c,value:f,...m,ref:S,onClick:Ee(e.onClick,E=>{O(N=>!N),w&&(x.current=E.isPropagationStopped(),x.current||E.stopPropagation())})}),w&&u.jsx(hq,{control:g,bubbles:!x.current,name:r,value:f,checked:A,required:s,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});uq.displayName=fg;var fq="SwitchThumb",dq=_.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Ipe(fq,n);return u.jsx(Me.span,{"data-state":pq(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});dq.displayName=fq;var Bpe="SwitchBubbleInput",hq=_.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const s=_.useRef(null),c=Ve(s,o),f=pO(n),h=mO(t);return _.useEffect(()=>{const p=s.current;if(!p)return;const m=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(m,"checked").set;if(f!==n&&y){const S=new Event("click",{bubbles:r});y.call(p,n),p.dispatchEvent(S)}},[f,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});hq.displayName=Bpe;function pq(e){return e?"checked":"unchecked"}var mq=uq,zpe=dq;const _t=_.forwardRef(({className:e,...t},n)=>u.jsx(mq,{className:we("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:u.jsx(zpe,{className:we("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")})}));_t.displayName=mq.displayName;var qpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Upe=qpe.reduce((e,t)=>{const n=fO(`Primitive.${t}`),r=_.forwardRef((a,o)=>{const{asChild:s,...c}=a,f=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Fpe="Label",vq=_.forwardRef((e,t)=>u.jsx(Upe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vq.displayName=Fpe;var gq=vq;const Hpe=ug("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ve=_.forwardRef(({className:e,...t},n)=>u.jsx(gq,{ref:n,className:we(Hpe(),e),...t}));ve.displayName=gq.displayName;const Ce=_.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:we("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}));Ce.displayName="Input";const Vpe=1,Gpe=1e6;let g1=0;function Kpe(){return g1=(g1+1)%Number.MAX_SAFE_INTEGER,g1.toString()}const y1=new Map,oI=e=>{if(y1.has(e))return;const t=setTimeout(()=>{y1.delete(e),Af({type:"REMOVE_TOAST",toastId:e})},Gpe);y1.set(e,t)},Wpe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Vpe)};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?oI(n):e.toasts.forEach(r=>{oI(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)}}},Ip=[];let Bp={toasts:[]};function Af(e){Bp=Wpe(Bp,e),Ip.forEach(t=>{t(Bp)})}function Ype({...e}){const t=Kpe(),n=a=>Af({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Af({type:"DISMISS_TOAST",toastId:t});return Af({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function Nd(){const[e,t]=_.useState(Bp);return _.useEffect(()=>(Ip.push(t),()=>{const n=Ip.indexOf(t);n>-1&&Ip.splice(n,1)}),[e]),{...e,toast:Ype,dismiss:n=>Af({type:"DISMISS_TOAST",toastId:n})}}const Xpe=[{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 Zpe(e){const t=Xpe.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 vO="0.1.1Beta",yq="MaiBot Dashboard",Qpe=`${yq} v${vO}`,Jpe=(e="v")=>`${e}${vO}`;function eme(e,t=globalThis?.document){const n=Wt(e);_.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 tme="DismissableLayer",yj="dismissableLayer.update",nme="dismissableLayer.pointerDownOutside",rme="dismissableLayer.focusOutside",sI,bq=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Cd=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...f}=e,h=_.useContext(bq),[p,m]=_.useState(null),g=p?.ownerDocument??globalThis?.document,[,y]=_.useState({}),S=Ve(t,R=>m(R)),x=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),A=x.indexOf(w),O=p?x.indexOf(p):-1,E=h.layersWithOutsidePointerEventsDisabled.size>0,N=O>=A,T=ime(R=>{const M=R.target,k=[...h.branches].some(z=>z.contains(M));!N||k||(a?.(R),s?.(R),R.defaultPrevented||c?.())},g),C=ome(R=>{const M=R.target;[...h.branches].some(z=>z.contains(M))||(o?.(R),s?.(R),R.defaultPrevented||c?.())},g);return eme(R=>{O===h.layers.size-1&&(r?.(R),!R.defaultPrevented&&c&&(R.preventDefault(),c()))},g),_.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(sI=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),lI(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=sI)}},[p,g,n,h]),_.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),lI())},[p,h]),_.useEffect(()=>{const R=()=>y({});return document.addEventListener(yj,R),()=>document.removeEventListener(yj,R)},[]),u.jsx(Me.div,{...f,ref:S,style:{pointerEvents:E?N?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,T.onPointerDownCapture)})});Cd.displayName=tme;var ame="DismissableLayerBranch",xq=_.forwardRef((e,t)=>{const n=_.useContext(bq),r=_.useRef(null),a=Ve(t,r);return _.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Me.div,{...e,ref:a})});xq.displayName=ame;function ime(e,t=globalThis?.document){const n=Wt(e),r=_.useRef(!1),a=_.useRef(()=>{});return _.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let f=function(){wq(nme,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=f,t.addEventListener("click",a.current,{once:!0})):f()}else t.removeEventListener("click",a.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ome(e,t=globalThis?.document){const n=Wt(e),r=_.useRef(!1);return _.useEffect(()=>{const a=o=>{o.target&&!r.current&&wq(rme,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 lI(){const e=new CustomEvent(yj);document.dispatchEvent(e)}function wq(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?K4(a,o):a.dispatchEvent(o)}var sme=Cd,lme=xq,b1="focusScope.autoFocusOnMount",x1="focusScope.autoFocusOnUnmount",cI={bubbles:!1,cancelable:!0},cme="FocusScope",dg=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,f]=_.useState(null),h=Wt(a),p=Wt(o),m=_.useRef(null),g=Ve(t,x=>f(x)),y=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let x=function(E){if(y.paused||!c)return;const N=E.target;c.contains(N)?m.current=N:ao(m.current,{select:!0})},w=function(E){if(y.paused||!c)return;const N=E.relatedTarget;N!==null&&(c.contains(N)||ao(m.current,{select:!0}))},A=function(E){if(document.activeElement===document.body)for(const T of E)T.removedNodes.length>0&&ao(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",w);const O=new MutationObserver(A);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),O.disconnect()}}},[r,c,y.paused]),_.useEffect(()=>{if(c){fI.add(y);const x=document.activeElement;if(!c.contains(x)){const A=new CustomEvent(b1,cI);c.addEventListener(b1,h),c.dispatchEvent(A),A.defaultPrevented||(ume(mme(Sq(c)),{select:!0}),document.activeElement===x&&ao(c))}return()=>{c.removeEventListener(b1,h),setTimeout(()=>{const A=new CustomEvent(x1,cI);c.addEventListener(x1,p),c.dispatchEvent(A),A.defaultPrevented||ao(x??document.body,{select:!0}),c.removeEventListener(x1,p),fI.remove(y)},0)}}},[c,h,p,y]);const S=_.useCallback(x=>{if(!n&&!r||y.paused)return;const w=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,A=document.activeElement;if(w&&A){const O=x.currentTarget,[E,N]=fme(O);E&&N?!x.shiftKey&&A===N?(x.preventDefault(),n&&ao(E,{select:!0})):x.shiftKey&&A===E&&(x.preventDefault(),n&&ao(N,{select:!0})):A===O&&x.preventDefault()}},[n,r,y.paused]);return u.jsx(Me.div,{tabIndex:-1,...s,ref:g,onKeyDown:S})});dg.displayName=cme;function ume(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ao(r,{select:t}),document.activeElement!==n)return}function fme(e){const t=Sq(e),n=uI(t,e),r=uI(t.reverse(),e);return[n,r]}function Sq(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 uI(e,t){for(const n of e)if(!dme(n,{upTo:t}))return n}function dme(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 hme(e){return e instanceof HTMLInputElement&&"select"in e}function ao(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hme(e)&&t&&e.select()}}var fI=pme();function pme(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=dI(e,t),e.unshift(t)},remove(t){e=dI(e,t),e[0]?.resume()}}}function dI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mme(e){return e.filter(t=>t.tagName!=="A")}var vme="Portal",Rd=_.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=_.useState(!1);nn(()=>o(!0),[]);const s=n||a&&globalThis?.document?.body;return s?PV.createPortal(u.jsx(Me.div,{...r,ref:t}),s):null});Rd.displayName=vme;var w1=0;function gO(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hI()),document.body.insertAdjacentElement("beforeend",e[1]??hI()),w1++,()=>{w1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),w1--}},[])}function hI(){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 _a=function(){return _a=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return Mme;var t=kme(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])}},Lme=Oq(),ql="data-scroll-locked",$me=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,c=e.gap;return n===void 0&&(n="margin"),` .`.concat(yme,` { overflow: hidden `).concat(r,`; padding-right: `).concat(c,"px ").concat(r,`; } body[`).concat(ql,`] { 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(s,`px; margin-left:0; margin-top:0; margin-right: `).concat(c,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(zp,` { right: `).concat(c,"px ").concat(r,`; } .`).concat(qp,` { margin-right: `).concat(c,"px ").concat(r,`; } .`).concat(zp," .").concat(zp,` { right: 0 `).concat(r,`; } .`).concat(qp," .").concat(qp,` { margin-right: 0 `).concat(r,`; } body[`).concat(ql,`] { `).concat(bme,": ").concat(c,`px; } `)},mI=function(){var e=parseInt(document.body.getAttribute(ql)||"0",10);return isFinite(e)?e:0},Ime=function(){_.useEffect(function(){return document.body.setAttribute(ql,(mI()+1).toString()),function(){var e=mI()-1;e<=0?document.body.removeAttribute(ql):document.body.setAttribute(ql,e.toString())}},[])},Bme=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Ime();var o=_.useMemo(function(){return Dme(a)},[a]);return _.createElement(Lme,{styles:$me(o,!t,a,n?"":"!important")})},bj=!1;if(typeof window<"u")try{var _p=Object.defineProperty({},"passive",{get:function(){return bj=!0,!0}});window.addEventListener("test",_p,_p),window.removeEventListener("test",_p,_p)}catch{bj=!1}var Al=bj?{passive:!1}:!1,zme=function(e){return e.tagName==="TEXTAREA"},Eq=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zme(e)&&n[t]==="visible")},qme=function(e){return Eq(e,"overflowY")},Ume=function(e){return Eq(e,"overflowX")},vI=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Tq(e,r);if(a){var o=Nq(e,r),s=o[1],c=o[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fme=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Hme=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Tq=function(e,t){return e==="v"?qme(t):Ume(t)},Nq=function(e,t){return e==="v"?Fme(t):Hme(t)},Vme=function(e,t){return e==="h"&&t==="rtl"?-1:1},Gme=function(e,t,n,r,a){var o=Vme(e,window.getComputedStyle(t).direction),s=o*r,c=n.target,f=t.contains(c),h=!1,p=s>0,m=0,g=0;do{if(!c)break;var y=Nq(e,c),S=y[0],x=y[1],w=y[2],A=x-w-o*S;(S||A)&&Tq(e,c)&&(m+=A,g+=S);var O=c.parentNode;c=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(h=!0),h},jp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gI=function(e){return[e.deltaX,e.deltaY]},yI=function(e){return e&&"current"in e?e.current:e},Kme=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wme=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Yme=0,Ol=[];function Xme(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),a=_.useState(Yme++)[0],o=_.useState(Oq)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var x=gme([e.lockRef.current],(e.shards||[]).map(yI),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=_.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!s.current.allowPinchZoom;var A=jp(x),O=n.current,E="deltaX"in x?x.deltaX:O[0]-A[0],N="deltaY"in x?x.deltaY:O[1]-A[1],T,C=x.target,R=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in x&&R==="h"&&C.type==="range")return!1;var M=vI(R,C);if(!M)return!0;if(M?T=R:(T=R==="v"?"h":"v",M=vI(R,C)),!M)return!1;if(!r.current&&"changedTouches"in x&&(E||N)&&(r.current=T),!T)return!0;var k=r.current||T;return Gme(k,w,x,k==="h"?E:N)},[]),f=_.useCallback(function(x){var w=x;if(!(!Ol.length||Ol[Ol.length-1]!==o)){var A="deltaY"in w?gI(w):jp(w),O=t.current.filter(function(T){return T.name===w.type&&(T.target===w.target||w.target===T.shadowParent)&&Kme(T.delta,A)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var E=(s.current.shards||[]).map(yI).filter(Boolean).filter(function(T){return T.contains(w.target)}),N=E.length>0?c(w,E[0]):!s.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),h=_.useCallback(function(x,w,A,O){var E={name:x,delta:w,target:A,should:O,shadowParent:Zme(A)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(N){return N!==E})},1)},[]),p=_.useCallback(function(x){n.current=jp(x),r.current=void 0},[]),m=_.useCallback(function(x){h(x.type,gI(x),x.target,c(x,e.lockRef.current))},[]),g=_.useCallback(function(x){h(x.type,jp(x),x.target,c(x,e.lockRef.current))},[]);_.useEffect(function(){return Ol.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",f,Al),document.addEventListener("touchmove",f,Al),document.addEventListener("touchstart",p,Al),function(){Ol=Ol.filter(function(x){return x!==o}),document.removeEventListener("wheel",f,Al),document.removeEventListener("touchmove",f,Al),document.removeEventListener("touchstart",p,Al)}},[]);var y=e.removeScrollBar,S=e.inert;return _.createElement(_.Fragment,null,S?_.createElement(o,{styles:Wme(a)}):null,y?_.createElement(Bme,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Zme(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Qme=Ome(Aq,Xme);var pg=_.forwardRef(function(e,t){return _.createElement(hg,_a({},e,{ref:t,sideCar:Qme}))});pg.classNames=hg.classNames;var Jme=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},El=new WeakMap,Ap=new WeakMap,Op={},A1=0,Cq=function(e){return e&&(e.host||Cq(e.parentNode))},eve=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Cq(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})},tve=function(e,t,n,r){var a=eve(t,Array.isArray(e)?e:[e]);Op[n]||(Op[n]=new WeakMap);var o=Op[n],s=[],c=new Set,f=new Set(a),h=function(m){!m||c.has(m)||(c.add(m),h(m.parentNode))};a.forEach(h);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(g){if(c.has(g))p(g);else try{var y=g.getAttribute(r),S=y!==null&&y!=="false",x=(El.get(g)||0)+1,w=(o.get(g)||0)+1;El.set(g,x),o.set(g,w),s.push(g),x===1&&S&&Ap.set(g,!0),w===1&&g.setAttribute(n,"true"),S||g.setAttribute(r,"true")}catch(A){console.error("aria-hidden: cannot operate on ",g,A)}})};return p(t),c.clear(),A1++,function(){s.forEach(function(m){var g=El.get(m)-1,y=o.get(m)-1;El.set(m,g),o.set(m,y),g||(Ap.has(m)||m.removeAttribute(r),Ap.delete(m)),y||m.removeAttribute(n)}),A1--,A1||(El=new WeakMap,El=new WeakMap,Ap=new WeakMap,Op={})}},yO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Jme(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),tve(r,a,n,"aria-hidden")):function(){return null}};function nve(e){const t=rve(e),n=_.forwardRef((r,a)=>{const{children:o,...s}=r,c=_.Children.toArray(o),f=c.find(ive);if(f){const h=f.props.children,p=c.map(m=>m===f?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:m);return u.jsx(t,{...s,ref:a,children:_.isValidElement(h)?_.cloneElement(h,void 0,p):null})}return u.jsx(t,{...s,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function rve(e){const t=_.forwardRef((n,r)=>{const{children:a,...o}=n;if(_.isValidElement(a)){const s=sve(a),c=ove(o,a.props);return a.type!==_.Fragment&&(c.ref=r?Yr(r,s):s),_.cloneElement(a,c)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ave=Symbol("radix.slottable");function ive(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ave}function ove(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]=(...c)=>{const f=o(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function sve(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 mg="Dialog",[Rq,Pq]=Zr(mg),[lve,va]=Rq(mg),Mq=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=_.useRef(null),f=_.useRef(null),[h,p]=xi({prop:r,defaultProp:a??!1,onChange:o,caller:mg});return u.jsx(lve,{scope:t,triggerRef:c,contentRef:f,contentId:kn(),titleId:kn(),descriptionId:kn(),open:h,onOpenChange:p,onOpenToggle:_.useCallback(()=>p(m=>!m),[p]),modal:s,children:n})};Mq.displayName=mg;var kq="DialogTrigger",Dq=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=va(kq,n),o=Ve(t,a.triggerRef);return u.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":wO(a.open),...r,ref:o,onClick:Ee(e.onClick,a.onOpenToggle)})});Dq.displayName=kq;var bO="DialogPortal",[cve,Lq]=Rq(bO,{forceMount:void 0}),$q=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=va(bO,t);return u.jsx(cve,{scope:t,forceMount:n,children:_.Children.map(r,s=>u.jsx(Qr,{present:n||o.open,children:u.jsx(Rd,{asChild:!0,container:a,children:s})}))})};$q.displayName=bO;var iv="DialogOverlay",Iq=_.forwardRef((e,t)=>{const n=Lq(iv,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=va(iv,e.__scopeDialog);return o.modal?u.jsx(Qr,{present:r||o.open,children:u.jsx(fve,{...a,ref:t})}):null});Iq.displayName=iv;var uve=nve("DialogOverlay.RemoveScroll"),fve=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=va(iv,n);return u.jsx(pg,{as:uve,allowPinchZoom:!0,shards:[a.contentRef],children:u.jsx(Me.div,{"data-state":wO(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ws="DialogContent",Bq=_.forwardRef((e,t)=>{const n=Lq(ws,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=va(ws,e.__scopeDialog);return u.jsx(Qr,{present:r||o.open,children:o.modal?u.jsx(dve,{...a,ref:t}):u.jsx(hve,{...a,ref:t})})});Bq.displayName=ws;var dve=_.forwardRef((e,t)=>{const n=va(ws,e.__scopeDialog),r=_.useRef(null),a=Ve(t,n.contentRef,r);return _.useEffect(()=>{const o=r.current;if(o)return yO(o)},[]),u.jsx(zq,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&o.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,o=>o.preventDefault())})}),hve=_.forwardRef((e,t)=>{const n=va(ws,e.__scopeDialog),r=_.useRef(!1),a=_.useRef(!1);return u.jsx(zq,{...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 s=o.target;n.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),zq=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...s}=e,c=va(ws,n),f=_.useRef(null),h=Ve(t,f);return gO(),u.jsxs(u.Fragment,{children:[u.jsx(dg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:u.jsx(Cd,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":wO(c.open),...s,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(mve,{titleId:c.titleId}),u.jsx(gve,{contentRef:f,descriptionId:c.descriptionId})]})]})}),xO="DialogTitle",qq=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=va(xO,n);return u.jsx(Me.h2,{id:a.titleId,...r,ref:t})});qq.displayName=xO;var Uq="DialogDescription",Fq=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=va(Uq,n);return u.jsx(Me.p,{id:a.descriptionId,...r,ref:t})});Fq.displayName=Uq;var Hq="DialogClose",Vq=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=va(Hq,n);return u.jsx(Me.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>a.onOpenChange(!1))})});Vq.displayName=Hq;function wO(e){return e?"open":"closed"}var Gq="DialogTitleWarning",[pve,Kq]=AW(Gq,{contentName:ws,titleName:xO,docsSlug:"dialog"}),mve=({titleId:e})=>{const t=Kq(Gq),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 _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vve="DialogDescriptionWarning",gve=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kq(vve).contentName}}.`;return _.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},SO=Mq,Wq=Dq,_O=$q,vg=Iq,gg=Bq,jO=qq,AO=Fq,OO=Vq;const Pd=SO,Yq=Wq,yve=_O,Xq=_.forwardRef(({className:e,...t},n)=>u.jsx(vg,{ref:n,className:we("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}));Xq.displayName=vg.displayName;const Bc=_.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(yve,{children:[u.jsx(Xq,{}),u.jsxs(gg,{ref:r,className:we("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,u.jsxs(OO,{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:[u.jsx(uO,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bc.displayName=gg.displayName;const zc=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});zc.displayName="DialogHeader";const yg=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yg.displayName="DialogFooter";const qc=_.forwardRef(({className:e,...t},n)=>u.jsx(jO,{ref:n,className:we("text-lg font-semibold leading-none tracking-tight",e),...t}));qc.displayName=jO.displayName;const Uc=_.forwardRef(({className:e,...t},n)=>u.jsx(AO,{ref:n,className:we("text-sm text-muted-foreground",e),...t}));Uc.displayName=AO.displayName;var bve=Symbol("radix.slottable");function xve(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=bve,t}var Zq="AlertDialog",[wve]=Zr(Zq,[Pq]),Ri=Pq(),Qq=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ri(t);return u.jsx(SO,{...r,...n,modal:!0})};Qq.displayName=Zq;var Sve="AlertDialogTrigger",Jq=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ri(n);return u.jsx(Wq,{...a,...r,ref:t})});Jq.displayName=Sve;var _ve="AlertDialogPortal",e6=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ri(t);return u.jsx(_O,{...r,...n})};e6.displayName=_ve;var jve="AlertDialogOverlay",t6=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ri(n);return u.jsx(vg,{...a,...r,ref:t})});t6.displayName=jve;var Ul="AlertDialogContent",[Ave,Ove]=wve(Ul),Eve=xve("AlertDialogContent"),n6=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=Ri(n),s=_.useRef(null),c=Ve(t,s),f=_.useRef(null);return u.jsx(pve,{contentName:Ul,titleName:r6,docsSlug:"alert-dialog",children:u.jsx(Ave,{scope:n,cancelRef:f,children:u.jsxs(gg,{role:"alertdialog",...o,...a,ref:c,onOpenAutoFocus:Ee(a.onOpenAutoFocus,h=>{h.preventDefault(),f.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[u.jsx(Eve,{children:r}),u.jsx(Nve,{contentRef:s})]})})})});n6.displayName=Ul;var r6="AlertDialogTitle",a6=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ri(n);return u.jsx(jO,{...a,...r,ref:t})});a6.displayName=r6;var i6="AlertDialogDescription",o6=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ri(n);return u.jsx(AO,{...a,...r,ref:t})});o6.displayName=i6;var Tve="AlertDialogAction",s6=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Ri(n);return u.jsx(OO,{...a,...r,ref:t})});s6.displayName=Tve;var l6="AlertDialogCancel",c6=_.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Ove(l6,n),o=Ri(n),s=Ve(t,a);return u.jsx(OO,{...o,...r,ref:s})});c6.displayName=l6;var Nve=({contentRef:e})=>{const t=`\`${Ul}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Ul}\` by passing a \`${i6}\` 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 \`${Ul}\`. 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 _.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Cve=Qq,Rve=Jq,Pve=e6,u6=t6,f6=n6,d6=s6,h6=c6,p6=a6,m6=o6;const Wr=Cve,Ra=Rve,Mve=Pve,v6=_.forwardRef(({className:e,...t},n)=>u.jsx(u6,{className:we("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}));v6.displayName=u6.displayName;const Sr=_.forwardRef(({className:e,...t},n)=>u.jsxs(Mve,{children:[u.jsx(v6,{}),u.jsx(f6,{ref:n,className:we("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})]}));Sr.displayName=f6.displayName;const _r=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col space-y-2 text-center sm:text-left",e),...t});_r.displayName="AlertDialogHeader";const jr=({className:e,...t})=>u.jsx("div",{className:we("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jr.displayName="AlertDialogFooter";const Ar=_.forwardRef(({className:e,...t},n)=>u.jsx(p6,{ref:n,className:we("text-lg font-semibold",e),...t}));Ar.displayName=p6.displayName;const Or=_.forwardRef(({className:e,...t},n)=>u.jsx(m6,{ref:n,className:we("text-sm text-muted-foreground",e),...t}));Or.displayName=m6.displayName;const Er=_.forwardRef(({className:e,...t},n)=>u.jsx(d6,{ref:n,className:we(dO(),e),...t}));Er.displayName=d6.displayName;const Tr=_.forwardRef(({className:e,...t},n)=>u.jsx(h6,{ref:n,className:we(dO({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Tr.displayName=h6.displayName;function kve(){return u.jsxs("div",{className:"container mx-auto p-6 max-w-5xl space-y-6",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-3xl font-bold",children:"系统设置"}),u.jsx("p",{className:"text-muted-foreground mt-2",children:"管理您的应用偏好设置"})]})}),u.jsxs(Yl,{defaultValue:"appearance",className:"w-full",children:[u.jsxs(ps,{className:"grid w-full max-w-2xl grid-cols-4",children:[u.jsxs(St,{value:"appearance",className:"gap-2",children:[u.jsx(aq,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"外观"]}),u.jsxs(St,{value:"notifications",className:"gap-2",children:[u.jsx(mhe,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"通知"]}),u.jsxs(St,{value:"security",className:"gap-2",children:[u.jsx(upe,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"安全"]}),u.jsxs(St,{value:"about",className:"gap-2",children:[u.jsx(Vhe,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"关于"]})]}),u.jsxs(pr,{className:"h-[calc(100vh-280px)] mt-6",children:[u.jsx(Rt,{value:"appearance",className:"mt-0",children:u.jsx(Dve,{})}),u.jsx(Rt,{value:"notifications",className:"mt-0",children:u.jsx(Lve,{})}),u.jsx(Rt,{value:"security",className:"mt-0",children:u.jsx($ve,{})}),u.jsx(Rt,{value:"about",className:"mt-0",children:u.jsx(Ive,{})})]})]})]})}function Dve(){const{theme:e,setTheme:t}=hO(),{enableAnimations:n,setEnableAnimations:r}=cq(),[a,o]=_.useState(()=>localStorage.getItem("accent-color")||"blue"),s=c=>{o(c),localStorage.setItem("accent-color",c);const f=document.documentElement,p={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%"}}[c];p&&f.style.setProperty("--primary",p.hsl)};return u.jsxs("div",{className:"space-y-8",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"主题模式"}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[u.jsx(O1,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),u.jsx(O1,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),u.jsx(O1,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"主题色"}),u.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-4",children:[u.jsx(af,{value:"blue",current:a,onChange:s,label:"蓝色",colorClass:"bg-blue-500"}),u.jsx(af,{value:"purple",current:a,onChange:s,label:"紫色",colorClass:"bg-purple-500"}),u.jsx(af,{value:"green",current:a,onChange:s,label:"绿色",colorClass:"bg-green-500"}),u.jsx(af,{value:"orange",current:a,onChange:s,label:"橙色",colorClass:"bg-orange-500"}),u.jsx(af,{value:"pink",current:a,onChange:s,label:"粉色",colorClass:"bg-pink-500"})]})]}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"动画效果"}),u.jsx("div",{className:"rounded-lg border bg-card p-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5 flex-1",children:[u.jsx(ve,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),u.jsx(_t,{id:"animations",checked:n,onCheckedChange:r})]})})]})]})}function Lve(){return u.jsx("div",{className:"space-y-6",children:u.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"通知设置"}),u.jsx("p",{className:"text-muted-foreground",children:"通知功能正在开发中..."})]})})}function $ve(){const[e,t]=_.useState(""),[n,r]=_.useState(""),[a,o]=_.useState(!1),[s,c]=_.useState(!1),[f,h]=_.useState(!1),[p,m]=_.useState(!1),[g,y]=_.useState(!1),[S,x]=_.useState(!1),[w,A]=_.useState(""),[O,E]=_.useState(!1),{toast:N}=Nd(),T=_.useMemo(()=>Zpe(n),[n]),C=()=>localStorage.getItem("access-token")||"",R=async B=>{try{await navigator.clipboard.writeText(B),y(!0),N({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{N({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},M=async()=>{if(!n.trim()){N({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!T.isValid){const B=T.rules.filter(F=>!F.passed).map(F=>F.label).join(", ");N({title:"格式错误",description:`Token 不符合要求: ${B}`,variant:"destructive"});return}h(!0);try{const B=C(),F=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${B}`},body:JSON.stringify({new_token:n.trim()})}),U=await F.json();F.ok&&U.success?(localStorage.setItem("access-token",n.trim()),r(""),e&&t(n.trim()),N({title:"更新成功",description:"Access Token 已更新"})):N({title:"更新失败",description:U.message||"无法更新 Token",variant:"destructive"})}catch(B){console.error("更新 Token 错误:",B),N({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{h(!1)}},k=async()=>{m(!0);try{const B=C(),F=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${B}`}}),U=await F.json();F.ok&&U.success?(localStorage.setItem("access-token",U.token),A(U.token),x(!0),E(!1),N({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):N({title:"生成失败",description:U.message||"无法生成新 Token",variant:"destructive"})}catch(B){console.error("生成 Token 错误:",B),N({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{m(!1)}},z=async()=>{try{await navigator.clipboard.writeText(w),E(!0),N({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{N({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},L=()=>{x(!1),setTimeout(()=>{A(""),E(!1)},300)};return u.jsxs("div",{className:"space-y-6",children:[u.jsx(Pd,{open:S,onOpenChange:x,children:u.jsxs(Bc,{className:"sm:max-w-md",children:[u.jsxs(zc,{children:[u.jsxs(qc,{className:"flex items-center gap-2",children:[u.jsx(rI,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),u.jsx(Uc,{children:"这是您的新 Token,请立即保存。关闭此窗口后将无法再次查看。"})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[u.jsx(ve,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),u.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:w})]}),u.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsx(rI,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),u.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[u.jsx("p",{className:"font-semibold",children:"重要提示"}),u.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[u.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),u.jsx("li",{children:"请立即复制并保存到安全的位置"}),u.jsx("li",{children:"旧的 Token 已失效,请使用新 Token 登录"})]})]})]})})]}),u.jsxs(yg,{className:"gap-2 sm:gap-0",children:[u.jsx(Se,{variant:"outline",onClick:z,className:"gap-2",children:O?u.jsxs(u.Fragment,{children:[u.jsx(jf,{className:"h-4 w-4 text-green-500"}),"已复制"]}):u.jsxs(u.Fragment,{children:[u.jsx(vj,{className:"h-4 w-4"}),"复制 Token"]})}),u.jsx(Se,{onClick:L,children:"我已保存,关闭"})]})]})}),u.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"当前 Access Token"}),u.jsx("div",{className:"space-y-4",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{htmlFor:"current-token",children:"您的访问令牌"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("div",{className:"relative flex-1",children:[u.jsx(Ce,{id:"current-token",type:a?"text":"password",value:e||C(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),u.jsx("button",{onClick:()=>{e||t(C()),o(!a)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:a?"隐藏":"显示",children:a?u.jsx(gj,{className:"h-4 w-4 text-muted-foreground"}):u.jsx(xs,{className:"h-4 w-4 text-muted-foreground"})})]}),u.jsx(Se,{variant:"outline",size:"icon",onClick:()=>R(C()),title:"复制到剪贴板",children:g?u.jsx(jf,{className:"h-4 w-4 text-green-500"}):u.jsx(vj,{className:"h-4 w-4"})}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsxs(Se,{variant:"outline",disabled:p,className:"gap-2",children:[u.jsx($p,{className:we("h-4 w-4",p&&"animate-spin")}),"重新生成"]})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认重新生成 Token"}),u.jsx(Or,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:k,children:"确认生成"})]})]})]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),u.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"自定义 Access Token"}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{htmlFor:"new-token",children:"新的访问令牌"}),u.jsxs("div",{className:"relative",children:[u.jsx(Ce,{id:"new-token",type:s?"text":"password",value:n,onChange:B=>r(B.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),u.jsx("button",{onClick:()=>c(!s),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:s?"隐藏":"显示",children:s?u.jsx(gj,{className:"h-4 w-4 text-muted-foreground"}):u.jsx(xs,{className:"h-4 w-4 text-muted-foreground"})})]}),n&&u.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[u.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),u.jsx("div",{className:"space-y-1.5",children:T.rules.map(B=>u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[B.passed?u.jsx(The,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):u.jsx(Phe,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),u.jsx("span",{className:we(B.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:B.label})]},B.id))}),T.isValid&&u.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:u.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[u.jsx(jf,{className:"h-4 w-4"}),u.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),u.jsx(Se,{onClick:M,disabled:f||!T.isValid||!n,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),u.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-4",children:[u.jsx("h4",{className:"font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),u.jsxs("ul",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[u.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),u.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),u.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),u.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),u.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),u.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function Ive(){return u.jsx("div",{className:"space-y-6",children:u.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[u.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["关于 ",yq]}),u.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[u.jsxs("p",{children:["版本: ",vO]}),u.jsx("p",{children:"基于 React 19 + Vite + TanStack Router"})]})]})})}function O1({value:e,current:t,onChange:n,label:r,description:a}){const o=t===e;return u.jsxs("button",{onClick:()=>n(e),className:we("relative rounded-lg border-2 p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&u.jsx("div",{className:"absolute top-3 right-3 h-2 w-2 rounded-full bg-primary"}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("div",{className:"font-medium",children:r}),u.jsx("div",{className:"text-xs text-muted-foreground",children:a})]}),u.jsxs("div",{className:"mt-3 flex gap-1",children:[e==="light"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),u.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),u.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),u.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),u.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),u.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),u.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function af({value:e,current:t,onChange:n,label:r,colorClass:a}){const o=t===e;return u.jsxs("button",{onClick:()=>n(e),className:we("relative rounded-lg border-2 p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&u.jsx("div",{className:"absolute top-2 right-2 h-2 w-2 rounded-full bg-primary"}),u.jsxs("div",{className:"flex flex-col items-center gap-3",children:[u.jsx("div",{className:we("h-12 w-12 rounded-full",a)}),u.jsx("div",{className:"text-sm font-medium",children:r})]})]})}class Bve{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),s=this.fade(n),c=this.perm[r]+a,f=this.perm[c],h=this.perm[c+1],p=this.perm[r+1]+a,m=this.perm[p],g=this.perm[p+1];return this.mix(this.mix(this.dot(this.grad3[f%12],t,n),this.dot(this.grad3[m%12],t-1,n),o),this.mix(this.dot(this.grad3[h%12],t,n-1),this.dot(this.grad3[g%12],t-1,n-1),o),s)}}function zve(){const e=_.useRef(null),t=_.useRef(null),n=_.useRef(void 0),r=_.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 Bve(Math.random()),bounding:null});return _.useEffect(()=>{const a=t.current,o=e.current;if(!a||!o)return;const s=r.current,c=()=>{const x=a.getBoundingClientRect();s.bounding=x,o.style.width=`${x.width}px`,o.style.height=`${x.height}px`},f=()=>{if(!s.bounding)return;const{width:x,height:w}=s.bounding;s.lines=[],s.paths.forEach(k=>k.remove()),s.paths=[];const A=10,O=32,E=x+200,N=w+30,T=Math.ceil(E/A),C=Math.ceil(N/O),R=(x-A*T)/2,M=(w-O*C)/2;for(let k=0;k<=T;k++){const z=[];for(let B=0;B<=C;B++){const F={x:R+A*k,y:M+O*B,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};z.push(F)}const L=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild(L),s.paths.push(L),s.lines.push(z)}},h=x=>{const{lines:w,mouse:A,noise:O}=s;w.forEach(E=>{E.forEach(N=>{const T=O.perlin2((N.x+x*.0125)*.002,(N.y+x*.005)*.0015)*12;N.wave.x=Math.cos(T)*32,N.wave.y=Math.sin(T)*16;const C=N.x-A.sx,R=N.y-A.sy,M=Math.hypot(C,R),k=Math.max(175,A.vs);if(M{const A={x:x.x+x.wave.x+(w?x.cursor.x:0),y:x.y+x.wave.y+(w?x.cursor.y:0)};return A.x=Math.round(A.x*10)/10,A.y=Math.round(A.y*10)/10,A},m=()=>{const{lines:x,paths:w}=s;x.forEach((A,O)=>{let E=p(A[0],!1),N=`M ${E.x} ${E.y}`;A.forEach((T,C)=>{const R=C===A.length-1;E=p(T,!R),N+=`L ${E.x} ${E.y}`}),w[O].setAttribute("d",N)})},g=x=>{const{mouse:w}=s;w.sx+=(w.x-w.sx)*.1,w.sy+=(w.y-w.sy)*.1;const A=w.x-w.lx,O=w.y-w.ly,E=Math.hypot(A,O);w.v=E,w.vs+=(E-w.vs)*.1,w.vs=Math.min(100,w.vs),w.lx=w.x,w.ly=w.y,w.a=Math.atan2(O,A),a&&(a.style.setProperty("--x",`${w.sx}px`),a.style.setProperty("--y",`${w.sy}px`)),h(x),m(),n.current=requestAnimationFrame(g)},y=x=>{if(!s.bounding)return;const{mouse:w}=s;w.x=x.pageX-s.bounding.left,w.y=x.pageY-s.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)},S=()=>{c(),f()};return c(),f(),window.addEventListener("resize",S),window.addEventListener("mousemove",y),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",S),window.removeEventListener("mousemove",y),n.current&&cancelAnimationFrame(n.current)}},[]),u.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[u.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"}}),u.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:u.jsx("style",{children:` path { fill: none; stroke: hsl(var(--primary) / 0.15); stroke-width: 1px; } `})})]})}function qve(){const e=Es();_.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function g6(){return!!localStorage.getItem("access-token")}function Uve(){const[e,t]=_.useState(""),[n,r]=_.useState(!1),[a,o]=_.useState(""),s=Es(),{enableAnimations:c}=cq(),{theme:f,setTheme:h}=hO();_.useEffect(()=>{g6()&&s({to:"/"})},[s]);const m=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,g=()=>{h(m==="dark"?"light":"dark")},y=async S=>{if(S.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}r(!0);try{const x=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),w=await x.json();x.ok&&w.valid?(localStorage.setItem("access-token",e.trim()),s({to:"/"})):o(w.message||"Token 验证失败,请检查后重试")}catch(x){console.error("Token 验证错误:",x),o("连接服务器失败,请检查网络连接")}finally{r(!1)}};return u.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[c&&u.jsx(zve,{}),u.jsxs(mn,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[u.jsx("button",{onClick:g,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:m==="dark"?"切换到浅色模式":"切换到深色模式",children:m==="dark"?u.jsx(iq,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):u.jsx(rq,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),u.jsxs(vn,{className:"space-y-4 text-center",children:[u.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:u.jsx(nI,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(gn,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),u.jsx(li,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),u.jsx(yn,{children:u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),u.jsxs("div",{className:"relative",children:[u.jsx(Khe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),u.jsx(Ce,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:S=>t(S.target.value),className:we("pl-10",a&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),a&&u.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:[u.jsx(tI,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),u.jsx("span",{children:a})]}),u.jsx(Se,{type:"submit",className:"w-full",disabled:n,children:n?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),u.jsxs(Pd,{children:[u.jsx(Yq,{asChild:!0,children:u.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:[u.jsx(Che,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),u.jsxs(Bc,{className:"sm:max-w-md",children:[u.jsxs(zc,{children:[u.jsxs(qc,{className:"flex items-center gap-2",children:[u.jsx(nI,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),u.jsx(Uc,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(mpe,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),u.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[u.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),u.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),u.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(eq,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),u.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:u.jsx("code",{className:"text-primary",children:"data/webui.json"})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",u.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),u.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:u.jsxs("div",{className:"flex gap-2",children:[u.jsx(tI,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),u.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[u.jsx("p",{className:"font-semibold",children:"安全提示"}),u.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[u.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),u.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]})]})})]}),u.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:u.jsx("p",{children:Qpe})})]})}function y6(){const e=Es();return u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:u.jsxs("div",{className:"w-full max-w-2xl text-center",children:[u.jsxs("div",{className:"relative mb-8",children:[u.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),u.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:u.jsx(cg,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),u.jsxs("div",{className:"space-y-4 mb-8",children:[u.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),u.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[u.jsxs(Se,{size:"lg",onClick:()=>e({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[u.jsx(tq,{className:"h-4 w-4"}),"返回首页"]}),u.jsxs(Se,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[u.jsx(hhe,{className:"h-4 w-4"}),"返回上一页"]})]}),u.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:u.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}const hr=_.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:we("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}));hr.displayName="Textarea";var b6=["PageUp","PageDown"],x6=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],w6={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Fc="Slider",[xj,Fve,Hve]=Sv(Fc),[S6]=Zr(Fc,[Hve]),[Vve,bg]=S6(Fc),_6=_.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:o=1,orientation:s="horizontal",disabled:c=!1,minStepsBetweenThumbs:f=0,defaultValue:h=[r],value:p,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:y=!1,form:S,...x}=e,w=_.useRef(new Set),A=_.useRef(0),E=s==="horizontal"?Gve:Kve,[N=[],T]=xi({prop:p,defaultProp:h,onChange:L=>{[...w.current][A.current]?.focus(),m(L)}}),C=_.useRef(N);function R(L){const B=Qve(N,L);z(L,B)}function M(L){z(L,A.current)}function k(){const L=C.current[A.current];N[A.current]!==L&&g(N)}function z(L,B,{commit:F}={commit:!1}){const U=nge(o),W=rge(Math.round((L-r)/o)*o+r,U),$=Tf(W,[r,a]);T((V=[])=>{const H=Xve(V,$,B);if(tge(H,f*o)){A.current=H.indexOf($);const ne=String(H)!==String(V);return ne&&F&&g(H),ne?H:V}else return V})}return u.jsx(Vve,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:A,thumbs:w.current,values:N,orientation:s,form:S,children:u.jsx(xj.Provider,{scope:e.__scopeSlider,children:u.jsx(xj.Slot,{scope:e.__scopeSlider,children:u.jsx(E,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:t,onPointerDown:Ee(x.onPointerDown,()=>{c||(C.current=N)}),min:r,max:a,inverted:y,onSlideStart:c?void 0:R,onSlideMove:c?void 0:M,onSlideEnd:c?void 0:k,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(a,N.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:B})=>{if(!c){const W=b6.includes(L.key)||L.shiftKey&&x6.includes(L.key)?10:1,$=A.current,V=N[$],H=o*W*B;z(V+H,$,{commit:!0})}}})})})})});_6.displayName=Fc;var[j6,A6]=S6(Fc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Gve=_.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:f,onStepKeyDown:h,...p}=e,[m,g]=_.useState(null),y=Ve(t,E=>g(E)),S=_.useRef(void 0),x=gd(a),w=x==="ltr",A=w&&!o||!w&&o;function O(E){const N=S.current||m.getBoundingClientRect(),T=[0,N.width],R=EO(T,A?[n,r]:[r,n]);return S.current=N,R(E-N.left)}return u.jsx(j6,{scope:e.__scopeSlider,startEdge:A?"left":"right",endEdge:A?"right":"left",direction:A?1:-1,size:"width",children:u.jsx(O6,{dir:x,"data-orientation":"horizontal",...p,ref:y,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:E=>{const N=O(E.clientX);s?.(N)},onSlideMove:E=>{const N=O(E.clientX);c?.(N)},onSlideEnd:()=>{S.current=void 0,f?.()},onStepKeyDown:E=>{const T=w6[A?"from-left":"from-right"].includes(E.key);h?.({event:E,direction:T?-1:1})}})})}),Kve=_.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:f,...h}=e,p=_.useRef(null),m=Ve(t,p),g=_.useRef(void 0),y=!a;function S(x){const w=g.current||p.current.getBoundingClientRect(),A=[0,w.height],E=EO(A,y?[r,n]:[n,r]);return g.current=w,E(x-w.top)}return u.jsx(j6,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:u.jsx(O6,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const w=S(x.clientY);o?.(w)},onSlideMove:x=>{const w=S(x.clientY);s?.(w)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:x=>{const A=w6[y?"from-bottom":"from-top"].includes(x.key);f?.({event:x,direction:A?-1:1})}})})}),O6=_.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:f,...h}=e,p=bg(Fc,n);return u.jsx(Me.span,{...h,ref:t,onKeyDown:Ee(e.onKeyDown,m=>{m.key==="Home"?(s(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):b6.concat(x6).includes(m.key)&&(f(m),m.preventDefault())}),onPointerDown:Ee(e.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(g)?g.focus():r(m)}),onPointerMove:Ee(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&a(m)}),onPointerUp:Ee(e.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),o(m))})})}),E6="SliderTrack",T6=_.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=bg(E6,n);return u.jsx(Me.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});T6.displayName=E6;var wj="SliderRange",N6=_.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=bg(wj,n),o=A6(wj,n),s=_.useRef(null),c=Ve(t,s),f=a.values.length,h=a.values.map(g=>P6(g,a.min,a.max)),p=f>1?Math.min(...h):0,m=100-Math.max(...h);return u.jsx(Me.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:m+"%"}})});N6.displayName=wj;var Sj="SliderThumb",C6=_.forwardRef((e,t)=>{const n=Fve(e.__scopeSlider),[r,a]=_.useState(null),o=Ve(t,c=>a(c)),s=_.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return u.jsx(Wve,{...e,ref:o,index:s})}),Wve=_.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...o}=e,s=bg(Sj,n),c=A6(Sj,n),[f,h]=_.useState(null),p=Ve(t,O=>h(O)),m=f?s.form||!!f.closest("form"):!0,g=mO(f),y=s.values[r],S=y===void 0?0:P6(y,s.min,s.max),x=Zve(r,s.values.length),w=g?.[c.size],A=w?Jve(w,S,c.direction):0;return _.useEffect(()=>{if(f)return s.thumbs.add(f),()=>{s.thumbs.delete(f)}},[f,s.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${S}% + ${A}px)`},children:[u.jsx(xj.ItemSlot,{scope:e.__scopeSlider,children:u.jsx(Me.span,{role:"slider","aria-label":e["aria-label"]||x,"aria-valuemin":s.min,"aria-valuenow":y,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...o,ref:p,style:y===void 0?{display:"none"}:e.style,onFocus:Ee(e.onFocus,()=>{s.valueIndexToChangeRef.current=r})})}),m&&u.jsx(R6,{name:a??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:y},r)]})});C6.displayName=Sj;var Yve="RadioBubbleInput",R6=_.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=_.useRef(null),o=Ve(a,r),s=pO(t);return _.useEffect(()=>{const c=a.current;if(!c)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&p){const m=new Event("input",{bubbles:!0});p.call(c,t),c.dispatchEvent(m)}},[s,t]),u.jsx(Me.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});R6.displayName=Yve;function Xve(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,o)=>a-o)}function P6(e,t,n){const o=100/(n-t)*(e-t);return Tf(o,[0,100])}function Zve(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Qve(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 Jve(e,t,n){const r=e/2,o=EO([0,50],[0,r]);return(r-o(t)*n)*n}function ege(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function tge(e,t){if(t>0){const n=ege(e);return Math.min(...n)>=t}return!0}function EO(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 nge(e){return(String(e).split(".")[1]||"").length}function rge(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var M6=_6,age=T6,ige=N6,oge=C6;const TO=_.forwardRef(({className:e,...t},n)=>u.jsxs(M6,{ref:n,className:we("relative flex w-full touch-none select-none items-center",e),...t,children:[u.jsx(age,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:u.jsx(ige,{className:"absolute h-full bg-primary"})}),u.jsx(oge,{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"})]}));TO.displayName=M6.displayName;const sge=["top","right","bottom","left"],vo=Math.min,vr=Math.max,ov=Math.round,Ep=Math.floor,Pa=e=>({x:e,y:e}),lge={left:"right",right:"left",bottom:"top",top:"bottom"},cge={start:"end",end:"start"};function _j(e,t,n){return vr(e,vo(t,n))}function ji(e,t){return typeof e=="function"?e(t):e}function Ai(e){return e.split("-")[0]}function Hc(e){return e.split("-")[1]}function NO(e){return e==="x"?"y":"x"}function CO(e){return e==="y"?"height":"width"}const uge=new Set(["top","bottom"]);function Ea(e){return uge.has(Ai(e))?"y":"x"}function RO(e){return NO(Ea(e))}function fge(e,t,n){n===void 0&&(n=!1);const r=Hc(e),a=RO(e),o=CO(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=sv(s)),[s,sv(s)]}function dge(e){const t=sv(e);return[jj(e),t,jj(t)]}function jj(e){return e.replace(/start|end/g,t=>cge[t])}const bI=["left","right"],xI=["right","left"],hge=["top","bottom"],pge=["bottom","top"];function mge(e,t,n){switch(e){case"top":case"bottom":return n?t?xI:bI:t?bI:xI;case"left":case"right":return t?hge:pge;default:return[]}}function vge(e,t,n,r){const a=Hc(e);let o=mge(Ai(e),n==="start",r);return a&&(o=o.map(s=>s+"-"+a),t&&(o=o.concat(o.map(jj)))),o}function sv(e){return e.replace(/left|right|bottom|top/g,t=>lge[t])}function gge(e){return{top:0,right:0,bottom:0,left:0,...e}}function k6(e){return typeof e!="number"?gge(e):{top:e,right:e,bottom:e,left:e}}function lv(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 wI(e,t,n){let{reference:r,floating:a}=e;const o=Ea(t),s=RO(t),c=CO(s),f=Ai(t),h=o==="y",p=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,g=r[c]/2-a[c]/2;let y;switch(f){case"top":y={x:p,y:r.y-a.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:m};break;case"left":y={x:r.x-a.width,y:m};break;default:y={x:r.x,y:r.y}}switch(Hc(t)){case"start":y[s]-=g*(n&&h?-1:1);break;case"end":y[s]+=g*(n&&h?-1:1);break}return y}const yge=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:s}=n,c=o.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let h=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:m}=wI(h,r,f),g=r,y={},S=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:s,elements:c,middlewareData:f}=t,{element:h,padding:p=0}=ji(e,t)||{};if(h==null)return{};const m=k6(p),g={x:n,y:r},y=RO(a),S=CO(y),x=await s.getDimensions(h),w=y==="y",A=w?"top":"left",O=w?"bottom":"right",E=w?"clientHeight":"clientWidth",N=o.reference[S]+o.reference[y]-g[y]-o.floating[S],T=g[y]-o.reference[y],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h));let R=C?C[E]:0;(!R||!await(s.isElement==null?void 0:s.isElement(C)))&&(R=c.floating[E]||o.floating[S]);const M=N/2-T/2,k=R/2-x[S]/2-1,z=vo(m[A],k),L=vo(m[O],k),B=z,F=R-x[S]-L,U=R/2-x[S]/2+M,W=_j(B,U,F),$=!f.arrow&&Hc(a)!=null&&U!==W&&o.reference[S]/2-(UU<=0)){var L,B;const U=(((L=o.flip)==null?void 0:L.index)||0)+1,W=R[U];if(W&&(!(m==="alignment"?O!==Ea(W):!1)||z.every(H=>Ea(H.placement)===O?H.overflows[0]>0:!0)))return{data:{index:U,overflows:z},reset:{placement:W}};let $=(B=z.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:B.placement;if(!$)switch(y){case"bestFit":{var F;const V=(F=z.filter(H=>{if(C){const ne=Ea(H.placement);return ne===O||ne==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ne=>ne>0).reduce((ne,ee)=>ne+ee,0)]).sort((H,ne)=>H[1]-ne[1])[0])==null?void 0:F[0];V&&($=V);break}case"initialPlacement":$=c;break}if(a!==$)return{reset:{placement:$}}}return{}}}};function SI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _I(e){return sge.some(t=>e[t]>=0)}const wge=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=ji(e,t);switch(r){case"referenceHidden":{const o=await ud(t,{...a,elementContext:"reference"}),s=SI(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_I(s)}}}case"escaped":{const o=await ud(t,{...a,altBoundary:!0}),s=SI(o,n.floating);return{data:{escapedOffsets:s,escaped:_I(s)}}}default:return{}}}}},D6=new Set(["left","top"]);async function Sge(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),s=Ai(n),c=Hc(n),f=Ea(n)==="y",h=D6.has(s)?-1:1,p=o&&f?-1:1,m=ji(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof S=="number"&&(y=c==="end"?S*-1:S),f?{x:y*p,y:g*h}:{x:g*h,y:y*p}}const _ge=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:s,middlewareData:c}=t,f=await Sge(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:s}}}}},jge=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:s=!1,limiter:c={fn:w=>{let{x:A,y:O}=w;return{x:A,y:O}}},...f}=ji(e,t),h={x:n,y:r},p=await ud(t,f),m=Ea(Ai(a)),g=NO(m);let y=h[g],S=h[m];if(o){const w=g==="y"?"top":"left",A=g==="y"?"bottom":"right",O=y+p[w],E=y-p[A];y=_j(O,y,E)}if(s){const w=m==="y"?"top":"left",A=m==="y"?"bottom":"right",O=S+p[w],E=S-p[A];S=_j(O,S,E)}const x=c.fn({...t,[g]:y,[m]:S});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[m]:s}}}}}},Age=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:s}=t,{offset:c=0,mainAxis:f=!0,crossAxis:h=!0}=ji(e,t),p={x:n,y:r},m=Ea(a),g=NO(m);let y=p[g],S=p[m];const x=ji(c,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const E=g==="y"?"height":"width",N=o.reference[g]-o.floating[E]+w.mainAxis,T=o.reference[g]+o.reference[E]-w.mainAxis;yT&&(y=T)}if(h){var A,O;const E=g==="y"?"width":"height",N=D6.has(Ai(a)),T=o.reference[m]-o.floating[E]+(N&&((A=s.offset)==null?void 0:A[m])||0)+(N?0:w.crossAxis),C=o.reference[m]+o.reference[E]+(N?0:((O=s.offset)==null?void 0:O[m])||0)-(N?w.crossAxis:0);SC&&(S=C)}return{[g]:y,[m]:S}}}},Oge=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:s,elements:c}=t,{apply:f=()=>{},...h}=ji(e,t),p=await ud(t,h),m=Ai(a),g=Hc(a),y=Ea(a)==="y",{width:S,height:x}=o.floating;let w,A;m==="top"||m==="bottom"?(w=m,A=g===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(A=m,w=g==="end"?"top":"bottom");const O=x-p.top-p.bottom,E=S-p.left-p.right,N=vo(x-p[w],O),T=vo(S-p[A],E),C=!t.middlewareData.shift;let R=N,M=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=O),C&&!g){const z=vr(p.left,0),L=vr(p.right,0),B=vr(p.top,0),F=vr(p.bottom,0);y?M=S-2*(z!==0||L!==0?z+L:vr(p.left,p.right)):R=x-2*(B!==0||F!==0?B+F:vr(p.top,p.bottom))}await f({...t,availableWidth:M,availableHeight:R});const k=await s.getDimensions(c.floating);return S!==k.width||x!==k.height?{reset:{rects:!0}}:{}}}};function xg(){return typeof window<"u"}function Vc(e){return L6(e)?(e.nodeName||"").toLowerCase():"#document"}function Nr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function za(e){var t;return(t=(L6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function L6(e){return xg()?e instanceof Node||e instanceof Nr(e).Node:!1}function da(e){return xg()?e instanceof Element||e instanceof Nr(e).Element:!1}function La(e){return xg()?e instanceof HTMLElement||e instanceof Nr(e).HTMLElement:!1}function jI(e){return!xg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nr(e).ShadowRoot}const Ege=new Set(["inline","contents"]);function Md(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ege.has(a)}const Tge=new Set(["table","td","th"]);function Nge(e){return Tge.has(Vc(e))}const Cge=[":popover-open",":modal"];function wg(e){return Cge.some(t=>{try{return e.matches(t)}catch{return!1}})}const Rge=["transform","translate","scale","rotate","perspective"],Pge=["transform","translate","scale","rotate","perspective","filter"],Mge=["paint","layout","strict","content"];function PO(e){const t=MO(),n=da(e)?ha(e):e;return Rge.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)||Pge.some(r=>(n.willChange||"").includes(r))||Mge.some(r=>(n.contain||"").includes(r))}function kge(e){let t=go(e);for(;La(t)&&!Sc(t);){if(PO(t))return t;if(wg(t))return null;t=go(t)}return null}function MO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dge=new Set(["html","body","#document"]);function Sc(e){return Dge.has(Vc(e))}function ha(e){return Nr(e).getComputedStyle(e)}function Sg(e){return da(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function go(e){if(Vc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jI(e)&&e.host||za(e);return jI(t)?t.host:t}function $6(e){const t=go(e);return Sc(t)?e.ownerDocument?e.ownerDocument.body:e.body:La(t)&&Md(t)?t:$6(t)}function fd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=$6(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),s=Nr(a);if(o){const c=Aj(s);return t.concat(s,s.visualViewport||[],Md(a)?a:[],c&&n?fd(c):[])}return t.concat(a,fd(a,[],n))}function Aj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I6(e){const t=ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=La(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:r,c=ov(n)!==o||ov(r)!==s;return c&&(n=o,r=s),{width:n,height:r,$:c}}function kO(e){return da(e)?e:e.contextElement}function Fl(e){const t=kO(e);if(!La(t))return Pa(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=I6(t);let s=(o?ov(n.width):n.width)/r,c=(o?ov(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Lge=Pa(0);function B6(e){const t=Nr(e);return!MO()||!t.visualViewport?Lge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $ge(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nr(e)?!1:t}function Ss(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=kO(e);let s=Pa(1);t&&(r?da(r)&&(s=Fl(r)):s=Fl(e));const c=$ge(o,n,r)?B6(o):Pa(0);let f=(a.left+c.x)/s.x,h=(a.top+c.y)/s.y,p=a.width/s.x,m=a.height/s.y;if(o){const g=Nr(o),y=r&&da(r)?Nr(r):r;let S=g,x=Aj(S);for(;x&&r&&y!==S;){const w=Fl(x),A=x.getBoundingClientRect(),O=ha(x),E=A.left+(x.clientLeft+parseFloat(O.paddingLeft))*w.x,N=A.top+(x.clientTop+parseFloat(O.paddingTop))*w.y;f*=w.x,h*=w.y,p*=w.x,m*=w.y,f+=E,h+=N,S=Nr(x),x=Aj(S)}}return lv({width:p,height:m,x:f,y:h})}function _g(e,t){const n=Sg(e).scrollLeft;return t?t.left+n:Ss(za(e)).left+n}function z6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-_g(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function Ige(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",s=za(r),c=t?wg(t.floating):!1;if(r===s||c&&o)return n;let f={scrollLeft:0,scrollTop:0},h=Pa(1);const p=Pa(0),m=La(r);if((m||!m&&!o)&&((Vc(r)!=="body"||Md(s))&&(f=Sg(r)),La(r))){const y=Ss(r);h=Fl(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const g=s&&!m&&!o?z6(s,f):Pa(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+p.x+g.x,y:n.y*h.y-f.scrollTop*h.y+p.y+g.y}}function Bge(e){return Array.from(e.getClientRects())}function zge(e){const t=za(e),n=Sg(e),r=e.ownerDocument.body,a=vr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=vr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+_g(e);const c=-n.scrollTop;return ha(r).direction==="rtl"&&(s+=vr(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:s,y:c}}const AI=25;function qge(e,t){const n=Nr(e),r=za(e),a=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,c=0,f=0;if(a){o=a.width,s=a.height;const p=MO();(!p||p&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const h=_g(r);if(h<=0){const p=r.ownerDocument,m=p.body,g=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,S=Math.abs(r.clientWidth-m.clientWidth-y);S<=AI&&(o-=S)}else h<=AI&&(o+=h);return{width:o,height:s,x:c,y:f}}const Uge=new Set(["absolute","fixed"]);function Fge(e,t){const n=Ss(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=La(e)?Fl(e):Pa(1),s=e.clientWidth*o.x,c=e.clientHeight*o.y,f=a*o.x,h=r*o.y;return{width:s,height:c,x:f,y:h}}function OI(e,t,n){let r;if(t==="viewport")r=qge(e,n);else if(t==="document")r=zge(za(e));else if(da(t))r=Fge(t,n);else{const a=B6(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return lv(r)}function q6(e,t){const n=go(e);return n===t||!da(n)||Sc(n)?!1:ha(n).position==="fixed"||q6(n,t)}function Hge(e,t){const n=t.get(e);if(n)return n;let r=fd(e,[],!1).filter(c=>da(c)&&Vc(c)!=="body"),a=null;const o=ha(e).position==="fixed";let s=o?go(e):e;for(;da(s)&&!Sc(s);){const c=ha(s),f=PO(s);!f&&c.position==="fixed"&&(a=null),(o?!f&&!a:!f&&c.position==="static"&&!!a&&Uge.has(a.position)||Md(s)&&!f&&q6(e,s))?r=r.filter(p=>p!==s):a=c,s=go(s)}return t.set(e,r),r}function Vge(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?wg(t)?[]:Hge(t,this._c):[].concat(n),r],c=s[0],f=s.reduce((h,p)=>{const m=OI(t,p,a);return h.top=vr(m.top,h.top),h.right=vo(m.right,h.right),h.bottom=vo(m.bottom,h.bottom),h.left=vr(m.left,h.left),h},OI(t,c,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Gge(e){const{width:t,height:n}=I6(e);return{width:t,height:n}}function Kge(e,t,n){const r=La(t),a=za(t),o=n==="fixed",s=Ss(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const f=Pa(0);function h(){f.x=_g(a)}if(r||!r&&!o)if((Vc(t)!=="body"||Md(a))&&(c=Sg(t)),r){const y=Ss(t,!0,o,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else a&&h();o&&!r&&a&&h();const p=a&&!r&&!o?z6(a,c):Pa(0),m=s.left+c.scrollLeft-f.x-p.x,g=s.top+c.scrollTop-f.y-p.y;return{x:m,y:g,width:s.width,height:s.height}}function E1(e){return ha(e).position==="static"}function EI(e,t){if(!La(e)||ha(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return za(e)===n&&(n=n.ownerDocument.body),n}function U6(e,t){const n=Nr(e);if(wg(e))return n;if(!La(e)){let a=go(e);for(;a&&!Sc(a);){if(da(a)&&!E1(a))return a;a=go(a)}return n}let r=EI(e,t);for(;r&&Nge(r)&&E1(r);)r=EI(r,t);return r&&Sc(r)&&E1(r)&&!PO(r)?n:r||kge(e)||n}const Wge=async function(e){const t=this.getOffsetParent||U6,n=this.getDimensions,r=await n(e.floating);return{reference:Kge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yge(e){return ha(e).direction==="rtl"}const Xge={convertOffsetParentRelativeRectToViewportRelativeRect:Ige,getDocumentElement:za,getClippingRect:Vge,getOffsetParent:U6,getElementRects:Wge,getClientRects:Bge,getDimensions:Gge,getScale:Fl,isElement:da,isRTL:Yge};function F6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zge(e,t){let n=null,r;const a=za(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const h=e.getBoundingClientRect(),{left:p,top:m,width:g,height:y}=h;if(c||t(),!g||!y)return;const S=Ep(m),x=Ep(a.clientWidth-(p+g)),w=Ep(a.clientHeight-(m+y)),A=Ep(p),E={rootMargin:-S+"px "+-x+"px "+-w+"px "+-A+"px",threshold:vr(0,vo(1,f))||1};let N=!0;function T(C){const R=C[0].intersectionRatio;if(R!==f){if(!N)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!F6(h,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(T,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(T,E)}n.observe(e)}return s(!0),o}function Qge(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=kO(e),p=a||o?[...h?fd(h):[],...fd(t)]:[];p.forEach(A=>{a&&A.addEventListener("scroll",n,{passive:!0}),o&&A.addEventListener("resize",n)});const m=h&&c?Zge(h,n):null;let g=-1,y=null;s&&(y=new ResizeObserver(A=>{let[O]=A;O&&O.target===h&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=y)==null||E.observe(t)})),n()}),h&&!f&&y.observe(h),y.observe(t));let S,x=f?Ss(e):null;f&&w();function w(){const A=Ss(e);x&&!F6(x,A)&&n(),x=A,S=requestAnimationFrame(w)}return n(),()=>{var A;p.forEach(O=>{a&&O.removeEventListener("scroll",n),o&&O.removeEventListener("resize",n)}),m?.(),(A=y)==null||A.disconnect(),y=null,f&&cancelAnimationFrame(S)}}const Jge=_ge,eye=jge,tye=xge,nye=Oge,rye=wge,TI=bge,aye=Age,iye=(e,t,n)=>{const r=new Map,a={platform:Xge,...n},o={...a.platform,_c:r};return yge(e,t,{...a,platform:o})};var oye=typeof document<"u",sye=function(){},Up=oye?_.useLayoutEffect:sye;function cv(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(!cv(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)&&!cv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function H6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function NI(e,t){const n=H6(e);return Math.round(t*n)/n}function T1(e){const t=_.useRef(e);return Up(()=>{t.current=e}),t}function lye(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:f,open:h}=e,[p,m]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=_.useState(r);cv(g,r)||y(r);const[S,x]=_.useState(null),[w,A]=_.useState(null),O=_.useCallback(H=>{H!==C.current&&(C.current=H,x(H))},[]),E=_.useCallback(H=>{H!==R.current&&(R.current=H,A(H))},[]),N=o||S,T=s||w,C=_.useRef(null),R=_.useRef(null),M=_.useRef(p),k=f!=null,z=T1(f),L=T1(a),B=T1(h),F=_.useCallback(()=>{if(!C.current||!R.current)return;const H={placement:t,strategy:n,middleware:g};L.current&&(H.platform=L.current),iye(C.current,R.current,H).then(ne=>{const ee={...ne,isPositioned:B.current!==!1};U.current&&!cv(M.current,ee)&&(M.current=ee,Ts.flushSync(()=>{m(ee)}))})},[g,t,n,L,B]);Up(()=>{h===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,m(H=>({...H,isPositioned:!1})))},[h]);const U=_.useRef(!1);Up(()=>(U.current=!0,()=>{U.current=!1}),[]),Up(()=>{if(N&&(C.current=N),T&&(R.current=T),N&&T){if(z.current)return z.current(N,T,F);F()}},[N,T,F,z,k]);const W=_.useMemo(()=>({reference:C,floating:R,setReference:O,setFloating:E}),[O,E]),$=_.useMemo(()=>({reference:N,floating:T}),[N,T]),V=_.useMemo(()=>{const H={position:n,left:0,top:0};if(!$.floating)return H;const ne=NI($.floating,p.x),ee=NI($.floating,p.y);return c?{...H,transform:"translate("+ne+"px, "+ee+"px)",...H6($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:ee}},[n,c,$.floating,p.x,p.y]);return _.useMemo(()=>({...p,update:F,refs:W,elements:$,floatingStyles:V}),[p,F,W,$,V])}const cye=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?TI({element:r.current,padding:a}).fn(n):{}:r?TI({element:r,padding:a}).fn(n):{}}}},uye=(e,t)=>({...Jge(e),options:[e,t]}),fye=(e,t)=>({...eye(e),options:[e,t]}),dye=(e,t)=>({...aye(e),options:[e,t]}),hye=(e,t)=>({...tye(e),options:[e,t]}),pye=(e,t)=>({...nye(e),options:[e,t]}),mye=(e,t)=>({...rye(e),options:[e,t]}),vye=(e,t)=>({...cye(e),options:[e,t]});var gye="Arrow",V6=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return u.jsx(Me.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});V6.displayName=gye;var yye=V6,DO="Popper",[G6,jg]=Zr(DO),[bye,K6]=G6(DO),W6=e=>{const{__scopePopper:t,children:n}=e,[r,a]=_.useState(null);return u.jsx(bye,{scope:t,anchor:r,onAnchorChange:a,children:n})};W6.displayName=DO;var Y6="PopperAnchor",X6=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=K6(Y6,n),s=_.useRef(null),c=Ve(t,s),f=_.useRef(null);return _.useEffect(()=>{const h=f.current;f.current=r?.current||s.current,h!==f.current&&o.onAnchorChange(f.current)}),r?null:u.jsx(Me.div,{...a,ref:c})});X6.displayName=Y6;var LO="PopperContent",[xye,wye]=G6(LO),Z6=_.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:S,...x}=e,w=K6(LO,n),[A,O]=_.useState(null),E=Ve(t,G=>O(G)),[N,T]=_.useState(null),C=mO(N),R=C?.width??0,M=C?.height??0,k=r+(o!=="center"?"-"+o:""),z=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},L=Array.isArray(h)?h:[h],B=L.length>0,F={padding:z,boundary:L.filter(_ye),altBoundary:B},{refs:U,floatingStyles:W,placement:$,isPositioned:V,middlewareData:H}=lye({strategy:"fixed",placement:k,whileElementsMounted:(...G)=>Qge(...G,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[uye({mainAxis:a+M,alignmentAxis:s}),f&&fye({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?dye():void 0,...F}),f&&hye({...F}),pye({...F,apply:({elements:G,rects:ge,availableWidth:re,availableHeight:pe})=>{const{width:ye,height:le}=ge.reference,Le=G.floating.style;Le.setProperty("--radix-popper-available-width",`${re}px`),Le.setProperty("--radix-popper-available-height",`${pe}px`),Le.setProperty("--radix-popper-anchor-width",`${ye}px`),Le.setProperty("--radix-popper-anchor-height",`${le}px`)}}),N&&vye({element:N,padding:c}),jye({arrowWidth:R,arrowHeight:M}),g&&mye({strategy:"referenceHidden",...F})]}),[ne,ee]=eU($),I=Wt(S);nn(()=>{V&&I?.()},[V,I]);const q=H.arrow?.x,X=H.arrow?.y,te=H.arrow?.centerOffset!==0,[se,Q]=_.useState();return nn(()=>{A&&Q(window.getComputedStyle(A).zIndex)},[A]),u.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:V?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(xye,{scope:n,placedSide:ne,onArrowChange:T,arrowX:q,arrowY:X,shouldHideArrow:te,children:u.jsx(Me.div,{"data-side":ne,"data-align":ee,...x,ref:E,style:{...x.style,animation:V?void 0:"none"}})})})});Z6.displayName=LO;var Q6="PopperArrow",Sye={top:"bottom",right:"left",bottom:"top",left:"right"},J6=_.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=wye(Q6,r),s=Sye[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]: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:u.jsx(yye,{...a,ref:n,style:{...a.style,display:"block"}})})});J6.displayName=Q6;function _ye(e){return e!==null}var jye=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,s=a.arrow?.centerOffset!==0,c=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[h,p]=eU(n),m={start:"0%",center:"50%",end:"100%"}[p],g=(a.arrow?.x??0)+c/2,y=(a.arrow?.y??0)+f/2;let S="",x="";return h==="bottom"?(S=s?m:`${g}px`,x=`${-f}px`):h==="top"?(S=s?m:`${g}px`,x=`${r.floating.height+f}px`):h==="right"?(S=`${-f}px`,x=s?m:`${y}px`):h==="left"&&(S=`${r.floating.width+f}px`,x=s?m:`${y}px`),{data:{x:S,y:x}}}});function eU(e){const[t,n="center"]=e.split("-");return[t,n]}var tU=W6,$O=X6,nU=Z6,rU=J6;function Aye(e){const t=Oye(e),n=_.forwardRef((r,a)=>{const{children:o,...s}=r,c=_.Children.toArray(o),f=c.find(Tye);if(f){const h=f.props.children,p=c.map(m=>m===f?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:m);return u.jsx(t,{...s,ref:a,children:_.isValidElement(h)?_.cloneElement(h,void 0,p):null})}return u.jsx(t,{...s,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Oye(e){const t=_.forwardRef((n,r)=>{const{children:a,...o}=n;if(_.isValidElement(a)){const s=Cye(a),c=Nye(o,a.props);return a.type!==_.Fragment&&(c.ref=r?Yr(r,s):s),_.cloneElement(a,c)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Eye=Symbol("radix.slottable");function Tye(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Eye}function Nye(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]=(...c)=>{const f=o(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Cye(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 aU=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"}),Rye="VisuallyHidden",IO=_.forwardRef((e,t)=>u.jsx(Me.span,{...e,ref:t,style:{...aU,...e.style}}));IO.displayName=Rye;var Pye=[" ","Enter","ArrowUp","ArrowDown"],Mye=[" ","Enter"],_s="Select",[Ag,Og,kye]=Sv(_s),[Gc]=Zr(_s,[kye,jg]),Eg=jg(),[Dye,_o]=Gc(_s),[Lye,$ye]=Gc(_s),iU=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:f,dir:h,name:p,autoComplete:m,disabled:g,required:y,form:S}=e,x=Eg(t),[w,A]=_.useState(null),[O,E]=_.useState(null),[N,T]=_.useState(!1),C=gd(h),[R,M]=xi({prop:r,defaultProp:a??!1,onChange:o,caller:_s}),[k,z]=xi({prop:s,defaultProp:c,onChange:f,caller:_s}),L=_.useRef(null),B=w?S||!!w.closest("form"):!0,[F,U]=_.useState(new Set),W=Array.from(F).map($=>$.props.value).join(";");return u.jsx(tU,{...x,children:u.jsxs(Dye,{required:y,scope:t,trigger:w,onTriggerChange:A,valueNode:O,onValueNodeChange:E,valueNodeHasChildren:N,onValueNodeHasChildrenChange:T,contentId:kn(),value:k,onValueChange:z,open:R,onOpenChange:M,dir:C,triggerPointerDownPosRef:L,disabled:g,children:[u.jsx(Ag.Provider,{scope:t,children:u.jsx(Lye,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback($=>{U(V=>new Set(V).add($))},[]),onNativeOptionRemove:_.useCallback($=>{U(V=>{const H=new Set(V);return H.delete($),H})},[]),children:n})}),B?u.jsxs(NU,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:m,value:k,onChange:$=>z($.target.value),disabled:g,form:S,children:[k===void 0?u.jsx("option",{value:""}):null,Array.from(F)]},W):null]})})};iU.displayName=_s;var oU="SelectTrigger",sU=_.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=Eg(n),s=_o(oU,n),c=s.disabled||r,f=Ve(t,s.onTriggerChange),h=Og(n),p=_.useRef("touch"),[m,g,y]=RU(x=>{const w=h().filter(E=>!E.disabled),A=w.find(E=>E.value===s.value),O=PU(w,x,A);O!==void 0&&s.onValueChange(O.value)}),S=x=>{c||(s.onOpenChange(!0),y()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return u.jsx($O,{asChild:!0,...o,children:u.jsx(Me.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":CU(s.value)?"":void 0,...a,ref:f,onClick:Ee(a.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&S(x)}),onPointerDown:Ee(a.onPointerDown,x=>{p.current=x.pointerType;const w=x.target;w.hasPointerCapture(x.pointerId)&&w.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(S(x),x.preventDefault())}),onKeyDown:Ee(a.onKeyDown,x=>{const w=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&g(x.key),!(w&&x.key===" ")&&Pye.includes(x.key)&&(S(),x.preventDefault())})})})});sU.displayName=oU;var lU="SelectValue",cU=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:s="",...c}=e,f=_o(lU,n),{onValueNodeHasChildrenChange:h}=f,p=o!==void 0,m=Ve(t,f.onValueNodeChange);return nn(()=>{h(p)},[h,p]),u.jsx(Me.span,{...c,ref:m,style:{pointerEvents:"none"},children:CU(f.value)?u.jsx(u.Fragment,{children:s}):o})});cU.displayName=lU;var Iye="SelectIcon",uU=_.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return u.jsx(Me.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});uU.displayName=Iye;var Bye="SelectPortal",fU=e=>u.jsx(Rd,{asChild:!0,...e});fU.displayName=Bye;var js="SelectContent",dU=_.forwardRef((e,t)=>{const n=_o(js,e.__scopeSelect),[r,a]=_.useState();if(nn(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?Ts.createPortal(u.jsx(hU,{scope:e.__scopeSelect,children:u.jsx(Ag.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(pU,{...e,ref:t})});dU.displayName=js;var oa=10,[hU,jo]=Gc(js),zye="SelectContentImpl",qye=Aye("SelectContent.RemoveScroll"),pU=_.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:f,align:h,alignOffset:p,arrowPadding:m,collisionBoundary:g,collisionPadding:y,sticky:S,hideWhenDetached:x,avoidCollisions:w,...A}=e,O=_o(js,n),[E,N]=_.useState(null),[T,C]=_.useState(null),R=Ve(t,G=>N(G)),[M,k]=_.useState(null),[z,L]=_.useState(null),B=Og(n),[F,U]=_.useState(!1),W=_.useRef(!1);_.useEffect(()=>{if(E)return yO(E)},[E]),gO();const $=_.useCallback(G=>{const[ge,...re]=B().map(le=>le.ref.current),[pe]=re.slice(-1),ye=document.activeElement;for(const le of G)if(le===ye||(le?.scrollIntoView({block:"nearest"}),le===ge&&T&&(T.scrollTop=0),le===pe&&T&&(T.scrollTop=T.scrollHeight),le?.focus(),document.activeElement!==ye))return},[B,T]),V=_.useCallback(()=>$([M,E]),[$,M,E]);_.useEffect(()=>{F&&V()},[F,V]);const{onOpenChange:H,triggerPointerDownPosRef:ne}=O;_.useEffect(()=>{if(E){let G={x:0,y:0};const ge=pe=>{G={x:Math.abs(Math.round(pe.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(pe.pageY)-(ne.current?.y??0))}},re=pe=>{G.x<=10&&G.y<=10?pe.preventDefault():E.contains(pe.target)||H(!1),document.removeEventListener("pointermove",ge),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",re,{capture:!0})}}},[E,H,ne]),_.useEffect(()=>{const G=()=>H(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[H]);const[ee,I]=RU(G=>{const ge=B().filter(ye=>!ye.disabled),re=ge.find(ye=>ye.ref.current===document.activeElement),pe=PU(ge,G,re);pe&&setTimeout(()=>pe.ref.current.focus())}),q=_.useCallback((G,ge,re)=>{const pe=!W.current&&!re;(O.value!==void 0&&O.value===ge||pe)&&(k(G),pe&&(W.current=!0))},[O.value]),X=_.useCallback(()=>E?.focus(),[E]),te=_.useCallback((G,ge,re)=>{const pe=!W.current&&!re;(O.value!==void 0&&O.value===ge||pe)&&L(G)},[O.value]),se=r==="popper"?Oj:mU,Q=se===Oj?{side:c,sideOffset:f,align:h,alignOffset:p,arrowPadding:m,collisionBoundary:g,collisionPadding:y,sticky:S,hideWhenDetached:x,avoidCollisions:w}:{};return u.jsx(hU,{scope:n,content:E,viewport:T,onViewportChange:C,itemRefCallback:q,selectedItem:M,onItemLeave:X,itemTextRefCallback:te,focusSelectedItem:V,selectedItemText:z,position:r,isPositioned:F,searchRef:ee,children:u.jsx(pg,{as:qye,allowPinchZoom:!0,children:u.jsx(dg,{asChild:!0,trapped:O.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:Ee(a,G=>{O.trigger?.focus({preventScroll:!0}),G.preventDefault()}),children:u.jsx(Cd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:u.jsx(se,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:G=>G.preventDefault(),...A,...Q,onPlaced:()=>U(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:Ee(A.onKeyDown,G=>{const ge=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ge&&G.key.length===1&&I(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let pe=B().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(G.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ye=G.target,le=pe.indexOf(ye);pe=pe.slice(le+1)}setTimeout(()=>$(pe)),G.preventDefault()}})})})})})})});pU.displayName=zye;var Uye="SelectItemAlignedPosition",mU=_.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=_o(js,n),s=jo(js,n),[c,f]=_.useState(null),[h,p]=_.useState(null),m=Ve(t,R=>p(R)),g=Og(n),y=_.useRef(!1),S=_.useRef(!0),{viewport:x,selectedItem:w,selectedItemText:A,focusSelectedItem:O}=s,E=_.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&h&&x&&w&&A){const R=o.trigger.getBoundingClientRect(),M=h.getBoundingClientRect(),k=o.valueNode.getBoundingClientRect(),z=A.getBoundingClientRect();if(o.dir!=="rtl"){const ye=z.left-M.left,le=k.left-ye,Le=R.left-le,be=R.width+Le,et=Math.max(be,M.width),Te=window.innerWidth-oa,st=Tf(le,[oa,Math.max(oa,Te-et)]);c.style.minWidth=be+"px",c.style.left=st+"px"}else{const ye=M.right-z.right,le=window.innerWidth-k.right-ye,Le=window.innerWidth-R.right-le,be=R.width+Le,et=Math.max(be,M.width),Te=window.innerWidth-oa,st=Tf(le,[oa,Math.max(oa,Te-et)]);c.style.minWidth=be+"px",c.style.right=st+"px"}const L=g(),B=window.innerHeight-oa*2,F=x.scrollHeight,U=window.getComputedStyle(h),W=parseInt(U.borderTopWidth,10),$=parseInt(U.paddingTop,10),V=parseInt(U.borderBottomWidth,10),H=parseInt(U.paddingBottom,10),ne=W+$+F+H+V,ee=Math.min(w.offsetHeight*5,ne),I=window.getComputedStyle(x),q=parseInt(I.paddingTop,10),X=parseInt(I.paddingBottom,10),te=R.top+R.height/2-oa,se=B-te,Q=w.offsetHeight/2,G=w.offsetTop+Q,ge=W+$+G,re=ne-ge;if(ge<=te){const ye=L.length>0&&w===L[L.length-1].ref.current;c.style.bottom="0px";const le=h.clientHeight-x.offsetTop-x.offsetHeight,Le=Math.max(se,Q+(ye?X:0)+le+V),be=ge+Le;c.style.height=be+"px"}else{const ye=L.length>0&&w===L[0].ref.current;c.style.top="0px";const Le=Math.max(te,W+x.offsetTop+(ye?q:0)+Q)+re;c.style.height=Le+"px",x.scrollTop=ge-te+x.offsetTop}c.style.margin=`${oa}px 0`,c.style.minHeight=ee+"px",c.style.maxHeight=B+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[g,o.trigger,o.valueNode,c,h,x,w,A,o.dir,r]);nn(()=>E(),[E]);const[N,T]=_.useState();nn(()=>{h&&T(window.getComputedStyle(h).zIndex)},[h]);const C=_.useCallback(R=>{R&&S.current===!0&&(E(),O?.(),S.current=!1)},[E,O]);return u.jsx(Hye,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:C,children:u.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:u.jsx(Me.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});mU.displayName=Uye;var Fye="SelectPopperPosition",Oj=_.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=oa,...o}=e,s=Eg(n);return u.jsx(nU,{...s,...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)"}})});Oj.displayName=Fye;var[Hye,BO]=Gc(js,{}),Ej="SelectViewport",vU=_.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=jo(Ej,n),s=BO(Ej,n),c=Ve(t,o.onViewportChange),f=_.useRef(0);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(Ag.Slot,{scope:n,children:u.jsx(Me.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ee(a.onScroll,h=>{const p=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=s;if(g?.current&&m){const y=Math.abs(f.current-p.scrollTop);if(y>0){const S=window.innerHeight-oa*2,x=parseFloat(m.style.minHeight),w=parseFloat(m.style.height),A=Math.max(x,w);if(A0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});vU.displayName=Ej;var gU="SelectGroup",[Vye,Gye]=Gc(gU),Kye=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=kn();return u.jsx(Vye,{scope:n,id:a,children:u.jsx(Me.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Kye.displayName=gU;var yU="SelectLabel",bU=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Gye(yU,n);return u.jsx(Me.div,{id:a.id,...r,ref:t})});bU.displayName=yU;var uv="SelectItem",[Wye,xU]=Gc(uv),wU=_.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,c=_o(uv,n),f=jo(uv,n),h=c.value===r,[p,m]=_.useState(o??""),[g,y]=_.useState(!1),S=Ve(t,O=>f.itemRefCallback?.(O,r,a)),x=kn(),w=_.useRef("touch"),A=()=>{a||(c.onValueChange(r),c.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 u.jsx(Wye,{scope:n,value:r,disabled:a,textId:x,isSelected:h,onItemTextChange:_.useCallback(O=>{m(E=>E||(O?.textContent??"").trim())},[]),children:u.jsx(Ag.ItemSlot,{scope:n,value:r,disabled:a,textValue:p,children:u.jsx(Me.div,{role:"option","aria-labelledby":x,"data-highlighted":g?"":void 0,"aria-selected":h&&g,"data-state":h?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:S,onFocus:Ee(s.onFocus,()=>y(!0)),onBlur:Ee(s.onBlur,()=>y(!1)),onClick:Ee(s.onClick,()=>{w.current!=="mouse"&&A()}),onPointerUp:Ee(s.onPointerUp,()=>{w.current==="mouse"&&A()}),onPointerDown:Ee(s.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Ee(s.onPointerMove,O=>{w.current=O.pointerType,a?f.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(s.onPointerLeave,O=>{O.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Ee(s.onKeyDown,O=>{f.searchRef?.current!==""&&O.key===" "||(Mye.includes(O.key)&&A(),O.key===" "&&O.preventDefault())})})})})});wU.displayName=uv;var hf="SelectItemText",SU=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,s=_o(hf,n),c=jo(hf,n),f=xU(hf,n),h=$ye(hf,n),[p,m]=_.useState(null),g=Ve(t,A=>m(A),f.onItemTextChange,A=>c.itemTextRefCallback?.(A,f.value,f.disabled)),y=p?.textContent,S=_.useMemo(()=>u.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=h;return nn(()=>(x(S),()=>w(S)),[x,w,S]),u.jsxs(u.Fragment,{children:[u.jsx(Me.span,{id:f.textId,...o,ref:g}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ts.createPortal(o.children,s.valueNode):null]})});SU.displayName=hf;var _U="SelectItemIndicator",jU=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return xU(_U,n).isSelected?u.jsx(Me.span,{"aria-hidden":!0,...r,ref:t}):null});jU.displayName=_U;var Tj="SelectScrollUpButton",AU=_.forwardRef((e,t)=>{const n=jo(Tj,e.__scopeSelect),r=BO(Tj,e.__scopeSelect),[a,o]=_.useState(!1),s=Ve(t,r.onScrollButtonChange);return nn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const h=f.scrollTop>0;o(h)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?u.jsx(EU,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});AU.displayName=Tj;var Nj="SelectScrollDownButton",OU=_.forwardRef((e,t)=>{const n=jo(Nj,e.__scopeSelect),r=BO(Nj,e.__scopeSelect),[a,o]=_.useState(!1),s=Ve(t,r.onScrollButtonChange);return nn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const h=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?u.jsx(EU,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});OU.displayName=Nj;var EU=_.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=jo("SelectScrollButton",n),s=_.useRef(null),c=Og(n),f=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>f(),[f]),nn(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),u.jsx(Me.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ee(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ee(a.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ee(a.onPointerLeave,()=>{f()})})}),Yye="SelectSeparator",TU=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Me.div,{"aria-hidden":!0,...r,ref:t})});TU.displayName=Yye;var Cj="SelectArrow",Xye=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Eg(n),o=_o(Cj,n),s=jo(Cj,n);return o.open&&s.position==="popper"?u.jsx(rU,{...a,...r,ref:t}):null});Xye.displayName=Cj;var Zye="SelectBubbleInput",NU=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=_.useRef(null),o=Ve(r,a),s=pO(t);return _.useEffect(()=>{const c=a.current;if(!c)return;const f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&p){const m=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(m)}},[s,t]),u.jsx(Me.select,{...n,style:{...aU,...n.style},ref:o,defaultValue:t})});NU.displayName=Zye;function CU(e){return e===""||e===void 0}function RU(e){const t=Wt(e),n=_.useRef(""),r=_.useRef(0),a=_.useCallback(s=>{const c=n.current+s;t(c),(function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(c)},[t]),o=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function PU(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Qye(e,Math.max(o,0));a.length===1&&(s=s.filter(h=>h!==n));const f=s.find(h=>h.textValue.toLowerCase().startsWith(a.toLowerCase()));return f!==n?f:void 0}function Qye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jye=iU,MU=sU,ebe=cU,tbe=uU,nbe=fU,kU=dU,rbe=vU,DU=bU,LU=wU,abe=SU,ibe=jU,$U=AU,IU=OU,BU=TU;const gr=Jye,yr=ebe,Gn=_.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(MU,{ref:r,className:we("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,u.jsx(tbe,{asChild:!0,children:u.jsx(Z5,{className:"h-4 w-4 opacity-50"})})]}));Gn.displayName=MU.displayName;const zU=_.forwardRef(({className:e,...t},n)=>u.jsx($U,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(_he,{className:"h-4 w-4"})}));zU.displayName=$U.displayName;const qU=_.forwardRef(({className:e,...t},n)=>u.jsx(IU,{ref:n,className:we("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Z5,{className:"h-4 w-4"})}));qU.displayName=IU.displayName;const Kn=_.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>u.jsx(nbe,{children:u.jsxs(kU,{ref:a,className:we("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:[u.jsx(zU,{}),u.jsx(rbe,{className:we("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(qU,{})]})}));Kn.displayName=kU.displayName;const obe=_.forwardRef(({className:e,...t},n)=>u.jsx(DU,{ref:n,className:we("px-2 py-1.5 text-sm font-semibold",e),...t}));obe.displayName=DU.displayName;const wn=_.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(LU,{ref:r,className:we("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:[u.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(ibe,{children:u.jsx(jf,{className:"h-4 w-4"})})}),u.jsx(abe,{children:t})]}));wn.displayName=LU.displayName;const sbe=_.forwardRef(({className:e,...t},n)=>u.jsx(BU,{ref:n,className:we("-mx-1 my-1 h-px bg-muted",e),...t}));sbe.displayName=BU.displayName;function lbe(e){const t=cbe(e),n=_.forwardRef((r,a)=>{const{children:o,...s}=r,c=_.Children.toArray(o),f=c.find(fbe);if(f){const h=f.props.children,p=c.map(m=>m===f?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:m);return u.jsx(t,{...s,ref:a,children:_.isValidElement(h)?_.cloneElement(h,void 0,p):null})}return u.jsx(t,{...s,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function cbe(e){const t=_.forwardRef((n,r)=>{const{children:a,...o}=n;if(_.isValidElement(a)){const s=hbe(a),c=dbe(o,a.props);return a.type!==_.Fragment&&(c.ref=r?Yr(r,s):s),_.cloneElement(a,c)}return _.Children.count(a)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ube=Symbol("radix.slottable");function fbe(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ube}function dbe(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]=(...c)=>{const f=o(...c);return a(...c),f}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function hbe(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 Tg="Popover",[UU]=Zr(Tg,[jg]),kd=jg(),[pbe,Ao]=UU(Tg),FU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,c=kd(t),f=_.useRef(null),[h,p]=_.useState(!1),[m,g]=xi({prop:r,defaultProp:a??!1,onChange:o,caller:Tg});return u.jsx(tU,{...c,children:u.jsx(pbe,{scope:t,contentId:kn(),triggerRef:f,open:m,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:h,onCustomAnchorAdd:_.useCallback(()=>p(!0),[]),onCustomAnchorRemove:_.useCallback(()=>p(!1),[]),modal:s,children:n})})};FU.displayName=Tg;var HU="PopoverAnchor",mbe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ao(HU,n),o=kd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=a;return _.useEffect(()=>(s(),()=>c()),[s,c]),u.jsx($O,{...o,...r,ref:t})});mbe.displayName=HU;var VU="PopoverTrigger",GU=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ao(VU,n),o=kd(n),s=Ve(t,a.triggerRef),c=u.jsx(Me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ZU(a.open),...r,ref:s,onClick:Ee(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:u.jsx($O,{asChild:!0,...o,children:c})});GU.displayName=VU;var zO="PopoverPortal",[vbe,gbe]=UU(zO,{forceMount:void 0}),KU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=Ao(zO,t);return u.jsx(vbe,{scope:t,forceMount:n,children:u.jsx(Qr,{present:n||o.open,children:u.jsx(Rd,{asChild:!0,container:a,children:r})})})};KU.displayName=zO;var _c="PopoverContent",WU=_.forwardRef((e,t)=>{const n=gbe(_c,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=Ao(_c,e.__scopePopover);return u.jsx(Qr,{present:r||o.open,children:o.modal?u.jsx(bbe,{...a,ref:t}):u.jsx(xbe,{...a,ref:t})})});WU.displayName=_c;var ybe=lbe("PopoverContent.RemoveScroll"),bbe=_.forwardRef((e,t)=>{const n=Ao(_c,e.__scopePopover),r=_.useRef(null),a=Ve(t,r),o=_.useRef(!1);return _.useEffect(()=>{const s=r.current;if(s)return yO(s)},[]),u.jsx(pg,{as:ybe,allowPinchZoom:!0,children:u.jsx(YU,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,s=>{s.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,h=c.button===2||f;o.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),xbe=_.forwardRef((e,t)=>{const n=Ao(_c,e.__scopePopover),r=_.useRef(!1),a=_.useRef(!1);return u.jsx(YU,{...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 s=o.target;n.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),YU=_.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,...m}=e,g=Ao(_c,n),y=kd(n);return gO(),u.jsx(dg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:u.jsx(Cd,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>g.onOpenChange(!1),children:u.jsx(nU,{"data-state":ZU(g.open),role:"dialog",id:g.contentId,...y,...m,ref:t,style:{...m.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)"}})})})}),XU="PopoverClose",wbe=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ao(XU,n);return u.jsx(Me.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,()=>a.onOpenChange(!1))})});wbe.displayName=XU;var Sbe="PopoverArrow",_be=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=kd(n);return u.jsx(rU,{...a,...r,ref:t})});_be.displayName=Sbe;function ZU(e){return e?"open":"closed"}var jbe=FU,Abe=GU,Obe=KU,QU=WU;const jc=jbe,Ac=Abe,As=_.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>u.jsx(Obe,{children:u.jsx(QU,{ref:a,align:t,sideOffset:n,className:we("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})}));As.displayName=QU.displayName;const Kc="/api/webui/config";async function Ebe(){const t=await(await fetch(`${Kc}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function fv(){const t=await(await fetch(`${Kc}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function Tbe(e){const t=localStorage.getItem("access-token"),r=await(await fetch(`${Kc}/bot`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}async function JU(e){const t=localStorage.getItem("access-token"),r=await(await fetch(`${Kc}/model`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}async function Nbe(e,t){const n=localStorage.getItem("access-token"),a=await(await fetch(`${Kc}/bot/section/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}async function Rj(e,t){const n=localStorage.getItem("access-token"),a=await(await fetch(`${Kc}/model/section/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}function Cbe(){const[e,t]=_.useState(!0),[n,r]=_.useState(!1),[a,o]=_.useState(!1),[s,c]=_.useState(!1),{toast:f}=Nd(),[h,p]=_.useState(null),[m,g]=_.useState(null),[y,S]=_.useState(null),[x,w]=_.useState(null),[A,O]=_.useState(null),[E,N]=_.useState(null),[T,C]=_.useState(null),[R,M]=_.useState(null),[k,z]=_.useState(null),[L,B]=_.useState(null),[F,U]=_.useState(null),[W,$]=_.useState(null),[V,H]=_.useState(null),[ne,ee]=_.useState(null),[I,q]=_.useState(null),[X,te]=_.useState(null),[se,Q]=_.useState(null),[G,ge]=_.useState(null),re=_.useRef(null),pe=_.useRef(!0),ye=_.useRef({}),le=_.useCallback(async()=>{try{t(!0);const Te=await Ebe();ye.current=Te,p(Te.bot),g(Te.personality);const st=Te.chat;st.talk_value_rules||(st.talk_value_rules=[]),S(st),w(Te.expression),O(Te.emoji),N(Te.memory),C(Te.tool),M(Te.mood),z(Te.voice),B(Te.lpmm_knowledge),U(Te.keyword_reaction),$(Te.response_post_process),H(Te.chinese_typo),ee(Te.response_splitter),q(Te.log),te(Te.debug),Q(Te.maim_message),ge(Te.telemetry),c(!1),pe.current=!1}catch(Te){console.error("加载配置失败:",Te),f({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[f]);_.useEffect(()=>{le()},[le]);const Le=_.useCallback(async(Te,st)=>{if(!pe.current)try{o(!0),await Nbe(Te,st),c(!1)}catch(En){console.error(`自动保存 ${Te} 失败:`,En),c(!0)}finally{o(!1)}},[]),be=_.useCallback((Te,st)=>{pe.current||(c(!0),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{Le(Te,st)},2e3))},[Le]);_.useEffect(()=>{h&&!pe.current&&be("bot",h)},[h,be]),_.useEffect(()=>{m&&!pe.current&&be("personality",m)},[m,be]),_.useEffect(()=>{y&&!pe.current&&be("chat",y)},[y,be]),_.useEffect(()=>{x&&!pe.current&&be("expression",x)},[x,be]),_.useEffect(()=>{A&&!pe.current&&be("emoji",A)},[A,be]),_.useEffect(()=>{E&&!pe.current&&be("memory",E)},[E,be]),_.useEffect(()=>{T&&!pe.current&&be("tool",T)},[T,be]),_.useEffect(()=>{R&&!pe.current&&be("mood",R)},[R,be]),_.useEffect(()=>{k&&!pe.current&&be("voice",k)},[k,be]),_.useEffect(()=>{L&&!pe.current&&be("lpmm_knowledge",L)},[L,be]),_.useEffect(()=>{F&&!pe.current&&be("keyword_reaction",F)},[F,be]),_.useEffect(()=>{W&&!pe.current&&be("response_post_process",W)},[W,be]),_.useEffect(()=>{V&&!pe.current&&be("chinese_typo",V)},[V,be]),_.useEffect(()=>{ne&&!pe.current&&be("response_splitter",ne)},[ne,be]),_.useEffect(()=>{I&&!pe.current&&be("log",I)},[I,be]),_.useEffect(()=>{X&&!pe.current&&be("debug",X)},[X,be]),_.useEffect(()=>{se&&!pe.current&&be("maim_message",se)},[se,be]),_.useEffect(()=>{G&&!pe.current&&be("telemetry",G)},[G,be]);const et=async()=>{try{r(!0),re.current&&clearTimeout(re.current);const Te={...ye.current,bot:h,personality:m,chat:y,expression:x,emoji:A,memory:E,tool:T,mood:R,voice:k,lpmm_knowledge:L,keyword_reaction:F,response_post_process:W,chinese_typo:V,response_splitter:ne,log:I,debug:X,maim_message:se,telemetry:G};await Tbe(Te),c(!1),f({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Te){console.error("保存配置失败:",Te),f({title:"保存失败",description:Te.message,variant:"destructive"})}finally{r(!1)}};return e?u.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:u.jsx("div",{className:"flex items-center justify-center h-64",children:u.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):u.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),u.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),u.jsxs(Se,{onClick:et,disabled:n||a||!s,size:"sm",className:"w-full sm:w-auto",children:[u.jsx(cO,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":a?"自动保存中...":s?"保存配置":"已保存"]})]}),u.jsxs(Yl,{defaultValue:"bot",className:"w-full",children:[u.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:u.jsxs(ps,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[u.jsx(St,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),u.jsx(St,{value:"personality",className:"flex-shrink-0",children:"人格"}),u.jsx(St,{value:"chat",className:"flex-shrink-0",children:"聊天"}),u.jsx(St,{value:"expression",className:"flex-shrink-0",children:"表达"}),u.jsx(St,{value:"features",className:"flex-shrink-0",children:"功能"}),u.jsx(St,{value:"processing",className:"flex-shrink-0",children:"处理"}),u.jsx(St,{value:"mood",className:"flex-shrink-0",children:"情绪"}),u.jsx(St,{value:"voice",className:"flex-shrink-0",children:"语音"}),u.jsx(St,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),u.jsx(St,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),u.jsxs(pr,{className:"h-[calc(100vh-320px)] sm:h-[calc(100vh-320px)]",children:[u.jsx(Rt,{value:"bot",className:"space-y-4",children:h&&u.jsx(Rbe,{config:h,onChange:p})}),u.jsx(Rt,{value:"personality",className:"space-y-4",children:m&&u.jsx(Pbe,{config:m,onChange:g})}),u.jsx(Rt,{value:"chat",className:"space-y-4",children:y&&u.jsx(Mbe,{config:y,onChange:S})}),u.jsx(Rt,{value:"expression",className:"space-y-4",children:x&&u.jsx(kbe,{config:x,onChange:w})}),u.jsx(Rt,{value:"features",className:"space-y-4",children:A&&E&&T&&u.jsx(Dbe,{emojiConfig:A,memoryConfig:E,toolConfig:T,onEmojiChange:O,onMemoryChange:N,onToolChange:C})}),u.jsx(Rt,{value:"processing",className:"space-y-4",children:F&&W&&V&&ne&&u.jsx(Lbe,{keywordReactionConfig:F,responsePostProcessConfig:W,chineseTypoConfig:V,responseSplitterConfig:ne,onKeywordReactionChange:U,onResponsePostProcessChange:$,onChineseTypoChange:H,onResponseSplitterChange:ee})}),u.jsx(Rt,{value:"mood",className:"space-y-4",children:R&&u.jsx($be,{config:R,onChange:M})}),u.jsx(Rt,{value:"voice",className:"space-y-4",children:k&&u.jsx(Ibe,{config:k,onChange:z})}),u.jsx(Rt,{value:"lpmm",className:"space-y-4",children:L&&u.jsx(Bbe,{config:L,onChange:B})}),u.jsxs(Rt,{value:"other",className:"space-y-4",children:[I&&u.jsx(zbe,{config:I,onChange:q}),X&&u.jsx(qbe,{config:X,onChange:te}),se&&u.jsx(Ube,{config:se,onChange:Q}),G&&u.jsx(Fbe,{config:G,onChange:ge})]})]})]})]})}function Rbe({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},r=f=>{t({...e,platforms:e.platforms.filter((h,p)=>p!==f)})},a=(f,h)=>{const p=[...e.platforms];p[f]=h,t({...e,platforms:p})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},s=f=>{t({...e,alias_names:e.alias_names.filter((h,p)=>p!==f)})},c=(f,h)=>{const p=[...e.alias_names];p[f]=h,t({...e,alias_names:p})};return u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"platform",children:"平台"}),u.jsx(Ce,{id:"platform",value:e.platform,onChange:f=>t({...e,platform:f.target.value}),placeholder:"qq"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"qq_account",children:"QQ账号"}),u.jsx(Ce,{id:"qq_account",value:e.qq_account,onChange:f=>t({...e,qq_account:f.target.value}),placeholder:"123456789"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"nickname",children:"昵称"}),u.jsx(Ce,{id:"nickname",value:e.nickname,onChange:f=>t({...e,nickname:f.target.value}),placeholder:"麦麦"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(ve,{children:"其他平台账号"}),u.jsxs(Se,{onClick:n,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加"]})]}),u.jsxs("div",{className:"space-y-2",children:[e.platforms.map((f,h)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Ce,{value:f,onChange:p=>a(h,p.target.value),placeholder:"wx:114514"}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"icon",variant:"outline",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:['确定要删除平台账号 "',f||"(空)",'" 吗?此操作无法撤销。']})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>r(h),children:"删除"})]})]})]})]},h)),e.platforms.length===0&&u.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(ve,{children:"别名"}),u.jsxs(Se,{onClick:o,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加"]})]}),u.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((f,h)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Ce,{value:f,onChange:p=>c(h,p.target.value),placeholder:"小麦"}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"icon",variant:"outline",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:['确定要删除别名 "',f||"(空)",'" 吗?此操作无法撤销。']})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>s(h),children:"删除"})]})]})]})]},h)),e.alias_names.length===0&&u.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function Pbe({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},r=o=>{t({...e,states:e.states.filter((s,c)=>c!==o)})},a=(o,s)=>{const c=[...e.states];c[o]=s,t({...e,states:c})};return u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"personality",children:"人格特质"}),u.jsx(hr,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"reply_style",children:"表达风格"}),u.jsx(hr,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"interest",children:"兴趣"}),u.jsx(hr,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"plan_style",children:"说话规则与行为风格"}),u.jsx(hr,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"visual_style",children:"识图规则"}),u.jsx(hr,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"private_plan_style",children:"私聊规则"}),u.jsx(hr,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(ve,{children:"状态列表(人格多样性)"}),u.jsxs(Se,{onClick:n,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),u.jsx("div",{className:"space-y-2",children:e.states.map((o,s)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx(hr,{value:o,onChange:c=>a(s,c.target.value),placeholder:"描述一个人格状态",rows:2}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"icon",variant:"outline",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsx(Or,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>r(s),children:"删除"})]})]})]})]},s))})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"state_probability",children:"状态替换概率"}),u.jsx(Ce,{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)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function Mbe({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=c=>{t({...e,talk_value_rules:e.talk_value_rules.filter((f,h)=>h!==c)})},a=(c,f,h)=>{const p=[...e.talk_value_rules];p[c]={...p[c],[f]:h},t({...e,talk_value_rules:p})},o=({value:c,onChange:f})=>{const[h,p]=_.useState("00"),[m,g]=_.useState("00"),[y,S]=_.useState("23"),[x,w]=_.useState("59");_.useEffect(()=>{const O=c.split("-");if(O.length===2){const[E,N]=O,[T,C]=E.split(":"),[R,M]=N.split(":");T&&p(T.padStart(2,"0")),C&&g(C.padStart(2,"0")),R&&S(R.padStart(2,"0")),M&&w(M.padStart(2,"0"))}},[c]);const A=(O,E,N,T)=>{const C=`${O}:${E}-${N}:${T}`;f(C)};return u.jsxs(jc,{children:[u.jsx(Ac,{asChild:!0,children:u.jsxs(Se,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[u.jsx(Q5,{className:"h-4 w-4 mr-2"}),c||"选择时间段"]})}),u.jsx(As,{className:"w-80",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[u.jsxs("div",{children:[u.jsx(ve,{className:"text-xs",children:"小时"}),u.jsxs(gr,{value:h,onValueChange:O=>{p(O),A(O,m,y,x)},children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:Array.from({length:24},(O,E)=>E).map(O=>u.jsx(wn,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),u.jsxs("div",{children:[u.jsx(ve,{className:"text-xs",children:"分钟"}),u.jsxs(gr,{value:m,onValueChange:O=>{g(O),A(h,O,y,x)},children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:Array.from({length:60},(O,E)=>E).map(O=>u.jsx(wn,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[u.jsxs("div",{children:[u.jsx(ve,{className:"text-xs",children:"小时"}),u.jsxs(gr,{value:y,onValueChange:O=>{S(O),A(h,m,O,x)},children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:Array.from({length:24},(O,E)=>E).map(O=>u.jsx(wn,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),u.jsxs("div",{children:[u.jsx(ve,{className:"text-xs",children:"分钟"}),u.jsxs(gr,{value:x,onValueChange:O=>{w(O),A(h,m,y,O)},children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:Array.from({length:60},(O,E)=>E).map(O=>u.jsx(wn,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]})]})})]})},s=({rule:c})=>{const f=`{ target = "${c.target}", time = "${c.time}", value = ${c.value.toFixed(1)} }`;return u.jsxs(jc,{children:[u.jsx(Ac,{asChild:!0,children:u.jsxs(Se,{variant:"outline",size:"sm",children:[u.jsx(xs,{className:"h-4 w-4 mr-1"}),"预览"]})}),u.jsx(As,{className:"w-96",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),u.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:f}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),u.jsx(Ce,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:c=>t({...e,talk_value:parseFloat(c.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),u.jsx(Ce,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:c=>t({...e,mentioned_bot_reply:parseFloat(c.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"max_context_size",children:"上下文长度"}),u.jsx(Ce,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:c=>t({...e,max_context_size:parseInt(c.target.value)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"planner_smooth",children:"规划器平滑"}),u.jsx(Ce,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:c=>t({...e,planner_smooth:parseFloat(c.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:c=>t({...e,enable_talk_value_rules:c})}),u.jsx(ve,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:c=>t({...e,include_planner_reasoning:c})}),u.jsx(ve,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&u.jsxs("div",{className:"border-t pt-6",children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),u.jsxs(Se,{onClick:n,size:"sm",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?u.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((c,f)=>u.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",f+1]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(s,{rule:c}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{variant:"ghost",size:"sm",children:u.jsx(dn,{className:"h-4 w-4 text-destructive"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:["确定要删除规则 #",f+1," 吗?此操作无法撤销。"]})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>r(f),children:"删除"})]})]})]})]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:`rule-target-${f}`,className:"text-xs font-medium",children:"目标聊天流 (Target)"}),u.jsx(Ce,{id:`rule-target-${f}`,placeholder:'留空=全局,或填 "platform:id:type"',value:c.target,onChange:h=>a(f,"target",h.target.value),className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"示例:qq:1919810:group 或 qq:114514:private"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{className:"text-xs font-medium",children:"时间段 (Time)"}),u.jsx(o,{value:c.time,onChange:h=>a(f,"time",h)}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),u.jsxs("div",{className:"grid gap-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(ve,{htmlFor:`rule-value-${f}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),u.jsx(Ce,{id:`rule-value-${f}`,type:"number",step:"0.01",min:"0",max:"1",value:c.value,onChange:h=>{const p=parseFloat(h.target.value);isNaN(p)||a(f,"value",Math.max(0,Math.min(1,p)))},className:"w-20 h-8 text-xs"})]}),u.jsx(TO,{value:[c.value],onValueChange:h=>a(f,"value",h[0]),min:0,max:1,step:.01,className:"w-full"}),u.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[u.jsx("span",{children:"0 (完全沉默)"}),u.jsx("span",{children:"0.5"}),u.jsx("span",{children:"1.0 (正常)"})]})]})]})]},f))}):u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:u.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),u.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:[u.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),u.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[u.jsxs("li",{children:["• ",u.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),u.jsxs("li",{children:["• ",u.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),u.jsxs("li",{children:["• ",u.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),u.jsxs("li",{children:["• ",u.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),u.jsxs("li",{children:["• ",u.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function kbe({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},r=m=>{t({...e,learning_list:e.learning_list.filter((g,y)=>y!==m)})},a=(m,g,y)=>{const S=[...e.learning_list];S[m][g]=y,t({...e,learning_list:S})},o=({rule:m})=>{const g=`["${m[0]}", "${m[1]}", "${m[2]}", "${m[3]}"]`;return u.jsxs(jc,{children:[u.jsx(Ac,{asChild:!0,children:u.jsxs(Se,{variant:"outline",size:"sm",children:[u.jsx(xs,{className:"h-4 w-4 mr-1"}),"预览"]})}),u.jsx(As,{className:"w-96",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),u.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},s=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},c=m=>{t({...e,expression_groups:e.expression_groups.filter((g,y)=>y!==m)})},f=m=>{const g=[...e.expression_groups];g[m]=[...g[m],""],t({...e,expression_groups:g})},h=(m,g)=>{const y=[...e.expression_groups];y[m]=y[m].filter((S,x)=>x!==g),t({...e,expression_groups:y})},p=(m,g,y)=>{const S=[...e.expression_groups];S[m][g]=y,t({...e,expression_groups:S})};return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),u.jsxs(Se,{onClick:n,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),u.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((m,g)=>u.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",m[0]===""&&"(全局配置)"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(o,{rule:m}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"sm",variant:"ghost",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{className:"text-xs font-medium",children:"聊天流 ID"}),u.jsx(Ce,{value:m[0],onChange:y=>a(g,0,y.target.value),placeholder:"留空表示全局配置,例如:qq:1919810:group",className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"格式:platform:id:type(group/private)"})]}),u.jsx("div",{className:"grid gap-2",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx(ve,{className:"text-xs font-medium",children:"使用学到的表达"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),u.jsx(_t,{checked:m[1]==="enable",onCheckedChange:y=>a(g,1,y?"enable":"disable")})]})}),u.jsx("div",{className:"grid gap-2",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx(ve,{className:"text-xs font-medium",children:"学习表达"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),u.jsx(_t,{checked:m[2]==="enable",onCheckedChange:y=>a(g,2,y?"enable":"disable")})]})}),u.jsxs("div",{className:"grid gap-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(ve,{className:"text-xs font-medium",children:"学习强度"}),u.jsx(Ce,{type:"number",step:"0.1",min:"0",max:"5",value:m[3],onChange:y=>{const S=parseFloat(y.target.value);isNaN(S)||a(g,3,Math.max(0,Math.min(5,S)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),u.jsx(TO,{value:[parseFloat(m[3])||1],onValueChange:y=>a(g,3,y[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),u.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[u.jsx("span",{children:"0 (不学习)"}),u.jsx("span",{children:"2.5"}),u.jsx("span",{children:"5.0 (快速学习)"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)),e.learning_list.length===0&&u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),u.jsxs(Se,{onClick:s,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),u.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((m,g)=>u.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,m.length===1&&m[0]==="*"&&"(全局共享)"]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Se,{onClick:()=>f(g),size:"sm",variant:"outline",children:u.jsx(Dn,{className:"h-4 w-4"})}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"sm",variant:"ghost",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>c(g),children:"删除"})]})]})]})]})]}),u.jsx("div",{className:"space-y-2",children:m.map((y,S)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Ce,{value:y,onChange:x=>p(g,S,x.target.value),placeholder:'输入 "*" 表示全局共享,或 "qq:123456:group"'}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"icon",variant:"outline",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:['确定要删除组成员 "',y||"(空)",'" 吗?此操作无法撤销。']})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>h(g,S),children:"删除"})]})]})]})]},S))}),u.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:输入 "*" 启用全局共享;或输入具体 chat_id(如 qq:114514:private)组成互通组'})]},g)),e.expression_groups.length===0&&u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function Dbe({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:r,onMemoryChange:a,onToolChange:o}){return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:s=>o({...n,enable_tool:s})}),u.jsx(ve,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),u.jsx(Ce,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:s=>a({...t,max_agent_iterations:parseInt(s.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),u.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"emoji_chance",children:"表情包激活概率"}),u.jsx(Ce,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:s=>r({...e,emoji_chance:parseFloat(s.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"max_reg_num",children:"最大注册数量"}),u.jsx(Ce,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:s=>r({...e,max_reg_num:parseInt(s.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),u.jsx(Ce,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:s=>r({...e,check_interval:parseInt(s.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"do_replace",checked:e.do_replace,onCheckedChange:s=>r({...e,do_replace:s})}),u.jsx(ve,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:s=>r({...e,steal_emoji:s})}),u.jsx(ve,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),u.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:s=>r({...e,content_filtration:s})}),u.jsx(ve,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&u.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[u.jsx(ve,{htmlFor:"filtration_prompt",children:"过滤要求"}),u.jsx(Ce,{id:"filtration_prompt",value:e.filtration_prompt,onChange:s=>r({...e,filtration_prompt:s.target.value}),placeholder:"符合公序良俗"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function Lbe({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:a,onResponsePostProcessChange:o,onChineseTypoChange:s,onResponseSplitterChange:c}){const f=()=>{a({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},h=N=>{a({...e,regex_rules:e.regex_rules.filter((T,C)=>C!==N)})},p=(N,T,C)=>{const R=[...e.regex_rules];T==="regex"&&typeof C=="string"?R[N]={...R[N],regex:[C]}:T==="reaction"&&typeof C=="string"&&(R[N]={...R[N],reaction:C}),a({...e,regex_rules:R})},m=({regex:N,reaction:T,onRegexChange:C,onReactionChange:R})=>{const[M,k]=_.useState(!1),[z,L]=_.useState(""),[B,F]=_.useState(null),[U,W]=_.useState(""),[$,V]=_.useState({}),[H,ne]=_.useState(""),ee=_.useRef(null),[I,q]=_.useState("build"),X=G=>G.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),te=(G,ge=0)=>{const re=ee.current;if(!re)return;const pe=re.selectionStart||0,ye=re.selectionEnd||0,le=N.substring(0,pe)+G+N.substring(ye);C(le),setTimeout(()=>{const Le=pe+G.length+ge;re.setSelectionRange(Le,Le),re.focus()},0)};_.useEffect(()=>{if(!N||!z){F(null),V({}),ne(T),W("");return}try{const G=X(N),ge=new RegExp(G,"g"),re=z.match(ge);F(re),W("");const ye=new RegExp(G).exec(z);if(ye&&ye.groups){V(ye.groups);let le=T;Object.entries(ye.groups).forEach(([Le,be])=>{le=le.replace(new RegExp(`\\[${Le}\\]`,"g"),be||"")}),ne(le)}else V({}),ne(T)}catch(G){W(G.message),F(null),V({}),ne(T)}},[N,z,T]);const se=()=>{if(!z||!B||B.length===0)return u.jsx("span",{className:"text-muted-foreground",children:z||"请输入测试文本"});try{const G=X(N),ge=new RegExp(G,"g");let re=0;const pe=[];let ye;for(;(ye=ge.exec(z))!==null;)ye.index>re&&pe.push(u.jsx("span",{children:z.substring(re,ye.index)},`text-${re}`)),pe.push(u.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:ye[0]},`match-${ye.index}`)),re=ye.index+ye[0].length;return re)",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 u.jsxs(Pd,{open:M,onOpenChange:k,children:[u.jsx(Yq,{asChild:!0,children:u.jsxs(Se,{variant:"outline",size:"sm",children:[u.jsx(J5,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),u.jsxs(Bc,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[u.jsxs(zc,{children:[u.jsx(qc,{children:"正则表达式编辑器"}),u.jsx(Uc,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),u.jsx(pr,{className:"max-h-[calc(90vh-120px)]",children:u.jsxs(Yl,{value:I,onValueChange:G=>q(G),className:"w-full",children:[u.jsxs(ps,{className:"grid w-full grid-cols-2",children:[u.jsx(St,{value:"build",children:"🔧 构建器"}),u.jsx(St,{value:"test",children:"🧪 测试器"})]}),u.jsxs(Rt,{value:"build",className:"space-y-4 mt-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{className:"text-sm font-medium",children:"正则表达式"}),u.jsx(Ce,{ref:ee,value:N,onChange:G=>C(G.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{className:"text-sm font-medium",children:"Reaction 内容"}),u.jsx(hr,{value:T,onChange:G=>R(G.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),u.jsxs("div",{className:"space-y-4 border-t pt-4",children:[Q.map(G=>u.jsxs("div",{className:"space-y-2",children:[u.jsx("h5",{className:"text-xs font-semibold text-primary",children:G.category}),u.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:G.items.map(ge=>u.jsx(Se,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>te(ge.pattern,ge.moveCursor||0),children:u.jsxs("div",{className:"flex flex-col items-start w-full",children:[u.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.jsx("span",{className:"text-xs font-medium",children:ge.label}),u.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ge.pattern})]}),u.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ge.desc})]})},ge.label))})]},G.category)),u.jsxs("div",{className:"space-y-2 border-t pt-4",children:[u.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>C("^(?P\\S{1,20})是这样的$"),children:u.jsxs("div",{className:"flex flex-col items-start w-full",children:[u.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),u.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),u.jsx(Se,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>C("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:u.jsxs("div",{className:"flex flex-col items-start w-full",children:[u.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),u.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),u.jsx(Se,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>C("(?P.+?)(?:是|为什么|怎么)"),children:u.jsxs("div",{className:"flex flex-col items-start w-full",children:[u.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),u.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),u.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:[u.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),u.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[u.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),u.jsxs("li",{children:["命名捕获组格式:",u.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),u.jsxs("li",{children:["在 reaction 中使用 ",u.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),u.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),u.jsxs(Rt,{value:"test",className:"space-y-4 mt-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{className:"text-sm font-medium",children:"当前正则表达式"}),u.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:N||"(未设置)"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),u.jsx(hr,{id:"test-text",value:z,onChange:G=>L(G.target.value),placeholder:`在此输入要测试的文本... 例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),U&&u.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[u.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),u.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:U})]}),!U&&z&&u.jsxs("div",{className:"space-y-3",children:[u.jsx("div",{className:"flex items-center gap-2",children:B&&B.length>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),u.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",B.length," 处)"]})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),u.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{className:"text-sm font-medium",children:"匹配高亮"}),u.jsx(pr,{className:"h-40 rounded-md bg-muted p-3",children:u.jsx("div",{className:"text-sm break-words",children:se()})})]}),Object.keys($).length>0&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{className:"text-sm font-medium",children:"命名捕获组"}),u.jsx(pr,{className:"h-32 rounded-md border p-3",children:u.jsx("div",{className:"space-y-2",children:Object.entries($).map(([G,ge])=>u.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[u.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",G,"]"]}),u.jsx("span",{className:"text-muted-foreground",children:"="}),u.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ge})]},G))})})]}),Object.keys($).length>0&&T&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(ve,{className:"text-sm font-medium",children:"Reaction 替换预览"}),u.jsx(pr,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:u.jsx("div",{className:"text-sm break-words",children:H})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),u.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:[u.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),u.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[u.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),u.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),u.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),u.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{a({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},y=N=>{a({...e,keyword_rules:e.keyword_rules.filter((T,C)=>C!==N)})},S=(N,T,C)=>{const R=[...e.keyword_rules];typeof C=="string"&&(R[N]={...R[N],reaction:C}),a({...e,keyword_rules:R})},x=N=>{const T=[...e.keyword_rules];T[N]={...T[N],keywords:[...T[N].keywords||[],""]},a({...e,keyword_rules:T})},w=(N,T)=>{const C=[...e.keyword_rules];C[N]={...C[N],keywords:(C[N].keywords||[]).filter((R,M)=>M!==T)},a({...e,keyword_rules:C})},A=(N,T,C)=>{const R=[...e.keyword_rules],M=[...R[N].keywords||[]];M[T]=C,R[N]={...R[N],keywords:M},a({...e,keyword_rules:R})},O=({rule:N})=>{const T=`{ regex = [${(N.regex||[]).map(C=>`"${C}"`).join(", ")}], reaction = "${N.reaction}" }`;return u.jsxs(jc,{children:[u.jsx(Ac,{asChild:!0,children:u.jsxs(Se,{variant:"outline",size:"sm",children:[u.jsx(xs,{className:"h-4 w-4 mr-1"}),"预览"]})}),u.jsx(As,{className:"w-[95vw] sm:w-[500px]",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),u.jsx(pr,{className:"h-60 rounded-md bg-muted p-3",children:u.jsx("pre",{className:"font-mono text-xs break-all",children:T})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},E=({rule:N})=>{const T=`[[keyword_reaction.keyword_rules]] keywords = [${(N.keywords||[]).map(C=>`"${C}"`).join(", ")}] reaction = "${N.reaction}"`;return u.jsxs(jc,{children:[u.jsx(Ac,{asChild:!0,children:u.jsxs(Se,{variant:"outline",size:"sm",children:[u.jsx(xs,{className:"h-4 w-4 mr-1"}),"预览"]})}),u.jsx(As,{className:"w-[95vw] sm:w-[500px]",children:u.jsxs("div",{className:"space-y-2",children:[u.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),u.jsx(pr,{className:"h-60 rounded-md bg-muted p-3",children:u.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:T})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),u.jsxs(Se,{onClick:f,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),u.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((N,T)=>u.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",T+1]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(m,{regex:N.regex&&N.regex[0]||"",reaction:N.reaction,onRegexChange:C=>p(T,"regex",C),onReactionChange:C=>p(T,"reaction",C)}),u.jsx(O,{rule:N}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"sm",variant:"ghost",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:["确定要删除正则规则 ",T+1," 吗?此操作无法撤销。"]})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>h(T),children:"删除"})]})]})]})]})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),u.jsx(Ce,{value:N.regex&&N.regex[0]||"",onChange:C=>p(T,"regex",C.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{className:"text-xs font-medium",children:"反应内容"}),u.jsx(hr,{value:N.reaction,onChange:C=>p(T,"reaction",C.target.value),placeholder:`触发后麦麦的反应... 可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},T)),e.regex_rules.length===0&&u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),u.jsxs("div",{className:"space-y-4 border-t pt-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),u.jsxs(Se,{onClick:g,size:"sm",variant:"outline",children:[u.jsx(Dn,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),u.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((N,T)=>u.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",T+1]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(E,{rule:N}),u.jsxs(Wr,{children:[u.jsx(Ra,{asChild:!0,children:u.jsx(Se,{size:"sm",variant:"ghost",children:u.jsx(dn,{className:"h-4 w-4"})})}),u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:["确定要删除关键词规则 ",T+1," 吗?此操作无法撤销。"]})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:()=>y(T),children:"删除"})]})]})]})]})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(ve,{className:"text-xs font-medium",children:"关键词列表"}),u.jsxs(Se,{onClick:()=>x(T),size:"sm",variant:"ghost",children:[u.jsx(Dn,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),u.jsxs("div",{className:"space-y-2",children:[(N.keywords||[]).map((C,R)=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ce,{value:C,onChange:M=>A(T,R,M.target.value),placeholder:"关键词",className:"flex-1"}),u.jsx(Se,{onClick:()=>w(T,R),size:"sm",variant:"ghost",children:u.jsx(dn,{className:"h-4 w-4"})})]},R)),(!N.keywords||N.keywords.length===0)&&u.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{className:"text-xs font-medium",children:"反应内容"}),u.jsx(hr,{value:N.reaction,onChange:C=>S(T,"reaction",C.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},T)),e.keyword_rules.length===0&&u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:N=>o({...t,enable_response_post_process:N})}),u.jsx(ve,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-t pt-6 space-y-4",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[u.jsx(_t,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:N=>s({...n,enable:N})}),u.jsx(ve,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),u.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&u.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),u.jsx(Ce,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:N=>s({...n,error_rate:parseFloat(N.target.value)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),u.jsx(Ce,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:N=>s({...n,min_freq:parseInt(N.target.value)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),u.jsx(Ce,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:N=>s({...n,tone_error_rate:parseFloat(N.target.value)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),u.jsx(Ce,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:N=>s({...n,word_replace_rate:parseFloat(N.target.value)})})]})]})]})}),u.jsx("div",{className:"border-t pt-6 space-y-4",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[u.jsx(_t,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:N=>c({...r,enable:N})}),u.jsx(ve,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),u.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&u.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),u.jsx(Ce,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:N=>c({...r,max_length:parseInt(N.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),u.jsx(Ce,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:N=>c({...r,max_sentence_num:parseInt(N.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:N=>c({...r,enable_kaomoji_protection:N})}),u.jsx(ve,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:N=>c({...r,enable_overflow_return_all:N})}),u.jsx(ve,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),u.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function $be({config:e,onChange:t}){return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[u.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),u.jsx(ve,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"情绪更新阈值"}),u.jsx(Ce,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"情感特征"}),u.jsx(hr,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function Ibe({config:e,onChange:t}){return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[u.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),u.jsx(ve,{className:"cursor-pointer",children:"启用语音识别"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function Bbe({config:e,onChange:t}){return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[u.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),u.jsx(ve,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"LPMM 模式"}),u.jsxs("select",{className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:e.lpmm_mode,onChange:n=>t({...e,lpmm_mode:n.target.value}),children:[u.jsx("option",{value:"classic",children:"经典模式"}),u.jsx("option",{value:"agent",children:"Agent 模式"})]})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"同义词搜索 TopK"}),u.jsx(Ce,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"同义词阈值"}),u.jsx(Ce,{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)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"实体提取线程数"}),u.jsx(Ce,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"嵌入向量维度"}),u.jsx(Ce,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function zbe({config:e,onChange:t}){const[n,r]=_.useState(""),[a,o]=_.useState("WARNING"),s=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),r(""))},c=y=>{t({...e,suppress_libraries:e.suppress_libraries.filter(S=>S!==y)})},f=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:a}}),r(""),o("WARNING"))},h=y=>{const S={...e.library_log_levels};delete S[y],t({...e,library_log_levels:S})},p=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],m=["FULL","compact","lite"],g=["none","title","full"];return u.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"日期格式"}),u.jsx(Ce,{value:e.date_style,onChange:y=>t({...e,date_style:y.target.value}),placeholder:"例如: m-d H:i:s"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"日志级别样式"}),u.jsxs(gr,{value:e.log_level_style,onValueChange:y=>t({...e,log_level_style:y}),children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:m.map(y=>u.jsx(wn,{value:y,children:y},y))})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"日志文本颜色"}),u.jsxs(gr,{value:e.color_text,onValueChange:y=>t({...e,color_text:y}),children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:g.map(y=>u.jsx(wn,{value:y,children:y},y))})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"全局日志级别"}),u.jsxs(gr,{value:e.log_level,onValueChange:y=>t({...e,log_level:y}),children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:p.map(y=>u.jsx(wn,{value:y,children:y},y))})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"控制台日志级别"}),u.jsxs(gr,{value:e.console_log_level,onValueChange:y=>t({...e,console_log_level:y}),children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:p.map(y=>u.jsx(wn,{value:y,children:y},y))})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"文件日志级别"}),u.jsxs(gr,{value:e.file_log_level,onValueChange:y=>t({...e,file_log_level:y}),children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsx(Kn,{children:p.map(y=>u.jsx(wn,{value:y,children:y},y))})]})]})]})]}),u.jsxs("div",{children:[u.jsx(ve,{className:"mb-2 block",children:"完全屏蔽的库"}),u.jsxs("div",{className:"flex gap-2 mb-2",children:[u.jsx(Ce,{value:n,onChange:y=>r(y.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),s())}}),u.jsx(Se,{onClick:s,size:"sm",className:"flex-shrink-0",children:u.jsx(Dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),u.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(y=>u.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[u.jsx("span",{className:"text-sm",children:y}),u.jsx(Se,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>c(y),children:u.jsx(dn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},y))})]}),u.jsxs("div",{children:[u.jsx(ve,{className:"mb-2 block",children:"特定库的日志级别"}),u.jsxs("div",{className:"flex gap-2 mb-2",children:[u.jsx(Ce,{value:n,onChange:y=>r(y.target.value),placeholder:"输入库名",className:"flex-1"}),u.jsxs(gr,{value:a,onValueChange:o,children:[u.jsx(Gn,{className:"w-32",children:u.jsx(yr,{})}),u.jsx(Kn,{children:p.map(y=>u.jsx(wn,{value:y,children:y},y))})]}),u.jsx(Se,{onClick:f,size:"sm",children:u.jsx(Dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),u.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([y,S])=>u.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[u.jsx("span",{className:"text-sm font-medium",children:y}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm text-muted-foreground",children:S}),u.jsx(Se,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>h(y),children:u.jsx(dn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},y))})]})]})}function qbe({config:e,onChange:t}){return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[u.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(ve,{children:"显示 Prompt"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),u.jsx(_t,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(ve,{children:"显示回复器 Prompt"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),u.jsx(_t,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(ve,{children:"显示回复器推理"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),u.jsx(_t,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(ve,{children:"显示 Jargon Prompt"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),u.jsx(_t,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function Ube({config:e,onChange:t}){const[n,r]=_.useState(""),a=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),r(""))},o=s=>{t({...e,auth_token:e.auth_token.filter((c,f)=>f!==s)})};return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(ve,{children:"启用自定义服务器"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),u.jsx(_t,{checked:e.use_custom,onCheckedChange:s=>t({...e,use_custom:s})})]}),e.use_custom&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"主机地址"}),u.jsx(Ce,{value:e.host,onChange:s=>t({...e,host:s.target.value}),placeholder:"127.0.0.1"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"端口号"}),u.jsx(Ce,{type:"number",value:e.port,onChange:s=>t({...e,port:parseInt(s.target.value)}),placeholder:"8090"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"连接模式"}),u.jsxs(gr,{value:e.mode,onValueChange:s=>t({...e,mode:s}),children:[u.jsx(Gn,{children:u.jsx(yr,{})}),u.jsxs(Kn,{children:[u.jsx(wn,{value:"ws",children:"WebSocket (ws)"}),u.jsx(wn,{value:"tcp",children:"TCP"})]})]})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{checked:e.use_wss,onCheckedChange:s=>t({...e,use_wss:s}),disabled:e.mode!=="ws"}),u.jsx(ve,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"SSL 证书文件路径"}),u.jsx(Ce,{value:e.cert_file,onChange:s=>t({...e,cert_file:s.target.value}),placeholder:"cert.pem"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"SSL 密钥文件路径"}),u.jsx(Ce,{value:e.key_file,onChange:s=>t({...e,key_file:s.target.value}),placeholder:"key.pem"})]})]})]})]})]}),u.jsxs("div",{children:[u.jsx(ve,{className:"mb-2 block",children:"认证令牌"}),u.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),u.jsxs("div",{className:"flex gap-2 mb-2",children:[u.jsx(Ce,{value:n,onChange:s=>r(s.target.value),placeholder:"输入认证令牌",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),a())}}),u.jsx(Se,{onClick:a,size:"sm",children:u.jsx(Dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),u.jsx("div",{className:"space-y-2",children:e.auth_token.map((s,c)=>u.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[u.jsx("span",{className:"text-sm font-mono",children:s}),u.jsx(Se,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(c),children:u.jsx(dn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},c))})]})]})}function Fbe({config:e,onChange:t}){return u.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[u.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx(ve,{children:"启用统计信息发送"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),u.jsx(_t,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const qO=_.forwardRef(({className:e,...t},n)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:n,className:we("w-full caption-bottom text-sm",e),...t})}));qO.displayName="Table";const UO=_.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:we("[&_tr]:border-b",e),...t}));UO.displayName="TableHeader";const FO=_.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:we("[&_tr:last-child]:border-0",e),...t}));FO.displayName="TableBody";const Hbe=_.forwardRef(({className:e,...t},n)=>u.jsx("tfoot",{ref:n,className:we("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Hbe.displayName="TableFooter";const fs=_.forwardRef(({className:e,...t},n)=>u.jsx("tr",{ref:n,className:we("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));fs.displayName="TableRow";const Cn=_.forwardRef(({className:e,...t},n)=>u.jsx("th",{ref:n,className:we("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}));Cn.displayName="TableHead";const fn=_.forwardRef(({className:e,...t},n)=>u.jsx("td",{ref:n,className:we("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));fn.displayName="TableCell";const Vbe=_.forwardRef(({className:e,...t},n)=>u.jsx("caption",{ref:n,className:we("mt-4 text-sm text-muted-foreground",e),...t}));Vbe.displayName="TableCaption";function Gbe(){const[e,t]=_.useState([]),[n,r]=_.useState(!0),[a,o]=_.useState(!1),[s,c]=_.useState(!1),[f,h]=_.useState(!1),[p,m]=_.useState(!1),[g,y]=_.useState(null),[S,x]=_.useState(null),[w,A]=_.useState(!1),[O,E]=_.useState(null),[N,T]=_.useState(!1),[C,R]=_.useState(""),{toast:M}=Nd(),k=_.useRef(null),z=_.useRef(!0);_.useEffect(()=>{L()},[]);const L=async()=>{try{r(!0);const ee=await fv();t(ee.api_providers||[]),h(!1),z.current=!1}catch(ee){console.error("加载配置失败:",ee)}finally{r(!1)}},B=_.useCallback(async ee=>{if(!z.current)try{c(!0),await Rj("api_providers",ee),h(!1)}catch(I){console.error("自动保存失败:",I),h(!0)}finally{c(!1)}},[]);_.useEffect(()=>{if(!z.current)return h(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{B(e)},2e3),()=>{k.current&&clearTimeout(k.current)}},[e,B]);const F=async()=>{try{o(!0),k.current&&clearTimeout(k.current);const ee=await fv();ee.api_providers=e,await JU(ee),h(!1),M({title:"保存成功",description:"模型提供商配置已保存"})}catch(ee){console.error("保存配置失败:",ee),M({title:"保存失败",description:ee.message,variant:"destructive"})}finally{o(!1)}},U=(ee,I)=>{y(ee||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),x(I),T(!1),m(!0)},W=async()=>{if(g?.api_key)try{await navigator.clipboard.writeText(g.api_key),M({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{M({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},$=()=>{if(g){if(S!==null){const ee=[...e];ee[S]=g,t(ee)}else t([...e,g]);m(!1),y(null),x(null)}},V=ee=>{E(ee),A(!0)},H=()=>{if(O!==null){const ee=e.filter((I,q)=>q!==O);t(ee),M({title:"删除成功",description:"提供商已从列表中移除"})}A(!1),E(null)},ne=e.filter(ee=>{if(!C)return!0;const I=C.toLowerCase();return ee.name.toLowerCase().includes(I)||ee.base_url.toLowerCase().includes(I)||ee.client_type.toLowerCase().includes(I)});return n?u.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:u.jsx("div",{className:"flex items-center justify-center h-64",children:u.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):u.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),u.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[u.jsxs(Se,{onClick:()=>U(null,null),size:"sm",className:"w-full sm:w-auto",children:[u.jsx(Dn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),u.jsxs(Se,{onClick:F,disabled:a||s||!f,size:"sm",variant:"default",className:"w-full sm:w-auto",children:[u.jsx(cO,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),a?"保存中...":s?"自动保存中...":f?"保存配置":"已保存"]})]})]}),u.jsxs(pr,{className:"h-[calc(100vh-260px)]",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[u.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[u.jsx(cg,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),u.jsx(Ce,{placeholder:"搜索提供商名称、URL 或类型...",value:C,onChange:ee=>R(ee.target.value),className:"pl-9"})]}),C&&u.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",ne.length," 个结果"]})]}),u.jsx("div",{className:"md:hidden space-y-3",children:ne.length===0?u.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:C?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):ne.map((ee,I)=>u.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("h3",{className:"font-semibold text-base truncate",children:ee.name}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ee.base_url})]}),u.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>U(ee,I),children:u.jsx(rv,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>V(I),children:u.jsx(dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),u.jsx("p",{className:"font-medium",children:ee.client_type})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),u.jsx("p",{className:"font-medium",children:ee.max_retry})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),u.jsx("p",{className:"font-medium",children:ee.timeout})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),u.jsx("p",{className:"font-medium",children:ee.retry_interval})]})]})]},I))}),u.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:u.jsxs(qO,{children:[u.jsx(UO,{children:u.jsxs(fs,{children:[u.jsx(Cn,{children:"名称"}),u.jsx(Cn,{children:"基础URL"}),u.jsx(Cn,{children:"客户端类型"}),u.jsx(Cn,{className:"text-right",children:"最大重试"}),u.jsx(Cn,{className:"text-right",children:"超时(秒)"}),u.jsx(Cn,{className:"text-right",children:"重试间隔(秒)"}),u.jsx(Cn,{className:"text-right",children:"操作"})]})}),u.jsx(FO,{children:ne.length===0?u.jsx(fs,{children:u.jsx(fn,{colSpan:7,className:"text-center text-muted-foreground py-8",children:C?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):ne.map((ee,I)=>u.jsxs(fs,{children:[u.jsx(fn,{className:"font-medium",children:ee.name}),u.jsx(fn,{className:"max-w-xs truncate",title:ee.base_url,children:ee.base_url}),u.jsx(fn,{children:ee.client_type}),u.jsx(fn,{className:"text-right",children:ee.max_retry}),u.jsx(fn,{className:"text-right",children:ee.timeout}),u.jsx(fn,{className:"text-right",children:ee.retry_interval}),u.jsx(fn,{className:"text-right",children:u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>U(ee,I),children:u.jsx(rv,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>V(I),children:u.jsx(dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},I))})]})})]}),u.jsx(Pd,{open:p,onOpenChange:m,children:u.jsxs(Bc,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[u.jsxs(zc,{children:[u.jsx(qc,{children:S!==null?"编辑提供商":"添加提供商"}),u.jsx(Uc,{children:"配置 API 提供商的连接信息和参数"})]}),u.jsxs("div",{className:"grid gap-4 py-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"name",children:"名称 *"}),u.jsx(Ce,{id:"name",value:g?.name||"",onChange:ee=>y(I=>I?{...I,name:ee.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"base_url",children:"基础 URL *"}),u.jsx(Ce,{id:"base_url",value:g?.base_url||"",onChange:ee=>y(I=>I?{...I,base_url:ee.target.value}:null),placeholder:"https://api.example.com/v1"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"api_key",children:"API Key *"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Ce,{id:"api_key",type:N?"text":"password",value:g?.api_key||"",onChange:ee=>y(I=>I?{...I,api_key:ee.target.value}:null),placeholder:"sk-...",className:"flex-1"}),u.jsx(Se,{type:"button",variant:"outline",size:"icon",onClick:()=>T(!N),title:N?"隐藏密钥":"显示密钥",children:N?u.jsx(gj,{className:"h-4 w-4"}):u.jsx(xs,{className:"h-4 w-4"})}),u.jsx(Se,{type:"button",variant:"outline",size:"icon",onClick:W,title:"复制密钥",children:u.jsx(vj,{className:"h-4 w-4"})})]})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"client_type",children:"客户端类型"}),u.jsxs(gr,{value:g?.client_type||"openai",onValueChange:ee=>y(I=>I?{...I,client_type:ee}:null),children:[u.jsx(Gn,{id:"client_type",children:u.jsx(yr,{placeholder:"选择客户端类型"})}),u.jsxs(Kn,{children:[u.jsx(wn,{value:"openai",children:"OpenAI"}),u.jsx(wn,{value:"gemini",children:"Gemini"})]})]})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"max_retry",children:"最大重试"}),u.jsx(Ce,{id:"max_retry",type:"number",min:"0",value:g?.max_retry||2,onChange:ee=>y(I=>I?{...I,max_retry:parseInt(ee.target.value)}:null)})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"timeout",children:"超时(秒)"}),u.jsx(Ce,{id:"timeout",type:"number",min:"1",value:g?.timeout||30,onChange:ee=>y(I=>I?{...I,timeout:parseInt(ee.target.value)}:null)})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),u.jsx(Ce,{id:"retry_interval",type:"number",min:"1",value:g?.retry_interval||10,onChange:ee=>y(I=>I?{...I,retry_interval:parseInt(ee.target.value)}:null)})]})]})]}),u.jsxs(yg,{children:[u.jsx(Se,{variant:"outline",onClick:()=>m(!1),children:"取消"}),u.jsx(Se,{onClick:$,children:"保存"})]})]})}),u.jsx(Wr,{open:w,onOpenChange:A,children:u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:['确定要删除提供商 "',O!==null?e[O]?.name:"",'" 吗? 此操作无法撤销。']})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:H,children:"删除"})]})]})})]})}var CI=1,Kbe=.9,Wbe=.8,Ybe=.17,N1=.1,C1=.999,Xbe=.9999,Zbe=.99,Qbe=/[\\\/_+.#"@\[\(\{&]/,Jbe=/[\\\/_+.#"@\[\(\{&]/g,exe=/[\s-]/,e8=/[\s-]/g;function Pj(e,t,n,r,a,o,s){if(o===t.length)return a===e.length?CI:Zbe;var c=`${a},${o}`;if(s[c]!==void 0)return s[c];for(var f=r.charAt(o),h=n.indexOf(f,a),p=0,m,g,y,S;h>=0;)m=Pj(e,t,n,r,h+1,o+1,s),m>p&&(h===a?m*=CI:Qbe.test(e.charAt(h-1))?(m*=Wbe,y=e.slice(a,h-1).match(Jbe),y&&a>0&&(m*=Math.pow(C1,y.length))):exe.test(e.charAt(h-1))?(m*=Kbe,S=e.slice(a,h-1).match(e8),S&&a>0&&(m*=Math.pow(C1,S.length))):(m*=Ybe,a>0&&(m*=Math.pow(C1,h-a))),e.charAt(h)!==t.charAt(o)&&(m*=Xbe)),(mm&&(m=g*N1)),m>p&&(p=m),h=n.indexOf(f,h+1);return s[c]=p,p}function RI(e){return e.toLowerCase().replace(e8," ")}function txe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Pj(e,t,RI(e),RI(t),0,0,{})}var nxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oo=nxe.reduce((e,t)=>{const n=fO(`Primitive.${t}`),r=_.forwardRef((a,o)=>{const{asChild:s,...c}=a,f=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),of='[cmdk-group=""]',R1='[cmdk-group-items=""]',rxe='[cmdk-group-heading=""]',t8='[cmdk-item=""]',PI=`${t8}:not([aria-disabled="true"])`,Mj="cmdk-item-select",Rl="data-value",axe=(e,t,n)=>txe(e,t,n),n8=_.createContext(void 0),Dd=()=>_.useContext(n8),r8=_.createContext(void 0),HO=()=>_.useContext(r8),a8=_.createContext(void 0),i8=_.forwardRef((e,t)=>{let n=Pl(()=>{var q,X;return{search:"",value:(X=(q=e.value)!=null?q:e.defaultValue)!=null?X:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pl(()=>new Set),a=Pl(()=>new Map),o=Pl(()=>new Map),s=Pl(()=>new Set),c=o8(e),{label:f,children:h,value:p,onValueChange:m,filter:g,shouldFilter:y,loop:S,disablePointerSelection:x=!1,vimBindings:w=!0,...A}=e,O=kn(),E=kn(),N=kn(),T=_.useRef(null),C=mxe();Os(()=>{if(p!==void 0){let q=p.trim();n.current.value=q,R.emit()}},[p]),Os(()=>{C(6,F)},[]);let R=_.useMemo(()=>({subscribe:q=>(s.current.add(q),()=>s.current.delete(q)),snapshot:()=>n.current,setState:(q,X,te)=>{var se,Q,G,ge;if(!Object.is(n.current[q],X)){if(n.current[q]=X,q==="search")B(),z(),C(1,L);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(N);re?re.focus():(se=document.getElementById(O))==null||se.focus()}if(C(7,()=>{var re;n.current.selectedItemId=(re=U())==null?void 0:re.id,R.emit()}),te||C(5,F),((Q=c.current)==null?void 0:Q.value)!==void 0){let re=X??"";(ge=(G=c.current).onValueChange)==null||ge.call(G,re);return}}R.emit()}},emit:()=>{s.current.forEach(q=>q())}}),[]),M=_.useMemo(()=>({value:(q,X,te)=>{var se;X!==((se=o.current.get(q))==null?void 0:se.value)&&(o.current.set(q,{value:X,keywords:te}),n.current.filtered.items.set(q,k(X,te)),C(2,()=>{z(),R.emit()}))},item:(q,X)=>(r.current.add(q),X&&(a.current.has(X)?a.current.get(X).add(q):a.current.set(X,new Set([q]))),C(3,()=>{B(),z(),n.current.value||L(),R.emit()}),()=>{o.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let te=U();C(4,()=>{B(),te?.getAttribute("id")===q&&L(),R.emit()})}),group:q=>(a.current.has(q)||a.current.set(q,new Set),()=>{o.current.delete(q),a.current.delete(q)}),filter:()=>c.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:O,inputId:N,labelId:E,listInnerRef:T}),[]);function k(q,X){var te,se;let Q=(se=(te=c.current)==null?void 0:te.filter)!=null?se:axe;return q?Q(q,n.current.search,X):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let q=n.current.filtered.items,X=[];n.current.filtered.groups.forEach(se=>{let Q=a.current.get(se),G=0;Q.forEach(ge=>{let re=q.get(ge);G=Math.max(re,G)}),X.push([se,G])});let te=T.current;W().sort((se,Q)=>{var G,ge;let re=se.getAttribute("id"),pe=Q.getAttribute("id");return((G=q.get(pe))!=null?G:0)-((ge=q.get(re))!=null?ge:0)}).forEach(se=>{let Q=se.closest(R1);Q?Q.appendChild(se.parentElement===Q?se:se.closest(`${R1} > *`)):te.appendChild(se.parentElement===te?se:se.closest(`${R1} > *`))}),X.sort((se,Q)=>Q[1]-se[1]).forEach(se=>{var Q;let G=(Q=T.current)==null?void 0:Q.querySelector(`${of}[${Rl}="${encodeURIComponent(se[0])}"]`);G?.parentElement.appendChild(G)})}function L(){let q=W().find(te=>te.getAttribute("aria-disabled")!=="true"),X=q?.getAttribute(Rl);R.setState("value",X||void 0)}function B(){var q,X,te,se;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let Q=0;for(let G of r.current){let ge=(X=(q=o.current.get(G))==null?void 0:q.value)!=null?X:"",re=(se=(te=o.current.get(G))==null?void 0:te.keywords)!=null?se:[],pe=k(ge,re);n.current.filtered.items.set(G,pe),pe>0&&Q++}for(let[G,ge]of a.current)for(let re of ge)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=Q}function F(){var q,X,te;let se=U();se&&(((q=se.parentElement)==null?void 0:q.firstChild)===se&&((te=(X=se.closest(of))==null?void 0:X.querySelector(rxe))==null||te.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function U(){var q;return(q=T.current)==null?void 0:q.querySelector(`${t8}[aria-selected="true"]`)}function W(){var q;return Array.from(((q=T.current)==null?void 0:q.querySelectorAll(PI))||[])}function $(q){let X=W()[q];X&&R.setState("value",X.getAttribute(Rl))}function V(q){var X;let te=U(),se=W(),Q=se.findIndex(ge=>ge===te),G=se[Q+q];(X=c.current)!=null&&X.loop&&(G=Q+q<0?se[se.length-1]:Q+q===se.length?se[0]:se[Q+q]),G&&R.setState("value",G.getAttribute(Rl))}function H(q){let X=U(),te=X?.closest(of),se;for(;te&&!se;)te=q>0?hxe(te,of):pxe(te,of),se=te?.querySelector(PI);se?R.setState("value",se.getAttribute(Rl)):V(q)}let ne=()=>$(W().length-1),ee=q=>{q.preventDefault(),q.metaKey?ne():q.altKey?H(1):V(1)},I=q=>{q.preventDefault(),q.metaKey?$(0):q.altKey?H(-1):V(-1)};return _.createElement(Oo.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:q=>{var X;(X=A.onKeyDown)==null||X.call(A,q);let te=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||te))switch(q.key){case"n":case"j":{w&&q.ctrlKey&&ee(q);break}case"ArrowDown":{ee(q);break}case"p":case"k":{w&&q.ctrlKey&&I(q);break}case"ArrowUp":{I(q);break}case"Home":{q.preventDefault(),$(0);break}case"End":{q.preventDefault(),ne();break}case"Enter":{q.preventDefault();let se=U();if(se){let Q=new Event(Mj);se.dispatchEvent(Q)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:gxe},f),Ng(e,q=>_.createElement(r8.Provider,{value:R},_.createElement(n8.Provider,{value:M},q))))}),ixe=_.forwardRef((e,t)=>{var n,r;let a=kn(),o=_.useRef(null),s=_.useContext(a8),c=Dd(),f=o8(e),h=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;Os(()=>{if(!h)return c.item(a,s?.id)},[h]);let p=s8(a,o,[e.value,e.children,o],e.keywords),m=HO(),g=yo(C=>C.value&&C.value===p.current),y=yo(C=>h||c.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);_.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(Mj,S),()=>C.removeEventListener(Mj,S)},[y,e.onSelect,e.disabled]);function S(){var C,R;x(),(R=(C=f.current).onSelect)==null||R.call(C,p.current)}function x(){m.setState("value",p.current,!0)}if(!y)return null;let{disabled:w,value:A,onSelect:O,forceMount:E,keywords:N,...T}=e;return _.createElement(Oo.div,{ref:Yr(o,t),...T,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!g,"data-disabled":!!w,"data-selected":!!g,onPointerMove:w||c.getDisablePointerSelection()?void 0:x,onClick:w?void 0:S},e.children)}),oxe=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=kn(),c=_.useRef(null),f=_.useRef(null),h=kn(),p=Dd(),m=yo(y=>a||p.filter()===!1?!0:y.search?y.filtered.groups.has(s):!0);Os(()=>p.group(s),[]),s8(s,c,[e.value,e.heading,f]);let g=_.useMemo(()=>({id:s,forceMount:a}),[a]);return _.createElement(Oo.div,{ref:Yr(c,t),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&_.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Ng(e,y=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},_.createElement(a8.Provider,{value:g},y))))}),sxe=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=_.useRef(null),o=yo(s=>!s.search);return!n&&!o?null:_.createElement(Oo.div,{ref:Yr(a,t),...r,"cmdk-separator":"",role:"separator"})}),lxe=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=HO(),s=yo(h=>h.search),c=yo(h=>h.selectedItemId),f=Dd();return _.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),_.createElement(Oo.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:a?e.value:s,onChange:h=>{a||o.setState("search",h.target.value),n?.(h.target.value)}})}),cxe=_.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=_.useRef(null),s=_.useRef(null),c=yo(h=>h.selectedItemId),f=Dd();return _.useEffect(()=>{if(s.current&&o.current){let h=s.current,p=o.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=h.offsetHeight;p.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(h),()=>{cancelAnimationFrame(m),g.unobserve(h)}}},[]),_.createElement(Oo.div,{ref:Yr(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:f.listId},Ng(e,h=>_.createElement("div",{ref:Yr(s,f.listInnerRef),"cmdk-list-sizer":""},h)))}),uxe=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:s,...c}=e;return _.createElement(SO,{open:n,onOpenChange:r},_.createElement(_O,{container:s},_.createElement(vg,{"cmdk-overlay":"",className:a}),_.createElement(gg,{"aria-label":e.label,"cmdk-dialog":"",className:o},_.createElement(i8,{ref:t,...c}))))}),fxe=_.forwardRef((e,t)=>yo(n=>n.filtered.count===0)?_.createElement(Oo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),dxe=_.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return _.createElement(Oo.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Ng(e,s=>_.createElement("div",{"aria-hidden":!0},s)))}),Qn=Object.assign(i8,{List:cxe,Item:ixe,Input:lxe,Group:oxe,Separator:sxe,Dialog:uxe,Empty:fxe,Loading:dxe});function hxe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function pxe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function o8(e){let t=_.useRef(e);return Os(()=>{t.current=e}),t}var Os=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Pl(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function yo(e){let t=HO(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function s8(e,t,n,r=[]){let a=_.useRef(),o=Dd();return Os(()=>{var s;let c=(()=>{var h;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(h=p.current.textContent)==null?void 0:h.trim():a.current}})(),f=r.map(h=>h.trim());o.value(e,c,f),(s=t.current)==null||s.setAttribute(Rl,c),a.current=c}),a}var mxe=()=>{let[e,t]=_.useState(),n=Pl(()=>new Map);return Os(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function vxe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ng({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(vxe(t),{ref:t.ref},n(t.props.children)):n(t)}var gxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const l8=_.forwardRef(({className:e,...t},n)=>u.jsx(Qn,{ref:n,className:we("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));l8.displayName=Qn.displayName;const c8=_.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(cg,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Qn.Input,{ref:n,className:we("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})]}));c8.displayName=Qn.Input.displayName;const u8=_.forwardRef(({className:e,...t},n)=>u.jsx(Qn.List,{ref:n,className:we("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));u8.displayName=Qn.List.displayName;const f8=_.forwardRef((e,t)=>u.jsx(Qn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));f8.displayName=Qn.Empty.displayName;const d8=_.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Group,{ref:n,className:we("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}));d8.displayName=Qn.Group.displayName;const yxe=_.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Separator,{ref:n,className:we("-mx-1 h-px bg-border",e),...t}));yxe.displayName=Qn.Separator.displayName;const h8=_.forwardRef(({className:e,...t},n)=>u.jsx(Qn.Item,{ref:n,className:we("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}));h8.displayName=Qn.Item.displayName;const bxe=ug("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 MI({className:e,variant:t,...n}){return u.jsx("div",{className:we(bxe({variant:t}),e),...n})}function xxe({options:e,selected:t,onChange:n,placeholder:r="选择选项...",emptyText:a="未找到选项",className:o}){const[s,c]=_.useState(!1),f=p=>{t.includes(p)?n(t.filter(m=>m!==p)):n([...t,p])},h=p=>{n(t.filter(m=>m!==p))};return u.jsxs(jc,{open:s,onOpenChange:c,children:[u.jsx(Ac,{asChild:!0,children:u.jsxs(Se,{variant:"outline",role:"combobox","aria-expanded":s,className:we("w-full justify-between",o),children:[u.jsx("div",{className:"flex gap-1 flex-wrap",children:t.length===0?u.jsx("span",{className:"text-muted-foreground",children:r}):u.jsxs(u.Fragment,{children:[t.slice(0,2).map(p=>{const m=e.find(g=>g.value===p);return u.jsxs(MI,{variant:"secondary",className:"mr-1 cursor-pointer hover:bg-secondary/80",onClick:g=>{g.stopPropagation(),h(p)},children:[m?.label||p,u.jsx(uO,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},p)}),t.length>2&&u.jsxs(MI,{variant:"secondary",className:"mr-1",children:["+",t.length-2]})]})}),u.jsx(Ahe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),u.jsx(As,{className:"w-full p-0",align:"start",children:u.jsxs(l8,{children:[u.jsx(c8,{placeholder:"搜索...",className:"h-9"}),u.jsxs(u8,{children:[u.jsx(f8,{children:a}),u.jsx(d8,{children:e.map(p=>{const m=t.includes(p.value);return u.jsxs(h8,{value:p.value,onSelect:()=>f(p.value),children:[u.jsx("div",{className:we("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:u.jsx(jf,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),u.jsx("span",{children:p.label})]},p.value)})})]})]})})]})}function wxe(){const[e,t]=_.useState([]),[n,r]=_.useState([]),[a,o]=_.useState([]),[s,c]=_.useState(null),[f,h]=_.useState(!0),[p,m]=_.useState(!1),[g,y]=_.useState(!1),[S,x]=_.useState(!1),[w,A]=_.useState(!1),[O,E]=_.useState(null),[N,T]=_.useState(null),[C,R]=_.useState(!1),[M,k]=_.useState(null),[z,L]=_.useState(""),{toast:B}=Nd(),F=_.useRef(null),U=_.useRef(null),W=_.useRef(!0);_.useEffect(()=>{$()},[]);const $=async()=>{try{h(!0);const Q=await fv(),G=Q.models||[];t(G),o(G.map(re=>re.name));const ge=Q.api_providers||[];r(ge.map(re=>re.name)),c(Q.model_task_config||null),x(!1),W.current=!1}catch(Q){console.error("加载配置失败:",Q)}finally{h(!1)}},V=_.useCallback(async Q=>{if(!W.current)try{y(!0),await Rj("models",Q),x(!1)}catch(G){console.error("自动保存模型列表失败:",G),x(!0)}finally{y(!1)}},[]),H=_.useCallback(async Q=>{if(!W.current)try{y(!0),await Rj("model_task_config",Q),x(!1)}catch(G){console.error("自动保存任务配置失败:",G),x(!0)}finally{y(!1)}},[]);_.useEffect(()=>{if(!W.current)return x(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{V(e)},2e3),()=>{F.current&&clearTimeout(F.current)}},[e,V]),_.useEffect(()=>{if(!(W.current||!s))return x(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{H(s)},2e3),()=>{U.current&&clearTimeout(U.current)}},[s,H]);const ne=async()=>{try{m(!0),F.current&&clearTimeout(F.current),U.current&&clearTimeout(U.current);const Q=await fv();Q.models=e,Q.model_task_config=s,await JU(Q),x(!1),B({title:"保存成功",description:"模型配置已保存"}),await $()}catch(Q){console.error("保存配置失败:",Q),B({title:"保存失败",description:Q.message,variant:"destructive"})}finally{m(!1)}},ee=(Q,G)=>{E(Q||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),T(G),A(!0)},I=()=>{if(O){if(N!==null){const Q=[...e];Q[N]=O,t(Q)}else t([...e,O]);A(!1),E(null),T(null)}},q=Q=>{k(Q),R(!0)},X=()=>{if(M!==null){const Q=e.filter((G,ge)=>ge!==M);t(Q),B({title:"删除成功",description:"模型已从列表中移除"})}R(!1),k(null)},te=(Q,G,ge)=>{s&&c({...s,[Q]:{...s[Q],[G]:ge}})},se=e.filter(Q=>{if(!z)return!0;const G=z.toLowerCase();return Q.name.toLowerCase().includes(G)||Q.model_identifier.toLowerCase().includes(G)||Q.api_provider.toLowerCase().includes(G)});return f?u.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:u.jsx("div",{className:"flex items-center justify-center h-64",children:u.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):u.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),u.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),u.jsxs(Se,{onClick:ne,disabled:p||g||!S,size:"sm",className:"w-full sm:w-auto",children:[u.jsx(cO,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),p?"保存中...":g?"自动保存中...":S?"保存配置":"已保存"]})]}),u.jsxs(Yl,{defaultValue:"models",className:"w-full",children:[u.jsxs(ps,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[u.jsx(St,{value:"models",children:"模型配置"}),u.jsx(St,{value:"tasks",children:"模型任务配置"})]}),u.jsxs(pr,{className:"h-[calc(100vh-320px)]",children:[u.jsxs(Rt,{value:"models",className:"space-y-4 mt-0",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),u.jsxs(Se,{onClick:()=>ee(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[u.jsx(Dn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[u.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[u.jsx(cg,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),u.jsx(Ce,{placeholder:"搜索模型名称、标识符或提供商...",value:z,onChange:Q=>L(Q.target.value),className:"pl-9"})]}),z&&u.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",se.length," 个结果"]})]}),u.jsx("div",{className:"md:hidden space-y-3",children:se.length===0?u.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的模型":"暂无模型配置"}):se.map((Q,G)=>u.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("h3",{className:"font-semibold text-base",children:Q.name}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",title:Q.model_identifier,children:Q.model_identifier})]}),u.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>ee(Q,G),children:u.jsx(rv,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>q(G),children:u.jsx(dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),u.jsx("p",{className:"font-medium",children:Q.api_provider})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),u.jsx("p",{className:"font-medium",children:Q.force_stream_mode?"是":"否"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),u.jsxs("p",{className:"font-medium",children:["¥",Q.price_in,"/M"]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),u.jsxs("p",{className:"font-medium",children:["¥",Q.price_out,"/M"]})]})]})]},G))}),u.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:u.jsxs(qO,{children:[u.jsx(UO,{children:u.jsxs(fs,{children:[u.jsx(Cn,{children:"模型名称"}),u.jsx(Cn,{children:"模型标识符"}),u.jsx(Cn,{children:"提供商"}),u.jsx(Cn,{className:"text-right",children:"输入价格"}),u.jsx(Cn,{className:"text-right",children:"输出价格"}),u.jsx(Cn,{className:"text-center",children:"强制流式"}),u.jsx(Cn,{className:"text-right",children:"操作"})]})}),u.jsx(FO,{children:se.length===0?u.jsx(fs,{children:u.jsx(fn,{colSpan:7,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的模型":"暂无模型配置"})}):se.map((Q,G)=>u.jsxs(fs,{children:[u.jsx(fn,{className:"font-medium",children:Q.name}),u.jsx(fn,{className:"max-w-xs truncate",title:Q.model_identifier,children:Q.model_identifier}),u.jsx(fn,{children:Q.api_provider}),u.jsxs(fn,{className:"text-right",children:["¥",Q.price_in,"/M"]}),u.jsxs(fn,{className:"text-right",children:["¥",Q.price_out,"/M"]}),u.jsx(fn,{className:"text-center",children:Q.force_stream_mode?"是":"否"}),u.jsx(fn,{className:"text-right",children:u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>ee(Q,G),children:u.jsx(rv,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),u.jsx(Se,{variant:"ghost",size:"sm",onClick:()=>q(G),children:u.jsx(dn,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},G))})]})})]}),u.jsxs(Rt,{value:"tasks",className:"space-y-6 mt-0",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),s&&u.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[u.jsx(ia,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:s.utils,modelNames:a,onChange:(Q,G)=>te("utils",Q,G)}),u.jsx(ia,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:s.utils_small,modelNames:a,onChange:(Q,G)=>te("utils_small",Q,G)}),u.jsx(ia,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:s.tool_use,modelNames:a,onChange:(Q,G)=>te("tool_use",Q,G)}),u.jsx(ia,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:s.replyer,modelNames:a,onChange:(Q,G)=>te("replyer",Q,G)}),u.jsx(ia,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:s.planner,modelNames:a,onChange:(Q,G)=>te("planner",Q,G)}),u.jsx(ia,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:s.vlm,modelNames:a,onChange:(Q,G)=>te("vlm",Q,G),hideTemperature:!0}),u.jsx(ia,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:s.voice,modelNames:a,onChange:(Q,G)=>te("voice",Q,G),hideTemperature:!0,hideMaxTokens:!0}),u.jsx(ia,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:s.embedding,modelNames:a,onChange:(Q,G)=>te("embedding",Q,G),hideTemperature:!0,hideMaxTokens:!0}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),u.jsx(ia,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:s.lpmm_entity_extract,modelNames:a,onChange:(Q,G)=>te("lpmm_entity_extract",Q,G)}),u.jsx(ia,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:s.lpmm_rdf_build,modelNames:a,onChange:(Q,G)=>te("lpmm_rdf_build",Q,G)}),u.jsx(ia,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:s.lpmm_qa,modelNames:a,onChange:(Q,G)=>te("lpmm_qa",Q,G)})]})]})]})]})]}),u.jsx(Pd,{open:w,onOpenChange:A,children:u.jsxs(Bc,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[u.jsxs(zc,{children:[u.jsx(qc,{children:N!==null?"编辑模型":"添加模型"}),u.jsx(Uc,{children:"配置模型的基本信息和参数"})]}),u.jsxs("div",{className:"grid gap-4 py-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"model_name",children:"模型名称 *"}),u.jsx(Ce,{id:"model_name",value:O?.name||"",onChange:Q=>E(G=>G?{...G,name:Q.target.value}:null),placeholder:"例如: qwen3-30b"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"model_identifier",children:"模型标识符 *"}),u.jsx(Ce,{id:"model_identifier",value:O?.model_identifier||"",onChange:Q=>E(G=>G?{...G,model_identifier:Q.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"api_provider",children:"API 提供商 *"}),u.jsxs(gr,{value:O?.api_provider||"",onValueChange:Q=>E(G=>G?{...G,api_provider:Q}:null),children:[u.jsx(Gn,{id:"api_provider",children:u.jsx(yr,{placeholder:"选择提供商"})}),u.jsx(Kn,{children:n.map(Q=>u.jsx(wn,{value:Q,children:Q},Q))})]})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),u.jsx(Ce,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in||0,onChange:Q=>E(G=>G?{...G,price_in:parseFloat(Q.target.value)}:null)})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),u.jsx(Ce,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out||0,onChange:Q=>E(G=>G?{...G,price_out:parseFloat(Q.target.value)}:null)})]})]}),u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(_t,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:Q=>E(G=>G?{...G,force_stream_mode:Q}:null)}),u.jsx(ve,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),u.jsxs(yg,{children:[u.jsx(Se,{variant:"outline",onClick:()=>A(!1),children:"取消"}),u.jsx(Se,{onClick:I,children:"保存"})]})]})}),u.jsx(Wr,{open:C,onOpenChange:R,children:u.jsxs(Sr,{children:[u.jsxs(_r,{children:[u.jsx(Ar,{children:"确认删除"}),u.jsxs(Or,{children:['确定要删除模型 "',M!==null?e[M]?.name:"",'" 吗? 此操作无法撤销。']})]}),u.jsxs(jr,{children:[u.jsx(Tr,{children:"取消"}),u.jsx(Er,{onClick:X,children:"删除"})]})]})})]})}function ia({title:e,description:t,taskConfig:n,modelNames:r,onChange:a,hideTemperature:o=!1,hideMaxTokens:s=!1}){const c=f=>{a("model_list",f)};return u.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),u.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"模型列表"}),u.jsx(xxe,{options:r.map(f=>({label:f,value:f})),selected:n.model_list||[],onChange:c,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"温度"}),u.jsx(Ce,{type:"number",step:"0.1",min:"0",max:"2",value:n.temperature||.3,onChange:f=>a("temperature",parseFloat(f.target.value))})]}),!s&&u.jsxs("div",{className:"grid gap-2",children:[u.jsx(ve,{children:"最大 Token"}),u.jsx(Ce,{type:"number",step:"1",min:"1",value:n.max_tokens||1024,onChange:f=>a("max_tokens",parseInt(f.target.value))})]})]})]})]})}function Sxe(){return u.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),u.jsx("div",{className:"rounded-lg border bg-card p-6 sm:p-8",children:u.jsx("p",{className:"text-muted-foreground text-center",children:"表情包管理功能开发中..."})})]})}function _xe(){return u.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表达方式管理"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表达方式和话术模板"})]}),u.jsx("div",{className:"rounded-lg border bg-card p-6 sm:p-8",children:u.jsx("p",{className:"text-muted-foreground text-center",children:"表达方式管理功能开发中..."})})]})}function jxe(){return u.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"人物关系管理"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦与用户的关系数据"})]}),u.jsx("div",{className:"rounded-lg border bg-card p-6 sm:p-8",children:u.jsx("p",{className:"text-muted-foreground text-center",children:"人物关系管理功能开发中..."})})]})}function Axe(){return u.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"日志查看器"}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),u.jsx("div",{className:"rounded-lg border bg-card p-6 sm:p-8",children:u.jsx("p",{className:"text-muted-foreground text-center",children:"日志查看器功能开发中..."})})]})}function Oxe({children:e}){qve();const[t,n]=_.useState(!0),[r,a]=_.useState(!1),{theme:o,setTheme:s}=hO(),c=JV(),f=Es(),h=[{title:"概览",items:[{icon:tq,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:eq,label:"麦麦主程序配置",path:"/config/bot"},{icon:spe,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:ghe,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:dpe,label:"表情包管理",path:"/resource/emoji"},{icon:nq,label:"表达方式管理",path:"/resource/expression"},{icon:wpe,label:"人物关系管理",path:"/resource/relationship"}]},{title:"运维与监控",items:[{icon:J5,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:aq,label:"系统设置",path:"/settings"}]}],m=o==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o,g=()=>{localStorage.removeItem("access-token"),f({to:"/auth"})};return u.jsxs("div",{className:"flex h-screen overflow-hidden",children:[u.jsxs("aside",{className:we("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0",t?"w-64":"w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[u.jsxs("div",{className:"flex h-16 items-center border-b px-4",children:[u.jsx("div",{className:we("relative flex items-center justify-center flex-1 transition-all",!t&&"flex-none w-8"),children:t?u.jsxs("div",{className:"relative inline-block",children:[u.jsx("span",{className:"font-bold text-2xl text-primary",children:"MaiBot"}),u.jsx("span",{className:"absolute -top-1 -right-10 text-[10px] font-medium text-muted-foreground",children:Jpe()})]}):u.jsx("span",{className:"font-bold text-primary text-2xl",children:"M"})}),u.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block flex-shrink-0 ml-2",children:u.jsx(whe,{className:we("h-4 w-4 transition-transform",!t&&"rotate-180")})})]}),u.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:u.jsx("ul",{className:"space-y-6",children:h.map((y,S)=>u.jsxs("li",{children:[t&&u.jsx("div",{className:"mb-2 px-3",children:u.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60",children:y.title})}),!t&&S>0&&u.jsx("div",{className:"mb-4 border-t border-border"}),u.jsx("ul",{className:"space-y-1",children:y.items.map(x=>{const w=c({to:x.path}),A=x.icon;return u.jsx("li",{className:"relative",children:u.jsxs(Gj,{to:x.path,className:we("relative flex items-center gap-3 rounded-lg px-3 py-2 transition-colors","hover:bg-accent hover:text-accent-foreground",w?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",!t&&"justify-center px-0"),onClick:()=>a(!1),children:[w&&u.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary"}),u.jsx(A,{className:we("h-5 w-5 flex-shrink-0",!t&&"mx-auto",w&&"text-primary"),strokeWidth:2,fill:"none"}),t&&u.jsx("span",{className:we("text-sm font-medium",w&&"font-semibold"),children:x.label})]})},x.path)})})]},y.title))})})]}),r&&u.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>a(!1)}),u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card px-4",children:[u.jsx("div",{className:"flex items-center gap-4",children:u.jsx("button",{onClick:()=>a(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:u.jsx(Qhe,{className:"h-5 w-5"})})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:y=>{Dpe(m==="dark"?"light":"dark",s,y)},className:"rounded-lg p-2 hover:bg-accent",title:m==="dark"?"切换到浅色模式":"切换到深色模式",children:m==="dark"?u.jsx(iq,{className:"h-5 w-5"}):u.jsx(rq,{className:"h-5 w-5"})}),u.jsx("div",{className:"h-6 w-px bg-border"}),u.jsxs(Se,{variant:"ghost",size:"sm",onClick:g,className:"gap-2",title:"登出系统",children:[u.jsx(Xhe,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),u.jsx("main",{className:"flex-1 overflow-y-auto bg-background p-6",children:e})]})]})}const Cg=HV({component:()=>u.jsxs(u.Fragment,{children:[u.jsx(Kj,{}),u.jsx(oG,{})]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!g6())throw BI({to:"/auth"})}}),Exe=Cr({getParentRoute:()=>Cg,path:"/auth",component:Uve}),qa=Cr({getParentRoute:()=>Cg,id:"protected",component:()=>u.jsx(Oxe,{children:u.jsx(Kj,{})})}),Txe=Cr({getParentRoute:()=>qa,path:"/",component:Mpe}),Nxe=Cr({getParentRoute:()=>qa,path:"/config/bot",component:Cbe}),Cxe=Cr({getParentRoute:()=>qa,path:"/config/modelProvider",component:Gbe}),Rxe=Cr({getParentRoute:()=>qa,path:"/config/model",component:wxe}),Pxe=Cr({getParentRoute:()=>qa,path:"/resource/emoji",component:Sxe}),Mxe=Cr({getParentRoute:()=>qa,path:"/resource/expression",component:_xe}),kxe=Cr({getParentRoute:()=>qa,path:"/resource/relationship",component:jxe}),Dxe=Cr({getParentRoute:()=>qa,path:"/logs",component:Axe}),Lxe=Cr({getParentRoute:()=>qa,path:"/settings",component:kve}),$xe=Cr({getParentRoute:()=>Cg,path:"*",component:y6}),Ixe=Cg.addChildren([Exe,qa.addChildren([Txe,Nxe,Cxe,Rxe,Pxe,Mxe,kxe,Dxe,Lxe]),$xe]),Bxe=e7({routeTree:Ixe,defaultNotFoundComponent:y6});function zxe({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...r}){const[a,o]=_.useState(()=>localStorage.getItem(n)||t);_.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),a==="system"){const f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(f);return}c.classList.add(a)},[a]),_.useEffect(()=>{const c=localStorage.getItem("accent-color");if(c){const f=document.documentElement,p={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%"}}[c];p&&f.style.setProperty("--primary",p.hsl)}},[]);const s={theme:a,setTheme:c=>{localStorage.setItem(n,c),o(c)}};return u.jsx(sq.Provider,{...r,value:s,children:e})}function qxe({children:e,defaultEnabled:t=!0,storageKey:n="enable-animations"}){const[r,a]=_.useState(()=>{const s=localStorage.getItem(n);return s!==null?s==="true":t});_.useEffect(()=>{const s=document.documentElement;r?s.classList.remove("no-animations"):s.classList.add("no-animations"),localStorage.setItem(n,String(r))},[r,n]);const o={enableAnimations:r,setEnableAnimations:a};return u.jsx(lq.Provider,{value:o,children:e})}var VO="ToastProvider",[GO,Uxe,Fxe]=Sv("Toast"),[p8]=Zr("Toast",[Fxe]),[Hxe,Rg]=p8(VO),m8=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:s}=e,[c,f]=_.useState(null),[h,p]=_.useState(0),m=_.useRef(!1),g=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${VO}\`. Expected non-empty \`string\`.`),u.jsx(GO.Provider,{scope:t,children:u.jsx(Hxe,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:o,toastCount:h,viewport:c,onViewportChange:f,onToastAdd:_.useCallback(()=>p(y=>y+1),[]),onToastRemove:_.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:s})})};m8.displayName=VO;var v8="ToastViewport",Vxe=["F8"],kj="toast.viewportPause",Dj="toast.viewportResume",g8=_.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Vxe,label:a="Notifications ({hotkey})",...o}=e,s=Rg(v8,n),c=Uxe(n),f=_.useRef(null),h=_.useRef(null),p=_.useRef(null),m=_.useRef(null),g=Ve(t,m,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=s.toastCount>0;_.useEffect(()=>{const w=A=>{r.length!==0&&r.every(E=>A[E]||A.code===E)&&m.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),_.useEffect(()=>{const w=f.current,A=m.current;if(S&&w&&A){const O=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent(kj);A.dispatchEvent(C),s.isClosePausedRef.current=!0}},E=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(Dj);A.dispatchEvent(C),s.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&E()},T=()=>{w.contains(document.activeElement)||E()};return w.addEventListener("focusin",O),w.addEventListener("focusout",N),w.addEventListener("pointermove",O),w.addEventListener("pointerleave",T),window.addEventListener("blur",O),window.addEventListener("focus",E),()=>{w.removeEventListener("focusin",O),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",O),w.removeEventListener("pointerleave",T),window.removeEventListener("blur",O),window.removeEventListener("focus",E)}}},[S,s.isClosePausedRef]);const x=_.useCallback(({tabbingDirection:w})=>{const O=c().map(E=>{const N=E.ref.current,T=[N,...a0e(N)];return w==="forwards"?T:T.reverse()});return(w==="forwards"?O.reverse():O).flat()},[c]);return _.useEffect(()=>{const w=m.current;if(w){const A=O=>{const E=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!E){const T=document.activeElement,C=O.shiftKey;if(O.target===w&&C){h.current?.focus();return}const k=x({tabbingDirection:C?"backwards":"forwards"}),z=k.findIndex(L=>L===T);P1(k.slice(z+1))?O.preventDefault():C?h.current?.focus():p.current?.focus()}};return w.addEventListener("keydown",A),()=>w.removeEventListener("keydown",A)}},[c,x]),u.jsxs(lme,{ref:f,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&u.jsx(Lj,{ref:h,onFocusFromOutsideViewport:()=>{const w=x({tabbingDirection:"forwards"});P1(w)}}),u.jsx(GO.Slot,{scope:n,children:u.jsx(Me.ol,{tabIndex:-1,...o,ref:g})}),S&&u.jsx(Lj,{ref:p,onFocusFromOutsideViewport:()=>{const w=x({tabbingDirection:"backwards"});P1(w)}})]})});g8.displayName=v8;var y8="ToastFocusProxy",Lj=_.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,o=Rg(y8,n);return u.jsx(IO,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:s=>{const c=s.relatedTarget;!o.viewport?.contains(c)&&r()}})});Lj.displayName=y8;var Ld="Toast",Gxe="toast.swipeStart",Kxe="toast.swipeMove",Wxe="toast.swipeCancel",Yxe="toast.swipeEnd",b8=_.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:o,...s}=e,[c,f]=xi({prop:r,defaultProp:a??!0,onChange:o,caller:Ld});return u.jsx(Qr,{present:n||c,children:u.jsx(Qxe,{open:c,...s,ref:t,onClose:()=>f(!1),onPause:Wt(e.onPause),onResume:Wt(e.onResume),onSwipeStart:Ee(e.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(e.onSwipeMove,h=>{const{x:p,y:m}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:Ee(e.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ee(e.onSwipeEnd,h=>{const{x:p,y:m}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),f(!1)})})})});b8.displayName=Ld;var[Xxe,Zxe]=p8(Ld,{onClose(){}}),Qxe=_.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:o,onClose:s,onEscapeKeyDown:c,onPause:f,onResume:h,onSwipeStart:p,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:y,...S}=e,x=Rg(Ld,n),[w,A]=_.useState(null),O=Ve(t,U=>A(U)),E=_.useRef(null),N=_.useRef(null),T=a||x.duration,C=_.useRef(0),R=_.useRef(T),M=_.useRef(0),{onToastAdd:k,onToastRemove:z}=x,L=Wt(()=>{w?.contains(document.activeElement)&&x.viewport?.focus(),s()}),B=_.useCallback(U=>{!U||U===1/0||(window.clearTimeout(M.current),C.current=new Date().getTime(),M.current=window.setTimeout(L,U))},[L]);_.useEffect(()=>{const U=x.viewport;if(U){const W=()=>{B(R.current),h?.()},$=()=>{const V=new Date().getTime()-C.current;R.current=R.current-V,window.clearTimeout(M.current),f?.()};return U.addEventListener(kj,$),U.addEventListener(Dj,W),()=>{U.removeEventListener(kj,$),U.removeEventListener(Dj,W)}}},[x.viewport,T,f,h,B]),_.useEffect(()=>{o&&!x.isClosePausedRef.current&&B(T)},[o,T,x.isClosePausedRef,B]),_.useEffect(()=>(k(),()=>z()),[k,z]);const F=_.useMemo(()=>w?O8(w):null,[w]);return x.viewport?u.jsxs(u.Fragment,{children:[F&&u.jsx(Jxe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:F}),u.jsx(Xxe,{scope:n,onClose:L,children:Ts.createPortal(u.jsx(GO.ItemSlot,{scope:n,children:u.jsx(sme,{asChild:!0,onEscapeKeyDown:Ee(c,()=>{x.isFocusedToastEscapeKeyDownRef.current||L(),x.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(Me.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":x.swipeDirection,...S,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ee(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(x.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:Ee(e.onPointerDown,U=>{U.button===0&&(E.current={x:U.clientX,y:U.clientY})}),onPointerMove:Ee(e.onPointerMove,U=>{if(!E.current)return;const W=U.clientX-E.current.x,$=U.clientY-E.current.y,V=!!N.current,H=["left","right"].includes(x.swipeDirection),ne=["left","up"].includes(x.swipeDirection)?Math.min:Math.max,ee=H?ne(0,W):0,I=H?0:ne(0,$),q=U.pointerType==="touch"?10:2,X={x:ee,y:I},te={originalEvent:U,delta:X};V?(N.current=X,Tp(Kxe,m,te,{discrete:!1})):kI(X,x.swipeDirection,q)?(N.current=X,Tp(Gxe,p,te,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(W)>q||Math.abs($)>q)&&(E.current=null)}),onPointerUp:Ee(e.onPointerUp,U=>{const W=N.current,$=U.target;if($.hasPointerCapture(U.pointerId)&&$.releasePointerCapture(U.pointerId),N.current=null,E.current=null,W){const V=U.currentTarget,H={originalEvent:U,delta:W};kI(W,x.swipeDirection,x.swipeThreshold)?Tp(Yxe,y,H,{discrete:!0}):Tp(Wxe,g,H,{discrete:!0}),V.addEventListener("click",ne=>ne.preventDefault(),{once:!0})}})})})}),x.viewport)})]}):null}),Jxe=e=>{const{__scopeToast:t,children:n,...r}=e,a=Rg(Ld,t),[o,s]=_.useState(!1),[c,f]=_.useState(!1);return n0e(()=>s(!0)),_.useEffect(()=>{const h=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(h)},[]),c?null:u.jsx(Rd,{asChild:!0,children:u.jsx(IO,{...r,children:o&&u.jsxs(u.Fragment,{children:[a.label," ",n]})})})},e0e="ToastTitle",x8=_.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(Me.div,{...r,ref:t})});x8.displayName=e0e;var t0e="ToastDescription",w8=_.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(Me.div,{...r,ref:t})});w8.displayName=t0e;var S8="ToastAction",_8=_.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?u.jsx(A8,{altText:n,asChild:!0,children:u.jsx(KO,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${S8}\`. Expected non-empty \`string\`.`),null)});_8.displayName=S8;var j8="ToastClose",KO=_.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=Zxe(j8,n);return u.jsx(A8,{asChild:!0,children:u.jsx(Me.button,{type:"button",...r,ref:t,onClick:Ee(e.onClick,a.onClose)})})});KO.displayName=j8;var A8=_.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return u.jsx(Me.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function O8(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),r0e(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...O8(r))}}),t}function Tp(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?K4(a,o):a.dispatchEvent(o)}var kI=(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 n0e(e=()=>{}){const t=Wt(e);nn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function r0e(e){return e.nodeType===e.ELEMENT_NODE}function a0e(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 P1(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var i0e=m8,E8=g8,T8=b8,N8=x8,C8=w8,R8=_8,P8=KO;const o0e=i0e,M8=_.forwardRef(({className:e,...t},n)=>u.jsx(E8,{ref:n,className:we("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}));M8.displayName=E8.displayName;const s0e=ug("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"}}),k8=_.forwardRef(({className:e,variant:t,...n},r)=>u.jsx(T8,{ref:r,className:we(s0e({variant:t}),e),...n}));k8.displayName=T8.displayName;const l0e=_.forwardRef(({className:e,...t},n)=>u.jsx(R8,{ref:n,className:we("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}));l0e.displayName=R8.displayName;const D8=_.forwardRef(({className:e,...t},n)=>u.jsx(P8,{ref:n,className:we("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:u.jsx(uO,{className:"h-4 w-4"})}));D8.displayName=P8.displayName;const L8=_.forwardRef(({className:e,...t},n)=>u.jsx(N8,{ref:n,className:we("text-sm font-semibold [&+div]:text-xs",e),...t}));L8.displayName=N8.displayName;const $8=_.forwardRef(({className:e,...t},n)=>u.jsx(C8,{ref:n,className:we("text-sm opacity-90",e),...t}));$8.displayName=C8.displayName;function c0e(){const{toasts:e}=Nd();return u.jsxs(o0e,{children:[e.map(function({id:t,title:n,description:r,action:a,...o}){return u.jsxs(k8,{...o,children:[u.jsxs("div",{className:"grid gap-1",children:[n&&u.jsx(L8,{children:n}),r&&u.jsx($8,{children:r})]}),a,u.jsx(D8,{})]},t)}),u.jsx(M8,{})]})}d9.createRoot(document.getElementById("root")).render(u.jsx(_.StrictMode,{children:u.jsx(zxe,{defaultTheme:"system",children:u.jsxs(qxe,{children:[u.jsx(r7,{router:Bxe}),u.jsx(c0e,{})]})})}));export{p0e as A,rG as D,m0e as F,y0e as M,g0e as S,u0e as a,os as b,fi as c,S0e as d,Ln as e,_n as f,K7 as g,U7 as h,On as i,q7 as j,E2 as k,b0e as l,h0e as m,qe as n,z1 as o,Np as p,Zb as q,dr as r,V7 as s,x0e as t,m7 as u,v0e as v,h7 as w,nG as x,I7 as y,w0e as z};