Files
mai-bot/webui/dist/assets/index-DgvN-P_n.js
墨梓柒 4485e570a2 upload WebUI 0.11.5 Beta.0a6f11a DashBoard after Build Files
commit hash : 0a6f11a6fe16a18ce9dbf59453e82e72b6291ac9
2025-11-20 11:10:24 +08:00

49 lines
758 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{r as x,j as e,u as qn,R as Ne,d as K_,L as Q_,e as Z_,f as Ts,g as J_,h as e2,O as ry,b as t2,k as s2}from"./router-BWgTyY51.js";import{a as n2,b as a2}from"./react-vendor-Dtc2IqVY.js";import{c as iy,R as l2,T as r2,L as i2,a as o2,C as Xc,X as Kc,Y as Ii,b as c2,B as uf,d as Qc,P as d2,e as u2,f as m2}from"./charts-DU5SeejN.js";import{c as Dn,a as _d,u as jn,P as dt,b as be,d as Tt,e as xo,f as Qa,g as ws,h as Is,i as oy,j as rh,k as ih,S as f2,l as cy,m as dy,R as uy,O as Cd,n as oh,C as kd,o as ch,T as dh,D as uh,p as mh,q as my,r as fy,W as h2,s as hy,I as x2,t as xy,v as py,w as p2,x as gy,V as g2,L as vy,y as jy,z as v2,A as j2,B as yy,E as y2,F as b2,G as Ga,H as Td,J as Wr,K as by,M as Ny,N as wy,Q as Sy,U as fh,X as hh,Y as Ed,Z as Md,_ as xh,$ as _y,a0 as N2,a1 as Cy,a2 as w2,a3 as S2,a4 as ky,a5 as _2}from"./ui-vendor-nTGLnMlb.js";import{R as xa,A as C2,D as k2,a as T2,Z as ao,C as _l,M as po,T as E2,X as go,P as Ty,S as M2,b as Tn,I as Fr,c as Lr,d as Cl,e as Df,E as Of,f as Mn,g as Ys,h as Af,i as D2,j as Rf,k as zf,L as Zv,K as O2,l as Tl,m as A2,n as R2,F as ph,o as z2,B as P2,U as Ey,p as gh,q as L2,r as B2,s as Gs,H as fd,t as My,u as lo,v as Pf,w as ro,x as vh,y as jh,z as ys,G as ft,J as hd,N as Yr,O as vo,Q as Ol,V as Al,W as jo,Y as U2,_ as Lf,$ as qr,a0 as Jv,a1 as xd,a2 as H2,a3 as ej,a4 as F2,a5 as Y2,a6 as Bf,a7 as q2,a8 as tj,a9 as so,aa as pd,ab as Dy,ac as Oy,ad as Ay,ae as V2,af as G2,ag as $2,ah as I2,ai as W2,aj as sj,ak as X2}from"./icons-DnP4c9nr.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();var mf={exports:{}},Wi={},ff={exports:{}},hf={};var nj;function K2(){return nj||(nj=1,(function(s){function a(R,O){var L=R.length;R.push(O);e:for(;0<L;){var ee=L-1>>>1,le=R[ee];if(0<c(le,O))R[ee]=O,R[L]=le,L=ee;else break e}}function l(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var O=R[0],L=R.pop();if(L!==O){R[0]=L;e:for(var ee=0,le=R.length,xe=le>>>1;ee<xe;){var F=2*(ee+1)-1,W=R[F],fe=F+1,I=R[fe];if(0>c(W,L))fe<le&&0>c(I,W)?(R[ee]=I,R[fe]=L,ee=fe):(R[ee]=W,R[F]=L,ee=F);else if(fe<le&&0>c(I,L))R[ee]=I,R[fe]=L,ee=fe;else break e}}return O}function c(R,O){var L=R.sortIndex-O.sortIndex;return L!==0?L:R.id-O.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var m=Date,h=m.now();s.unstable_now=function(){return m.now()-h}}var p=[],v=[],g=1,j=null,b=3,w=!1,S=!1,C=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function k(R){for(var O=l(v);O!==null;){if(O.callback===null)i(v);else if(O.startTime<=R)i(v),O.sortIndex=O.expirationTime,a(p,O);else break;O=l(v)}}function D(R){if(C=!1,k(R),!S)if(l(p)!==null)S=!0,A||(A=!0,oe());else{var O=l(v);O!==null&&me(D,O.startTime-R)}}var A=!1,E=-1,B=5,Y=-1;function G(){return N?!0:!(s.unstable_now()-Y<B)}function $(){if(N=!1,A){var R=s.unstable_now();Y=R;var O=!0;try{e:{S=!1,C&&(C=!1,P(E),E=-1),w=!0;var L=b;try{t:{for(k(R),j=l(p);j!==null&&!(j.expirationTime>R&&G());){var ee=j.callback;if(typeof ee=="function"){j.callback=null,b=j.priorityLevel;var le=ee(j.expirationTime<=R);if(R=s.unstable_now(),typeof le=="function"){j.callback=le,k(R),O=!0;break t}j===l(p)&&i(p),k(R)}else i(p);j=l(p)}if(j!==null)O=!0;else{var xe=l(v);xe!==null&&me(D,xe.startTime-R),O=!1}}break e}finally{j=null,b=L,w=!1}O=void 0}}finally{O?oe():A=!1}}}var oe;if(typeof M=="function")oe=function(){M($)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,ae=je.port2;je.port1.onmessage=$,oe=function(){ae.postMessage(null)}}else oe=function(){T($,0)};function me(R,O){E=T(function(){R(s.unstable_now())},O)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(R){R.callback=null},s.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<R?Math.floor(1e3/R):5},s.unstable_getCurrentPriorityLevel=function(){return b},s.unstable_next=function(R){switch(b){case 1:case 2:case 3:var O=3;break;default:O=b}var L=b;b=O;try{return R()}finally{b=L}},s.unstable_requestPaint=function(){N=!0},s.unstable_runWithPriority=function(R,O){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var L=b;b=R;try{return O()}finally{b=L}},s.unstable_scheduleCallback=function(R,O,L){var ee=s.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?ee+L:ee):L=ee,R){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=L+le,R={id:g++,callback:O,priorityLevel:R,startTime:L,expirationTime:le,sortIndex:-1},L>ee?(R.sortIndex=L,a(v,R),l(p)===null&&R===l(v)&&(C?(P(E),E=-1):C=!0,me(D,L-ee))):(R.sortIndex=le,a(p,R),S||w||(S=!0,A||(A=!0,oe()))),R},s.unstable_shouldYield=G,s.unstable_wrapCallback=function(R){var O=b;return function(){var L=b;b=O;try{return R.apply(this,arguments)}finally{b=L}}}})(hf)),hf}var aj;function Q2(){return aj||(aj=1,ff.exports=K2()),ff.exports}var lj;function Z2(){if(lj)return Wi;lj=1;var s=Q2(),a=n2(),l=a2();function i(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var n=t,r=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(r=n.return),t=n.return;while(t)}return n.tag===3?r:null}function m(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(d(t)!==t)throw Error(i(188))}function v(t){var n=t.alternate;if(!n){if(n=d(t),n===null)throw Error(i(188));return n!==t?null:t}for(var r=t,o=n;;){var u=r.return;if(u===null)break;var f=u.alternate;if(f===null){if(o=u.return,o!==null){r=o;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===r)return p(u),t;if(f===o)return p(u),n;f=f.sibling}throw Error(i(188))}if(r.return!==o.return)r=u,o=f;else{for(var y=!1,_=u.child;_;){if(_===r){y=!0,r=u,o=f;break}if(_===o){y=!0,o=u,r=f;break}_=_.sibling}if(!y){for(_=f.child;_;){if(_===r){y=!0,r=f,o=u;break}if(_===o){y=!0,o=f,r=u;break}_=_.sibling}if(!y)throw Error(i(189))}}if(r.alternate!==o)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?t:n}function g(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=g(t),n!==null)return n;t=t.sibling}return null}var j=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function oe(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var je=Symbol.for("react.client.reference");function ae(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===je?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case D:return"Suspense";case A:return"SuspenseList";case Y:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case M:return t.displayName||"Context";case P:return(t._context.displayName||"Context")+".Consumer";case k:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case E:return n=t.displayName||null,n!==null?n:ae(t.type)||"Memo";case B:n=t._payload,t=t._init;try{return ae(t(n))}catch{}}return null}var me=Array.isArray,R=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},ee=[],le=-1;function xe(t){return{current:t}}function F(t){0>le||(t.current=ee[le],ee[le]=null,le--)}function W(t,n){le++,ee[le]=t.current,t.current=n}var fe=xe(null),I=xe(null),ve=xe(null),de=xe(null);function Ce(t,n){switch(W(ve,n),W(I,t),W(fe,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?bv(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=bv(n),t=Nv(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(fe),W(fe,t)}function Q(){F(fe),F(I),F(ve)}function Oe(t){t.memoizedState!==null&&W(de,t);var n=fe.current,r=Nv(n,t.type);n!==r&&(W(I,t),W(fe,r))}function $e(t){I.current===t&&(F(fe),F(I)),de.current===t&&(F(de),qi._currentValue=L)}var re,Pe;function ze(t){if(re===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);re=n&&n[1]||"",Pe=-1<r.stack.indexOf(`
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
`+re+t+Pe}var Zt=!1;function Rs(t,n){if(!t||Zt)return"";Zt=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ne){var J=ne}Reflect.construct(t,[],ue)}else{try{ue.call()}catch(ne){J=ne}t.call(ue.prototype)}}else{try{throw Error()}catch(ne){J=ne}(ue=t())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ne){if(ne&&J&&typeof ne.stack=="string")return[ne.stack,J.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),y=f[0],_=f[1];if(y&&_){var z=y.split(`
`),K=_.split(`
`);for(u=o=0;o<z.length&&!z[o].includes("DetermineComponentFrameRoot");)o++;for(;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;if(o===z.length||u===K.length)for(o=z.length-1,u=K.length-1;1<=o&&0<=u&&z[o]!==K[u];)u--;for(;1<=o&&0<=u;o--,u--)if(z[o]!==K[u]){if(o!==1||u!==1)do if(o--,u--,0>u||z[o]!==K[u]){var ie=`
`+z[o].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=o&&0<=u);break}}}finally{Zt=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?ze(r):""}function An(t,n){switch(t.tag){case 26:case 27:case 5:return ze(t.type);case 16:return ze("Lazy");case 13:return t.child!==n&&n!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return Rs(t.type,!1);case 11:return Rs(t.type.render,!1);case 1:return Rs(t.type,!0);case 31:return ze("Activity");default:return""}}function Le(t){try{var n="",r=null;do n+=An(t,r),r=t,t=t.return;while(t);return n}catch(o){return`
Error generating stack: `+o.message+`
`+o.stack}}var Nn=Object.prototype.hasOwnProperty,ln=s.unstable_scheduleCallback,rn=s.unstable_cancelCallback,Xt=s.unstable_shouldYield,Ds=s.unstable_requestPaint,ke=s.unstable_now,is=s.unstable_getCurrentPriorityLevel,he=s.unstable_ImmediatePriority,Ee=s.unstable_UserBlockingPriority,Ve=s.unstable_NormalPriority,Os=s.unstable_LowPriority,$n=s.unstable_IdlePriority,Hl=s.log,Fl=s.unstable_setDisableYieldValue,se=null,ge=null;function Qe(t){if(typeof Hl=="function"&&Fl(t),ge&&typeof ge.setStrictMode=="function")try{ge.setStrictMode(se,t)}catch{}}var pt=Math.clz32?Math.clz32:Mt,tl=Math.log,We=Math.LN2;function Mt(t){return t>>>=0,t===0?32:31-(tl(t)/We|0)|0}var Be=256,ht=262144,os=4194304;function Xe(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Yl(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var u=0,f=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var _=o&134217727;return _!==0?(o=_&~f,o!==0?u=Xe(o):(y&=_,y!==0?u=Xe(y):r||(r=_&~t,r!==0&&(u=Xe(r))))):(_=o&~f,_!==0?u=Xe(_):y!==0?u=Xe(y):r||(r=o&~t,r!==0&&(u=Xe(r)))),u===0?0:n!==0&&n!==u&&(n&f)===0&&(f=u&-u,r=n&-n,f>=r||f===32&&(r&4194048)!==0)?n:u}function sl(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Zd(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 ql(){var t=os;return os<<=1,(os&62914560)===0&&(os=4194304),t}function nl(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function ni(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function B1(t,n,r,o,u,f){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var _=t.entanglements,z=t.expirationTimes,K=t.hiddenUpdates;for(r=y&~r;0<r;){var ie=31-pt(r),ue=1<<ie;_[ie]=0,z[ie]=-1;var J=K[ie];if(J!==null)for(K[ie]=null,ie=0;ie<J.length;ie++){var ne=J[ie];ne!==null&&(ne.lane&=-536870913)}r&=~ue}o!==0&&nx(t,o,0),f!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=f&~(y&~n))}function nx(t,n,r){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-pt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|r&261930}function ax(t,n){var r=t.entangledLanes|=n;for(t=t.entanglements;r;){var o=31-pt(r),u=1<<o;u&n|t[o]&n&&(t[o]|=n),r&=~u}}function lx(t,n){var r=n&-n;return r=(r&42)!==0?1:Jd(r),(r&(t.suspendedLanes|n))!==0?0:r}function Jd(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function eu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function rx(){var t=O.p;return t!==0?t:(t=window.event,t===void 0?32:Gv(t.type))}function ix(t,n){var r=O.p;try{return O.p=t,n()}finally{O.p=r}}var ja=Math.random().toString(36).slice(2),xs="__reactFiber$"+ja,zs="__reactProps$"+ja,Vl="__reactContainer$"+ja,tu="__reactEvents$"+ja,U1="__reactListeners$"+ja,H1="__reactHandles$"+ja,ox="__reactResources$"+ja,ai="__reactMarker$"+ja;function su(t){delete t[xs],delete t[zs],delete t[tu],delete t[U1],delete t[H1]}function Gl(t){var n=t[xs];if(n)return n;for(var r=t.parentNode;r;){if(n=r[Vl]||r[xs]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(t=Ev(t);t!==null;){if(r=t[xs])return r;t=Ev(t)}return n}t=r,r=t.parentNode}return null}function $l(t){if(t=t[xs]||t[Vl]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function li(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(i(33))}function Il(t){var n=t[ox];return n||(n=t[ox]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function cs(t){t[ai]=!0}var cx=new Set,dx={};function al(t,n){Wl(t,n),Wl(t+"Capture",n)}function Wl(t,n){for(dx[t]=n,t=0;t<n.length;t++)cx.add(n[t])}var F1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ux={},mx={};function Y1(t){return Nn.call(mx,t)?!0:Nn.call(ux,t)?!1:F1.test(t)?mx[t]=!0:(ux[t]=!0,!1)}function Lo(t,n,r){if(Y1(n))if(r===null)t.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+r)}}function Bo(t,n,r){if(r===null)t.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+r)}}function In(t,n,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(n,r,""+o)}}function on(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function fx(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function q1(t,n,r){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return u.call(this)},set:function(y){r=""+y,f.call(this,y)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return r},setValue:function(y){r=""+y},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function nu(t){if(!t._valueTracker){var n=fx(t)?"checked":"value";t._valueTracker=q1(t,n,""+t[n])}}function hx(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var r=n.getValue(),o="";return t&&(o=fx(t)?t.checked?"true":"false":t.value),t=o,t!==r?(n.setValue(t),!0):!1}function Uo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var V1=/[\n"\\]/g;function cn(t){return t.replace(V1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function au(t,n,r,o,u,f,y,_){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+on(n)):t.value!==""+on(n)&&(t.value=""+on(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?lu(t,y,on(n)):r!=null?lu(t,y,on(r)):o!=null&&t.removeAttribute("value"),u==null&&f!=null&&(t.defaultChecked=!!f),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?t.name=""+on(_):t.removeAttribute("name")}function xx(t,n,r,o,u,f,y,_){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),n!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){nu(t);return}r=r!=null?""+on(r):"",n=n!=null?""+on(n):r,_||n===t.value||(t.value=n),t.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=_?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),nu(t)}function lu(t,n,r){n==="number"&&Uo(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Xl(t,n,r,o){if(t=t.options,n){n={};for(var u=0;u<r.length;u++)n["$"+r[u]]=!0;for(r=0;r<t.length;r++)u=n.hasOwnProperty("$"+t[r].value),t[r].selected!==u&&(t[r].selected=u),u&&o&&(t[r].defaultSelected=!0)}else{for(r=""+on(r),n=null,u=0;u<t.length;u++){if(t[u].value===r){t[u].selected=!0,o&&(t[u].defaultSelected=!0);return}n!==null||t[u].disabled||(n=t[u])}n!==null&&(n.selected=!0)}}function px(t,n,r){if(n!=null&&(n=""+on(n),n!==t.value&&(t.value=n),r==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=r!=null?""+on(r):""}function gx(t,n,r,o){if(n==null){if(o!=null){if(r!=null)throw Error(i(92));if(me(o)){if(1<o.length)throw Error(i(93));o=o[0]}r=o}r==null&&(r=""),n=r}r=on(n),t.defaultValue=r,o=t.textContent,o===r&&o!==""&&o!==null&&(t.value=o),nu(t)}function Kl(t,n){if(n){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=n;return}}t.textContent=n}var G1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vx(t,n,r){var o=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,r):typeof r!="number"||r===0||G1.has(n)?n==="float"?t.cssFloat=r:t[n]=(""+r).trim():t[n]=r+"px"}function jx(t,n,r){if(n!=null&&typeof n!="object")throw Error(i(62));if(t=t.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&r[u]!==o&&vx(t,u,o)}else for(var f in n)n.hasOwnProperty(f)&&vx(t,f,n[f])}function ru(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),I1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ho(t){return I1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Wn(){}var iu=null;function ou(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ql=null,Zl=null;function yx(t){var n=$l(t);if(n&&(t=n.stateNode)){var r=t[zs]||null;e:switch(t=n.stateNode,n.type){case"input":if(au(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+cn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var o=r[n];if(o!==t&&o.form===t.form){var u=o[zs]||null;if(!u)throw Error(i(90));au(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<r.length;n++)o=r[n],o.form===t.form&&hx(o)}break e;case"textarea":px(t,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Xl(t,!!r.multiple,n,!1)}}}var cu=!1;function bx(t,n,r){if(cu)return t(n,r);cu=!0;try{var o=t(n);return o}finally{if(cu=!1,(Ql!==null||Zl!==null)&&(kc(),Ql&&(n=Ql,t=Zl,Zl=Ql=null,yx(n),t)))for(n=0;n<t.length;n++)yx(t[n])}}function ri(t,n){var r=t.stateNode;if(r===null)return null;var o=r[zs]||null;if(o===null)return null;r=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var Xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),du=!1;if(Xn)try{var ii={};Object.defineProperty(ii,"passive",{get:function(){du=!0}}),window.addEventListener("test",ii,ii),window.removeEventListener("test",ii,ii)}catch{du=!1}var ya=null,uu=null,Fo=null;function Nx(){if(Fo)return Fo;var t,n=uu,r=n.length,o,u="value"in ya?ya.value:ya.textContent,f=u.length;for(t=0;t<r&&n[t]===u[t];t++);var y=r-t;for(o=1;o<=y&&n[r-o]===u[f-o];o++);return Fo=u.slice(t,1<o?1-o:void 0)}function Yo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function qo(){return!0}function wx(){return!1}function Ps(t){function n(r,o,u,f,y){this._reactName=r,this._targetInst=u,this.type=o,this.nativeEvent=f,this.target=y,this.currentTarget=null;for(var _ in t)t.hasOwnProperty(_)&&(r=t[_],this[_]=r?r(f):f[_]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?qo:wx,this.isPropagationStopped=wx,this}return j(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=qo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=qo)},persist:function(){},isPersistent:qo}),n}var ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vo=Ps(ll),oi=j({},ll,{view:0,detail:0}),W1=Ps(oi),mu,fu,ci,Go=j({},oi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ci&&(ci&&t.type==="mousemove"?(mu=t.screenX-ci.screenX,fu=t.screenY-ci.screenY):fu=mu=0,ci=t),mu)},movementY:function(t){return"movementY"in t?t.movementY:fu}}),Sx=Ps(Go),X1=j({},Go,{dataTransfer:0}),K1=Ps(X1),Q1=j({},oi,{relatedTarget:0}),hu=Ps(Q1),Z1=j({},ll,{animationName:0,elapsedTime:0,pseudoElement:0}),J1=Ps(Z1),eS=j({},ll,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),tS=Ps(eS),sS=j({},ll,{data:0}),_x=Ps(sS),nS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},lS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rS(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=lS[t])?!!n[t]:!1}function xu(){return rS}var iS=j({},oi,{key:function(t){if(t.key){var n=nS[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Yo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?aS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xu,charCode:function(t){return t.type==="keypress"?Yo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Yo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),oS=Ps(iS),cS=j({},Go,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cx=Ps(cS),dS=j({},oi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xu}),uS=Ps(dS),mS=j({},ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),fS=Ps(mS),hS=j({},Go,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),xS=Ps(hS),pS=j({},ll,{newState:0,oldState:0}),gS=Ps(pS),vS=[9,13,27,32],pu=Xn&&"CompositionEvent"in window,di=null;Xn&&"documentMode"in document&&(di=document.documentMode);var jS=Xn&&"TextEvent"in window&&!di,kx=Xn&&(!pu||di&&8<di&&11>=di),Tx=" ",Ex=!1;function Mx(t,n){switch(t){case"keyup":return vS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jl=!1;function yS(t,n){switch(t){case"compositionend":return Dx(n);case"keypress":return n.which!==32?null:(Ex=!0,Tx);case"textInput":return t=n.data,t===Tx&&Ex?null:t;default:return null}}function bS(t,n){if(Jl)return t==="compositionend"||!pu&&Mx(t,n)?(t=Nx(),Fo=uu=ya=null,Jl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return kx&&n.locale!=="ko"?null:n.data;default:return null}}var NS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ox(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!NS[t.type]:n==="textarea"}function Ax(t,n,r,o){Ql?Zl?Zl.push(o):Zl=[o]:Ql=o,n=Rc(n,"onChange"),0<n.length&&(r=new Vo("onChange","change",null,r,o),t.push({event:r,listeners:n}))}var ui=null,mi=null;function wS(t){xv(t,0)}function $o(t){var n=li(t);if(hx(n))return t}function Rx(t,n){if(t==="change")return n}var zx=!1;if(Xn){var gu;if(Xn){var vu="oninput"in document;if(!vu){var Px=document.createElement("div");Px.setAttribute("oninput","return;"),vu=typeof Px.oninput=="function"}gu=vu}else gu=!1;zx=gu&&(!document.documentMode||9<document.documentMode)}function Lx(){ui&&(ui.detachEvent("onpropertychange",Bx),mi=ui=null)}function Bx(t){if(t.propertyName==="value"&&$o(mi)){var n=[];Ax(n,mi,t,ou(t)),bx(wS,n)}}function SS(t,n,r){t==="focusin"?(Lx(),ui=n,mi=r,ui.attachEvent("onpropertychange",Bx)):t==="focusout"&&Lx()}function _S(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $o(mi)}function CS(t,n){if(t==="click")return $o(n)}function kS(t,n){if(t==="input"||t==="change")return $o(n)}function TS(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Xs=typeof Object.is=="function"?Object.is:TS;function fi(t,n){if(Xs(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var u=r[o];if(!Nn.call(n,u)||!Xs(t[u],n[u]))return!1}return!0}function Ux(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Hx(t,n){var r=Ux(t);t=0;for(var o;r;){if(r.nodeType===3){if(o=t+r.textContent.length,t<=n&&o>=n)return{node:r,offset:n-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ux(r)}}function Fx(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Fx(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Yx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Uo(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=Uo(t.document)}return n}function ju(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var ES=Xn&&"documentMode"in document&&11>=document.documentMode,er=null,yu=null,hi=null,bu=!1;function qx(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;bu||er==null||er!==Uo(o)||(o=er,"selectionStart"in o&&ju(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),hi&&fi(hi,o)||(hi=o,o=Rc(yu,"onSelect"),0<o.length&&(n=new Vo("onSelect","select",null,n,r),t.push({event:n,listeners:o}),n.target=er)))}function rl(t,n){var r={};return r[t.toLowerCase()]=n.toLowerCase(),r["Webkit"+t]="webkit"+n,r["Moz"+t]="moz"+n,r}var tr={animationend:rl("Animation","AnimationEnd"),animationiteration:rl("Animation","AnimationIteration"),animationstart:rl("Animation","AnimationStart"),transitionrun:rl("Transition","TransitionRun"),transitionstart:rl("Transition","TransitionStart"),transitioncancel:rl("Transition","TransitionCancel"),transitionend:rl("Transition","TransitionEnd")},Nu={},Vx={};Xn&&(Vx=document.createElement("div").style,"AnimationEvent"in window||(delete tr.animationend.animation,delete tr.animationiteration.animation,delete tr.animationstart.animation),"TransitionEvent"in window||delete tr.transitionend.transition);function il(t){if(Nu[t])return Nu[t];if(!tr[t])return t;var n=tr[t],r;for(r in n)if(n.hasOwnProperty(r)&&r in Vx)return Nu[t]=n[r];return t}var Gx=il("animationend"),$x=il("animationiteration"),Ix=il("animationstart"),MS=il("transitionrun"),DS=il("transitionstart"),OS=il("transitioncancel"),Wx=il("transitionend"),Xx=new Map,wu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");wu.push("scrollEnd");function wn(t,n){Xx.set(t,n),al(n,[t])}var Io=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},dn=[],sr=0,Su=0;function Wo(){for(var t=sr,n=Su=sr=0;n<t;){var r=dn[n];dn[n++]=null;var o=dn[n];dn[n++]=null;var u=dn[n];dn[n++]=null;var f=dn[n];if(dn[n++]=null,o!==null&&u!==null){var y=o.pending;y===null?u.next=u:(u.next=y.next,y.next=u),o.pending=u}f!==0&&Kx(r,u,f)}}function Xo(t,n,r,o){dn[sr++]=t,dn[sr++]=n,dn[sr++]=r,dn[sr++]=o,Su|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function _u(t,n,r,o){return Xo(t,n,r,o),Ko(t)}function ol(t,n){return Xo(t,null,null,n),Ko(t)}function Kx(t,n,r){t.lanes|=r;var o=t.alternate;o!==null&&(o.lanes|=r);for(var u=!1,f=t.return;f!==null;)f.childLanes|=r,o=f.alternate,o!==null&&(o.childLanes|=r),f.tag===22&&(t=f.stateNode,t===null||t._visibility&1||(u=!0)),t=f,f=f.return;return t.tag===3?(f=t.stateNode,u&&n!==null&&(u=31-pt(r),t=f.hiddenUpdates,o=t[u],o===null?t[u]=[n]:o.push(n),n.lane=r|536870912),f):null}function Ko(t){if(50<Pi)throw Pi=0,Rm=null,Error(i(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var nr={};function AS(t,n,r,o){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ks(t,n,r,o){return new AS(t,n,r,o)}function Cu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Kn(t,n){var r=t.alternate;return r===null?(r=Ks(t.tag,n,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=n,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,n=t.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function Qx(t,n){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,n=r.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Qo(t,n,r,o,u,f){var y=0;if(o=t,typeof t=="function")Cu(t)&&(y=1);else if(typeof t=="string")y=B_(t,r,fe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Y:return t=Ks(31,r,n,u),t.elementType=Y,t.lanes=f,t;case C:return cl(r.children,u,f,n);case N:y=8,u|=24;break;case T:return t=Ks(12,r,n,u|2),t.elementType=T,t.lanes=f,t;case D:return t=Ks(13,r,n,u),t.elementType=D,t.lanes=f,t;case A:return t=Ks(19,r,n,u),t.elementType=A,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case M:y=10;break e;case P:y=9;break e;case k:y=11;break e;case E:y=14;break e;case B:y=16,o=null;break e}y=29,r=Error(i(130,t===null?"null":typeof t,"")),o=null}return n=Ks(y,r,n,u),n.elementType=t,n.type=o,n.lanes=f,n}function cl(t,n,r,o){return t=Ks(7,t,o,n),t.lanes=r,t}function ku(t,n,r){return t=Ks(6,t,null,n),t.lanes=r,t}function Zx(t){var n=Ks(18,null,null,0);return n.stateNode=t,n}function Tu(t,n,r){return n=Ks(4,t.children!==null?t.children:[],t.key,n),n.lanes=r,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Jx=new WeakMap;function un(t,n){if(typeof t=="object"&&t!==null){var r=Jx.get(t);return r!==void 0?r:(n={value:t,source:n,stack:Le(n)},Jx.set(t,n),n)}return{value:t,source:n,stack:Le(n)}}var ar=[],lr=0,Zo=null,xi=0,mn=[],fn=0,ba=null,Rn=1,zn="";function Qn(t,n){ar[lr++]=xi,ar[lr++]=Zo,Zo=t,xi=n}function ep(t,n,r){mn[fn++]=Rn,mn[fn++]=zn,mn[fn++]=ba,ba=t;var o=Rn;t=zn;var u=32-pt(o)-1;o&=~(1<<u),r+=1;var f=32-pt(n)+u;if(30<f){var y=u-u%5;f=(o&(1<<y)-1).toString(32),o>>=y,u-=y,Rn=1<<32-pt(n)+u|r<<u|o,zn=f+t}else Rn=1<<f|r<<u|o,zn=t}function Eu(t){t.return!==null&&(Qn(t,1),ep(t,1,0))}function Mu(t){for(;t===Zo;)Zo=ar[--lr],ar[lr]=null,xi=ar[--lr],ar[lr]=null;for(;t===ba;)ba=mn[--fn],mn[fn]=null,zn=mn[--fn],mn[fn]=null,Rn=mn[--fn],mn[fn]=null}function tp(t,n){mn[fn++]=Rn,mn[fn++]=zn,mn[fn++]=ba,Rn=n.id,zn=n.overflow,ba=t}var ps=null,Ut=null,nt=!1,Na=null,hn=!1,Du=Error(i(519));function wa(t){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pi(un(n,t)),Du}function sp(t){var n=t.stateNode,r=t.type,o=t.memoizedProps;switch(n[xs]=t,n[zs]=o,r){case"dialog":et("cancel",n),et("close",n);break;case"iframe":case"object":case"embed":et("load",n);break;case"video":case"audio":for(r=0;r<Bi.length;r++)et(Bi[r],n);break;case"source":et("error",n);break;case"img":case"image":case"link":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"input":et("invalid",n),xx(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":et("invalid",n);break;case"textarea":et("invalid",n),gx(n,o.value,o.defaultValue,o.children)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||o.suppressHydrationWarning===!0||jv(n.textContent,r)?(o.popover!=null&&(et("beforetoggle",n),et("toggle",n)),o.onScroll!=null&&et("scroll",n),o.onScrollEnd!=null&&et("scrollend",n),o.onClick!=null&&(n.onclick=Wn),n=!0):n=!1,n||wa(t,!0)}function np(t){for(ps=t.return;ps;)switch(ps.tag){case 5:case 31:case 13:hn=!1;return;case 27:case 3:hn=!0;return;default:ps=ps.return}}function rr(t){if(t!==ps)return!1;if(!nt)return np(t),nt=!0,!1;var n=t.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||Xm(t.type,t.memoizedProps)),r=!r),r&&Ut&&wa(t),np(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));Ut=Tv(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));Ut=Tv(t)}else n===27?(n=Ut,La(t.type)?(t=ef,ef=null,Ut=t):Ut=n):Ut=ps?pn(t.stateNode.nextSibling):null;return!0}function dl(){Ut=ps=null,nt=!1}function Ou(){var t=Na;return t!==null&&(Hs===null?Hs=t:Hs.push.apply(Hs,t),Na=null),t}function pi(t){Na===null?Na=[t]:Na.push(t)}var Au=xe(null),ul=null,Zn=null;function Sa(t,n,r){W(Au,n._currentValue),n._currentValue=r}function Jn(t){t._currentValue=Au.current,F(Au)}function Ru(t,n,r){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===r)break;t=t.return}}function zu(t,n,r,o){var u=t.child;for(u!==null&&(u.return=t);u!==null;){var f=u.dependencies;if(f!==null){var y=u.child;f=f.firstContext;e:for(;f!==null;){var _=f;f=u;for(var z=0;z<n.length;z++)if(_.context===n[z]){f.lanes|=r,_=f.alternate,_!==null&&(_.lanes|=r),Ru(f.return,r,t),o||(y=null);break e}f=_.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(i(341));y.lanes|=r,f=y.alternate,f!==null&&(f.lanes|=r),Ru(y,r,t),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===t){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function ir(t,n,r,o){t=null;for(var u=n,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var _=u.type;Xs(u.pendingProps.value,y.value)||(t!==null?t.push(_):t=[_])}}else if(u===de.current){if(y=u.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(qi):t=[qi])}u=u.return}t!==null&&zu(n,t,r,o),n.flags|=262144}function Jo(t){for(t=t.firstContext;t!==null;){if(!Xs(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ml(t){ul=t,Zn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function gs(t){return ap(ul,t)}function ec(t,n){return ul===null&&ml(t),ap(t,n)}function ap(t,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Zn===null){if(t===null)throw Error(i(308));Zn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Zn=Zn.next=n;return r}var RS=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(r,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(r){return r()})}},zS=s.unstable_scheduleCallback,PS=s.unstable_NormalPriority,Jt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new RS,data:new Map,refCount:0}}function gi(t){t.refCount--,t.refCount===0&&zS(PS,function(){t.controller.abort()})}var vi=null,Lu=0,or=0,cr=null;function LS(t,n){if(vi===null){var r=vi=[];Lu=0,or=Hm(),cr={status:"pending",value:void 0,then:function(o){r.push(o)}}}return Lu++,n.then(lp,lp),n}function lp(){if(--Lu===0&&vi!==null){cr!==null&&(cr.status="fulfilled");var t=vi;vi=null,or=0,cr=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function BS(t,n){var r=[],o={status:"pending",value:null,reason:null,then:function(u){r.push(u)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<r.length;u++)(0,r[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<r.length;u++)(0,r[u])(void 0)}),o}var rp=R.S;R.S=function(t,n){qg=ke(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&LS(t,n),rp!==null&&rp(t,n)};var fl=xe(null);function Bu(){var t=fl.current;return t!==null?t:Et.pooledCache}function tc(t,n){n===null?W(fl,fl.current):W(fl,n.pool)}function ip(){var t=Bu();return t===null?null:{parent:Jt._currentValue,pool:t}}var dr=Error(i(460)),Uu=Error(i(474)),sc=Error(i(542)),nc={then:function(){}};function op(t){return t=t.status,t==="fulfilled"||t==="rejected"}function cp(t,n,r){switch(r=t[r],r===void 0?t.push(n):r!==n&&(n.then(Wn,Wn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,up(t),t;default:if(typeof n.status=="string")n.then(Wn,Wn);else{if(t=Et,t!==null&&100<t.shellSuspendCounter)throw Error(i(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,up(t),t}throw xl=n,dr}}function hl(t){try{var n=t._init;return n(t._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(xl=r,dr):r}}var xl=null;function dp(){if(xl===null)throw Error(i(459));var t=xl;return xl=null,t}function up(t){if(t===dr||t===sc)throw Error(i(483))}var ur=null,ji=0;function ac(t){var n=ji;return ji+=1,ur===null&&(ur=[]),cp(ur,t,n)}function yi(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function lc(t,n){throw n.$$typeof===b?Error(i(525)):(t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function mp(t){function n(V,H){if(t){var X=V.deletions;X===null?(V.deletions=[H],V.flags|=16):X.push(H)}}function r(V,H){if(!t)return null;for(;H!==null;)n(V,H),H=H.sibling;return null}function o(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function u(V,H){return V=Kn(V,H),V.index=0,V.sibling=null,V}function f(V,H,X){return V.index=X,t?(X=V.alternate,X!==null?(X=X.index,X<H?(V.flags|=67108866,H):X):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function y(V){return t&&V.alternate===null&&(V.flags|=67108866),V}function _(V,H,X,ce){return H===null||H.tag!==6?(H=ku(X,V.mode,ce),H.return=V,H):(H=u(H,X),H.return=V,H)}function z(V,H,X,ce){var De=X.type;return De===C?ie(V,H,X.props.children,ce,X.key):H!==null&&(H.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===B&&hl(De)===H.type)?(H=u(H,X.props),yi(H,X),H.return=V,H):(H=Qo(X.type,X.key,X.props,null,V.mode,ce),yi(H,X),H.return=V,H)}function K(V,H,X,ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=Tu(X,V.mode,ce),H.return=V,H):(H=u(H,X.children||[]),H.return=V,H)}function ie(V,H,X,ce,De){return H===null||H.tag!==7?(H=cl(X,V.mode,ce,De),H.return=V,H):(H=u(H,X),H.return=V,H)}function ue(V,H,X){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=ku(""+H,V.mode,X),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return X=Qo(H.type,H.key,H.props,null,V.mode,X),yi(X,H),X.return=V,X;case S:return H=Tu(H,V.mode,X),H.return=V,H;case B:return H=hl(H),ue(V,H,X)}if(me(H)||oe(H))return H=cl(H,V.mode,X,null),H.return=V,H;if(typeof H.then=="function")return ue(V,ac(H),X);if(H.$$typeof===M)return ue(V,ec(V,H),X);lc(V,H)}return null}function J(V,H,X,ce){var De=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return De!==null?null:_(V,H,""+X,ce);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case w:return X.key===De?z(V,H,X,ce):null;case S:return X.key===De?K(V,H,X,ce):null;case B:return X=hl(X),J(V,H,X,ce)}if(me(X)||oe(X))return De!==null?null:ie(V,H,X,ce,null);if(typeof X.then=="function")return J(V,H,ac(X),ce);if(X.$$typeof===M)return J(V,H,ec(V,X),ce);lc(V,X)}return null}function ne(V,H,X,ce,De){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return V=V.get(X)||null,_(H,V,""+ce,De);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case w:return V=V.get(ce.key===null?X:ce.key)||null,z(H,V,ce,De);case S:return V=V.get(ce.key===null?X:ce.key)||null,K(H,V,ce,De);case B:return ce=hl(ce),ne(V,H,X,ce,De)}if(me(ce)||oe(ce))return V=V.get(X)||null,ie(H,V,ce,De,null);if(typeof ce.then=="function")return ne(V,H,X,ac(ce),De);if(ce.$$typeof===M)return ne(V,H,X,ec(H,ce),De);lc(H,ce)}return null}function we(V,H,X,ce){for(var De=null,ut=null,Te=H,Ge=H=0,st=null;Te!==null&&Ge<X.length;Ge++){Te.index>Ge?(st=Te,Te=null):st=Te.sibling;var mt=J(V,Te,X[Ge],ce);if(mt===null){Te===null&&(Te=st);break}t&&Te&&mt.alternate===null&&n(V,Te),H=f(mt,H,Ge),ut===null?De=mt:ut.sibling=mt,ut=mt,Te=st}if(Ge===X.length)return r(V,Te),nt&&Qn(V,Ge),De;if(Te===null){for(;Ge<X.length;Ge++)Te=ue(V,X[Ge],ce),Te!==null&&(H=f(Te,H,Ge),ut===null?De=Te:ut.sibling=Te,ut=Te);return nt&&Qn(V,Ge),De}for(Te=o(Te);Ge<X.length;Ge++)st=ne(Te,V,Ge,X[Ge],ce),st!==null&&(t&&st.alternate!==null&&Te.delete(st.key===null?Ge:st.key),H=f(st,H,Ge),ut===null?De=st:ut.sibling=st,ut=st);return t&&Te.forEach(function(Ya){return n(V,Ya)}),nt&&Qn(V,Ge),De}function Re(V,H,X,ce){if(X==null)throw Error(i(151));for(var De=null,ut=null,Te=H,Ge=H=0,st=null,mt=X.next();Te!==null&&!mt.done;Ge++,mt=X.next()){Te.index>Ge?(st=Te,Te=null):st=Te.sibling;var Ya=J(V,Te,mt.value,ce);if(Ya===null){Te===null&&(Te=st);break}t&&Te&&Ya.alternate===null&&n(V,Te),H=f(Ya,H,Ge),ut===null?De=Ya:ut.sibling=Ya,ut=Ya,Te=st}if(mt.done)return r(V,Te),nt&&Qn(V,Ge),De;if(Te===null){for(;!mt.done;Ge++,mt=X.next())mt=ue(V,mt.value,ce),mt!==null&&(H=f(mt,H,Ge),ut===null?De=mt:ut.sibling=mt,ut=mt);return nt&&Qn(V,Ge),De}for(Te=o(Te);!mt.done;Ge++,mt=X.next())mt=ne(Te,V,Ge,mt.value,ce),mt!==null&&(t&&mt.alternate!==null&&Te.delete(mt.key===null?Ge:mt.key),H=f(mt,H,Ge),ut===null?De=mt:ut.sibling=mt,ut=mt);return t&&Te.forEach(function(X_){return n(V,X_)}),nt&&Qn(V,Ge),De}function St(V,H,X,ce){if(typeof X=="object"&&X!==null&&X.type===C&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case w:e:{for(var De=X.key;H!==null;){if(H.key===De){if(De=X.type,De===C){if(H.tag===7){r(V,H.sibling),ce=u(H,X.props.children),ce.return=V,V=ce;break e}}else if(H.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===B&&hl(De)===H.type){r(V,H.sibling),ce=u(H,X.props),yi(ce,X),ce.return=V,V=ce;break e}r(V,H);break}else n(V,H);H=H.sibling}X.type===C?(ce=cl(X.props.children,V.mode,ce,X.key),ce.return=V,V=ce):(ce=Qo(X.type,X.key,X.props,null,V.mode,ce),yi(ce,X),ce.return=V,V=ce)}return y(V);case S:e:{for(De=X.key;H!==null;){if(H.key===De)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){r(V,H.sibling),ce=u(H,X.children||[]),ce.return=V,V=ce;break e}else{r(V,H);break}else n(V,H);H=H.sibling}ce=Tu(X,V.mode,ce),ce.return=V,V=ce}return y(V);case B:return X=hl(X),St(V,H,X,ce)}if(me(X))return we(V,H,X,ce);if(oe(X)){if(De=oe(X),typeof De!="function")throw Error(i(150));return X=De.call(X),Re(V,H,X,ce)}if(typeof X.then=="function")return St(V,H,ac(X),ce);if(X.$$typeof===M)return St(V,H,ec(V,X),ce);lc(V,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,H!==null&&H.tag===6?(r(V,H.sibling),ce=u(H,X),ce.return=V,V=ce):(r(V,H),ce=ku(X,V.mode,ce),ce.return=V,V=ce),y(V)):r(V,H)}return function(V,H,X,ce){try{ji=0;var De=St(V,H,X,ce);return ur=null,De}catch(Te){if(Te===dr||Te===sc)throw Te;var ut=Ks(29,Te,null,V.mode);return ut.lanes=ce,ut.return=V,ut}finally{}}}var pl=mp(!0),fp=mp(!1),_a=!1;function Hu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ca(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ka(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(xt&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Ko(t),Kx(t,null,r),n}return Xo(t,o,n,r),Ko(t)}function bi(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ax(t,r)}}function Yu(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var u=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};f===null?u=f=y:f=f.next=y,r=r.next}while(r!==null);f===null?u=f=n:f=f.next=n}else u=f=n;r={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var qu=!1;function Ni(){if(qu){var t=cr;if(t!==null)throw t}}function wi(t,n,r,o){qu=!1;var u=t.updateQueue;_a=!1;var f=u.firstBaseUpdate,y=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var z=_,K=z.next;z.next=null,y===null?f=K:y.next=K,y=z;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,_=ie.lastBaseUpdate,_!==y&&(_===null?ie.firstBaseUpdate=K:_.next=K,ie.lastBaseUpdate=z))}if(f!==null){var ue=u.baseState;y=0,ie=K=z=null,_=f;do{var J=_.lane&-536870913,ne=J!==_.lane;if(ne?(tt&J)===J:(o&J)===J){J!==0&&J===or&&(qu=!0),ie!==null&&(ie=ie.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var we=t,Re=_;J=n;var St=r;switch(Re.tag){case 1:if(we=Re.payload,typeof we=="function"){ue=we.call(St,ue,J);break e}ue=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Re.payload,J=typeof we=="function"?we.call(St,ue,J):we,J==null)break e;ue=j({},ue,J);break e;case 2:_a=!0}}J=_.callback,J!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=u.callbacks,ne===null?u.callbacks=[J]:ne.push(J))}else ne={lane:J,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ie===null?(K=ie=ne,z=ue):ie=ie.next=ne,y|=J;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;ne=_,_=ne.next,ne.next=null,u.lastBaseUpdate=ne,u.shared.pending=null}}while(!0);ie===null&&(z=ue),u.baseState=z,u.firstBaseUpdate=K,u.lastBaseUpdate=ie,f===null&&(u.shared.lanes=0),Oa|=y,t.lanes=y,t.memoizedState=ue}}function hp(t,n){if(typeof t!="function")throw Error(i(191,t));t.call(n)}function xp(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)hp(r[t],n)}var mr=xe(null),rc=xe(0);function pp(t,n){t=oa,W(rc,t),W(mr,n),oa=t|n.baseLanes}function Vu(){W(rc,oa),W(mr,mr.current)}function Gu(){oa=rc.current,F(mr),F(rc)}var Qs=xe(null),xn=null;function Ta(t){var n=t.alternate;W(Kt,Kt.current&1),W(Qs,t),xn===null&&(n===null||mr.current!==null||n.memoizedState!==null)&&(xn=t)}function $u(t){W(Kt,Kt.current),W(Qs,t),xn===null&&(xn=t)}function gp(t){t.tag===22?(W(Kt,Kt.current),W(Qs,t),xn===null&&(xn=t)):Ea()}function Ea(){W(Kt,Kt.current),W(Qs,Qs.current)}function Zs(t){F(Qs),xn===t&&(xn=null),F(Kt)}var Kt=xe(0);function ic(t){for(var n=t;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Zm(r)||Jm(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ea=0,Ye=null,Nt=null,es=null,oc=!1,fr=!1,gl=!1,cc=0,Si=0,hr=null,US=0;function It(){throw Error(i(321))}function Iu(t,n){if(n===null)return!1;for(var r=0;r<n.length&&r<t.length;r++)if(!Xs(t[r],n[r]))return!1;return!0}function Wu(t,n,r,o,u,f){return ea=f,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,R.H=t===null||t.memoizedState===null?eg:cm,gl=!1,f=r(o,u),gl=!1,fr&&(f=jp(n,r,o,u)),vp(t),f}function vp(t){R.H=ki;var n=Nt!==null&&Nt.next!==null;if(ea=0,es=Nt=Ye=null,oc=!1,Si=0,hr=null,n)throw Error(i(300));t===null||ts||(t=t.dependencies,t!==null&&Jo(t)&&(ts=!0))}function jp(t,n,r,o){Ye=t;var u=0;do{if(fr&&(hr=null),Si=0,fr=!1,25<=u)throw Error(i(301));if(u+=1,es=Nt=null,t.updateQueue!=null){var f=t.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}R.H=tg,f=n(r,o)}while(fr);return f}function HS(){var t=R.H,n=t.useState()[0];return n=typeof n.then=="function"?_i(n):n,t=t.useState()[0],(Nt!==null?Nt.memoizedState:null)!==t&&(Ye.flags|=1024),n}function Xu(){var t=cc!==0;return cc=0,t}function Ku(t,n,r){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~r}function Qu(t){if(oc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}oc=!1}ea=0,es=Nt=Ye=null,fr=!1,Si=cc=0,hr=null}function As(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return es===null?Ye.memoizedState=es=t:es=es.next=t,es}function Qt(){if(Nt===null){var t=Ye.alternate;t=t!==null?t.memoizedState:null}else t=Nt.next;var n=es===null?Ye.memoizedState:es.next;if(n!==null)es=n,Nt=t;else{if(t===null)throw Ye.alternate===null?Error(i(467)):Error(i(310));Nt=t,t={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},es===null?Ye.memoizedState=es=t:es=es.next=t}return es}function dc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _i(t){var n=Si;return Si+=1,hr===null&&(hr=[]),t=cp(hr,t,n),n=Ye,(es===null?n.memoizedState:es.next)===null&&(n=n.alternate,R.H=n===null||n.memoizedState===null?eg:cm),t}function uc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return _i(t);if(t.$$typeof===M)return gs(t)}throw Error(i(438,String(t)))}function Zu(t){var n=null,r=Ye.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var o=Ye.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=dc(),Ye.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(t),o=0;o<t;o++)r[o]=G;return n.index++,r}function ta(t,n){return typeof n=="function"?n(t):n}function mc(t){var n=Qt();return Ju(n,Nt,t)}function Ju(t,n,r){var o=t.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=r;var u=t.baseQueue,f=o.pending;if(f!==null){if(u!==null){var y=u.next;u.next=f.next,f.next=y}n.baseQueue=u=f,o.pending=null}if(f=t.baseState,u===null)t.memoizedState=f;else{n=u.next;var _=y=null,z=null,K=n,ie=!1;do{var ue=K.lane&-536870913;if(ue!==K.lane?(tt&ue)===ue:(ea&ue)===ue){var J=K.revertLane;if(J===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ue===or&&(ie=!0);else if((ea&J)===J){K=K.next,J===or&&(ie=!0);continue}else ue={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},z===null?(_=z=ue,y=f):z=z.next=ue,Ye.lanes|=J,Oa|=J;ue=K.action,gl&&r(f,ue),f=K.hasEagerState?K.eagerState:r(f,ue)}else J={lane:ue,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},z===null?(_=z=J,y=f):z=z.next=J,Ye.lanes|=ue,Oa|=ue;K=K.next}while(K!==null&&K!==n);if(z===null?y=f:z.next=_,!Xs(f,t.memoizedState)&&(ts=!0,ie&&(r=cr,r!==null)))throw r;t.memoizedState=f,t.baseState=y,t.baseQueue=z,o.lastRenderedState=f}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function em(t){var n=Qt(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=t;var o=r.dispatch,u=r.pending,f=n.memoizedState;if(u!==null){r.pending=null;var y=u=u.next;do f=t(f,y.action),y=y.next;while(y!==u);Xs(f,n.memoizedState)||(ts=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),r.lastRenderedState=f}return[f,o]}function yp(t,n,r){var o=Ye,u=Qt(),f=nt;if(f){if(r===void 0)throw Error(i(407));r=r()}else r=n();var y=!Xs((Nt||u).memoizedState,r);if(y&&(u.memoizedState=r,ts=!0),u=u.queue,nm(wp.bind(null,o,u,t),[t]),u.getSnapshot!==n||y||es!==null&&es.memoizedState.tag&1){if(o.flags|=2048,xr(9,{destroy:void 0},Np.bind(null,o,u,r,n),null),Et===null)throw Error(i(349));f||(ea&127)!==0||bp(o,n,r)}return r}function bp(t,n,r){t.flags|=16384,t={getSnapshot:n,value:r},n=Ye.updateQueue,n===null?(n=dc(),Ye.updateQueue=n,n.stores=[t]):(r=n.stores,r===null?n.stores=[t]:r.push(t))}function Np(t,n,r,o){n.value=r,n.getSnapshot=o,Sp(n)&&_p(t)}function wp(t,n,r){return r(function(){Sp(n)&&_p(t)})}function Sp(t){var n=t.getSnapshot;t=t.value;try{var r=n();return!Xs(t,r)}catch{return!0}}function _p(t){var n=ol(t,2);n!==null&&Fs(n,t,2)}function tm(t){var n=As();if(typeof t=="function"){var r=t;if(t=r(),gl){Qe(!0);try{r()}finally{Qe(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:t},n}function Cp(t,n,r,o){return t.baseState=r,Ju(t,Nt,typeof o=="function"?o:ta)}function FS(t,n,r,o,u){if(xc(t))throw Error(i(485));if(t=n.action,t!==null){var f={payload:u,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};R.T!==null?r(!0):f.isTransition=!1,o(f),r=n.pending,r===null?(f.next=n.pending=f,kp(n,f)):(f.next=r.next,n.pending=r.next=f)}}function kp(t,n){var r=n.action,o=n.payload,u=t.state;if(n.isTransition){var f=R.T,y={};R.T=y;try{var _=r(u,o),z=R.S;z!==null&&z(y,_),Tp(t,n,_)}catch(K){sm(t,n,K)}finally{f!==null&&y.types!==null&&(f.types=y.types),R.T=f}}else try{f=r(u,o),Tp(t,n,f)}catch(K){sm(t,n,K)}}function Tp(t,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){Ep(t,n,o)},function(o){return sm(t,n,o)}):Ep(t,n,r)}function Ep(t,n,r){n.status="fulfilled",n.value=r,Mp(n),t.state=r,n=t.pending,n!==null&&(r=n.next,r===n?t.pending=null:(r=r.next,n.next=r,kp(t,r)))}function sm(t,n,r){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=r,Mp(n),n=n.next;while(n!==o)}t.action=null}function Mp(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Dp(t,n){return n}function Op(t,n){if(nt){var r=Et.formState;if(r!==null){e:{var o=Ye;if(nt){if(Ut){t:{for(var u=Ut,f=hn;u.nodeType!==8;){if(!f){u=null;break t}if(u=pn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Ut=pn(u.nextSibling),o=u.data==="F!";break e}}wa(o)}o=!1}o&&(n=r[0])}}return r=As(),r.memoizedState=r.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dp,lastRenderedState:n},r.queue=o,r=Qp.bind(null,Ye,o),o.dispatch=r,o=tm(!1),f=om.bind(null,Ye,!1,o.queue),o=As(),u={state:n,dispatch:null,action:t,pending:null},o.queue=u,r=FS.bind(null,Ye,u,f,r),u.dispatch=r,o.memoizedState=t,[n,r,!1]}function Ap(t){var n=Qt();return Rp(n,Nt,t)}function Rp(t,n,r){if(n=Ju(t,n,Dp)[0],t=mc(ta)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=_i(n)}catch(y){throw y===dr?sc:y}else o=n;n=Qt();var u=n.queue,f=u.dispatch;return r!==n.memoizedState&&(Ye.flags|=2048,xr(9,{destroy:void 0},YS.bind(null,u,r),null)),[o,f,t]}function YS(t,n){t.action=n}function zp(t){var n=Qt(),r=Nt;if(r!==null)return Rp(n,r,t);Qt(),n=n.memoizedState,r=Qt();var o=r.queue.dispatch;return r.memoizedState=t,[n,o,!1]}function xr(t,n,r,o){return t={tag:t,create:r,deps:o,inst:n,next:null},n=Ye.updateQueue,n===null&&(n=dc(),Ye.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=t.next=t:(o=r.next,r.next=t,t.next=o,n.lastEffect=t),t}function Pp(){return Qt().memoizedState}function fc(t,n,r,o){var u=As();Ye.flags|=t,u.memoizedState=xr(1|n,{destroy:void 0},r,o===void 0?null:o)}function hc(t,n,r,o){var u=Qt();o=o===void 0?null:o;var f=u.memoizedState.inst;Nt!==null&&o!==null&&Iu(o,Nt.memoizedState.deps)?u.memoizedState=xr(n,f,r,o):(Ye.flags|=t,u.memoizedState=xr(1|n,f,r,o))}function Lp(t,n){fc(8390656,8,t,n)}function nm(t,n){hc(2048,8,t,n)}function qS(t){Ye.flags|=4;var n=Ye.updateQueue;if(n===null)n=dc(),Ye.updateQueue=n,n.events=[t];else{var r=n.events;r===null?n.events=[t]:r.push(t)}}function Bp(t){var n=Qt().memoizedState;return qS({ref:n,nextImpl:t}),function(){if((xt&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Up(t,n){return hc(4,2,t,n)}function Hp(t,n){return hc(4,4,t,n)}function Fp(t,n){if(typeof n=="function"){t=t();var r=n(t);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Yp(t,n,r){r=r!=null?r.concat([t]):null,hc(4,4,Fp.bind(null,n,t),r)}function am(){}function qp(t,n){var r=Qt();n=n===void 0?null:n;var o=r.memoizedState;return n!==null&&Iu(n,o[1])?o[0]:(r.memoizedState=[t,n],t)}function Vp(t,n){var r=Qt();n=n===void 0?null:n;var o=r.memoizedState;if(n!==null&&Iu(n,o[1]))return o[0];if(o=t(),gl){Qe(!0);try{t()}finally{Qe(!1)}}return r.memoizedState=[o,n],o}function lm(t,n,r){return r===void 0||(ea&1073741824)!==0&&(tt&261930)===0?t.memoizedState=n:(t.memoizedState=r,t=Gg(),Ye.lanes|=t,Oa|=t,r)}function Gp(t,n,r,o){return Xs(r,n)?r:mr.current!==null?(t=lm(t,r,o),Xs(t,n)||(ts=!0),t):(ea&42)===0||(ea&1073741824)!==0&&(tt&261930)===0?(ts=!0,t.memoizedState=r):(t=Gg(),Ye.lanes|=t,Oa|=t,n)}function $p(t,n,r,o,u){var f=O.p;O.p=f!==0&&8>f?f:8;var y=R.T,_={};R.T=_,om(t,!1,n,r);try{var z=u(),K=R.S;if(K!==null&&K(_,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ie=BS(z,o);Ci(t,n,ie,tn(t))}else Ci(t,n,o,tn(t))}catch(ue){Ci(t,n,{then:function(){},status:"rejected",reason:ue},tn())}finally{O.p=f,y!==null&&_.types!==null&&(y.types=_.types),R.T=y}}function VS(){}function rm(t,n,r,o){if(t.tag!==5)throw Error(i(476));var u=Ip(t).queue;$p(t,u,n,L,r===null?VS:function(){return Wp(t),r(o)})}function Ip(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:L},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Wp(t){var n=Ip(t);n.next===null&&(n=t.alternate.memoizedState),Ci(t,n.next.queue,{},tn())}function im(){return gs(qi)}function Xp(){return Qt().memoizedState}function Kp(){return Qt().memoizedState}function GS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=tn();t=Ca(r);var o=ka(n,t,r);o!==null&&(Fs(o,n,r),bi(o,n,r)),n={cache:Pu()},t.payload=n;return}n=n.return}}function $S(t,n,r){var o=tn();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},xc(t)?Zp(n,r):(r=_u(t,n,r,o),r!==null&&(Fs(r,t,o),Jp(r,n,o)))}function Qp(t,n,r){var o=tn();Ci(t,n,r,o)}function Ci(t,n,r,o){var u={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(xc(t))Zp(n,u);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,_=f(y,r);if(u.hasEagerState=!0,u.eagerState=_,Xs(_,y))return Xo(t,n,u,0),Et===null&&Wo(),!1}catch{}finally{}if(r=_u(t,n,u,o),r!==null)return Fs(r,t,o),Jp(r,n,o),!0}return!1}function om(t,n,r,o){if(o={lane:2,revertLane:Hm(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xc(t)){if(n)throw Error(i(479))}else n=_u(t,r,o,2),n!==null&&Fs(n,t,2)}function xc(t){var n=t.alternate;return t===Ye||n!==null&&n===Ye}function Zp(t,n){fr=oc=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Jp(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ax(t,r)}}var ki={readContext:gs,use:uc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};ki.useEffectEvent=It;var eg={readContext:gs,use:uc,useCallback:function(t,n){return As().memoizedState=[t,n===void 0?null:n],t},useContext:gs,useEffect:Lp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,fc(4194308,4,Fp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return fc(4194308,4,t,n)},useInsertionEffect:function(t,n){fc(4,2,t,n)},useMemo:function(t,n){var r=As();n=n===void 0?null:n;var o=t();if(gl){Qe(!0);try{t()}finally{Qe(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=As();if(r!==void 0){var u=r(n);if(gl){Qe(!0);try{r(n)}finally{Qe(!1)}}}else u=n;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=$S.bind(null,Ye,t),[o.memoizedState,t]},useRef:function(t){var n=As();return t={current:t},n.memoizedState=t},useState:function(t){t=tm(t);var n=t.queue,r=Qp.bind(null,Ye,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:am,useDeferredValue:function(t,n){var r=As();return lm(r,t,n)},useTransition:function(){var t=tm(!1);return t=$p.bind(null,Ye,t.queue,!0,!1),As().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Ye,u=As();if(nt){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Et===null)throw Error(i(349));(tt&127)!==0||bp(o,n,r)}u.memoizedState=r;var f={value:r,getSnapshot:n};return u.queue=f,Lp(wp.bind(null,o,f,t),[t]),o.flags|=2048,xr(9,{destroy:void 0},Np.bind(null,o,f,r,n),null),r},useId:function(){var t=As(),n=Et.identifierPrefix;if(nt){var r=zn,o=Rn;r=(o&~(1<<32-pt(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=cc++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=US++,n="_"+n+"r_"+r.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:im,useFormState:Op,useActionState:Op,useOptimistic:function(t){var n=As();n.memoizedState=n.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=om.bind(null,Ye,!0,r),r.dispatch=n,[t,n]},useMemoCache:Zu,useCacheRefresh:function(){return As().memoizedState=GS.bind(null,Ye)},useEffectEvent:function(t){var n=As(),r={impl:t};return n.memoizedState=r,function(){if((xt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}},cm={readContext:gs,use:uc,useCallback:qp,useContext:gs,useEffect:nm,useImperativeHandle:Yp,useInsertionEffect:Up,useLayoutEffect:Hp,useMemo:Vp,useReducer:mc,useRef:Pp,useState:function(){return mc(ta)},useDebugValue:am,useDeferredValue:function(t,n){var r=Qt();return Gp(r,Nt.memoizedState,t,n)},useTransition:function(){var t=mc(ta)[0],n=Qt().memoizedState;return[typeof t=="boolean"?t:_i(t),n]},useSyncExternalStore:yp,useId:Xp,useHostTransitionStatus:im,useFormState:Ap,useActionState:Ap,useOptimistic:function(t,n){var r=Qt();return Cp(r,Nt,t,n)},useMemoCache:Zu,useCacheRefresh:Kp};cm.useEffectEvent=Bp;var tg={readContext:gs,use:uc,useCallback:qp,useContext:gs,useEffect:nm,useImperativeHandle:Yp,useInsertionEffect:Up,useLayoutEffect:Hp,useMemo:Vp,useReducer:em,useRef:Pp,useState:function(){return em(ta)},useDebugValue:am,useDeferredValue:function(t,n){var r=Qt();return Nt===null?lm(r,t,n):Gp(r,Nt.memoizedState,t,n)},useTransition:function(){var t=em(ta)[0],n=Qt().memoizedState;return[typeof t=="boolean"?t:_i(t),n]},useSyncExternalStore:yp,useId:Xp,useHostTransitionStatus:im,useFormState:zp,useActionState:zp,useOptimistic:function(t,n){var r=Qt();return Nt!==null?Cp(r,Nt,t,n):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:Zu,useCacheRefresh:Kp};tg.useEffectEvent=Bp;function dm(t,n,r,o){n=t.memoizedState,r=r(o,n),r=r==null?n:j({},n,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var um={enqueueSetState:function(t,n,r){t=t._reactInternals;var o=tn(),u=Ca(o);u.payload=n,r!=null&&(u.callback=r),n=ka(t,u,o),n!==null&&(Fs(n,t,o),bi(n,t,o))},enqueueReplaceState:function(t,n,r){t=t._reactInternals;var o=tn(),u=Ca(o);u.tag=1,u.payload=n,r!=null&&(u.callback=r),n=ka(t,u,o),n!==null&&(Fs(n,t,o),bi(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var r=tn(),o=Ca(r);o.tag=2,n!=null&&(o.callback=n),n=ka(t,o,r),n!==null&&(Fs(n,t,r),bi(n,t,r))}};function sg(t,n,r,o,u,f,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,f,y):n.prototype&&n.prototype.isPureReactComponent?!fi(r,o)||!fi(u,f):!0}function ng(t,n,r,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,o),n.state!==t&&um.enqueueReplaceState(n,n.state,null)}function vl(t,n){var r=n;if("ref"in n){r={};for(var o in n)o!=="ref"&&(r[o]=n[o])}if(t=t.defaultProps){r===n&&(r=j({},r));for(var u in t)r[u]===void 0&&(r[u]=t[u])}return r}function ag(t){Io(t)}function lg(t){console.error(t)}function rg(t){Io(t)}function pc(t,n){try{var r=t.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function ig(t,n,r){try{var o=t.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function mm(t,n,r){return r=Ca(r),r.tag=3,r.payload={element:null},r.callback=function(){pc(t,n)},r}function og(t){return t=Ca(t),t.tag=3,t}function cg(t,n,r,o){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=o.value;t.payload=function(){return u(f)},t.callback=function(){ig(n,r,o)}}var y=r.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){ig(n,r,o),typeof u!="function"&&(Aa===null?Aa=new Set([this]):Aa.add(this));var _=o.stack;this.componentDidCatch(o.value,{componentStack:_!==null?_:""})})}function IS(t,n,r,o,u){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=r.alternate,n!==null&&ir(n,r,u,!0),r=Qs.current,r!==null){switch(r.tag){case 31:case 13:return xn===null?Tc():r.alternate===null&&Wt===0&&(Wt=3),r.flags&=-257,r.flags|=65536,r.lanes=u,o===nc?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([o]):n.add(o),Lm(t,o,u)),!1;case 22:return r.flags|=65536,o===nc?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([o]):r.add(o)),Lm(t,o,u)),!1}throw Error(i(435,r.tag))}return Lm(t,o,u),Tc(),!1}if(nt)return n=Qs.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==Du&&(t=Error(i(422),{cause:o}),pi(un(t,r)))):(o!==Du&&(n=Error(i(423),{cause:o}),pi(un(n,r))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=un(o,r),u=mm(t.stateNode,o,u),Yu(t,u),Wt!==4&&(Wt=2)),!1;var f=Error(i(520),{cause:o});if(f=un(f,r),zi===null?zi=[f]:zi.push(f),Wt!==4&&(Wt=2),n===null)return!0;o=un(o,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,t=u&-u,r.lanes|=t,t=mm(r.stateNode,o,t),Yu(r,t),!1;case 1:if(n=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Aa===null||!Aa.has(f))))return r.flags|=65536,u&=-u,r.lanes|=u,u=og(u),cg(u,t,r,o),Yu(r,u),!1}r=r.return}while(r!==null);return!1}var fm=Error(i(461)),ts=!1;function vs(t,n,r,o){n.child=t===null?fp(n,null,r,o):pl(n,t.child,r,o)}function dg(t,n,r,o,u){r=r.render;var f=n.ref;if("ref"in o){var y={};for(var _ in o)_!=="ref"&&(y[_]=o[_])}else y=o;return ml(n),o=Wu(t,n,r,y,f,u),_=Xu(),t!==null&&!ts?(Ku(t,n,u),sa(t,n,u)):(nt&&_&&Eu(n),n.flags|=1,vs(t,n,o,u),n.child)}function ug(t,n,r,o,u){if(t===null){var f=r.type;return typeof f=="function"&&!Cu(f)&&f.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=f,mg(t,n,f,o,u)):(t=Qo(r.type,null,o,n,n.mode,u),t.ref=n.ref,t.return=n,n.child=t)}if(f=t.child,!bm(t,u)){var y=f.memoizedProps;if(r=r.compare,r=r!==null?r:fi,r(y,o)&&t.ref===n.ref)return sa(t,n,u)}return n.flags|=1,t=Kn(f,o),t.ref=n.ref,t.return=n,n.child=t}function mg(t,n,r,o,u){if(t!==null){var f=t.memoizedProps;if(fi(f,o)&&t.ref===n.ref)if(ts=!1,n.pendingProps=o=f,bm(t,u))(t.flags&131072)!==0&&(ts=!0);else return n.lanes=t.lanes,sa(t,n,u)}return hm(t,n,r,o,u)}function fg(t,n,r,o){var u=o.children,f=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(f=f!==null?f.baseLanes|r:r,t!==null){for(o=n.child=t.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~f}else o=0,n.child=null;return hg(t,n,f,r,o)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&tc(n,f!==null?f.cachePool:null),f!==null?pp(n,f):Vu(),gp(n);else return o=n.lanes=536870912,hg(t,n,f!==null?f.baseLanes|r:r,r,o)}else f!==null?(tc(n,f.cachePool),pp(n,f),Ea(),n.memoizedState=null):(t!==null&&tc(n,null),Vu(),Ea());return vs(t,n,u,r),n.child}function Ti(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function hg(t,n,r,o,u){var f=Bu();return f=f===null?null:{parent:Jt._currentValue,pool:f},n.memoizedState={baseLanes:r,cachePool:f},t!==null&&tc(n,null),Vu(),gp(n),t!==null&&ir(t,n,o,!0),n.childLanes=u,null}function gc(t,n){return n=jc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function xg(t,n,r){return pl(n,t.child,null,r),t=gc(n,n.pendingProps),t.flags|=2,Zs(n),n.memoizedState=null,t}function WS(t,n,r){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(nt){if(o.mode==="hidden")return t=gc(n,o),n.lanes=536870912,Ti(null,t);if($u(n),(t=Ut)?(t=kv(t,hn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:ba!==null?{id:Rn,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},r=Zx(t),r.return=n,n.child=r,ps=n,Ut=null)):t=null,t===null)throw wa(n);return n.lanes=536870912,null}return gc(n,o)}var f=t.memoizedState;if(f!==null){var y=f.dehydrated;if($u(n),u)if(n.flags&256)n.flags&=-257,n=xg(t,n,r);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(i(558));else if(ts||ir(t,n,r,!1),u=(r&t.childLanes)!==0,ts||u){if(o=Et,o!==null&&(y=lx(o,r),y!==0&&y!==f.retryLane))throw f.retryLane=y,ol(t,y),Fs(o,t,y),fm;Tc(),n=xg(t,n,r)}else t=f.treeContext,Ut=pn(y.nextSibling),ps=n,nt=!0,Na=null,hn=!1,t!==null&&tp(n,t),n=gc(n,o),n.flags|=4096;return n}return t=Kn(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function vc(t,n){var r=n.ref;if(r===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(t===null||t.ref!==r)&&(n.flags|=4194816)}}function hm(t,n,r,o,u){return ml(n),r=Wu(t,n,r,o,void 0,u),o=Xu(),t!==null&&!ts?(Ku(t,n,u),sa(t,n,u)):(nt&&o&&Eu(n),n.flags|=1,vs(t,n,r,u),n.child)}function pg(t,n,r,o,u,f){return ml(n),n.updateQueue=null,r=jp(n,o,r,u),vp(t),o=Xu(),t!==null&&!ts?(Ku(t,n,f),sa(t,n,f)):(nt&&o&&Eu(n),n.flags|=1,vs(t,n,r,f),n.child)}function gg(t,n,r,o,u){if(ml(n),n.stateNode===null){var f=nr,y=r.contextType;typeof y=="object"&&y!==null&&(f=gs(y)),f=new r(o,f),n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=um,n.stateNode=f,f._reactInternals=n,f=n.stateNode,f.props=o,f.state=n.memoizedState,f.refs={},Hu(n),y=r.contextType,f.context=typeof y=="object"&&y!==null?gs(y):nr,f.state=n.memoizedState,y=r.getDerivedStateFromProps,typeof y=="function"&&(dm(n,r,y,o),f.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&um.enqueueReplaceState(f,f.state,null),wi(n,o,f,u),Ni(),f.state=n.memoizedState),typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){f=n.stateNode;var _=n.memoizedProps,z=vl(r,_);f.props=z;var K=f.context,ie=r.contextType;y=nr,typeof ie=="object"&&ie!==null&&(y=gs(ie));var ue=r.getDerivedStateFromProps;ie=typeof ue=="function"||typeof f.getSnapshotBeforeUpdate=="function",_=n.pendingProps!==_,ie||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_||K!==y)&&ng(n,f,o,y),_a=!1;var J=n.memoizedState;f.state=J,wi(n,o,f,u),Ni(),K=n.memoizedState,_||J!==K||_a?(typeof ue=="function"&&(dm(n,r,ue,o),K=n.memoizedState),(z=_a||sg(n,r,z,o,J,K,y))?(ie||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=K),f.props=o,f.state=K,f.context=y,o=z):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{f=n.stateNode,Fu(t,n),y=n.memoizedProps,ie=vl(r,y),f.props=ie,ue=n.pendingProps,J=f.context,K=r.contextType,z=nr,typeof K=="object"&&K!==null&&(z=gs(K)),_=r.getDerivedStateFromProps,(K=typeof _=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==ue||J!==z)&&ng(n,f,o,z),_a=!1,J=n.memoizedState,f.state=J,wi(n,o,f,u),Ni();var ne=n.memoizedState;y!==ue||J!==ne||_a||t!==null&&t.dependencies!==null&&Jo(t.dependencies)?(typeof _=="function"&&(dm(n,r,_,o),ne=n.memoizedState),(ie=_a||sg(n,r,ie,o,J,ne,z)||t!==null&&t.dependencies!==null&&Jo(t.dependencies))?(K||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,ne,z),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,ne,z)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&J===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&J===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=ne),f.props=o,f.state=ne,f.context=z,o=ie):(typeof f.componentDidUpdate!="function"||y===t.memoizedProps&&J===t.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&J===t.memoizedState||(n.flags|=1024),o=!1)}return f=o,vc(t,n),o=(n.flags&128)!==0,f||o?(f=n.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:f.render(),n.flags|=1,t!==null&&o?(n.child=pl(n,t.child,null,u),n.child=pl(n,null,r,u)):vs(t,n,r,u),n.memoizedState=f.state,t=n.child):t=sa(t,n,u),t}function vg(t,n,r,o){return dl(),n.flags|=256,vs(t,n,r,o),n.child}var xm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pm(t){return{baseLanes:t,cachePool:ip()}}function gm(t,n,r){return t=t!==null?t.childLanes&~r:0,n&&(t|=en),t}function jg(t,n,r){var o=n.pendingProps,u=!1,f=(n.flags&128)!==0,y;if((y=f)||(y=t!==null&&t.memoizedState===null?!1:(Kt.current&2)!==0),y&&(u=!0,n.flags&=-129),y=(n.flags&32)!==0,n.flags&=-33,t===null){if(nt){if(u?Ta(n):Ea(),(t=Ut)?(t=kv(t,hn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:ba!==null?{id:Rn,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},r=Zx(t),r.return=n,n.child=r,ps=n,Ut=null)):t=null,t===null)throw wa(n);return Jm(t)?n.lanes=32:n.lanes=536870912,null}var _=o.children;return o=o.fallback,u?(Ea(),u=n.mode,_=jc({mode:"hidden",children:_},u),o=cl(o,u,r,null),_.return=n,o.return=n,_.sibling=o,n.child=_,o=n.child,o.memoizedState=pm(r),o.childLanes=gm(t,y,r),n.memoizedState=xm,Ti(null,o)):(Ta(n),vm(n,_))}var z=t.memoizedState;if(z!==null&&(_=z.dehydrated,_!==null)){if(f)n.flags&256?(Ta(n),n.flags&=-257,n=jm(t,n,r)):n.memoizedState!==null?(Ea(),n.child=t.child,n.flags|=128,n=null):(Ea(),_=o.fallback,u=n.mode,o=jc({mode:"visible",children:o.children},u),_=cl(_,u,r,null),_.flags|=2,o.return=n,_.return=n,o.sibling=_,n.child=o,pl(n,t.child,null,r),o=n.child,o.memoizedState=pm(r),o.childLanes=gm(t,y,r),n.memoizedState=xm,n=Ti(null,o));else if(Ta(n),Jm(_)){if(y=_.nextSibling&&_.nextSibling.dataset,y)var K=y.dgst;y=K,o=Error(i(419)),o.stack="",o.digest=y,pi({value:o,source:null,stack:null}),n=jm(t,n,r)}else if(ts||ir(t,n,r,!1),y=(r&t.childLanes)!==0,ts||y){if(y=Et,y!==null&&(o=lx(y,r),o!==0&&o!==z.retryLane))throw z.retryLane=o,ol(t,o),Fs(y,t,o),fm;Zm(_)||Tc(),n=jm(t,n,r)}else Zm(_)?(n.flags|=192,n.child=t.child,n=null):(t=z.treeContext,Ut=pn(_.nextSibling),ps=n,nt=!0,Na=null,hn=!1,t!==null&&tp(n,t),n=vm(n,o.children),n.flags|=4096);return n}return u?(Ea(),_=o.fallback,u=n.mode,z=t.child,K=z.sibling,o=Kn(z,{mode:"hidden",children:o.children}),o.subtreeFlags=z.subtreeFlags&65011712,K!==null?_=Kn(K,_):(_=cl(_,u,r,null),_.flags|=2),_.return=n,o.return=n,o.sibling=_,n.child=o,Ti(null,o),o=n.child,_=t.child.memoizedState,_===null?_=pm(r):(u=_.cachePool,u!==null?(z=Jt._currentValue,u=u.parent!==z?{parent:z,pool:z}:u):u=ip(),_={baseLanes:_.baseLanes|r,cachePool:u}),o.memoizedState=_,o.childLanes=gm(t,y,r),n.memoizedState=xm,Ti(t.child,o)):(Ta(n),r=t.child,t=r.sibling,r=Kn(r,{mode:"visible",children:o.children}),r.return=n,r.sibling=null,t!==null&&(y=n.deletions,y===null?(n.deletions=[t],n.flags|=16):y.push(t)),n.child=r,n.memoizedState=null,r)}function vm(t,n){return n=jc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function jc(t,n){return t=Ks(22,t,null,n),t.lanes=0,t}function jm(t,n,r){return pl(n,t.child,null,r),t=vm(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function yg(t,n,r){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Ru(t.return,n,r)}function ym(t,n,r,o,u,f){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:u,treeForkCount:f}:(y.isBackwards=n,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=r,y.tailMode=u,y.treeForkCount=f)}function bg(t,n,r){var o=n.pendingProps,u=o.revealOrder,f=o.tail;o=o.children;var y=Kt.current,_=(y&2)!==0;if(_?(y=y&1|2,n.flags|=128):y&=1,W(Kt,y),vs(t,n,o,r),o=nt?xi:0,!_&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&yg(t,r,n);else if(t.tag===19)yg(t,r,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"forwards":for(r=n.child,u=null;r!==null;)t=r.alternate,t!==null&&ic(t)===null&&(u=r),r=r.sibling;r=u,r===null?(u=n.child,n.child=null):(u=r.sibling,r.sibling=null),ym(n,!1,u,r,f,o);break;case"backwards":case"unstable_legacy-backwards":for(r=null,u=n.child,n.child=null;u!==null;){if(t=u.alternate,t!==null&&ic(t)===null){n.child=u;break}t=u.sibling,u.sibling=r,r=u,u=t}ym(n,!0,r,null,f,o);break;case"together":ym(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function sa(t,n,r){if(t!==null&&(n.dependencies=t.dependencies),Oa|=n.lanes,(r&n.childLanes)===0)if(t!==null){if(ir(t,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,r=Kn(t,t.pendingProps),n.child=r,r.return=n;t.sibling!==null;)t=t.sibling,r=r.sibling=Kn(t,t.pendingProps),r.return=n;r.sibling=null}return n.child}function bm(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Jo(t)))}function XS(t,n,r){switch(n.tag){case 3:Ce(n,n.stateNode.containerInfo),Sa(n,Jt,t.memoizedState.cache),dl();break;case 27:case 5:Oe(n);break;case 4:Ce(n,n.stateNode.containerInfo);break;case 10:Sa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,$u(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ta(n),n.flags|=128,null):(r&n.child.childLanes)!==0?jg(t,n,r):(Ta(n),t=sa(t,n,r),t!==null?t.sibling:null);Ta(n);break;case 19:var u=(t.flags&128)!==0;if(o=(r&n.childLanes)!==0,o||(ir(t,n,r,!1),o=(r&n.childLanes)!==0),u){if(o)return bg(t,n,r);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),W(Kt,Kt.current),o)break;return null;case 22:return n.lanes=0,fg(t,n,r,n.pendingProps);case 24:Sa(n,Jt,t.memoizedState.cache)}return sa(t,n,r)}function Ng(t,n,r){if(t!==null)if(t.memoizedProps!==n.pendingProps)ts=!0;else{if(!bm(t,r)&&(n.flags&128)===0)return ts=!1,XS(t,n,r);ts=(t.flags&131072)!==0}else ts=!1,nt&&(n.flags&1048576)!==0&&ep(n,xi,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=hl(n.elementType),n.type=t,typeof t=="function")Cu(t)?(o=vl(t,o),n.tag=1,n=gg(null,n,t,o,r)):(n.tag=0,n=hm(null,n,t,o,r));else{if(t!=null){var u=t.$$typeof;if(u===k){n.tag=11,n=dg(null,n,t,o,r);break e}else if(u===E){n.tag=14,n=ug(null,n,t,o,r);break e}}throw n=ae(t)||t,Error(i(306,n,""))}}return n;case 0:return hm(t,n,n.type,n.pendingProps,r);case 1:return o=n.type,u=vl(o,n.pendingProps),gg(t,n,o,u,r);case 3:e:{if(Ce(n,n.stateNode.containerInfo),t===null)throw Error(i(387));o=n.pendingProps;var f=n.memoizedState;u=f.element,Fu(t,n),wi(n,o,null,r);var y=n.memoizedState;if(o=y.cache,Sa(n,Jt,o),o!==f.cache&&zu(n,[Jt],r,!0),Ni(),o=y.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:y.cache},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){n=vg(t,n,o,r);break e}else if(o!==u){u=un(Error(i(424)),n),pi(u),n=vg(t,n,o,r);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ut=pn(t.firstChild),ps=n,nt=!0,Na=null,hn=!0,r=fp(n,null,o,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(dl(),o===u){n=sa(t,n,r);break e}vs(t,n,o,r)}n=n.child}return n;case 26:return vc(t,n),t===null?(r=Av(n.type,null,n.pendingProps,null))?n.memoizedState=r:nt||(r=n.type,t=n.pendingProps,o=zc(ve.current).createElement(r),o[xs]=n,o[zs]=t,js(o,r,t),cs(o),n.stateNode=o):n.memoizedState=Av(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Oe(n),t===null&&nt&&(o=n.stateNode=Mv(n.type,n.pendingProps,ve.current),ps=n,hn=!0,u=Ut,La(n.type)?(ef=u,Ut=pn(o.firstChild)):Ut=u),vs(t,n,n.pendingProps.children,r),vc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&nt&&((u=o=Ut)&&(o=__(o,n.type,n.pendingProps,hn),o!==null?(n.stateNode=o,ps=n,Ut=pn(o.firstChild),hn=!1,u=!0):u=!1),u||wa(n)),Oe(n),u=n.type,f=n.pendingProps,y=t!==null?t.memoizedProps:null,o=f.children,Xm(u,f)?o=null:y!==null&&Xm(u,y)&&(n.flags|=32),n.memoizedState!==null&&(u=Wu(t,n,HS,null,null,r),qi._currentValue=u),vc(t,n),vs(t,n,o,r),n.child;case 6:return t===null&&nt&&((t=r=Ut)&&(r=C_(r,n.pendingProps,hn),r!==null?(n.stateNode=r,ps=n,Ut=null,t=!0):t=!1),t||wa(n)),null;case 13:return jg(t,n,r);case 4:return Ce(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=pl(n,null,o,r):vs(t,n,o,r),n.child;case 11:return dg(t,n,n.type,n.pendingProps,r);case 7:return vs(t,n,n.pendingProps,r),n.child;case 8:return vs(t,n,n.pendingProps.children,r),n.child;case 12:return vs(t,n,n.pendingProps.children,r),n.child;case 10:return o=n.pendingProps,Sa(n,n.type,o.value),vs(t,n,o.children,r),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,ml(n),u=gs(u),o=o(u),n.flags|=1,vs(t,n,o,r),n.child;case 14:return ug(t,n,n.type,n.pendingProps,r);case 15:return mg(t,n,n.type,n.pendingProps,r);case 19:return bg(t,n,r);case 31:return WS(t,n,r);case 22:return fg(t,n,r,n.pendingProps);case 24:return ml(n),o=gs(Jt),t===null?(u=Bu(),u===null&&(u=Et,f=Pu(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=r),u=f),n.memoizedState={parent:o,cache:u},Hu(n),Sa(n,Jt,u)):((t.lanes&r)!==0&&(Fu(t,n),wi(n,null,null,r),Ni()),u=t.memoizedState,f=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),Sa(n,Jt,o)):(o=f.cache,Sa(n,Jt,o),o!==u.cache&&zu(n,[Jt],r,!0))),vs(t,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function na(t){t.flags|=4}function Nm(t,n,r,o,u){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(Xg())t.flags|=8192;else throw xl=nc,Uu}else t.flags&=-16777217}function wg(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Bv(n))if(Xg())t.flags|=8192;else throw xl=nc,Uu}function yc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?ql():536870912,t.lanes|=n,jr|=n)}function Ei(t,n){if(!nt)switch(t.tailMode){case"hidden":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Ht(t){var n=t.alternate!==null&&t.alternate.child===t.child,r=0,o=0;if(n)for(var u=t.child;u!==null;)r|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)r|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=r,n}function KS(t,n,r){var o=n.pendingProps;switch(Mu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(n),null;case 1:return Ht(n),null;case 3:return r=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Jn(Jt),Q(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(rr(n)?na(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Ou())),Ht(n),null;case 26:var u=n.type,f=n.memoizedState;return t===null?(na(n),f!==null?(Ht(n),wg(n,f)):(Ht(n),Nm(n,u,null,o,r))):f?f!==t.memoizedState?(na(n),Ht(n),wg(n,f)):(Ht(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&na(n),Ht(n),Nm(n,u,t,o,r)),null;case 27:if($e(n),r=ve.current,u=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&na(n);else{if(!o){if(n.stateNode===null)throw Error(i(166));return Ht(n),null}t=fe.current,rr(n)?sp(n):(t=Mv(u,o,r),n.stateNode=t,na(n))}return Ht(n),null;case 5:if($e(n),u=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&na(n);else{if(!o){if(n.stateNode===null)throw Error(i(166));return Ht(n),null}if(f=fe.current,rr(n))sp(n);else{var y=zc(ve.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?f.multiple=!0:o.size&&(f.size=o.size);break;default:f=typeof o.is=="string"?y.createElement(u,{is:o.is}):y.createElement(u)}}f[xs]=n,f[zs]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(js(f,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&na(n)}}return Ht(n),Nm(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&na(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(i(166));if(t=ve.current,rr(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,u=ps,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[xs]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||jv(t.nodeValue,r)),t||wa(n,!0)}else t=zc(t).createTextNode(o),t[xs]=n,n.stateNode=t}return Ht(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=rr(n),r!==null){if(t===null){if(!o)throw Error(i(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[xs]=n}else dl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ht(n),t=!1}else r=Ou(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(Zs(n),n):(Zs(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Ht(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=rr(n),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(i(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));u[xs]=n}else dl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ht(n),u=!1}else u=Ou(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(Zs(n),n):(Zs(n),null)}return Zs(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==u&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),yc(n,n.updateQueue),Ht(n),null);case 4:return Q(),t===null&&Vm(n.stateNode.containerInfo),Ht(n),null;case 10:return Jn(n.type),Ht(n),null;case 19:if(F(Kt),o=n.memoizedState,o===null)return Ht(n),null;if(u=(n.flags&128)!==0,f=o.rendering,f===null)if(u)Ei(o,!1);else{if(Wt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(f=ic(t),f!==null){for(n.flags|=128,Ei(o,!1),t=f.updateQueue,n.updateQueue=t,yc(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Qx(r,t),r=r.sibling;return W(Kt,Kt.current&1|2),nt&&Qn(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&ke()>_c&&(n.flags|=128,u=!0,Ei(o,!1),n.lanes=4194304)}else{if(!u)if(t=ic(f),t!==null){if(n.flags|=128,u=!0,t=t.updateQueue,n.updateQueue=t,yc(n,t),Ei(o,!0),o.tail===null&&o.tailMode==="hidden"&&!f.alternate&&!nt)return Ht(n),null}else 2*ke()-o.renderingStartTime>_c&&r!==536870912&&(n.flags|=128,u=!0,Ei(o,!1),n.lanes=4194304);o.isBackwards?(f.sibling=n.child,n.child=f):(t=o.last,t!==null?t.sibling=f:n.child=f,o.last=f)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ke(),t.sibling=null,r=Kt.current,W(Kt,u?r&1|2:r&1),nt&&Qn(n,o.treeForkCount),t):(Ht(n),null);case 22:case 23:return Zs(n),Gu(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(Ht(n),n.subtreeFlags&6&&(n.flags|=8192)):Ht(n),r=n.updateQueue,r!==null&&yc(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&F(fl),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Jn(Jt),Ht(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function QS(t,n){switch(Mu(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Jn(Jt),Q(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return $e(n),null;case 31:if(n.memoizedState!==null){if(Zs(n),n.alternate===null)throw Error(i(340));dl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Zs(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));dl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return F(Kt),null;case 4:return Q(),null;case 10:return Jn(n.type),null;case 22:case 23:return Zs(n),Gu(),t!==null&&F(fl),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Jn(Jt),null;case 25:return null;default:return null}}function Sg(t,n){switch(Mu(n),n.tag){case 3:Jn(Jt),Q();break;case 26:case 27:case 5:$e(n);break;case 4:Q();break;case 31:n.memoizedState!==null&&Zs(n);break;case 13:Zs(n);break;case 19:F(Kt);break;case 10:Jn(n.type);break;case 22:case 23:Zs(n),Gu(),t!==null&&F(fl);break;case 24:Jn(Jt)}}function Mi(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var u=o.next;r=u;do{if((r.tag&t)===t){o=void 0;var f=r.create,y=r.inst;o=f(),y.destroy=o}r=r.next}while(r!==u)}}catch(_){jt(n,n.return,_)}}function Ma(t,n,r){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var f=u.next;o=f;do{if((o.tag&t)===t){var y=o.inst,_=y.destroy;if(_!==void 0){y.destroy=void 0,u=n;var z=r,K=_;try{K()}catch(ie){jt(u,z,ie)}}}o=o.next}while(o!==f)}}catch(ie){jt(n,n.return,ie)}}function _g(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{xp(n,r)}catch(o){jt(t,t.return,o)}}}function Cg(t,n,r){r.props=vl(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){jt(t,n,o)}}function Di(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(u){jt(t,n,u)}}function Pn(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(u){jt(t,n,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(u){jt(t,n,u)}else r.current=null}function kg(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(u){jt(t,t.return,u)}}function wm(t,n,r){try{var o=t.stateNode;j_(o,t.type,r,n),o[zs]=n}catch(u){jt(t,t.return,u)}}function Tg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&La(t.type)||t.tag===4}function Sm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Tg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&La(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function _m(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Wn));else if(o!==4&&(o===27&&La(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(_m(t,n,r),t=t.sibling;t!==null;)_m(t,n,r),t=t.sibling}function bc(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&La(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(bc(t,n,r),t=t.sibling;t!==null;)bc(t,n,r),t=t.sibling}function Eg(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);js(n,o,r),n[xs]=t,n[zs]=r}catch(f){jt(t,t.return,f)}}var aa=!1,ss=!1,Cm=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,ds=null;function ZS(t,n){if(t=t.containerInfo,Im=Yc,t=Yx(t),ju(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var u=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var y=0,_=-1,z=-1,K=0,ie=0,ue=t,J=null;t:for(;;){for(var ne;ue!==r||u!==0&&ue.nodeType!==3||(_=y+u),ue!==f||o!==0&&ue.nodeType!==3||(z=y+o),ue.nodeType===3&&(y+=ue.nodeValue.length),(ne=ue.firstChild)!==null;)J=ue,ue=ne;for(;;){if(ue===t)break t;if(J===r&&++K===u&&(_=y),J===f&&++ie===o&&(z=y),(ne=ue.nextSibling)!==null)break;ue=J,J=ue.parentNode}ue=ne}r=_===-1||z===-1?null:{start:_,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Wm={focusedElem:t,selectionRange:r},Yc=!1,ds=n;ds!==null;)if(n=ds,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,ds=t;else for(;ds!==null;){switch(n=ds,f=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r<t.length;r++)u=t[r],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&f!==null){t=void 0,r=n,u=f.memoizedProps,f=f.memoizedState,o=r.stateNode;try{var we=vl(r.type,u);t=o.getSnapshotBeforeUpdate(we,f),o.__reactInternalSnapshotBeforeUpdate=t}catch(Re){jt(r,r.return,Re)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,r=t.nodeType,r===9)Qm(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Qm(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(i(163))}if(t=n.sibling,t!==null){t.return=n.return,ds=t;break}ds=n.return}}function Dg(t,n,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:ra(t,r),o&4&&Mi(5,r);break;case 1:if(ra(t,r),o&4)if(t=r.stateNode,n===null)try{t.componentDidMount()}catch(y){jt(r,r.return,y)}else{var u=vl(r.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(u,n,t.__reactInternalSnapshotBeforeUpdate)}catch(y){jt(r,r.return,y)}}o&64&&_g(r),o&512&&Di(r,r.return);break;case 3:if(ra(t,r),o&64&&(t=r.updateQueue,t!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{xp(t,n)}catch(y){jt(r,r.return,y)}}break;case 27:n===null&&o&4&&Eg(r);case 26:case 5:ra(t,r),n===null&&o&4&&kg(r),o&512&&Di(r,r.return);break;case 12:ra(t,r);break;case 31:ra(t,r),o&4&&Rg(t,r);break;case 13:ra(t,r),o&4&&zg(t,r),o&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=i_.bind(null,r),k_(t,r))));break;case 22:if(o=r.memoizedState!==null||aa,!o){n=n!==null&&n.memoizedState!==null||ss,u=aa;var f=ss;aa=o,(ss=n)&&!f?ia(t,r,(r.subtreeFlags&8772)!==0):ra(t,r),aa=u,ss=f}break;case 30:break;default:ra(t,r)}}function Og(t){var n=t.alternate;n!==null&&(t.alternate=null,Og(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&su(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Yt=null,Ls=!1;function la(t,n,r){for(r=r.child;r!==null;)Ag(t,n,r),r=r.sibling}function Ag(t,n,r){if(ge&&typeof ge.onCommitFiberUnmount=="function")try{ge.onCommitFiberUnmount(se,r)}catch{}switch(r.tag){case 26:ss||Pn(r,n),la(t,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ss||Pn(r,n);var o=Yt,u=Ls;La(r.type)&&(Yt=r.stateNode,Ls=!1),la(t,n,r),Hi(r.stateNode),Yt=o,Ls=u;break;case 5:ss||Pn(r,n);case 6:if(o=Yt,u=Ls,Yt=null,la(t,n,r),Yt=o,Ls=u,Yt!==null)if(Ls)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(r.stateNode)}catch(f){jt(r,n,f)}else try{Yt.removeChild(r.stateNode)}catch(f){jt(r,n,f)}break;case 18:Yt!==null&&(Ls?(t=Yt,_v(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),kr(t)):_v(Yt,r.stateNode));break;case 4:o=Yt,u=Ls,Yt=r.stateNode.containerInfo,Ls=!0,la(t,n,r),Yt=o,Ls=u;break;case 0:case 11:case 14:case 15:Ma(2,r,n),ss||Ma(4,r,n),la(t,n,r);break;case 1:ss||(Pn(r,n),o=r.stateNode,typeof o.componentWillUnmount=="function"&&Cg(r,n,o)),la(t,n,r);break;case 21:la(t,n,r);break;case 22:ss=(o=ss)||r.memoizedState!==null,la(t,n,r),ss=o;break;default:la(t,n,r)}}function Rg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{kr(t)}catch(r){jt(n,n.return,r)}}}function zg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{kr(t)}catch(r){jt(n,n.return,r)}}function JS(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Mg),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Mg),n;default:throw Error(i(435,t.tag))}}function Nc(t,n){var r=JS(t);n.forEach(function(o){if(!r.has(o)){r.add(o);var u=o_.bind(null,t,o);o.then(u,u)}})}function Bs(t,n){var r=n.deletions;if(r!==null)for(var o=0;o<r.length;o++){var u=r[o],f=t,y=n,_=y;e:for(;_!==null;){switch(_.tag){case 27:if(La(_.type)){Yt=_.stateNode,Ls=!1;break e}break;case 5:Yt=_.stateNode,Ls=!1;break e;case 3:case 4:Yt=_.stateNode.containerInfo,Ls=!0;break e}_=_.return}if(Yt===null)throw Error(i(160));Ag(f,y,u),Yt=null,Ls=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Pg(n,t),n=n.sibling}var Sn=null;function Pg(t,n){var r=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Bs(n,t),Us(t),o&4&&(Ma(3,t,t.return),Mi(3,t),Ma(5,t,t.return));break;case 1:Bs(n,t),Us(t),o&512&&(ss||r===null||Pn(r,r.return)),o&64&&aa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?o:r.concat(o))));break;case 26:var u=Sn;if(Bs(n,t),Us(t),o&512&&(ss||r===null||Pn(r,r.return)),o&4){var f=r!==null?r.memoizedState:null;if(o=t.memoizedState,r===null)if(o===null)if(t.stateNode===null){e:{o=t.type,r=t.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":f=u.getElementsByTagName("title")[0],(!f||f[ai]||f[xs]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(o),u.head.insertBefore(f,u.querySelector("head > title"))),js(f,o,r),f[xs]=t,cs(f),o=f;break e;case"link":var y=Pv("link","href",u).get(o+(r.href||""));if(y){for(var _=0;_<y.length;_++)if(f=y[_],f.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&f.getAttribute("rel")===(r.rel==null?null:r.rel)&&f.getAttribute("title")===(r.title==null?null:r.title)&&f.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){y.splice(_,1);break t}}f=u.createElement(o),js(f,o,r),u.head.appendChild(f);break;case"meta":if(y=Pv("meta","content",u).get(o+(r.content||""))){for(_=0;_<y.length;_++)if(f=y[_],f.getAttribute("content")===(r.content==null?null:""+r.content)&&f.getAttribute("name")===(r.name==null?null:r.name)&&f.getAttribute("property")===(r.property==null?null:r.property)&&f.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&f.getAttribute("charset")===(r.charSet==null?null:r.charSet)){y.splice(_,1);break t}}f=u.createElement(o),js(f,o,r),u.head.appendChild(f);break;default:throw Error(i(468,o))}f[xs]=t,cs(f),o=f}t.stateNode=o}else Lv(u,t.type,t.stateNode);else t.stateNode=zv(u,o,t.memoizedProps);else f!==o?(f===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):f.count--,o===null?Lv(u,t.type,t.stateNode):zv(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&wm(t,t.memoizedProps,r.memoizedProps)}break;case 27:Bs(n,t),Us(t),o&512&&(ss||r===null||Pn(r,r.return)),r!==null&&o&4&&wm(t,t.memoizedProps,r.memoizedProps);break;case 5:if(Bs(n,t),Us(t),o&512&&(ss||r===null||Pn(r,r.return)),t.flags&32){u=t.stateNode;try{Kl(u,"")}catch(we){jt(t,t.return,we)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,wm(t,u,r!==null?r.memoizedProps:u)),o&1024&&(Cm=!0);break;case 6:if(Bs(n,t),Us(t),o&4){if(t.stateNode===null)throw Error(i(162));o=t.memoizedProps,r=t.stateNode;try{r.nodeValue=o}catch(we){jt(t,t.return,we)}}break;case 3:if(Bc=null,u=Sn,Sn=Pc(n.containerInfo),Bs(n,t),Sn=u,Us(t),o&4&&r!==null&&r.memoizedState.isDehydrated)try{kr(n.containerInfo)}catch(we){jt(t,t.return,we)}Cm&&(Cm=!1,Lg(t));break;case 4:o=Sn,Sn=Pc(t.stateNode.containerInfo),Bs(n,t),Us(t),Sn=o;break;case 12:Bs(n,t),Us(t);break;case 31:Bs(n,t),Us(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Nc(t,o)));break;case 13:Bs(n,t),Us(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Sc=ke()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Nc(t,o)));break;case 22:u=t.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,K=aa,ie=ss;if(aa=K||u,ss=ie||z,Bs(n,t),ss=ie,aa=K,Us(t),o&8192)e:for(n=t.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(r===null||z||aa||ss||jl(t)),r=null,n=t;;){if(n.tag===5||n.tag===26){if(r===null){z=r=n;try{if(f=z.stateNode,u)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{_=z.stateNode;var ue=z.memoizedProps.style,J=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;_.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(we){jt(z,z.return,we)}}}else if(n.tag===6){if(r===null){z=n;try{z.stateNode.nodeValue=u?"":z.memoizedProps}catch(we){jt(z,z.return,we)}}}else if(n.tag===18){if(r===null){z=n;try{var ne=z.stateNode;u?Cv(ne,!0):Cv(z.stateNode,!1)}catch(we){jt(z,z.return,we)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(r=o.retryQueue,r!==null&&(o.retryQueue=null,Nc(t,r))));break;case 19:Bs(n,t),Us(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Nc(t,o)));break;case 30:break;case 21:break;default:Bs(n,t),Us(t)}}function Us(t){var n=t.flags;if(n&2){try{for(var r,o=t.return;o!==null;){if(Tg(o)){r=o;break}o=o.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var u=r.stateNode,f=Sm(t);bc(t,f,u);break;case 5:var y=r.stateNode;r.flags&32&&(Kl(y,""),r.flags&=-33);var _=Sm(t);bc(t,_,y);break;case 3:case 4:var z=r.stateNode.containerInfo,K=Sm(t);_m(t,K,z);break;default:throw Error(i(161))}}catch(ie){jt(t,t.return,ie)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Lg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Lg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function ra(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Dg(t,n.alternate,n),n=n.sibling}function jl(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Ma(4,n,n.return),jl(n);break;case 1:Pn(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Cg(n,n.return,r),jl(n);break;case 27:Hi(n.stateNode);case 26:case 5:Pn(n,n.return),jl(n);break;case 22:n.memoizedState===null&&jl(n);break;case 30:jl(n);break;default:jl(n)}t=t.sibling}}function ia(t,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=t,f=n,y=f.flags;switch(f.tag){case 0:case 11:case 15:ia(u,f,r),Mi(4,f);break;case 1:if(ia(u,f,r),o=f,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(K){jt(o,o.return,K)}if(o=f,u=o.updateQueue,u!==null){var _=o.stateNode;try{var z=u.shared.hiddenCallbacks;if(z!==null)for(u.shared.hiddenCallbacks=null,u=0;u<z.length;u++)hp(z[u],_)}catch(K){jt(o,o.return,K)}}r&&y&64&&_g(f),Di(f,f.return);break;case 27:Eg(f);case 26:case 5:ia(u,f,r),r&&o===null&&y&4&&kg(f),Di(f,f.return);break;case 12:ia(u,f,r);break;case 31:ia(u,f,r),r&&y&4&&Rg(u,f);break;case 13:ia(u,f,r),r&&y&4&&zg(u,f);break;case 22:f.memoizedState===null&&ia(u,f,r),Di(f,f.return);break;case 30:break;default:ia(u,f,r)}n=n.sibling}}function km(t,n){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&gi(r))}function Tm(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&gi(t))}function _n(t,n,r,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bg(t,n,r,o),n=n.sibling}function Bg(t,n,r,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:_n(t,n,r,o),u&2048&&Mi(9,n);break;case 1:_n(t,n,r,o);break;case 3:_n(t,n,r,o),u&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&gi(t)));break;case 12:if(u&2048){_n(t,n,r,o),t=n.stateNode;try{var f=n.memoizedProps,y=f.id,_=f.onPostCommit;typeof _=="function"&&_(y,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(z){jt(n,n.return,z)}}else _n(t,n,r,o);break;case 31:_n(t,n,r,o);break;case 13:_n(t,n,r,o);break;case 23:break;case 22:f=n.stateNode,y=n.alternate,n.memoizedState!==null?f._visibility&2?_n(t,n,r,o):Oi(t,n):f._visibility&2?_n(t,n,r,o):(f._visibility|=2,pr(t,n,r,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&km(y,n);break;case 24:_n(t,n,r,o),u&2048&&Tm(n.alternate,n);break;default:_n(t,n,r,o)}}function pr(t,n,r,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var f=t,y=n,_=r,z=o,K=y.flags;switch(y.tag){case 0:case 11:case 15:pr(f,y,_,z,u),Mi(8,y);break;case 23:break;case 22:var ie=y.stateNode;y.memoizedState!==null?ie._visibility&2?pr(f,y,_,z,u):Oi(f,y):(ie._visibility|=2,pr(f,y,_,z,u)),u&&K&2048&&km(y.alternate,y);break;case 24:pr(f,y,_,z,u),u&&K&2048&&Tm(y.alternate,y);break;default:pr(f,y,_,z,u)}n=n.sibling}}function Oi(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=t,o=n,u=o.flags;switch(o.tag){case 22:Oi(r,o),u&2048&&km(o.alternate,o);break;case 24:Oi(r,o),u&2048&&Tm(o.alternate,o);break;default:Oi(r,o)}n=n.sibling}}var Ai=8192;function gr(t,n,r){if(t.subtreeFlags&Ai)for(t=t.child;t!==null;)Ug(t,n,r),t=t.sibling}function Ug(t,n,r){switch(t.tag){case 26:gr(t,n,r),t.flags&Ai&&t.memoizedState!==null&&U_(r,Sn,t.memoizedState,t.memoizedProps);break;case 5:gr(t,n,r);break;case 3:case 4:var o=Sn;Sn=Pc(t.stateNode.containerInfo),gr(t,n,r),Sn=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Ai,Ai=16777216,gr(t,n,r),Ai=o):gr(t,n,r));break;default:gr(t,n,r)}}function Hg(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Ri(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];ds=o,Yg(o,t)}Hg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fg(t),t=t.sibling}function Fg(t){switch(t.tag){case 0:case 11:case 15:Ri(t),t.flags&2048&&Ma(9,t,t.return);break;case 3:Ri(t);break;case 12:Ri(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,wc(t)):Ri(t);break;default:Ri(t)}}function wc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];ds=o,Yg(o,t)}Hg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Ma(8,n,n.return),wc(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,wc(n));break;default:wc(n)}t=t.sibling}}function Yg(t,n){for(;ds!==null;){var r=ds;switch(r.tag){case 0:case 11:case 15:Ma(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:gi(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,ds=o;else e:for(r=t;ds!==null;){o=ds;var u=o.sibling,f=o.return;if(Og(o),o===r){ds=null;break e}if(u!==null){u.return=f,ds=u;break e}ds=f}}}var e_={getCacheForType:function(t){var n=gs(Jt),r=n.data.get(t);return r===void 0&&(r=t(),n.data.set(t,r)),r},cacheSignal:function(){return gs(Jt).controller.signal}},t_=typeof WeakMap=="function"?WeakMap:Map,xt=0,Et=null,Je=null,tt=0,vt=0,Js=null,Da=!1,vr=!1,Em=!1,oa=0,Wt=0,Oa=0,yl=0,Mm=0,en=0,jr=0,zi=null,Hs=null,Dm=!1,Sc=0,qg=0,_c=1/0,Cc=null,Aa=null,ls=0,Ra=null,yr=null,ca=0,Om=0,Am=null,Vg=null,Pi=0,Rm=null;function tn(){return(xt&2)!==0&&tt!==0?tt&-tt:R.T!==null?Hm():rx()}function Gg(){if(en===0)if((tt&536870912)===0||nt){var t=ht;ht<<=1,(ht&3932160)===0&&(ht=262144),en=t}else en=536870912;return t=Qs.current,t!==null&&(t.flags|=32),en}function Fs(t,n,r){(t===Et&&(vt===2||vt===9)||t.cancelPendingCommit!==null)&&(br(t,0),za(t,tt,en,!1)),ni(t,r),((xt&2)===0||t!==Et)&&(t===Et&&((xt&2)===0&&(yl|=r),Wt===4&&za(t,tt,en,!1)),Ln(t))}function $g(t,n,r){if((xt&6)!==0)throw Error(i(327));var o=!r&&(n&127)===0&&(n&t.expiredLanes)===0||sl(t,n),u=o?a_(t,n):Pm(t,n,!0),f=o;do{if(u===0){vr&&!o&&za(t,n,0,!1);break}else{if(r=t.current.alternate,f&&!s_(r)){u=Pm(t,n,!1),f=!1;continue}if(u===2){if(f=n,t.errorRecoveryDisabledLanes&f)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){n=y;e:{var _=t;u=zi;var z=_.current.memoizedState.isDehydrated;if(z&&(br(_,y).flags|=256),y=Pm(_,y,!1),y!==2){if(Em&&!z){_.errorRecoveryDisabledLanes|=f,yl|=f,u=4;break e}f=Hs,Hs=u,f!==null&&(Hs===null?Hs=f:Hs.push.apply(Hs,f))}u=y}if(f=!1,u!==2)continue}}if(u===1){br(t,0),za(t,n,0,!0);break}e:{switch(o=t,f=u,f){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:za(o,n,en,!Da);break e;case 2:Hs=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(u=Sc+300-ke(),10<u)){if(za(o,n,en,!Da),Yl(o,0,!0)!==0)break e;ca=n,o.timeoutHandle=wv(Ig.bind(null,o,r,Hs,Cc,Dm,n,en,yl,jr,Da,f,"Throttled",-0,0),u);break e}Ig(o,r,Hs,Cc,Dm,n,en,yl,jr,Da,f,null,-0,0)}}break}while(!0);Ln(t)}function Ig(t,n,r,o,u,f,y,_,z,K,ie,ue,J,ne){if(t.timeoutHandle=-1,ue=n.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wn},Ug(n,f,ue);var we=(f&62914560)===f?Sc-ke():(f&4194048)===f?qg-ke():0;if(we=H_(ue,we),we!==null){ca=f,t.cancelPendingCommit=we(tv.bind(null,t,n,f,r,o,u,y,_,z,ie,ue,null,J,ne)),za(t,f,y,!K);return}}tv(t,n,f,r,o,u,y,_,z)}function s_(t){for(var n=t;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var u=r[o],f=u.getSnapshot;u=u.value;try{if(!Xs(f(),u))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function za(t,n,r,o){n&=~Mm,n&=~yl,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var u=n;0<u;){var f=31-pt(u),y=1<<f;o[f]=-1,u&=~y}r!==0&&nx(t,r,n)}function kc(){return(xt&6)===0?(Li(0),!1):!0}function zm(){if(Je!==null){if(vt===0)var t=Je.return;else t=Je,Zn=ul=null,Qu(t),ur=null,ji=0,t=Je;for(;t!==null;)Sg(t.alternate,t),t=t.return;Je=null}}function br(t,n){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,N_(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),ca=0,zm(),Et=t,Je=r=Kn(t.current,null),tt=n,vt=0,Js=null,Da=!1,vr=sl(t,n),Em=!1,jr=en=Mm=yl=Oa=Wt=0,Hs=zi=null,Dm=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var u=31-pt(o),f=1<<u;n|=t[u],o&=~f}return oa=n,Wo(),r}function Wg(t,n){Ye=null,R.H=ki,n===dr||n===sc?(n=dp(),vt=3):n===Uu?(n=dp(),vt=4):vt=n===fm?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Js=n,Je===null&&(Wt=1,pc(t,un(n,t.current)))}function Xg(){var t=Qs.current;return t===null?!0:(tt&4194048)===tt?xn===null:(tt&62914560)===tt||(tt&536870912)!==0?t===xn:!1}function Kg(){var t=R.H;return R.H=ki,t===null?ki:t}function Qg(){var t=R.A;return R.A=e_,t}function Tc(){Wt=4,Da||(tt&4194048)!==tt&&Qs.current!==null||(vr=!0),(Oa&134217727)===0&&(yl&134217727)===0||Et===null||za(Et,tt,en,!1)}function Pm(t,n,r){var o=xt;xt|=2;var u=Kg(),f=Qg();(Et!==t||tt!==n)&&(Cc=null,br(t,n)),n=!1;var y=Wt;e:do try{if(vt!==0&&Je!==null){var _=Je,z=Js;switch(vt){case 8:zm(),y=6;break e;case 3:case 2:case 9:case 6:Qs.current===null&&(n=!0);var K=vt;if(vt=0,Js=null,Nr(t,_,z,K),r&&vr){y=0;break e}break;default:K=vt,vt=0,Js=null,Nr(t,_,z,K)}}n_(),y=Wt;break}catch(ie){Wg(t,ie)}while(!0);return n&&t.shellSuspendCounter++,Zn=ul=null,xt=o,R.H=u,R.A=f,Je===null&&(Et=null,tt=0,Wo()),y}function n_(){for(;Je!==null;)Zg(Je)}function a_(t,n){var r=xt;xt|=2;var o=Kg(),u=Qg();Et!==t||tt!==n?(Cc=null,_c=ke()+500,br(t,n)):vr=sl(t,n);e:do try{if(vt!==0&&Je!==null){n=Je;var f=Js;t:switch(vt){case 1:vt=0,Js=null,Nr(t,n,f,1);break;case 2:case 9:if(op(f)){vt=0,Js=null,Jg(n);break}n=function(){vt!==2&&vt!==9||Et!==t||(vt=7),Ln(t)},f.then(n,n);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:op(f)?(vt=0,Js=null,Jg(n)):(vt=0,Js=null,Nr(t,n,f,7));break;case 5:var y=null;switch(Je.tag){case 26:y=Je.memoizedState;case 5:case 27:var _=Je;if(y?Bv(y):_.stateNode.complete){vt=0,Js=null;var z=_.sibling;if(z!==null)Je=z;else{var K=_.return;K!==null?(Je=K,Ec(K)):Je=null}break t}}vt=0,Js=null,Nr(t,n,f,5);break;case 6:vt=0,Js=null,Nr(t,n,f,6);break;case 8:zm(),Wt=6;break e;default:throw Error(i(462))}}l_();break}catch(ie){Wg(t,ie)}while(!0);return Zn=ul=null,R.H=o,R.A=u,xt=r,Je!==null?0:(Et=null,tt=0,Wo(),Wt)}function l_(){for(;Je!==null&&!Xt();)Zg(Je)}function Zg(t){var n=Ng(t.alternate,t,oa);t.memoizedProps=t.pendingProps,n===null?Ec(t):Je=n}function Jg(t){var n=t,r=n.alternate;switch(n.tag){case 15:case 0:n=pg(r,n,n.pendingProps,n.type,void 0,tt);break;case 11:n=pg(r,n,n.pendingProps,n.type.render,n.ref,tt);break;case 5:Qu(n);default:Sg(r,n),n=Je=Qx(n,oa),n=Ng(r,n,oa)}t.memoizedProps=t.pendingProps,n===null?Ec(t):Je=n}function Nr(t,n,r,o){Zn=ul=null,Qu(n),ur=null,ji=0;var u=n.return;try{if(IS(t,u,n,r,tt)){Wt=1,pc(t,un(r,t.current)),Je=null;return}}catch(f){if(u!==null)throw Je=u,f;Wt=1,pc(t,un(r,t.current)),Je=null;return}n.flags&32768?(nt||o===1?t=!0:vr||(tt&536870912)!==0?t=!1:(Da=t=!0,(o===2||o===9||o===3||o===6)&&(o=Qs.current,o!==null&&o.tag===13&&(o.flags|=16384))),ev(n,t)):Ec(n)}function Ec(t){var n=t;do{if((n.flags&32768)!==0){ev(n,Da);return}t=n.return;var r=KS(n.alternate,n,oa);if(r!==null){Je=r;return}if(n=n.sibling,n!==null){Je=n;return}Je=n=t}while(n!==null);Wt===0&&(Wt=5)}function ev(t,n){do{var r=QS(t.alternate,t);if(r!==null){r.flags&=32767,Je=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(t=t.sibling,t!==null)){Je=t;return}Je=t=r}while(t!==null);Wt=6,Je=null}function tv(t,n,r,o,u,f,y,_,z){t.cancelPendingCommit=null;do Mc();while(ls!==0);if((xt&6)!==0)throw Error(i(327));if(n!==null){if(n===t.current)throw Error(i(177));if(f=n.lanes|n.childLanes,f|=Su,B1(t,r,f,y,_,z),t===Et&&(Je=Et=null,tt=0),yr=n,Ra=t,ca=r,Om=f,Am=u,Vg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,c_(Ve,function(){return rv(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=R.T,R.T=null,u=O.p,O.p=2,y=xt,xt|=4;try{ZS(t,n,r)}finally{xt=y,O.p=u,R.T=o}}ls=1,sv(),nv(),av()}}function sv(){if(ls===1){ls=0;var t=Ra,n=yr,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=R.T,R.T=null;var o=O.p;O.p=2;var u=xt;xt|=4;try{Pg(n,t);var f=Wm,y=Yx(t.containerInfo),_=f.focusedElem,z=f.selectionRange;if(y!==_&&_&&_.ownerDocument&&Fx(_.ownerDocument.documentElement,_)){if(z!==null&&ju(_)){var K=z.start,ie=z.end;if(ie===void 0&&(ie=K),"selectionStart"in _)_.selectionStart=K,_.selectionEnd=Math.min(ie,_.value.length);else{var ue=_.ownerDocument||document,J=ue&&ue.defaultView||window;if(J.getSelection){var ne=J.getSelection(),we=_.textContent.length,Re=Math.min(z.start,we),St=z.end===void 0?Re:Math.min(z.end,we);!ne.extend&&Re>St&&(y=St,St=Re,Re=y);var V=Hx(_,Re),H=Hx(_,St);if(V&&H&&(ne.rangeCount!==1||ne.anchorNode!==V.node||ne.anchorOffset!==V.offset||ne.focusNode!==H.node||ne.focusOffset!==H.offset)){var X=ue.createRange();X.setStart(V.node,V.offset),ne.removeAllRanges(),Re>St?(ne.addRange(X),ne.extend(H.node,H.offset)):(X.setEnd(H.node,H.offset),ne.addRange(X))}}}}for(ue=[],ne=_;ne=ne.parentNode;)ne.nodeType===1&&ue.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ue.length;_++){var ce=ue[_];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Yc=!!Im,Wm=Im=null}finally{xt=u,O.p=o,R.T=r}}t.current=n,ls=2}}function nv(){if(ls===2){ls=0;var t=Ra,n=yr,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=R.T,R.T=null;var o=O.p;O.p=2;var u=xt;xt|=4;try{Dg(t,n.alternate,n)}finally{xt=u,O.p=o,R.T=r}}ls=3}}function av(){if(ls===4||ls===3){ls=0,Ds();var t=Ra,n=yr,r=ca,o=Vg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ls=5:(ls=0,yr=Ra=null,lv(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Aa=null),eu(r),n=n.stateNode,ge&&typeof ge.onCommitFiberRoot=="function")try{ge.onCommitFiberRoot(se,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=R.T,u=O.p,O.p=2,R.T=null;try{for(var f=t.onRecoverableError,y=0;y<o.length;y++){var _=o[y];f(_.value,{componentStack:_.stack})}}finally{R.T=n,O.p=u}}(ca&3)!==0&&Mc(),Ln(t),u=t.pendingLanes,(r&261930)!==0&&(u&42)!==0?t===Rm?Pi++:(Pi=0,Rm=t):Pi=0,Li(0)}}function lv(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,gi(n)))}function Mc(){return sv(),nv(),av(),rv()}function rv(){if(ls!==5)return!1;var t=Ra,n=Om;Om=0;var r=eu(ca),o=R.T,u=O.p;try{O.p=32>r?32:r,R.T=null,r=Am,Am=null;var f=Ra,y=ca;if(ls=0,yr=Ra=null,ca=0,(xt&6)!==0)throw Error(i(331));var _=xt;if(xt|=4,Fg(f.current),Bg(f,f.current,y,r),xt=_,Li(0,!1),ge&&typeof ge.onPostCommitFiberRoot=="function")try{ge.onPostCommitFiberRoot(se,f)}catch{}return!0}finally{O.p=u,R.T=o,lv(t,n)}}function iv(t,n,r){n=un(r,n),n=mm(t.stateNode,n,2),t=ka(t,n,2),t!==null&&(ni(t,2),Ln(t))}function jt(t,n,r){if(t.tag===3)iv(t,t,r);else for(;n!==null;){if(n.tag===3){iv(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Aa===null||!Aa.has(o))){t=un(r,t),r=og(2),o=ka(n,r,2),o!==null&&(cg(r,o,n,t),ni(o,2),Ln(o));break}}n=n.return}}function Lm(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new t_;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(r)||(Em=!0,u.add(r),t=r_.bind(null,t,n,r),n.then(t,t))}function r_(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,Et===t&&(tt&r)===r&&(Wt===4||Wt===3&&(tt&62914560)===tt&&300>ke()-Sc?(xt&2)===0&&br(t,0):Mm|=r,jr===tt&&(jr=0)),Ln(t)}function ov(t,n){n===0&&(n=ql()),t=ol(t,n),t!==null&&(ni(t,n),Ln(t))}function i_(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),ov(t,r)}function o_(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(r=u.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(n),ov(t,r)}function c_(t,n){return ln(t,n)}var Dc=null,wr=null,Bm=!1,Oc=!1,Um=!1,Pa=0;function Ln(t){t!==wr&&t.next===null&&(wr===null?Dc=wr=t:wr=wr.next=t),Oc=!0,Bm||(Bm=!0,u_())}function Li(t,n){if(!Um&&Oc){Um=!0;do for(var r=!1,o=Dc;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var f=0;else{var y=o.suspendedLanes,_=o.pingedLanes;f=(1<<31-pt(42|t)+1)-1,f&=u&~(y&~_),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,mv(o,f))}else f=tt,f=Yl(o,o===Et?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||sl(o,f)||(r=!0,mv(o,f));o=o.next}while(r);Um=!1}}function d_(){cv()}function cv(){Oc=Bm=!1;var t=0;Pa!==0&&b_()&&(t=Pa);for(var n=ke(),r=null,o=Dc;o!==null;){var u=o.next,f=dv(o,n);f===0?(o.next=null,r===null?Dc=u:r.next=u,u===null&&(wr=r)):(r=o,(t!==0||(f&3)!==0)&&(Oc=!0)),o=u}ls!==0&&ls!==5||Li(t),Pa!==0&&(Pa=0)}function dv(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,f=t.pendingLanes&-62914561;0<f;){var y=31-pt(f),_=1<<y,z=u[y];z===-1?((_&r)===0||(_&o)!==0)&&(u[y]=Zd(_,n)):z<=n&&(t.expiredLanes|=_),f&=~_}if(n=Et,r=tt,r=Yl(t,t===n?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,r===0||t===n&&(vt===2||vt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&rn(o),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||sl(t,r)){if(n=r&-r,n===t.callbackPriority)return n;switch(o!==null&&rn(o),eu(r)){case 2:case 8:r=Ee;break;case 32:r=Ve;break;case 268435456:r=$n;break;default:r=Ve}return o=uv.bind(null,t),r=ln(r,o),t.callbackPriority=n,t.callbackNode=r,n}return o!==null&&o!==null&&rn(o),t.callbackPriority=2,t.callbackNode=null,2}function uv(t,n){if(ls!==0&&ls!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(Mc()&&t.callbackNode!==r)return null;var o=tt;return o=Yl(t,t===Et?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:($g(t,o,n),dv(t,ke()),t.callbackNode!=null&&t.callbackNode===r?uv.bind(null,t):null)}function mv(t,n){if(Mc())return null;$g(t,n,!0)}function u_(){w_(function(){(xt&6)!==0?ln(he,d_):cv()})}function Hm(){if(Pa===0){var t=or;t===0&&(t=Be,Be<<=1,(Be&261888)===0&&(Be=256)),Pa=t}return Pa}function fv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ho(""+t)}function hv(t,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,t.id&&r.setAttribute("form",t.id),n.parentNode.insertBefore(r,n),t=new FormData(t),r.parentNode.removeChild(r),t}function m_(t,n,r,o,u){if(n==="submit"&&r&&r.stateNode===u){var f=fv((u[zs]||null).action),y=o.submitter;y&&(n=(n=y[zs]||null)?fv(n.formAction):y.getAttribute("formAction"),n!==null&&(f=n,y=null));var _=new Vo("action","action",null,o,u);t.push({event:_,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Pa!==0){var z=y?hv(u,y):new FormData(u);rm(r,{pending:!0,data:z,method:u.method,action:f},null,z)}}else typeof f=="function"&&(_.preventDefault(),z=y?hv(u,y):new FormData(u),rm(r,{pending:!0,data:z,method:u.method,action:f},f,z))},currentTarget:u}]})}}for(var Fm=0;Fm<wu.length;Fm++){var Ym=wu[Fm],f_=Ym.toLowerCase(),h_=Ym[0].toUpperCase()+Ym.slice(1);wn(f_,"on"+h_)}wn(Gx,"onAnimationEnd"),wn($x,"onAnimationIteration"),wn(Ix,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(MS,"onTransitionRun"),wn(DS,"onTransitionStart"),wn(OS,"onTransitionCancel"),wn(Wx,"onTransitionEnd"),Wl("onMouseEnter",["mouseout","mouseover"]),Wl("onMouseLeave",["mouseout","mouseover"]),Wl("onPointerEnter",["pointerout","pointerover"]),Wl("onPointerLeave",["pointerout","pointerover"]),al("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),al("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),al("onBeforeInput",["compositionend","keypress","textInput","paste"]),al("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),al("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),al("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),x_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bi));function xv(t,n){n=(n&4)!==0;for(var r=0;r<t.length;r++){var o=t[r],u=o.event;o=o.listeners;e:{var f=void 0;if(n)for(var y=o.length-1;0<=y;y--){var _=o[y],z=_.instance,K=_.currentTarget;if(_=_.listener,z!==f&&u.isPropagationStopped())break e;f=_,u.currentTarget=K;try{f(u)}catch(ie){Io(ie)}u.currentTarget=null,f=z}else for(y=0;y<o.length;y++){if(_=o[y],z=_.instance,K=_.currentTarget,_=_.listener,z!==f&&u.isPropagationStopped())break e;f=_,u.currentTarget=K;try{f(u)}catch(ie){Io(ie)}u.currentTarget=null,f=z}}}}function et(t,n){var r=n[tu];r===void 0&&(r=n[tu]=new Set);var o=t+"__bubble";r.has(o)||(pv(n,t,2,!1),r.add(o))}function qm(t,n,r){var o=0;n&&(o|=4),pv(r,t,o,n)}var Ac="_reactListening"+Math.random().toString(36).slice(2);function Vm(t){if(!t[Ac]){t[Ac]=!0,cx.forEach(function(r){r!=="selectionchange"&&(x_.has(r)||qm(r,!1,t),qm(r,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Ac]||(n[Ac]=!0,qm("selectionchange",!1,n))}}function pv(t,n,r,o){switch(Gv(n)){case 2:var u=q_;break;case 8:u=V_;break;default:u=lf}r=u.bind(null,n,r,t),u=void 0,!du||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?t.addEventListener(n,r,{capture:!0,passive:u}):t.addEventListener(n,r,!0):u!==void 0?t.addEventListener(n,r,{passive:u}):t.addEventListener(n,r,!1)}function Gm(t,n,r,o,u){var f=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var _=o.stateNode.containerInfo;if(_===u)break;if(y===4)for(y=o.return;y!==null;){var z=y.tag;if((z===3||z===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;_!==null;){if(y=Gl(_),y===null)return;if(z=y.tag,z===5||z===6||z===26||z===27){o=f=y;continue e}_=_.parentNode}}o=o.return}bx(function(){var K=f,ie=ou(r),ue=[];e:{var J=Xx.get(t);if(J!==void 0){var ne=Vo,we=t;switch(t){case"keypress":if(Yo(r)===0)break e;case"keydown":case"keyup":ne=oS;break;case"focusin":we="focus",ne=hu;break;case"focusout":we="blur",ne=hu;break;case"beforeblur":case"afterblur":ne=hu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Sx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=K1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=uS;break;case Gx:case $x:case Ix:ne=J1;break;case Wx:ne=fS;break;case"scroll":case"scrollend":ne=W1;break;case"wheel":ne=xS;break;case"copy":case"cut":case"paste":ne=tS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Cx;break;case"toggle":case"beforetoggle":ne=gS}var Re=(n&4)!==0,St=!Re&&(t==="scroll"||t==="scrollend"),V=Re?J!==null?J+"Capture":null:J;Re=[];for(var H=K,X;H!==null;){var ce=H;if(X=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||X===null||V===null||(ce=ri(H,V),ce!=null&&Re.push(Ui(H,ce,X))),St)break;H=H.return}0<Re.length&&(J=new ne(J,we,null,r,ie),ue.push({event:J,listeners:Re}))}}if((n&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",J&&r!==iu&&(we=r.relatedTarget||r.fromElement)&&(Gl(we)||we[Vl]))break e;if((ne||J)&&(J=ie.window===ie?ie:(J=ie.ownerDocument)?J.defaultView||J.parentWindow:window,ne?(we=r.relatedTarget||r.toElement,ne=K,we=we?Gl(we):null,we!==null&&(St=d(we),Re=we.tag,we!==St||Re!==5&&Re!==27&&Re!==6)&&(we=null)):(ne=null,we=K),ne!==we)){if(Re=Sx,ce="onMouseLeave",V="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Re=Cx,ce="onPointerLeave",V="onPointerEnter",H="pointer"),St=ne==null?J:li(ne),X=we==null?J:li(we),J=new Re(ce,H+"leave",ne,r,ie),J.target=St,J.relatedTarget=X,ce=null,Gl(ie)===K&&(Re=new Re(V,H+"enter",we,r,ie),Re.target=X,Re.relatedTarget=St,ce=Re),St=ce,ne&&we)t:{for(Re=p_,V=ne,H=we,X=0,ce=V;ce;ce=Re(ce))X++;ce=0;for(var De=H;De;De=Re(De))ce++;for(;0<X-ce;)V=Re(V),X--;for(;0<ce-X;)H=Re(H),ce--;for(;X--;){if(V===H||H!==null&&V===H.alternate){Re=V;break t}V=Re(V),H=Re(H)}Re=null}else Re=null;ne!==null&&gv(ue,J,ne,Re,!1),we!==null&&St!==null&&gv(ue,St,we,Re,!0)}}e:{if(J=K?li(K):window,ne=J.nodeName&&J.nodeName.toLowerCase(),ne==="select"||ne==="input"&&J.type==="file")var ut=Rx;else if(Ox(J))if(zx)ut=kS;else{ut=_S;var Te=SS}else ne=J.nodeName,!ne||ne.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?K&&ru(K.elementType)&&(ut=Rx):ut=CS;if(ut&&(ut=ut(t,K))){Ax(ue,ut,r,ie);break e}Te&&Te(t,J,K),t==="focusout"&&K&&J.type==="number"&&K.memoizedProps.value!=null&&lu(J,"number",J.value)}switch(Te=K?li(K):window,t){case"focusin":(Ox(Te)||Te.contentEditable==="true")&&(er=Te,yu=K,hi=null);break;case"focusout":hi=yu=er=null;break;case"mousedown":bu=!0;break;case"contextmenu":case"mouseup":case"dragend":bu=!1,qx(ue,r,ie);break;case"selectionchange":if(ES)break;case"keydown":case"keyup":qx(ue,r,ie)}var Ge;if(pu)e:{switch(t){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Jl?Mx(t,r)&&(st="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(st="onCompositionStart");st&&(kx&&r.locale!=="ko"&&(Jl||st!=="onCompositionStart"?st==="onCompositionEnd"&&Jl&&(Ge=Nx()):(ya=ie,uu="value"in ya?ya.value:ya.textContent,Jl=!0)),Te=Rc(K,st),0<Te.length&&(st=new _x(st,t,null,r,ie),ue.push({event:st,listeners:Te}),Ge?st.data=Ge:(Ge=Dx(r),Ge!==null&&(st.data=Ge)))),(Ge=jS?yS(t,r):bS(t,r))&&(st=Rc(K,"onBeforeInput"),0<st.length&&(Te=new _x("onBeforeInput","beforeinput",null,r,ie),ue.push({event:Te,listeners:st}),Te.data=Ge)),m_(ue,t,K,r,ie)}xv(ue,n)})}function Ui(t,n,r){return{instance:t,listener:n,currentTarget:r}}function Rc(t,n){for(var r=n+"Capture",o=[];t!==null;){var u=t,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=ri(t,r),u!=null&&o.unshift(Ui(t,u,f)),u=ri(t,n),u!=null&&o.push(Ui(t,u,f))),t.tag===3)return o;t=t.return}return[]}function p_(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function gv(t,n,r,o,u){for(var f=n._reactName,y=[];r!==null&&r!==o;){var _=r,z=_.alternate,K=_.stateNode;if(_=_.tag,z!==null&&z===o)break;_!==5&&_!==26&&_!==27||K===null||(z=K,u?(K=ri(r,f),K!=null&&y.unshift(Ui(r,K,z))):u||(K=ri(r,f),K!=null&&y.push(Ui(r,K,z)))),r=r.return}y.length!==0&&t.push({event:n,listeners:y})}var g_=/\r\n?/g,v_=/\u0000|\uFFFD/g;function vv(t){return(typeof t=="string"?t:""+t).replace(g_,`
`).replace(v_,"")}function jv(t,n){return n=vv(n),vv(t)===n}function wt(t,n,r,o,u,f){switch(r){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Kl(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Kl(t,""+o);break;case"className":Bo(t,"class",o);break;case"tabIndex":Bo(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Bo(t,r,o);break;case"style":jx(t,o,f);break;case"data":if(n!=="object"){Bo(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||r!=="href")){t.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(r);break}o=Ho(""+o),t.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(r==="formAction"?(n!=="input"&&wt(t,n,"name",u.name,u,null),wt(t,n,"formEncType",u.formEncType,u,null),wt(t,n,"formMethod",u.formMethod,u,null),wt(t,n,"formTarget",u.formTarget,u,null)):(wt(t,n,"encType",u.encType,u,null),wt(t,n,"method",u.method,u,null),wt(t,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(r);break}o=Ho(""+o),t.setAttribute(r,o);break;case"onClick":o!=null&&(t.onclick=Wn);break;case"onScroll":o!=null&&et("scroll",t);break;case"onScrollEnd":o!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(r=o.__html,r!=null){if(u.children!=null)throw Error(i(60));t.innerHTML=r}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}r=Ho(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(r,""+o):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":o===!0?t.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(r,o):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(r,o):t.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(r):t.setAttribute(r,o);break;case"popover":et("beforetoggle",t),et("toggle",t),Lo(t,"popover",o);break;case"xlinkActuate":In(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":In(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":In(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":In(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":In(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":In(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":In(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":In(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":In(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Lo(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=$1.get(r)||r,Lo(t,r,o))}}function $m(t,n,r,o,u,f){switch(r){case"style":jx(t,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(r=o.__html,r!=null){if(u.children!=null)throw Error(i(60));t.innerHTML=r}}break;case"children":typeof o=="string"?Kl(t,o):(typeof o=="number"||typeof o=="bigint")&&Kl(t,""+o);break;case"onScroll":o!=null&&et("scroll",t);break;case"onScrollEnd":o!=null&&et("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Wn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dx.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(u=r.endsWith("Capture"),n=r.slice(2,u?r.length-7:void 0),f=t[zs]||null,f=f!=null?f[r]:null,typeof f=="function"&&t.removeEventListener(n,f,u),typeof o=="function")){typeof f!="function"&&f!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(n,o,u);break e}r in t?t[r]=o:o===!0?t.setAttribute(r,""):Lo(t,r,o)}}}function js(t,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var o=!1,u=!1,f;for(f in r)if(r.hasOwnProperty(f)){var y=r[f];if(y!=null)switch(f){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:wt(t,n,f,y,r,null)}}u&&wt(t,n,"srcSet",r.srcSet,r,null),o&&wt(t,n,"src",r.src,r,null);return;case"input":et("invalid",t);var _=f=y=u=null,z=null,K=null;for(o in r)if(r.hasOwnProperty(o)){var ie=r[o];if(ie!=null)switch(o){case"name":u=ie;break;case"type":y=ie;break;case"checked":z=ie;break;case"defaultChecked":K=ie;break;case"value":f=ie;break;case"defaultValue":_=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,n));break;default:wt(t,n,o,ie,r,null)}}xx(t,f,_,z,K,y,u,!1);return;case"select":et("invalid",t),o=y=f=null;for(u in r)if(r.hasOwnProperty(u)&&(_=r[u],_!=null))switch(u){case"value":f=_;break;case"defaultValue":y=_;break;case"multiple":o=_;default:wt(t,n,u,_,r,null)}n=f,r=y,t.multiple=!!o,n!=null?Xl(t,!!o,n,!1):r!=null&&Xl(t,!!o,r,!0);return;case"textarea":et("invalid",t),f=u=o=null;for(y in r)if(r.hasOwnProperty(y)&&(_=r[y],_!=null))switch(y){case"value":o=_;break;case"defaultValue":u=_;break;case"children":f=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:wt(t,n,y,_,r,null)}gx(t,o,u,f);return;case"option":for(z in r)if(r.hasOwnProperty(z)&&(o=r[z],o!=null))switch(z){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:wt(t,n,z,o,r,null)}return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(o=0;o<Bi.length;o++)et(Bi[o],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in r)if(r.hasOwnProperty(K)&&(o=r[K],o!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:wt(t,n,K,o,r,null)}return;default:if(ru(n)){for(ie in r)r.hasOwnProperty(ie)&&(o=r[ie],o!==void 0&&$m(t,n,ie,o,r,void 0));return}}for(_ in r)r.hasOwnProperty(_)&&(o=r[_],o!=null&&wt(t,n,_,o,r,null))}function j_(t,n,r,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,y=null,_=null,z=null,K=null,ie=null;for(ne in r){var ue=r[ne];if(r.hasOwnProperty(ne)&&ue!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":z=ue;default:o.hasOwnProperty(ne)||wt(t,n,ne,null,o,ue)}}for(var J in o){var ne=o[J];if(ue=r[J],o.hasOwnProperty(J)&&(ne!=null||ue!=null))switch(J){case"type":f=ne;break;case"name":u=ne;break;case"checked":K=ne;break;case"defaultChecked":ie=ne;break;case"value":y=ne;break;case"defaultValue":_=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,n));break;default:ne!==ue&&wt(t,n,J,ne,o,ue)}}au(t,y,_,z,K,ie,f,u);return;case"select":ne=y=_=J=null;for(f in r)if(z=r[f],r.hasOwnProperty(f)&&z!=null)switch(f){case"value":break;case"multiple":ne=z;default:o.hasOwnProperty(f)||wt(t,n,f,null,o,z)}for(u in o)if(f=o[u],z=r[u],o.hasOwnProperty(u)&&(f!=null||z!=null))switch(u){case"value":J=f;break;case"defaultValue":_=f;break;case"multiple":y=f;default:f!==z&&wt(t,n,u,f,o,z)}n=_,r=y,o=ne,J!=null?Xl(t,!!r,J,!1):!!o!=!!r&&(n!=null?Xl(t,!!r,n,!0):Xl(t,!!r,r?[]:"",!1));return;case"textarea":ne=J=null;for(_ in r)if(u=r[_],r.hasOwnProperty(_)&&u!=null&&!o.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:wt(t,n,_,null,o,u)}for(y in o)if(u=o[y],f=r[y],o.hasOwnProperty(y)&&(u!=null||f!=null))switch(y){case"value":J=u;break;case"defaultValue":ne=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==f&&wt(t,n,y,u,o,f)}px(t,J,ne);return;case"option":for(var we in r)if(J=r[we],r.hasOwnProperty(we)&&J!=null&&!o.hasOwnProperty(we))switch(we){case"selected":t.selected=!1;break;default:wt(t,n,we,null,o,J)}for(z in o)if(J=o[z],ne=r[z],o.hasOwnProperty(z)&&J!==ne&&(J!=null||ne!=null))switch(z){case"selected":t.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:wt(t,n,z,J,o,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Re in r)J=r[Re],r.hasOwnProperty(Re)&&J!=null&&!o.hasOwnProperty(Re)&&wt(t,n,Re,null,o,J);for(K in o)if(J=o[K],ne=r[K],o.hasOwnProperty(K)&&J!==ne&&(J!=null||ne!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,n));break;default:wt(t,n,K,J,o,ne)}return;default:if(ru(n)){for(var St in r)J=r[St],r.hasOwnProperty(St)&&J!==void 0&&!o.hasOwnProperty(St)&&$m(t,n,St,void 0,o,J);for(ie in o)J=o[ie],ne=r[ie],!o.hasOwnProperty(ie)||J===ne||J===void 0&&ne===void 0||$m(t,n,ie,J,o,ne);return}}for(var V in r)J=r[V],r.hasOwnProperty(V)&&J!=null&&!o.hasOwnProperty(V)&&wt(t,n,V,null,o,J);for(ue in o)J=o[ue],ne=r[ue],!o.hasOwnProperty(ue)||J===ne||J==null&&ne==null||wt(t,n,ue,J,o,ne)}function yv(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function y_(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,r=performance.getEntriesByType("resource"),o=0;o<r.length;o++){var u=r[o],f=u.transferSize,y=u.initiatorType,_=u.duration;if(f&&_&&yv(y)){for(y=0,_=u.responseEnd,o+=1;o<r.length;o++){var z=r[o],K=z.startTime;if(K>_)break;var ie=z.transferSize,ue=z.initiatorType;ie&&yv(ue)&&(z=z.responseEnd,y+=ie*(z<_?1:(_-K)/(z-K)))}if(--o,n+=8*(f+y)/(u.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Im=null,Wm=null;function zc(t){return t.nodeType===9?t:t.ownerDocument}function bv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Nv(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Xm(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Km=null;function b_(){var t=window.event;return t&&t.type==="popstate"?t===Km?!1:(Km=t,!0):(Km=null,!1)}var wv=typeof setTimeout=="function"?setTimeout:void 0,N_=typeof clearTimeout=="function"?clearTimeout:void 0,Sv=typeof Promise=="function"?Promise:void 0,w_=typeof queueMicrotask=="function"?queueMicrotask:typeof Sv<"u"?function(t){return Sv.resolve(null).then(t).catch(S_)}:wv;function S_(t){setTimeout(function(){throw t})}function La(t){return t==="head"}function _v(t,n){var r=n,o=0;do{var u=r.nextSibling;if(t.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"||r==="/&"){if(o===0){t.removeChild(u),kr(n);return}o--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")o++;else if(r==="html")Hi(t.ownerDocument.documentElement);else if(r==="head"){r=t.ownerDocument.head,Hi(r);for(var f=r.firstChild;f;){var y=f.nextSibling,_=f.nodeName;f[ai]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&f.rel.toLowerCase()==="stylesheet"||r.removeChild(f),f=y}}else r==="body"&&Hi(t.ownerDocument.body);r=u}while(r);kr(n)}function Cv(t,n){var r=t;t=0;do{var o=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(t===0)break;t--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||t++;r=o}while(r)}function Qm(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Qm(r),su(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function __(t,n,r,o){for(;t.nodeType===1;){var u=r;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ai])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(f=t.getAttribute("rel"),f==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(f!==u.rel||t.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||t.getAttribute("title")!==(u.title==null?null:u.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(f=t.getAttribute("src"),(f!==(u.src==null?null:u.src)||t.getAttribute("type")!==(u.type==null?null:u.type)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&t.getAttribute("name")===f)return t}else return t;if(t=pn(t.nextSibling),t===null)break}return null}function C_(t,n,r){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=pn(t.nextSibling),t===null))return null;return t}function kv(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=pn(t.nextSibling),t===null))return null;return t}function Zm(t){return t.data==="$?"||t.data==="$~"}function Jm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function k_(t,n){var r=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||r.readyState!=="loading")n();else{var o=function(){n(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function pn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var ef=null;function Tv(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"||r==="/&"){if(n===0)return pn(t.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}t=t.nextSibling}return null}function Ev(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return t;n--}else r!=="/$"&&r!=="/&"||n++}t=t.previousSibling}return null}function Mv(t,n,r){switch(n=zc(r),t){case"html":if(t=n.documentElement,!t)throw Error(i(452));return t;case"head":if(t=n.head,!t)throw Error(i(453));return t;case"body":if(t=n.body,!t)throw Error(i(454));return t;default:throw Error(i(451))}}function Hi(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);su(t)}var gn=new Map,Dv=new Set;function Pc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var da=O.d;O.d={f:T_,r:E_,D:M_,C:D_,L:O_,m:A_,X:z_,S:R_,M:P_};function T_(){var t=da.f(),n=kc();return t||n}function E_(t){var n=$l(t);n!==null&&n.tag===5&&n.type==="form"?Wp(n):da.r(t)}var Sr=typeof document>"u"?null:document;function Ov(t,n,r){var o=Sr;if(o&&typeof n=="string"&&n){var u=cn(n);u='link[rel="'+t+'"][href="'+u+'"]',typeof r=="string"&&(u+='[crossorigin="'+r+'"]'),Dv.has(u)||(Dv.add(u),t={rel:t,crossOrigin:r,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),js(n,"link",t),cs(n),o.head.appendChild(n)))}}function M_(t){da.D(t),Ov("dns-prefetch",t,null)}function D_(t,n){da.C(t,n),Ov("preconnect",t,n)}function O_(t,n,r){da.L(t,n,r);var o=Sr;if(o&&t&&n){var u='link[rel="preload"][as="'+cn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(u+='[imagesrcset="'+cn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(u+='[imagesizes="'+cn(r.imageSizes)+'"]')):u+='[href="'+cn(t)+'"]';var f=u;switch(n){case"style":f=_r(t);break;case"script":f=Cr(t)}gn.has(f)||(t=j({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),gn.set(f,t),o.querySelector(u)!==null||n==="style"&&o.querySelector(Fi(f))||n==="script"&&o.querySelector(Yi(f))||(n=o.createElement("link"),js(n,"link",t),cs(n),o.head.appendChild(n)))}}function A_(t,n){da.m(t,n);var r=Sr;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+cn(o)+'"][href="'+cn(t)+'"]',f=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Cr(t)}if(!gn.has(f)&&(t=j({rel:"modulepreload",href:t},n),gn.set(f,t),r.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Yi(f)))return}o=r.createElement("link"),js(o,"link",t),cs(o),r.head.appendChild(o)}}}function R_(t,n,r){da.S(t,n,r);var o=Sr;if(o&&t){var u=Il(o).hoistableStyles,f=_r(t);n=n||"default";var y=u.get(f);if(!y){var _={loading:0,preload:null};if(y=o.querySelector(Fi(f)))_.loading=5;else{t=j({rel:"stylesheet",href:t,"data-precedence":n},r),(r=gn.get(f))&&tf(t,r);var z=y=o.createElement("link");cs(z),js(z,"link",t),z._p=new Promise(function(K,ie){z.onload=K,z.onerror=ie}),z.addEventListener("load",function(){_.loading|=1}),z.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Lc(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:_},u.set(f,y)}}}function z_(t,n){da.X(t,n);var r=Sr;if(r&&t){var o=Il(r).hoistableScripts,u=Cr(t),f=o.get(u);f||(f=r.querySelector(Yi(u)),f||(t=j({src:t,async:!0},n),(n=gn.get(u))&&sf(t,n),f=r.createElement("script"),cs(f),js(f,"link",t),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function P_(t,n){da.M(t,n);var r=Sr;if(r&&t){var o=Il(r).hoistableScripts,u=Cr(t),f=o.get(u);f||(f=r.querySelector(Yi(u)),f||(t=j({src:t,async:!0,type:"module"},n),(n=gn.get(u))&&sf(t,n),f=r.createElement("script"),cs(f),js(f,"link",t),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(u,f))}}function Av(t,n,r,o){var u=(u=ve.current)?Pc(u):null;if(!u)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=_r(r.href),r=Il(u).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=_r(r.href);var f=Il(u).hoistableStyles,y=f.get(t);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,y),(f=u.querySelector(Fi(t)))&&!f._p&&(y.instance=f,y.state.loading=5),gn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},gn.set(t,r),f||L_(u,t,r,y.state))),n&&o===null)throw Error(i(528,""));return y}if(n&&o!==null)throw Error(i(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Cr(r),r=Il(u).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function _r(t){return'href="'+cn(t)+'"'}function Fi(t){return'link[rel="stylesheet"]['+t+"]"}function Rv(t){return j({},t,{"data-precedence":t.precedence,precedence:null})}function L_(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),js(n,"link",r),cs(n),t.head.appendChild(n))}function Cr(t){return'[src="'+cn(t)+'"]'}function Yi(t){return"script[async]"+t}function zv(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+cn(r.href)+'"]');if(o)return n.instance=o,cs(o),o;var u=j({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),cs(o),js(o,"style",u),Lc(o,r.precedence,t),n.instance=o;case"stylesheet":u=_r(r.href);var f=t.querySelector(Fi(u));if(f)return n.state.loading|=4,n.instance=f,cs(f),f;o=Rv(r),(u=gn.get(u))&&tf(o,u),f=(t.ownerDocument||t).createElement("link"),cs(f);var y=f;return y._p=new Promise(function(_,z){y.onload=_,y.onerror=z}),js(f,"link",o),n.state.loading|=4,Lc(f,r.precedence,t),n.instance=f;case"script":return f=Cr(r.src),(u=t.querySelector(Yi(f)))?(n.instance=u,cs(u),u):(o=r,(u=gn.get(f))&&(o=j({},r),sf(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),cs(u),js(u,"link",o),t.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Lc(o,r.precedence,t));return n.instance}function Lc(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,f=u,y=0;y<o.length;y++){var _=o[y];if(_.dataset.precedence===n)f=_;else if(f!==u)break}f?f.parentNode.insertBefore(t,f.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(t,n.firstChild))}function tf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function sf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Bc=null;function Pv(t,n,r){if(Bc===null){var o=new Map,u=Bc=new Map;u.set(r,o)}else u=Bc,o=u.get(r),o||(o=new Map,u.set(r,o));if(o.has(t))return o;for(o.set(t,null),r=r.getElementsByTagName(t),u=0;u<r.length;u++){var f=r[u];if(!(f[ai]||f[xs]||t==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(n)||"";y=t+y;var _=o.get(y);_?_.push(f):o.set(y,[f])}}return o}function Lv(t,n,r){t=t.ownerDocument||t,t.head.insertBefore(r,n==="title"?t.querySelector("head > title"):null)}function B_(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Bv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function U_(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var u=_r(o.href),f=n.querySelector(Fi(u));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Uc.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=f,cs(f);return}f=n.ownerDocument||n,o=Rv(o),(u=gn.get(u))&&tf(o,u),f=f.createElement("link"),cs(f);var y=f;y._p=new Promise(function(_,z){y.onload=_,y.onerror=z}),js(f,"link",o),r.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Uc.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var nf=0;function H_(t,n){return t.stylesheets&&t.count===0&&Fc(t,t.stylesheets),0<t.count||0<t.imgCount?function(r){var o=setTimeout(function(){if(t.stylesheets&&Fc(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4+n);0<t.imgBytes&&nf===0&&(nf=62500*y_());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Fc(t,t.stylesheets),t.unsuspend)){var f=t.unsuspend;t.unsuspend=null,f()}},(t.imgBytes>nf?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Hc=null;function Fc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Hc=new Map,n.forEach(F_,t),Hc=null,Uc.call(t))}function F_(t,n){if(!(n.state.loading&4)){var r=Hc.get(t);if(r)var o=r.get(null);else{r=new Map,Hc.set(t,r);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var y=u[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(r.set(y.dataset.precedence,y),o=y)}o&&r.set(null,o)}u=n.instance,y=u.getAttribute("data-precedence"),f=r.get(y)||o,f===o&&r.set(null,u),r.set(y,u),this.count++,o=Uc.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),f?f.parentNode.insertBefore(u,f.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(u,t.firstChild)),n.state.loading|=4}}var qi={$$typeof:M,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function Y_(t,n,r,o,u,f,y,_,z){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nl(0),this.hiddenUpdates=nl(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Uv(t,n,r,o,u,f,y,_,z,K,ie,ue){return t=new Y_(t,n,r,y,z,K,ie,ue,_),n=1,f===!0&&(n|=24),f=Ks(3,null,null,n),t.current=f,f.stateNode=t,n=Pu(),n.refCount++,t.pooledCache=n,n.refCount++,f.memoizedState={element:o,isDehydrated:r,cache:n},Hu(f),t}function Hv(t){return t?(t=nr,t):nr}function Fv(t,n,r,o,u,f){u=Hv(u),o.context===null?o.context=u:o.pendingContext=u,o=Ca(n),o.payload={element:r},f=f===void 0?null:f,f!==null&&(o.callback=f),r=ka(t,o,n),r!==null&&(Fs(r,t,n),bi(r,t,n))}function Yv(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<n?r:n}}function af(t,n){Yv(t,n),(t=t.alternate)&&Yv(t,n)}function qv(t){if(t.tag===13||t.tag===31){var n=ol(t,67108864);n!==null&&Fs(n,t,67108864),af(t,67108864)}}function Vv(t){if(t.tag===13||t.tag===31){var n=tn();n=Jd(n);var r=ol(t,n);r!==null&&Fs(r,t,n),af(t,n)}}var Yc=!0;function q_(t,n,r,o){var u=R.T;R.T=null;var f=O.p;try{O.p=2,lf(t,n,r,o)}finally{O.p=f,R.T=u}}function V_(t,n,r,o){var u=R.T;R.T=null;var f=O.p;try{O.p=8,lf(t,n,r,o)}finally{O.p=f,R.T=u}}function lf(t,n,r,o){if(Yc){var u=rf(o);if(u===null)Gm(t,n,o,qc,r),$v(t,o);else if($_(u,t,n,r,o))o.stopPropagation();else if($v(t,o),n&4&&-1<G_.indexOf(t)){for(;u!==null;){var f=$l(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=Xe(f.pendingLanes);if(y!==0){var _=f;for(_.pendingLanes|=2,_.entangledLanes|=2;y;){var z=1<<31-pt(y);_.entanglements[1]|=z,y&=~z}Ln(f),(xt&6)===0&&(_c=ke()+500,Li(0))}}break;case 31:case 13:_=ol(f,2),_!==null&&Fs(_,f,2),kc(),af(f,2)}if(f=rf(o),f===null&&Gm(t,n,o,qc,r),f===u)break;u=f}u!==null&&o.stopPropagation()}else Gm(t,n,o,null,r)}}function rf(t){return t=ou(t),of(t)}var qc=null;function of(t){if(qc=null,t=Gl(t),t!==null){var n=d(t);if(n===null)t=null;else{var r=n.tag;if(r===13){if(t=m(n),t!==null)return t;t=null}else if(r===31){if(t=h(n),t!==null)return t;t=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return qc=t,null}function Gv(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(is()){case he:return 2;case Ee:return 8;case Ve:case Os:return 32;case $n:return 268435456;default:return 32}default:return 32}}var cf=!1,Ba=null,Ua=null,Ha=null,Vi=new Map,Gi=new Map,Fa=[],G_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function $v(t,n){switch(t){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":Vi.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gi.delete(n.pointerId)}}function $i(t,n,r,o,u,f){return t===null||t.nativeEvent!==f?(t={blockedOn:n,domEventName:r,eventSystemFlags:o,nativeEvent:f,targetContainers:[u]},n!==null&&(n=$l(n),n!==null&&qv(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),t)}function $_(t,n,r,o,u){switch(n){case"focusin":return Ba=$i(Ba,t,n,r,o,u),!0;case"dragenter":return Ua=$i(Ua,t,n,r,o,u),!0;case"mouseover":return Ha=$i(Ha,t,n,r,o,u),!0;case"pointerover":var f=u.pointerId;return Vi.set(f,$i(Vi.get(f)||null,t,n,r,o,u)),!0;case"gotpointercapture":return f=u.pointerId,Gi.set(f,$i(Gi.get(f)||null,t,n,r,o,u)),!0}return!1}function Iv(t){var n=Gl(t.target);if(n!==null){var r=d(n);if(r!==null){if(n=r.tag,n===13){if(n=m(r),n!==null){t.blockedOn=n,ix(t.priority,function(){Vv(r)});return}}else if(n===31){if(n=h(r),n!==null){t.blockedOn=n,ix(t.priority,function(){Vv(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Vc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var r=rf(t.nativeEvent);if(r===null){r=t.nativeEvent;var o=new r.constructor(r.type,r);iu=o,r.target.dispatchEvent(o),iu=null}else return n=$l(r),n!==null&&qv(n),t.blockedOn=r,!1;n.shift()}return!0}function Wv(t,n,r){Vc(t)&&r.delete(n)}function I_(){cf=!1,Ba!==null&&Vc(Ba)&&(Ba=null),Ua!==null&&Vc(Ua)&&(Ua=null),Ha!==null&&Vc(Ha)&&(Ha=null),Vi.forEach(Wv),Gi.forEach(Wv)}function Gc(t,n){t.blockedOn===n&&(t.blockedOn=null,cf||(cf=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,I_)))}var $c=null;function Xv(t){$c!==t&&($c=t,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){$c===t&&($c=null);for(var n=0;n<t.length;n+=3){var r=t[n],o=t[n+1],u=t[n+2];if(typeof o!="function"){if(of(o||r)===null)continue;break}var f=$l(r);f!==null&&(t.splice(n,3),n-=3,rm(f,{pending:!0,data:u,method:r.method,action:o},o,u))}}))}function kr(t){function n(z){return Gc(z,t)}Ba!==null&&Gc(Ba,t),Ua!==null&&Gc(Ua,t),Ha!==null&&Gc(Ha,t),Vi.forEach(n),Gi.forEach(n);for(var r=0;r<Fa.length;r++){var o=Fa[r];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Fa.length&&(r=Fa[0],r.blockedOn===null);)Iv(r),r.blockedOn===null&&Fa.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var u=r[o],f=r[o+1],y=u[zs]||null;if(typeof f=="function")y||Xv(r);else if(y){var _=null;if(f&&f.hasAttribute("formAction")){if(u=f,y=f[zs]||null)_=y.formAction;else if(of(u)!==null)continue}else _=y.action;typeof _=="function"?r[o+1]=_:(r.splice(o,3),o-=3),Xv(r)}}}function Kv(){function t(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(r,20)}function r(){if(!o&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function df(t){this._internalRoot=t}Ic.prototype.render=df.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));var r=n.current,o=tn();Fv(r,o,t,n,null,null)},Ic.prototype.unmount=df.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Fv(t.current,2,null,t,null,null),kc(),n[Vl]=null}};function Ic(t){this._internalRoot=t}Ic.prototype.unstable_scheduleHydration=function(t){if(t){var n=rx();t={blockedOn:null,target:t,priority:n};for(var r=0;r<Fa.length&&n!==0&&n<Fa[r].priority;r++);Fa.splice(r,0,t),r===0&&Iv(t)}};var Qv=a.version;if(Qv!=="19.2.0")throw Error(i(527,Qv,"19.2.0"));O.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=v(n),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var W_={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wc.isDisabled&&Wc.supportsFiber)try{se=Wc.inject(W_),ge=Wc}catch{}}return Wi.createRoot=function(t,n){if(!c(t))throw Error(i(299));var r=!1,o="",u=ag,f=lg,y=rg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError)),n=Uv(t,1,!1,null,null,r,o,null,u,f,y,Kv),t[Vl]=n.current,Vm(t),new df(n)},Wi.hydrateRoot=function(t,n,r){if(!c(t))throw Error(i(299));var o=!1,u="",f=ag,y=lg,_=rg,z=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(_=r.onRecoverableError),r.formState!==void 0&&(z=r.formState)),n=Uv(t,1,!0,n,r??null,o,u,z,f,y,_,Kv),n.context=Hv(null),r=n.current,o=tn(),o=Jd(o),u=Ca(o),u.callback=null,ka(r,u,o),r=o,n.current.lanes=r,ni(n,r),Ln(n),t[Vl]=n.current,Vm(t),new Ic(n)},Wi.version="19.2.0",Wi}var rj;function J2(){if(rj)return mf.exports;rj=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(a){console.error(a)}}return s(),mf.exports=Z2(),mf.exports}var eC=J2();function Ry(s,a){return function(){return s.apply(a,arguments)}}const{toString:tC}=Object.prototype,{getPrototypeOf:yh}=Object,{iterator:Dd,toStringTag:zy}=Symbol,Od=(s=>a=>{const l=tC.call(a);return s[l]||(s[l]=l.slice(8,-1).toLowerCase())})(Object.create(null)),On=s=>(s=s.toLowerCase(),a=>Od(a)===s),Ad=s=>a=>typeof a===s,{isArray:Xr}=Array,Vr=Ad("undefined");function yo(s){return s!==null&&!Vr(s)&&s.constructor!==null&&!Vr(s.constructor)&&qs(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const Py=On("ArrayBuffer");function sC(s){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(s):a=s&&s.buffer&&Py(s.buffer),a}const nC=Ad("string"),qs=Ad("function"),Ly=Ad("number"),bo=s=>s!==null&&typeof s=="object",aC=s=>s===!0||s===!1,id=s=>{if(Od(s)!=="object")return!1;const a=yh(s);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(zy in s)&&!(Dd in s)},lC=s=>{if(!bo(s)||yo(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},rC=On("Date"),iC=On("File"),oC=On("Blob"),cC=On("FileList"),dC=s=>bo(s)&&qs(s.pipe),uC=s=>{let a;return s&&(typeof FormData=="function"&&s instanceof FormData||qs(s.append)&&((a=Od(s))==="formdata"||a==="object"&&qs(s.toString)&&s.toString()==="[object FormData]"))},mC=On("URLSearchParams"),[fC,hC,xC,pC]=["ReadableStream","Request","Response","Headers"].map(On),gC=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function No(s,a,{allOwnKeys:l=!1}={}){if(s===null||typeof s>"u")return;let i,c;if(typeof s!="object"&&(s=[s]),Xr(s))for(i=0,c=s.length;i<c;i++)a.call(null,s[i],i,s);else{if(yo(s))return;const d=l?Object.getOwnPropertyNames(s):Object.keys(s),m=d.length;let h;for(i=0;i<m;i++)h=d[i],a.call(null,s[h],h,s)}}function By(s,a){if(yo(s))return null;a=a.toLowerCase();const l=Object.keys(s);let i=l.length,c;for(;i-- >0;)if(c=l[i],a===c.toLowerCase())return c;return null}const wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Uy=s=>!Vr(s)&&s!==wl;function Uf(){const{caseless:s,skipUndefined:a}=Uy(this)&&this||{},l={},i=(c,d)=>{const m=s&&By(l,d)||d;id(l[m])&&id(c)?l[m]=Uf(l[m],c):id(c)?l[m]=Uf({},c):Xr(c)?l[m]=c.slice():(!a||!Vr(c))&&(l[m]=c)};for(let c=0,d=arguments.length;c<d;c++)arguments[c]&&No(arguments[c],i);return l}const vC=(s,a,l,{allOwnKeys:i}={})=>(No(a,(c,d)=>{l&&qs(c)?s[d]=Ry(c,l):s[d]=c},{allOwnKeys:i}),s),jC=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),yC=(s,a,l,i)=>{s.prototype=Object.create(a.prototype,i),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:a.prototype}),l&&Object.assign(s.prototype,l)},bC=(s,a,l,i)=>{let c,d,m;const h={};if(a=a||{},s==null)return a;do{for(c=Object.getOwnPropertyNames(s),d=c.length;d-- >0;)m=c[d],(!i||i(m,s,a))&&!h[m]&&(a[m]=s[m],h[m]=!0);s=l!==!1&&yh(s)}while(s&&(!l||l(s,a))&&s!==Object.prototype);return a},NC=(s,a,l)=>{s=String(s),(l===void 0||l>s.length)&&(l=s.length),l-=a.length;const i=s.indexOf(a,l);return i!==-1&&i===l},wC=s=>{if(!s)return null;if(Xr(s))return s;let a=s.length;if(!Ly(a))return null;const l=new Array(a);for(;a-- >0;)l[a]=s[a];return l},SC=(s=>a=>s&&a instanceof s)(typeof Uint8Array<"u"&&yh(Uint8Array)),_C=(s,a)=>{const i=(s&&s[Dd]).call(s);let c;for(;(c=i.next())&&!c.done;){const d=c.value;a.call(s,d[0],d[1])}},CC=(s,a)=>{let l;const i=[];for(;(l=s.exec(a))!==null;)i.push(l);return i},kC=On("HTMLFormElement"),TC=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(l,i,c){return i.toUpperCase()+c}),ij=(({hasOwnProperty:s})=>(a,l)=>s.call(a,l))(Object.prototype),EC=On("RegExp"),Hy=(s,a)=>{const l=Object.getOwnPropertyDescriptors(s),i={};No(l,(c,d)=>{let m;(m=a(c,d,s))!==!1&&(i[d]=m||c)}),Object.defineProperties(s,i)},MC=s=>{Hy(s,(a,l)=>{if(qs(s)&&["arguments","caller","callee"].indexOf(l)!==-1)return!1;const i=s[l];if(qs(i)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+l+"'")})}})},DC=(s,a)=>{const l={},i=c=>{c.forEach(d=>{l[d]=!0})};return Xr(s)?i(s):i(String(s).split(a)),l},OC=()=>{},AC=(s,a)=>s!=null&&Number.isFinite(s=+s)?s:a;function RC(s){return!!(s&&qs(s.append)&&s[zy]==="FormData"&&s[Dd])}const zC=s=>{const a=new Array(10),l=(i,c)=>{if(bo(i)){if(a.indexOf(i)>=0)return;if(yo(i))return i;if(!("toJSON"in i)){a[c]=i;const d=Xr(i)?[]:{};return No(i,(m,h)=>{const p=l(m,c+1);!Vr(p)&&(d[h]=p)}),a[c]=void 0,d}}return i};return l(s,0)},PC=On("AsyncFunction"),LC=s=>s&&(bo(s)||qs(s))&&qs(s.then)&&qs(s.catch),Fy=((s,a)=>s?setImmediate:a?((l,i)=>(wl.addEventListener("message",({source:c,data:d})=>{c===wl&&d===l&&i.length&&i.shift()()},!1),c=>{i.push(c),wl.postMessage(l,"*")}))(`axios@${Math.random()}`,[]):l=>setTimeout(l))(typeof setImmediate=="function",qs(wl.postMessage)),BC=typeof queueMicrotask<"u"?queueMicrotask.bind(wl):typeof process<"u"&&process.nextTick||Fy,UC=s=>s!=null&&qs(s[Dd]),te={isArray:Xr,isArrayBuffer:Py,isBuffer:yo,isFormData:uC,isArrayBufferView:sC,isString:nC,isNumber:Ly,isBoolean:aC,isObject:bo,isPlainObject:id,isEmptyObject:lC,isReadableStream:fC,isRequest:hC,isResponse:xC,isHeaders:pC,isUndefined:Vr,isDate:rC,isFile:iC,isBlob:oC,isRegExp:EC,isFunction:qs,isStream:dC,isURLSearchParams:mC,isTypedArray:SC,isFileList:cC,forEach:No,merge:Uf,extend:vC,trim:gC,stripBOM:jC,inherits:yC,toFlatObject:bC,kindOf:Od,kindOfTest:On,endsWith:NC,toArray:wC,forEachEntry:_C,matchAll:CC,isHTMLForm:kC,hasOwnProperty:ij,hasOwnProp:ij,reduceDescriptors:Hy,freezeMethods:MC,toObjectSet:DC,toCamelCase:TC,noop:OC,toFiniteNumber:AC,findKey:By,global:wl,isContextDefined:Uy,isSpecCompliantForm:RC,toJSONObject:zC,isAsyncFn:PC,isThenable:LC,setImmediate:Fy,asap:BC,isIterable:UC};function qe(s,a,l,i,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",a&&(this.code=a),l&&(this.config=l),i&&(this.request=i),c&&(this.response=c,this.status=c.status?c.status:null)}te.inherits(qe,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:te.toJSONObject(this.config),code:this.code,status:this.status}}});const Yy=qe.prototype,qy={};["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(s=>{qy[s]={value:s}});Object.defineProperties(qe,qy);Object.defineProperty(Yy,"isAxiosError",{value:!0});qe.from=(s,a,l,i,c,d)=>{const m=Object.create(Yy);te.toFlatObject(s,m,function(g){return g!==Error.prototype},v=>v!=="isAxiosError");const h=s&&s.message?s.message:"Error",p=a==null&&s?s.code:a;return qe.call(m,h,p,l,i,c),s&&m.cause==null&&Object.defineProperty(m,"cause",{value:s,configurable:!0}),m.name=s&&s.name||"Error",d&&Object.assign(m,d),m};const HC=null;function Hf(s){return te.isPlainObject(s)||te.isArray(s)}function Vy(s){return te.endsWith(s,"[]")?s.slice(0,-2):s}function oj(s,a,l){return s?s.concat(a).map(function(c,d){return c=Vy(c),!l&&d?"["+c+"]":c}).join(l?".":""):a}function FC(s){return te.isArray(s)&&!s.some(Hf)}const YC=te.toFlatObject(te,{},null,function(a){return/^is[A-Z]/.test(a)});function Rd(s,a,l){if(!te.isObject(s))throw new TypeError("target must be an object");a=a||new FormData,l=te.toFlatObject(l,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,N){return!te.isUndefined(N[C])});const i=l.metaTokens,c=l.visitor||g,d=l.dots,m=l.indexes,p=(l.Blob||typeof Blob<"u"&&Blob)&&te.isSpecCompliantForm(a);if(!te.isFunction(c))throw new TypeError("visitor must be a function");function v(S){if(S===null)return"";if(te.isDate(S))return S.toISOString();if(te.isBoolean(S))return S.toString();if(!p&&te.isBlob(S))throw new qe("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(S)||te.isTypedArray(S)?p&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function g(S,C,N){let T=S;if(S&&!N&&typeof S=="object"){if(te.endsWith(C,"{}"))C=i?C:C.slice(0,-2),S=JSON.stringify(S);else if(te.isArray(S)&&FC(S)||(te.isFileList(S)||te.endsWith(C,"[]"))&&(T=te.toArray(S)))return C=Vy(C),T.forEach(function(M,k){!(te.isUndefined(M)||M===null)&&a.append(m===!0?oj([C],k,d):m===null?C:C+"[]",v(M))}),!1}return Hf(S)?!0:(a.append(oj(N,C,d),v(S)),!1)}const j=[],b=Object.assign(YC,{defaultVisitor:g,convertValue:v,isVisitable:Hf});function w(S,C){if(!te.isUndefined(S)){if(j.indexOf(S)!==-1)throw Error("Circular reference detected in "+C.join("."));j.push(S),te.forEach(S,function(T,P){(!(te.isUndefined(T)||T===null)&&c.call(a,T,te.isString(P)?P.trim():P,C,b))===!0&&w(T,C?C.concat(P):[P])}),j.pop()}}if(!te.isObject(s))throw new TypeError("data must be an object");return w(s),a}function cj(s){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(i){return a[i]})}function bh(s,a){this._pairs=[],s&&Rd(s,this,a)}const Gy=bh.prototype;Gy.append=function(a,l){this._pairs.push([a,l])};Gy.toString=function(a){const l=a?function(i){return a.call(this,i,cj)}:cj;return this._pairs.map(function(c){return l(c[0])+"="+l(c[1])},"").join("&")};function qC(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $y(s,a,l){if(!a)return s;const i=l&&l.encode||qC;te.isFunction(l)&&(l={serialize:l});const c=l&&l.serialize;let d;if(c?d=c(a,l):d=te.isURLSearchParams(a)?a.toString():new bh(a,l).toString(i),d){const m=s.indexOf("#");m!==-1&&(s=s.slice(0,m)),s+=(s.indexOf("?")===-1?"?":"&")+d}return s}class dj{constructor(){this.handlers=[]}use(a,l,i){return this.handlers.push({fulfilled:a,rejected:l,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){te.forEach(this.handlers,function(i){i!==null&&a(i)})}}const Iy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},VC=typeof URLSearchParams<"u"?URLSearchParams:bh,GC=typeof FormData<"u"?FormData:null,$C=typeof Blob<"u"?Blob:null,IC={isBrowser:!0,classes:{URLSearchParams:VC,FormData:GC,Blob:$C},protocols:["http","https","file","blob","url","data"]},Nh=typeof window<"u"&&typeof document<"u",Ff=typeof navigator=="object"&&navigator||void 0,WC=Nh&&(!Ff||["ReactNative","NativeScript","NS"].indexOf(Ff.product)<0),XC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",KC=Nh&&window.location.href||"http://localhost",QC=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Nh,hasStandardBrowserEnv:WC,hasStandardBrowserWebWorkerEnv:XC,navigator:Ff,origin:KC},Symbol.toStringTag,{value:"Module"})),Ss={...QC,...IC};function ZC(s,a){return Rd(s,new Ss.classes.URLSearchParams,{visitor:function(l,i,c,d){return Ss.isNode&&te.isBuffer(l)?(this.append(i,l.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)},...a})}function JC(s){return te.matchAll(/\w+|\[(\w*)]/g,s).map(a=>a[0]==="[]"?"":a[1]||a[0])}function ek(s){const a={},l=Object.keys(s);let i;const c=l.length;let d;for(i=0;i<c;i++)d=l[i],a[d]=s[d];return a}function Wy(s){function a(l,i,c,d){let m=l[d++];if(m==="__proto__")return!0;const h=Number.isFinite(+m),p=d>=l.length;return m=!m&&te.isArray(c)?c.length:m,p?(te.hasOwnProp(c,m)?c[m]=[c[m],i]:c[m]=i,!h):((!c[m]||!te.isObject(c[m]))&&(c[m]=[]),a(l,i,c[m],d)&&te.isArray(c[m])&&(c[m]=ek(c[m])),!h)}if(te.isFormData(s)&&te.isFunction(s.entries)){const l={};return te.forEachEntry(s,(i,c)=>{a(JC(i),c,l,0)}),l}return null}function tk(s,a,l){if(te.isString(s))try{return(a||JSON.parse)(s),te.trim(s)}catch(i){if(i.name!=="SyntaxError")throw i}return(l||JSON.stringify)(s)}const wo={transitional:Iy,adapter:["xhr","http","fetch"],transformRequest:[function(a,l){const i=l.getContentType()||"",c=i.indexOf("application/json")>-1,d=te.isObject(a);if(d&&te.isHTMLForm(a)&&(a=new FormData(a)),te.isFormData(a))return c?JSON.stringify(Wy(a)):a;if(te.isArrayBuffer(a)||te.isBuffer(a)||te.isStream(a)||te.isFile(a)||te.isBlob(a)||te.isReadableStream(a))return a;if(te.isArrayBufferView(a))return a.buffer;if(te.isURLSearchParams(a))return l.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let h;if(d){if(i.indexOf("application/x-www-form-urlencoded")>-1)return ZC(a,this.formSerializer).toString();if((h=te.isFileList(a))||i.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return Rd(h?{"files[]":a}:a,p&&new p,this.formSerializer)}}return d||c?(l.setContentType("application/json",!1),tk(a)):a}],transformResponse:[function(a){const l=this.transitional||wo.transitional,i=l&&l.forcedJSONParsing,c=this.responseType==="json";if(te.isResponse(a)||te.isReadableStream(a))return a;if(a&&te.isString(a)&&(i&&!this.responseType||c)){const m=!(l&&l.silentJSONParsing)&&c;try{return JSON.parse(a,this.parseReviver)}catch(h){if(m)throw h.name==="SyntaxError"?qe.from(h,qe.ERR_BAD_RESPONSE,this,null,this.response):h}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ss.classes.FormData,Blob:Ss.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(["delete","get","head","post","put","patch"],s=>{wo.headers[s]={}});const sk=te.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"]),nk=s=>{const a={};let l,i,c;return s&&s.split(`
`).forEach(function(m){c=m.indexOf(":"),l=m.substring(0,c).trim().toLowerCase(),i=m.substring(c+1).trim(),!(!l||a[l]&&sk[l])&&(l==="set-cookie"?a[l]?a[l].push(i):a[l]=[i]:a[l]=a[l]?a[l]+", "+i:i)}),a},uj=Symbol("internals");function Xi(s){return s&&String(s).trim().toLowerCase()}function od(s){return s===!1||s==null?s:te.isArray(s)?s.map(od):String(s)}function ak(s){const a=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=l.exec(s);)a[i[1]]=i[2];return a}const lk=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function xf(s,a,l,i,c){if(te.isFunction(i))return i.call(this,a,l);if(c&&(a=l),!!te.isString(a)){if(te.isString(i))return a.indexOf(i)!==-1;if(te.isRegExp(i))return i.test(a)}}function rk(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,l,i)=>l.toUpperCase()+i)}function ik(s,a){const l=te.toCamelCase(" "+a);["get","set","has"].forEach(i=>{Object.defineProperty(s,i+l,{value:function(c,d,m){return this[i].call(this,a,c,d,m)},configurable:!0})})}let Vs=class{constructor(a){a&&this.set(a)}set(a,l,i){const c=this;function d(h,p,v){const g=Xi(p);if(!g)throw new Error("header name must be a non-empty string");const j=te.findKey(c,g);(!j||c[j]===void 0||v===!0||v===void 0&&c[j]!==!1)&&(c[j||p]=od(h))}const m=(h,p)=>te.forEach(h,(v,g)=>d(v,g,p));if(te.isPlainObject(a)||a instanceof this.constructor)m(a,l);else if(te.isString(a)&&(a=a.trim())&&!lk(a))m(nk(a),l);else if(te.isObject(a)&&te.isIterable(a)){let h={},p,v;for(const g of a){if(!te.isArray(g))throw TypeError("Object iterator must return a key-value pair");h[v=g[0]]=(p=h[v])?te.isArray(p)?[...p,g[1]]:[p,g[1]]:g[1]}m(h,l)}else a!=null&&d(l,a,i);return this}get(a,l){if(a=Xi(a),a){const i=te.findKey(this,a);if(i){const c=this[i];if(!l)return c;if(l===!0)return ak(c);if(te.isFunction(l))return l.call(this,c,i);if(te.isRegExp(l))return l.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,l){if(a=Xi(a),a){const i=te.findKey(this,a);return!!(i&&this[i]!==void 0&&(!l||xf(this,this[i],i,l)))}return!1}delete(a,l){const i=this;let c=!1;function d(m){if(m=Xi(m),m){const h=te.findKey(i,m);h&&(!l||xf(i,i[h],h,l))&&(delete i[h],c=!0)}}return te.isArray(a)?a.forEach(d):d(a),c}clear(a){const l=Object.keys(this);let i=l.length,c=!1;for(;i--;){const d=l[i];(!a||xf(this,this[d],d,a,!0))&&(delete this[d],c=!0)}return c}normalize(a){const l=this,i={};return te.forEach(this,(c,d)=>{const m=te.findKey(i,d);if(m){l[m]=od(c),delete l[d];return}const h=a?rk(d):String(d).trim();h!==d&&delete l[d],l[h]=od(c),i[h]=!0}),this}concat(...a){return this.constructor.concat(this,...a)}toJSON(a){const l=Object.create(null);return te.forEach(this,(i,c)=>{i!=null&&i!==!1&&(l[c]=a&&te.isArray(i)?i.join(", "):i)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([a,l])=>a+": "+l).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...l){const i=new this(a);return l.forEach(c=>i.set(c)),i}static accessor(a){const i=(this[uj]=this[uj]={accessors:{}}).accessors,c=this.prototype;function d(m){const h=Xi(m);i[h]||(ik(c,m),i[h]=!0)}return te.isArray(a)?a.forEach(d):d(a),this}};Vs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);te.reduceDescriptors(Vs.prototype,({value:s},a)=>{let l=a[0].toUpperCase()+a.slice(1);return{get:()=>s,set(i){this[l]=i}}});te.freezeMethods(Vs);function pf(s,a){const l=this||wo,i=a||l,c=Vs.from(i.headers);let d=i.data;return te.forEach(s,function(h){d=h.call(l,d,c.normalize(),a?a.status:void 0)}),c.normalize(),d}function Xy(s){return!!(s&&s.__CANCEL__)}function Kr(s,a,l){qe.call(this,s??"canceled",qe.ERR_CANCELED,a,l),this.name="CanceledError"}te.inherits(Kr,qe,{__CANCEL__:!0});function Ky(s,a,l){const i=l.config.validateStatus;!l.status||!i||i(l.status)?s(l):a(new qe("Request failed with status code "+l.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function ok(s){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return a&&a[1]||""}function ck(s,a){s=s||10;const l=new Array(s),i=new Array(s);let c=0,d=0,m;return a=a!==void 0?a:1e3,function(p){const v=Date.now(),g=i[d];m||(m=v),l[c]=p,i[c]=v;let j=d,b=0;for(;j!==c;)b+=l[j++],j=j%s;if(c=(c+1)%s,c===d&&(d=(d+1)%s),v-m<a)return;const w=g&&v-g;return w?Math.round(b*1e3/w):void 0}}function dk(s,a){let l=0,i=1e3/a,c,d;const m=(v,g=Date.now())=>{l=g,c=null,d&&(clearTimeout(d),d=null),s(...v)};return[(...v)=>{const g=Date.now(),j=g-l;j>=i?m(v,g):(c=v,d||(d=setTimeout(()=>{d=null,m(c)},i-j)))},()=>c&&m(c)]}const gd=(s,a,l=3)=>{let i=0;const c=ck(50,250);return dk(d=>{const m=d.loaded,h=d.lengthComputable?d.total:void 0,p=m-i,v=c(p),g=m<=h;i=m;const j={loaded:m,total:h,progress:h?m/h:void 0,bytes:p,rate:v||void 0,estimated:v&&h&&g?(h-m)/v:void 0,event:d,lengthComputable:h!=null,[a?"download":"upload"]:!0};s(j)},l)},mj=(s,a)=>{const l=s!=null;return[i=>a[0]({lengthComputable:l,total:s,loaded:i}),a[1]]},fj=s=>(...a)=>te.asap(()=>s(...a)),uk=Ss.hasStandardBrowserEnv?((s,a)=>l=>(l=new URL(l,Ss.origin),s.protocol===l.protocol&&s.host===l.host&&(a||s.port===l.port)))(new URL(Ss.origin),Ss.navigator&&/(msie|trident)/i.test(Ss.navigator.userAgent)):()=>!0,mk=Ss.hasStandardBrowserEnv?{write(s,a,l,i,c,d,m){if(typeof document>"u")return;const h=[`${s}=${encodeURIComponent(a)}`];te.isNumber(l)&&h.push(`expires=${new Date(l).toUTCString()}`),te.isString(i)&&h.push(`path=${i}`),te.isString(c)&&h.push(`domain=${c}`),d===!0&&h.push("secure"),te.isString(m)&&h.push(`SameSite=${m}`),document.cookie=h.join("; ")},read(s){if(typeof document>"u")return null;const a=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return a?decodeURIComponent(a[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function fk(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function hk(s,a){return a?s.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):s}function Qy(s,a,l){let i=!fk(a);return s&&(i||l==!1)?hk(s,a):a}const hj=s=>s instanceof Vs?{...s}:s;function El(s,a){a=a||{};const l={};function i(v,g,j,b){return te.isPlainObject(v)&&te.isPlainObject(g)?te.merge.call({caseless:b},v,g):te.isPlainObject(g)?te.merge({},g):te.isArray(g)?g.slice():g}function c(v,g,j,b){if(te.isUndefined(g)){if(!te.isUndefined(v))return i(void 0,v,j,b)}else return i(v,g,j,b)}function d(v,g){if(!te.isUndefined(g))return i(void 0,g)}function m(v,g){if(te.isUndefined(g)){if(!te.isUndefined(v))return i(void 0,v)}else return i(void 0,g)}function h(v,g,j){if(j in a)return i(v,g);if(j in s)return i(void 0,v)}const p={url:d,method:d,data:d,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:h,headers:(v,g,j)=>c(hj(v),hj(g),j,!0)};return te.forEach(Object.keys({...s,...a}),function(g){const j=p[g]||c,b=j(s[g],a[g],g);te.isUndefined(b)&&j!==h||(l[g]=b)}),l}const Zy=s=>{const a=El({},s);let{data:l,withXSRFToken:i,xsrfHeaderName:c,xsrfCookieName:d,headers:m,auth:h}=a;if(a.headers=m=Vs.from(m),a.url=$y(Qy(a.baseURL,a.url,a.allowAbsoluteUrls),s.params,s.paramsSerializer),h&&m.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),te.isFormData(l)){if(Ss.hasStandardBrowserEnv||Ss.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(te.isFunction(l.getHeaders)){const p=l.getHeaders(),v=["content-type","content-length"];Object.entries(p).forEach(([g,j])=>{v.includes(g.toLowerCase())&&m.set(g,j)})}}if(Ss.hasStandardBrowserEnv&&(i&&te.isFunction(i)&&(i=i(a)),i||i!==!1&&uk(a.url))){const p=c&&d&&mk.read(d);p&&m.set(c,p)}return a},xk=typeof XMLHttpRequest<"u",pk=xk&&function(s){return new Promise(function(l,i){const c=Zy(s);let d=c.data;const m=Vs.from(c.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:v}=c,g,j,b,w,S;function C(){w&&w(),S&&S(),c.cancelToken&&c.cancelToken.unsubscribe(g),c.signal&&c.signal.removeEventListener("abort",g)}let N=new XMLHttpRequest;N.open(c.method.toUpperCase(),c.url,!0),N.timeout=c.timeout;function T(){if(!N)return;const M=Vs.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),D={data:!h||h==="text"||h==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:M,config:s,request:N};Ky(function(E){l(E),C()},function(E){i(E),C()},D),N=null}"onloadend"in N?N.onloadend=T:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(T)},N.onabort=function(){N&&(i(new qe("Request aborted",qe.ECONNABORTED,s,N)),N=null)},N.onerror=function(k){const D=k&&k.message?k.message:"Network Error",A=new qe(D,qe.ERR_NETWORK,s,N);A.event=k||null,i(A),N=null},N.ontimeout=function(){let k=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const D=c.transitional||Iy;c.timeoutErrorMessage&&(k=c.timeoutErrorMessage),i(new qe(k,D.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,s,N)),N=null},d===void 0&&m.setContentType(null),"setRequestHeader"in N&&te.forEach(m.toJSON(),function(k,D){N.setRequestHeader(D,k)}),te.isUndefined(c.withCredentials)||(N.withCredentials=!!c.withCredentials),h&&h!=="json"&&(N.responseType=c.responseType),v&&([b,S]=gd(v,!0),N.addEventListener("progress",b)),p&&N.upload&&([j,w]=gd(p),N.upload.addEventListener("progress",j),N.upload.addEventListener("loadend",w)),(c.cancelToken||c.signal)&&(g=M=>{N&&(i(!M||M.type?new Kr(null,s,N):M),N.abort(),N=null)},c.cancelToken&&c.cancelToken.subscribe(g),c.signal&&(c.signal.aborted?g():c.signal.addEventListener("abort",g)));const P=ok(c.url);if(P&&Ss.protocols.indexOf(P)===-1){i(new qe("Unsupported protocol "+P+":",qe.ERR_BAD_REQUEST,s));return}N.send(d||null)})},gk=(s,a)=>{const{length:l}=s=s?s.filter(Boolean):[];if(a||l){let i=new AbortController,c;const d=function(v){if(!c){c=!0,h();const g=v instanceof Error?v:this.reason;i.abort(g instanceof qe?g:new Kr(g instanceof Error?g.message:g))}};let m=a&&setTimeout(()=>{m=null,d(new qe(`timeout ${a} of ms exceeded`,qe.ETIMEDOUT))},a);const h=()=>{s&&(m&&clearTimeout(m),m=null,s.forEach(v=>{v.unsubscribe?v.unsubscribe(d):v.removeEventListener("abort",d)}),s=null)};s.forEach(v=>v.addEventListener("abort",d));const{signal:p}=i;return p.unsubscribe=()=>te.asap(h),p}},vk=function*(s,a){let l=s.byteLength;if(l<a){yield s;return}let i=0,c;for(;i<l;)c=i+a,yield s.slice(i,c),i=c},jk=async function*(s,a){for await(const l of yk(s))yield*vk(l,a)},yk=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const a=s.getReader();try{for(;;){const{done:l,value:i}=await a.read();if(l)break;yield i}}finally{await a.cancel()}},xj=(s,a,l,i)=>{const c=jk(s,a);let d=0,m,h=p=>{m||(m=!0,i&&i(p))};return new ReadableStream({async pull(p){try{const{done:v,value:g}=await c.next();if(v){h(),p.close();return}let j=g.byteLength;if(l){let b=d+=j;l(b)}p.enqueue(new Uint8Array(g))}catch(v){throw h(v),v}},cancel(p){return h(p),c.return()}},{highWaterMark:2})},pj=64*1024,{isFunction:Zc}=te,bk=(({Request:s,Response:a})=>({Request:s,Response:a}))(te.global),{ReadableStream:gj,TextEncoder:vj}=te.global,jj=(s,...a)=>{try{return!!s(...a)}catch{return!1}},Nk=s=>{s=te.merge.call({skipUndefined:!0},bk,s);const{fetch:a,Request:l,Response:i}=s,c=a?Zc(a):typeof fetch=="function",d=Zc(l),m=Zc(i);if(!c)return!1;const h=c&&Zc(gj),p=c&&(typeof vj=="function"?(S=>C=>S.encode(C))(new vj):async S=>new Uint8Array(await new l(S).arrayBuffer())),v=d&&h&&jj(()=>{let S=!1;const C=new l(Ss.origin,{body:new gj,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!C}),g=m&&h&&jj(()=>te.isReadableStream(new i("").body)),j={stream:g&&(S=>S.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!j[S]&&(j[S]=(C,N)=>{let T=C&&C[S];if(T)return T.call(C);throw new qe(`Response type '${S}' is not supported`,qe.ERR_NOT_SUPPORT,N)})});const b=async S=>{if(S==null)return 0;if(te.isBlob(S))return S.size;if(te.isSpecCompliantForm(S))return(await new l(Ss.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(te.isArrayBufferView(S)||te.isArrayBuffer(S))return S.byteLength;if(te.isURLSearchParams(S)&&(S=S+""),te.isString(S))return(await p(S)).byteLength},w=async(S,C)=>{const N=te.toFiniteNumber(S.getContentLength());return N??b(C)};return async S=>{let{url:C,method:N,data:T,signal:P,cancelToken:M,timeout:k,onDownloadProgress:D,onUploadProgress:A,responseType:E,headers:B,withCredentials:Y="same-origin",fetchOptions:G}=Zy(S),$=a||fetch;E=E?(E+"").toLowerCase():"text";let oe=gk([P,M&&M.toAbortSignal()],k),je=null;const ae=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()});let me;try{if(A&&v&&N!=="get"&&N!=="head"&&(me=await w(B,T))!==0){let xe=new l(C,{method:"POST",body:T,duplex:"half"}),F;if(te.isFormData(T)&&(F=xe.headers.get("content-type"))&&B.setContentType(F),xe.body){const[W,fe]=mj(me,gd(fj(A)));T=xj(xe.body,pj,W,fe)}}te.isString(Y)||(Y=Y?"include":"omit");const R=d&&"credentials"in l.prototype,O={...G,signal:oe,method:N.toUpperCase(),headers:B.normalize().toJSON(),body:T,duplex:"half",credentials:R?Y:void 0};je=d&&new l(C,O);let L=await(d?$(je,G):$(C,O));const ee=g&&(E==="stream"||E==="response");if(g&&(D||ee&&ae)){const xe={};["status","statusText","headers"].forEach(I=>{xe[I]=L[I]});const F=te.toFiniteNumber(L.headers.get("content-length")),[W,fe]=D&&mj(F,gd(fj(D),!0))||[];L=new i(xj(L.body,pj,W,()=>{fe&&fe(),ae&&ae()}),xe)}E=E||"text";let le=await j[te.findKey(j,E)||"text"](L,S);return!ee&&ae&&ae(),await new Promise((xe,F)=>{Ky(xe,F,{data:le,headers:Vs.from(L.headers),status:L.status,statusText:L.statusText,config:S,request:je})})}catch(R){throw ae&&ae(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new qe("Network Error",qe.ERR_NETWORK,S,je),{cause:R.cause||R}):qe.from(R,R&&R.code,S,je)}}},wk=new Map,Jy=s=>{let a=s&&s.env||{};const{fetch:l,Request:i,Response:c}=a,d=[i,c,l];let m=d.length,h=m,p,v,g=wk;for(;h--;)p=d[h],v=g.get(p),v===void 0&&g.set(p,v=h?new Map:Nk(a)),g=v;return v};Jy();const wh={http:HC,xhr:pk,fetch:{get:Jy}};te.forEach(wh,(s,a)=>{if(s){try{Object.defineProperty(s,"name",{value:a})}catch{}Object.defineProperty(s,"adapterName",{value:a})}});const yj=s=>`- ${s}`,Sk=s=>te.isFunction(s)||s===null||s===!1;function _k(s,a){s=te.isArray(s)?s:[s];const{length:l}=s;let i,c;const d={};for(let m=0;m<l;m++){i=s[m];let h;if(c=i,!Sk(i)&&(c=wh[(h=String(i)).toLowerCase()],c===void 0))throw new qe(`Unknown adapter '${h}'`);if(c&&(te.isFunction(c)||(c=c.get(a))))break;d[h||"#"+m]=c}if(!c){const m=Object.entries(d).map(([p,v])=>`adapter ${p} `+(v===!1?"is not supported by the environment":"is not available in the build"));let h=l?m.length>1?`since :
`+m.map(yj).join(`
`):" "+yj(m[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return c}const eb={getAdapter:_k,adapters:wh};function gf(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Kr(null,s)}function bj(s){return gf(s),s.headers=Vs.from(s.headers),s.data=pf.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),eb.getAdapter(s.adapter||wo.adapter,s)(s).then(function(i){return gf(s),i.data=pf.call(s,s.transformResponse,i),i.headers=Vs.from(i.headers),i},function(i){return Xy(i)||(gf(s),i&&i.response&&(i.response.data=pf.call(s,s.transformResponse,i.response),i.response.headers=Vs.from(i.response.headers))),Promise.reject(i)})}const tb="1.13.2",zd={};["object","boolean","number","function","string","symbol"].forEach((s,a)=>{zd[s]=function(i){return typeof i===s||"a"+(a<1?"n ":" ")+s}});const Nj={};zd.transitional=function(a,l,i){function c(d,m){return"[Axios v"+tb+"] Transitional option '"+d+"'"+m+(i?". "+i:"")}return(d,m,h)=>{if(a===!1)throw new qe(c(m," has been removed"+(l?" in "+l:"")),qe.ERR_DEPRECATED);return l&&!Nj[m]&&(Nj[m]=!0,console.warn(c(m," has been deprecated since v"+l+" and will be removed in the near future"))),a?a(d,m,h):!0}};zd.spelling=function(a){return(l,i)=>(console.warn(`${i} is likely a misspelling of ${a}`),!0)};function Ck(s,a,l){if(typeof s!="object")throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const i=Object.keys(s);let c=i.length;for(;c-- >0;){const d=i[c],m=a[d];if(m){const h=s[d],p=h===void 0||m(h,d,s);if(p!==!0)throw new qe("option "+d+" must be "+p,qe.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new qe("Unknown option "+d,qe.ERR_BAD_OPTION)}}const cd={assertOptions:Ck,validators:zd},Bn=cd.validators;let kl=class{constructor(a){this.defaults=a||{},this.interceptors={request:new dj,response:new dj}}async request(a,l){try{return await this._request(a,l)}catch(i){if(i instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const d=c.stack?c.stack.replace(/^.+\n/,""):"";try{i.stack?d&&!String(i.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(i.stack+=`
`+d):i.stack=d}catch{}}throw i}}_request(a,l){typeof a=="string"?(l=l||{},l.url=a):l=a||{},l=El(this.defaults,l);const{transitional:i,paramsSerializer:c,headers:d}=l;i!==void 0&&cd.assertOptions(i,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean)},!1),c!=null&&(te.isFunction(c)?l.paramsSerializer={serialize:c}:cd.assertOptions(c,{encode:Bn.function,serialize:Bn.function},!0)),l.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?l.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:l.allowAbsoluteUrls=!0),cd.assertOptions(l,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),l.method=(l.method||this.defaults.method||"get").toLowerCase();let m=d&&te.merge(d.common,d[l.method]);d&&te.forEach(["delete","get","head","post","put","patch","common"],S=>{delete d[S]}),l.headers=Vs.concat(m,d);const h=[];let p=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(l)===!1||(p=p&&C.synchronous,h.unshift(C.fulfilled,C.rejected))});const v=[];this.interceptors.response.forEach(function(C){v.push(C.fulfilled,C.rejected)});let g,j=0,b;if(!p){const S=[bj.bind(this),void 0];for(S.unshift(...h),S.push(...v),b=S.length,g=Promise.resolve(l);j<b;)g=g.then(S[j++],S[j++]);return g}b=h.length;let w=l;for(;j<b;){const S=h[j++],C=h[j++];try{w=S(w)}catch(N){C.call(this,N);break}}try{g=bj.call(this,w)}catch(S){return Promise.reject(S)}for(j=0,b=v.length;j<b;)g=g.then(v[j++],v[j++]);return g}getUri(a){a=El(this.defaults,a);const l=Qy(a.baseURL,a.url,a.allowAbsoluteUrls);return $y(l,a.params,a.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(a){kl.prototype[a]=function(l,i){return this.request(El(i||{},{method:a,url:l,data:(i||{}).data}))}});te.forEach(["post","put","patch"],function(a){function l(i){return function(d,m,h){return this.request(El(h||{},{method:a,headers:i?{"Content-Type":"multipart/form-data"}:{},url:d,data:m}))}}kl.prototype[a]=l(),kl.prototype[a+"Form"]=l(!0)});let kk=class sb{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let l;this.promise=new Promise(function(d){l=d});const i=this;this.promise.then(c=>{if(!i._listeners)return;let d=i._listeners.length;for(;d-- >0;)i._listeners[d](c);i._listeners=null}),this.promise.then=c=>{let d;const m=new Promise(h=>{i.subscribe(h),d=h}).then(c);return m.cancel=function(){i.unsubscribe(d)},m},a(function(d,m,h){i.reason||(i.reason=new Kr(d,m,h),l(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const l=this._listeners.indexOf(a);l!==-1&&this._listeners.splice(l,1)}toAbortSignal(){const a=new AbortController,l=i=>{a.abort(i)};return this.subscribe(l),a.signal.unsubscribe=()=>this.unsubscribe(l),a.signal}static source(){let a;return{token:new sb(function(c){a=c}),cancel:a}}};function Tk(s){return function(l){return s.apply(null,l)}}function Ek(s){return te.isObject(s)&&s.isAxiosError===!0}const Yf={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(Yf).forEach(([s,a])=>{Yf[a]=s});function nb(s){const a=new kl(s),l=Ry(kl.prototype.request,a);return te.extend(l,kl.prototype,a,{allOwnKeys:!0}),te.extend(l,a,null,{allOwnKeys:!0}),l.create=function(c){return nb(El(s,c))},l}const $t=nb(wo);$t.Axios=kl;$t.CanceledError=Kr;$t.CancelToken=kk;$t.isCancel=Xy;$t.VERSION=tb;$t.toFormData=Rd;$t.AxiosError=qe;$t.Cancel=$t.CanceledError;$t.all=function(a){return Promise.all(a)};$t.spread=Tk;$t.isAxiosError=Ek;$t.mergeConfig=El;$t.AxiosHeaders=Vs;$t.formToJSON=s=>Wy(te.isHTMLForm(s)?new FormData(s):s);$t.getAdapter=eb.getAdapter;$t.HttpStatusCode=Yf;$t.default=$t;const{Axios:c6,AxiosError:d6,CanceledError:u6,isCancel:m6,CancelToken:f6,VERSION:h6,all:x6,Cancel:p6,isAxiosError:g6,spread:v6,toFormData:j6,AxiosHeaders:y6,HttpStatusCode:b6,formToJSON:N6,getAdapter:w6,mergeConfig:S6}=$t,Mk=(s,a)=>{const l=new Array(s.length+a.length);for(let i=0;i<s.length;i++)l[i]=s[i];for(let i=0;i<a.length;i++)l[s.length+i]=a[i];return l},Dk=(s,a)=>({classGroupId:s,validator:a}),ab=(s=new Map,a=null,l)=>({nextPart:s,validators:a,classGroupId:l}),vd="-",wj=[],Ok="arbitrary..",Ak=s=>{const a=zk(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=s;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Rk(m);const h=m.split(vd),p=h[0]===""&&h.length>1?1:0;return lb(h,p,a)},getConflictingClassGroupIds:(m,h)=>{if(h){const p=i[m],v=l[m];return p?v?Mk(v,p):p:v||wj}return l[m]||wj}}},lb=(s,a,l)=>{if(s.length-a===0)return l.classGroupId;const c=s[a],d=l.nextPart.get(c);if(d){const v=lb(s,a+1,d);if(v)return v}const m=l.validators;if(m===null)return;const h=a===0?s.join(vd):s.slice(a).join(vd),p=m.length;for(let v=0;v<p;v++){const g=m[v];if(g.validator(h))return g.classGroupId}},Rk=s=>s.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=s.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?Ok+i:void 0})(),zk=s=>{const{theme:a,classGroups:l}=s;return Pk(l,a)},Pk=(s,a)=>{const l=ab();for(const i in s){const c=s[i];Sh(c,l,i,a)}return l},Sh=(s,a,l,i)=>{const c=s.length;for(let d=0;d<c;d++){const m=s[d];Lk(m,a,l,i)}},Lk=(s,a,l,i)=>{if(typeof s=="string"){Bk(s,a,l);return}if(typeof s=="function"){Uk(s,a,l,i);return}Hk(s,a,l,i)},Bk=(s,a,l)=>{const i=s===""?a:rb(a,s);i.classGroupId=l},Uk=(s,a,l,i)=>{if(Fk(s)){Sh(s(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(Dk(l,s))},Hk=(s,a,l,i)=>{const c=Object.entries(s),d=c.length;for(let m=0;m<d;m++){const[h,p]=c[m];Sh(p,rb(a,h),l,i)}},rb=(s,a)=>{let l=s;const i=a.split(vd),c=i.length;for(let d=0;d<c;d++){const m=i[d];let h=l.nextPart.get(m);h||(h=ab(),l.nextPart.set(m,h)),l=h}return l},Fk=s=>"isThemeGetter"in s&&s.isThemeGetter===!0,Yk=s=>{if(s<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>s&&(a=0,i=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=i[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},qf="!",Sj=":",qk=[],_j=(s,a,l,i,c)=>({modifiers:s,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),Vk=s=>{const{prefix:a,experimentalParseClassName:l}=s;let i=c=>{const d=[];let m=0,h=0,p=0,v;const g=c.length;for(let C=0;C<g;C++){const N=c[C];if(m===0&&h===0){if(N===Sj){d.push(c.slice(p,C)),p=C+1;continue}if(N==="/"){v=C;continue}}N==="["?m++:N==="]"?m--:N==="("?h++:N===")"&&h--}const j=d.length===0?c:c.slice(p);let b=j,w=!1;j.endsWith(qf)?(b=j.slice(0,-1),w=!0):j.startsWith(qf)&&(b=j.slice(1),w=!0);const S=v&&v>p?v-p:void 0;return _j(d,w,b,S)};if(a){const c=a+Sj,d=i;i=m=>m.startsWith(c)?d(m.slice(c.length)):_j(qk,!1,m,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},Gk=s=>{const a=new Map;return s.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let d=0;d<l.length;d++){const m=l[d],h=m[0]==="[",p=a.has(m);h||p?(c.length>0&&(c.sort(),i.push(...c),c=[]),i.push(m)):c.push(m)}return c.length>0&&(c.sort(),i.push(...c)),i}},$k=s=>({cache:Yk(s.cacheSize),parseClassName:Vk(s),sortModifiers:Gk(s),...Ak(s)}),Ik=/\s+/,Wk=(s,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],h=s.trim().split(Ik);let p="";for(let v=h.length-1;v>=0;v-=1){const g=h[v],{isExternal:j,modifiers:b,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:C}=l(g);if(j){p=g+(p.length>0?" "+p:p);continue}let N=!!C,T=i(N?S.substring(0,C):S);if(!T){if(!N){p=g+(p.length>0?" "+p:p);continue}if(T=i(S),!T){p=g+(p.length>0?" "+p:p);continue}N=!1}const P=b.length===0?"":b.length===1?b[0]:d(b).join(":"),M=w?P+qf:P,k=M+T;if(m.indexOf(k)>-1)continue;m.push(k);const D=c(T,N);for(let A=0;A<D.length;++A){const E=D[A];m.push(M+E)}p=g+(p.length>0?" "+p:p)}return p},Xk=(...s)=>{let a=0,l,i,c="";for(;a<s.length;)(l=s[a++])&&(i=ib(l))&&(c&&(c+=" "),c+=i);return c},ib=s=>{if(typeof s=="string")return s;let a,l="";for(let i=0;i<s.length;i++)s[i]&&(a=ib(s[i]))&&(l&&(l+=" "),l+=a);return l},Kk=(s,...a)=>{let l,i,c,d;const m=p=>{const v=a.reduce((g,j)=>j(g),s());return l=$k(v),i=l.cache.get,c=l.cache.set,d=h,h(p)},h=p=>{const v=i(p);if(v)return v;const g=Wk(p,l);return c(p,g),g};return d=m,(...p)=>d(Xk(...p))},Qk=[],rs=s=>{const a=l=>l[s]||Qk;return a.isThemeGetter=!0,a},ob=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zk=/^\d+\/\d+$/,Jk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eT=/\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$/,tT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tr=s=>Zk.test(s),Ke=s=>!!s&&!Number.isNaN(Number(s)),qa=s=>!!s&&Number.isInteger(Number(s)),vf=s=>s.endsWith("%")&&Ke(s.slice(0,-1)),ua=s=>Jk.test(s),aT=()=>!0,lT=s=>eT.test(s)&&!tT.test(s),db=()=>!1,rT=s=>sT.test(s),iT=s=>nT.test(s),oT=s=>!Se(s)&&!_e(s),cT=s=>Qr(s,fb,db),Se=s=>ob.test(s),bl=s=>Qr(s,hb,lT),jf=s=>Qr(s,hT,Ke),Cj=s=>Qr(s,ub,db),dT=s=>Qr(s,mb,iT),Jc=s=>Qr(s,xb,rT),_e=s=>cb.test(s),Ki=s=>Zr(s,hb),uT=s=>Zr(s,xT),kj=s=>Zr(s,ub),mT=s=>Zr(s,fb),fT=s=>Zr(s,mb),ed=s=>Zr(s,xb,!0),Qr=(s,a,l)=>{const i=ob.exec(s);return i?i[1]?a(i[1]):l(i[2]):!1},Zr=(s,a,l=!1)=>{const i=cb.exec(s);return i?i[1]?a(i[1]):l:!1},ub=s=>s==="position"||s==="percentage",mb=s=>s==="image"||s==="url",fb=s=>s==="length"||s==="size"||s==="bg-size",hb=s=>s==="length",hT=s=>s==="number",xT=s=>s==="family-name",xb=s=>s==="shadow",pT=()=>{const s=rs("color"),a=rs("font"),l=rs("text"),i=rs("font-weight"),c=rs("tracking"),d=rs("leading"),m=rs("breakpoint"),h=rs("container"),p=rs("spacing"),v=rs("radius"),g=rs("shadow"),j=rs("inset-shadow"),b=rs("text-shadow"),w=rs("drop-shadow"),S=rs("blur"),C=rs("perspective"),N=rs("aspect"),T=rs("ease"),P=rs("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...k(),_e,Se],A=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],B=()=>[_e,Se,p],Y=()=>[Tr,"full","auto",...B()],G=()=>[qa,"none","subgrid",_e,Se],$=()=>["auto",{span:["full",qa,_e,Se]},qa,_e,Se],oe=()=>[qa,"auto",_e,Se],je=()=>["auto","min","max","fr",_e,Se],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...B()],O=()=>[Tr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],L=()=>[s,_e,Se],ee=()=>[...k(),kj,Cj,{position:[_e,Se]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",mT,cT,{size:[_e,Se]}],F=()=>[vf,Ki,bl],W=()=>["","none","full",v,_e,Se],fe=()=>["",Ke,Ki,bl],I=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Ke,vf,kj,Cj],Ce=()=>["","none",S,_e,Se],Q=()=>["none",Ke,_e,Se],Oe=()=>["none",Ke,_e,Se],$e=()=>[Ke,_e,Se],re=()=>[Tr,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ua],breakpoint:[ua],color:[aT],container:[ua],"drop-shadow":[ua],ease:["in","out","in-out"],font:[oT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ua],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ua],shadow:[ua],spacing:["px",Ke],text:[ua],"text-shadow":[ua],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tr,Se,_e,N]}],container:["container"],columns:[{columns:[Ke,Se,_e,h]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:D()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[qa,"auto",_e,Se]}],basis:[{basis:[Tr,"full","auto",h,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,Tr,"auto","initial","none",Se]}],grow:[{grow:["",Ke,_e,Se]}],shrink:[{shrink:["",Ke,_e,Se]}],order:[{order:[qa,"first","last","none",_e,Se]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":je()}],"auto-rows":[{"auto-rows":je()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[h,"screen",...O()]}],"min-w":[{"min-w":[h,"screen","none",...O()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",l,Ki,bl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,_e,jf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vf,Se]}],"font-family":[{font:[uT,Se,a]}],"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:[c,_e,Se]}],"line-clamp":[{"line-clamp":[Ke,"none",_e,jf]}],leading:[{leading:[d,...B()]}],"list-image":[{"list-image":["none",_e,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_e,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",_e,bl]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Ke,"auto",_e,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e,Se]}],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",_e,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qa,_e,Se],radial:["",_e,Se],conic:[qa,_e,Se]},fT,dT]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,_e,Se]}],"outline-w":[{outline:["",Ke,Ki,bl]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,ed,Jc]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",j,ed,Jc]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Ke,bl]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",b,ed,Jc]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Ke,_e,Se]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[_e,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_e,Se]}],filter:[{filter:["","none",_e,Se]}],blur:[{blur:Ce()}],brightness:[{brightness:[Ke,_e,Se]}],contrast:[{contrast:[Ke,_e,Se]}],"drop-shadow":[{"drop-shadow":["","none",w,ed,Jc]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Ke,_e,Se]}],"hue-rotate":[{"hue-rotate":[Ke,_e,Se]}],invert:[{invert:["",Ke,_e,Se]}],saturate:[{saturate:[Ke,_e,Se]}],sepia:[{sepia:["",Ke,_e,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",_e,Se]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,_e,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,_e,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,_e,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,_e,Se]}],"backdrop-invert":[{"backdrop-invert":["",Ke,_e,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,_e,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,_e,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,_e,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_e,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",_e,Se]}],ease:[{ease:["linear","initial",T,_e,Se]}],delay:[{delay:[Ke,_e,Se]}],animate:[{animate:["none",P,_e,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,_e,Se]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Q()}],"rotate-x":[{"rotate-x":Q()}],"rotate-y":[{"rotate-y":Q()}],"rotate-z":[{"rotate-z":Q()}],scale:[{scale:Oe()}],"scale-x":[{"scale-x":Oe()}],"scale-y":[{"scale-y":Oe()}],"scale-z":[{"scale-z":Oe()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[_e,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",_e,Se]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",_e,Se]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Ke,Ki,bl,jf]}],stroke:[{stroke:["none",...L()]}],"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"]}},gT=Kk(pT);function Z(...s){return gT(iy(s))}const Ue=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("rounded-xl border bg-card text-card-foreground shadow",s),...a}));Ue.displayName="Card";const ot=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("flex flex-col space-y-1.5 p-6",s),...a}));ot.displayName="CardHeader";const ct=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("font-semibold leading-none tracking-tight",s),...a}));ct.displayName="CardTitle";const us=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("text-sm text-muted-foreground",s),...a}));us.displayName="CardDescription";const gt=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("p-6 pt-0",s),...a}));gt.displayName="CardContent";const pb=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("flex items-center p-6 pt-0",s),...a}));pb.displayName="CardFooter";var yf="rovingFocusGroup.onEntryFocus",vT={bubbles:!1,cancelable:!0},So="RovingFocusGroup",[Vf,gb,jT]=_d(So),[yT,Pd]=Dn(So,[jT]),[bT,NT]=yT(So),vb=x.forwardRef((s,a)=>e.jsx(Vf.Provider,{scope:s.__scopeRovingFocusGroup,children:e.jsx(Vf.Slot,{scope:s.__scopeRovingFocusGroup,children:e.jsx(wT,{...s,ref:a})})}));vb.displayName=So;var wT=x.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:p,onEntryFocus:v,preventScrollOnEntryFocus:g=!1,...j}=s,b=x.useRef(null),w=Tt(a,b),S=xo(d),[C,N]=Qa({prop:m,defaultProp:h??null,onChange:p,caller:So}),[T,P]=x.useState(!1),M=ws(v),k=gb(l),D=x.useRef(!1),[A,E]=x.useState(0);return x.useEffect(()=>{const B=b.current;if(B)return B.addEventListener(yf,M),()=>B.removeEventListener(yf,M)},[M]),e.jsx(bT,{scope:l,orientation:i,dir:S,loop:c,currentTabStopId:C,onItemFocus:x.useCallback(B=>N(B),[N]),onItemShiftTab:x.useCallback(()=>P(!0),[]),onFocusableItemAdd:x.useCallback(()=>E(B=>B+1),[]),onFocusableItemRemove:x.useCallback(()=>E(B=>B-1),[]),children:e.jsx(dt.div,{tabIndex:T||A===0?-1:0,"data-orientation":i,...j,ref:w,style:{outline:"none",...s.style},onMouseDown:be(s.onMouseDown,()=>{D.current=!0}),onFocus:be(s.onFocus,B=>{const Y=!D.current;if(B.target===B.currentTarget&&Y&&!T){const G=new CustomEvent(yf,vT);if(B.currentTarget.dispatchEvent(G),!G.defaultPrevented){const $=k().filter(R=>R.focusable),oe=$.find(R=>R.active),je=$.find(R=>R.id===C),me=[oe,je,...$].filter(Boolean).map(R=>R.ref.current);bb(me,g)}}D.current=!1}),onBlur:be(s.onBlur,()=>P(!1))})})}),jb="RovingFocusGroupItem",yb=x.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:m,...h}=s,p=jn(),v=d||p,g=NT(jb,l),j=g.currentTabStopId===v,b=gb(l),{onFocusableItemAdd:w,onFocusableItemRemove:S,currentTabStopId:C}=g;return x.useEffect(()=>{if(i)return w(),()=>S()},[i,w,S]),e.jsx(Vf.ItemSlot,{scope:l,id:v,focusable:i,active:c,children:e.jsx(dt.span,{tabIndex:j?0:-1,"data-orientation":g.orientation,...h,ref:a,onMouseDown:be(s.onMouseDown,N=>{i?g.onItemFocus(v):N.preventDefault()}),onFocus:be(s.onFocus,()=>g.onItemFocus(v)),onKeyDown:be(s.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const T=CT(N,g.orientation,g.dir);if(T!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let M=b().filter(k=>k.focusable).map(k=>k.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const k=M.indexOf(N.currentTarget);M=g.loop?kT(M,k+1):M.slice(k+1)}setTimeout(()=>bb(M))}}),children:typeof m=="function"?m({isCurrentTabStop:j,hasTabStop:C!=null}):m})})});yb.displayName=jb;var ST={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _T(s,a){return a!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function CT(s,a,l){const i=_T(s.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return ST[i]}function bb(s,a=!1){const l=document.activeElement;for(const i of s)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function kT(s,a){return s.map((l,i)=>s[(a+i)%s.length])}var Nb=vb,wb=yb,Ld="Tabs",[TT]=Dn(Ld,[Pd]),Sb=Pd(),[ET,_h]=TT(Ld),_b=x.forwardRef((s,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:h,activationMode:p="automatic",...v}=s,g=xo(h),[j,b]=Qa({prop:i,onChange:c,defaultProp:d??"",caller:Ld});return e.jsx(ET,{scope:l,baseId:jn(),value:j,onValueChange:b,orientation:m,dir:g,activationMode:p,children:e.jsx(dt.div,{dir:g,"data-orientation":m,...v,ref:a})})});_b.displayName=Ld;var Cb="TabsList",kb=x.forwardRef((s,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=s,d=_h(Cb,l),m=Sb(l);return e.jsx(Nb,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(dt.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});kb.displayName=Cb;var Tb="TabsTrigger",Eb=x.forwardRef((s,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=s,m=_h(Tb,l),h=Sb(l),p=Ob(m.baseId,i),v=Ab(m.baseId,i),g=i===m.value;return e.jsx(wb,{asChild:!0,...h,focusable:!c,active:g,children:e.jsx(dt.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":v,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:be(s.onMouseDown,j=>{!c&&j.button===0&&j.ctrlKey===!1?m.onValueChange(i):j.preventDefault()}),onKeyDown:be(s.onKeyDown,j=>{[" ","Enter"].includes(j.key)&&m.onValueChange(i)}),onFocus:be(s.onFocus,()=>{const j=m.activationMode!=="manual";!g&&!c&&j&&m.onValueChange(i)})})})});Eb.displayName=Tb;var Mb="TabsContent",Db=x.forwardRef((s,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...m}=s,h=_h(Mb,l),p=Ob(h.baseId,i),v=Ab(h.baseId,i),g=i===h.value,j=x.useRef(g);return x.useEffect(()=>{const b=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(b)},[]),e.jsx(Is,{present:c||g,children:({present:b})=>e.jsx(dt.div,{"data-state":g?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":p,hidden:!b,id:v,tabIndex:0,...m,ref:a,style:{...s.style,animationDuration:j.current?"0s":void 0},children:b&&d})})});Db.displayName=Mb;function Ob(s,a){return`${s}-trigger-${a}`}function Ab(s,a){return`${s}-content-${a}`}var MT=_b,Rb=kb,zb=Eb,Pb=Db;const Ml=MT,$a=x.forwardRef(({className:s,...a},l)=>e.jsx(Rb,{ref:l,className:Z("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a}));$a.displayName=Rb.displayName;const bt=x.forwardRef(({className:s,...a},l)=>e.jsx(zb,{ref:l,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a}));bt.displayName=zb.displayName;const Vt=x.forwardRef(({className:s,...a},l)=>e.jsx(Pb,{ref:l,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",s),...a}));Vt.displayName=Pb.displayName;function DT(s,a){return x.useReducer((l,i)=>a[l][i]??l,s)}var Ch="ScrollArea",[Lb]=Dn(Ch),[OT,bn]=Lb(Ch),Bb=x.forwardRef((s,a)=>{const{__scopeScrollArea:l,type:i="hover",dir:c,scrollHideDelay:d=600,...m}=s,[h,p]=x.useState(null),[v,g]=x.useState(null),[j,b]=x.useState(null),[w,S]=x.useState(null),[C,N]=x.useState(null),[T,P]=x.useState(0),[M,k]=x.useState(0),[D,A]=x.useState(!1),[E,B]=x.useState(!1),Y=Tt(a,$=>p($)),G=xo(c);return e.jsx(OT,{scope:l,type:i,dir:G,scrollHideDelay:d,scrollArea:h,viewport:v,onViewportChange:g,content:j,onContentChange:b,scrollbarX:w,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:A,scrollbarY:C,onScrollbarYChange:N,scrollbarYEnabled:E,onScrollbarYEnabledChange:B,onCornerWidthChange:P,onCornerHeightChange:k,children:e.jsx(dt.div,{dir:G,...m,ref:Y,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":M+"px",...s.style}})})});Bb.displayName=Ch;var Ub="ScrollAreaViewport",Hb=x.forwardRef((s,a)=>{const{__scopeScrollArea:l,children:i,nonce:c,...d}=s,m=bn(Ub,l),h=x.useRef(null),p=Tt(a,h,m.onViewportChange);return e.jsxs(e.Fragment,{children:[e.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:c}),e.jsx(dt.div,{"data-radix-scroll-area-viewport":"",...d,ref:p,style:{overflowX:m.scrollbarXEnabled?"scroll":"hidden",overflowY:m.scrollbarYEnabled?"scroll":"hidden",...s.style},children:e.jsx("div",{ref:m.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});Hb.displayName=Ub;var Vn="ScrollAreaScrollbar",kh=x.forwardRef((s,a)=>{const{forceMount:l,...i}=s,c=bn(Vn,s.__scopeScrollArea),{onScrollbarXEnabledChange:d,onScrollbarYEnabledChange:m}=c,h=s.orientation==="horizontal";return x.useEffect(()=>(h?d(!0):m(!0),()=>{h?d(!1):m(!1)}),[h,d,m]),c.type==="hover"?e.jsx(AT,{...i,ref:a,forceMount:l}):c.type==="scroll"?e.jsx(RT,{...i,ref:a,forceMount:l}):c.type==="auto"?e.jsx(Fb,{...i,ref:a,forceMount:l}):c.type==="always"?e.jsx(Th,{...i,ref:a}):null});kh.displayName=Vn;var AT=x.forwardRef((s,a)=>{const{forceMount:l,...i}=s,c=bn(Vn,s.__scopeScrollArea),[d,m]=x.useState(!1);return x.useEffect(()=>{const h=c.scrollArea;let p=0;if(h){const v=()=>{window.clearTimeout(p),m(!0)},g=()=>{p=window.setTimeout(()=>m(!1),c.scrollHideDelay)};return h.addEventListener("pointerenter",v),h.addEventListener("pointerleave",g),()=>{window.clearTimeout(p),h.removeEventListener("pointerenter",v),h.removeEventListener("pointerleave",g)}}},[c.scrollArea,c.scrollHideDelay]),e.jsx(Is,{present:l||d,children:e.jsx(Fb,{"data-state":d?"visible":"hidden",...i,ref:a})})}),RT=x.forwardRef((s,a)=>{const{forceMount:l,...i}=s,c=bn(Vn,s.__scopeScrollArea),d=s.orientation==="horizontal",m=Ud(()=>p("SCROLL_END"),100),[h,p]=DT("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 x.useEffect(()=>{if(h==="idle"){const v=window.setTimeout(()=>p("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(v)}},[h,c.scrollHideDelay,p]),x.useEffect(()=>{const v=c.viewport,g=d?"scrollLeft":"scrollTop";if(v){let j=v[g];const b=()=>{const w=v[g];j!==w&&(p("SCROLL"),m()),j=w};return v.addEventListener("scroll",b),()=>v.removeEventListener("scroll",b)}},[c.viewport,d,p,m]),e.jsx(Is,{present:l||h!=="hidden",children:e.jsx(Th,{"data-state":h==="hidden"?"hidden":"visible",...i,ref:a,onPointerEnter:be(s.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:be(s.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),Fb=x.forwardRef((s,a)=>{const l=bn(Vn,s.__scopeScrollArea),{forceMount:i,...c}=s,[d,m]=x.useState(!1),h=s.orientation==="horizontal",p=Ud(()=>{if(l.viewport){const v=l.viewport.offsetWidth<l.viewport.scrollWidth,g=l.viewport.offsetHeight<l.viewport.scrollHeight;m(h?v:g)}},10);return Gr(l.viewport,p),Gr(l.content,p),e.jsx(Is,{present:i||d,children:e.jsx(Th,{"data-state":d?"visible":"hidden",...c,ref:a})})}),Th=x.forwardRef((s,a)=>{const{orientation:l="vertical",...i}=s,c=bn(Vn,s.__scopeScrollArea),d=x.useRef(null),m=x.useRef(0),[h,p]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),v=$b(h.viewport,h.content),g={...i,sizes:h,onSizesChange:p,hasThumb:v>0&&v<1,onThumbChange:b=>d.current=b,onThumbPointerUp:()=>m.current=0,onThumbPointerDown:b=>m.current=b};function j(b,w){return HT(b,m.current,h,w)}return l==="horizontal"?e.jsx(zT,{...g,ref:a,onThumbPositionChange:()=>{if(c.viewport&&d.current){const b=c.viewport.scrollLeft,w=Tj(b,h,c.dir);d.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{c.viewport&&(c.viewport.scrollLeft=b)},onDragScroll:b=>{c.viewport&&(c.viewport.scrollLeft=j(b,c.dir))}}):l==="vertical"?e.jsx(PT,{...g,ref:a,onThumbPositionChange:()=>{if(c.viewport&&d.current){const b=c.viewport.scrollTop,w=Tj(b,h);d.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{c.viewport&&(c.viewport.scrollTop=b)},onDragScroll:b=>{c.viewport&&(c.viewport.scrollTop=j(b))}}):null}),zT=x.forwardRef((s,a)=>{const{sizes:l,onSizesChange:i,...c}=s,d=bn(Vn,s.__scopeScrollArea),[m,h]=x.useState(),p=x.useRef(null),v=Tt(a,p,d.onScrollbarXChange);return x.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),e.jsx(qb,{"data-orientation":"horizontal",...c,ref:v,sizes:l,style:{bottom:0,left:d.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:d.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Bd(l)+"px",...s.style},onThumbPointerDown:g=>s.onThumbPointerDown(g.x),onDragScroll:g=>s.onDragScroll(g.x),onWheelScroll:(g,j)=>{if(d.viewport){const b=d.viewport.scrollLeft+g.deltaX;s.onWheelScroll(b),Wb(b,j)&&g.preventDefault()}},onResize:()=>{p.current&&d.viewport&&m&&i({content:d.viewport.scrollWidth,viewport:d.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:yd(m.paddingLeft),paddingEnd:yd(m.paddingRight)}})}})}),PT=x.forwardRef((s,a)=>{const{sizes:l,onSizesChange:i,...c}=s,d=bn(Vn,s.__scopeScrollArea),[m,h]=x.useState(),p=x.useRef(null),v=Tt(a,p,d.onScrollbarYChange);return x.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),e.jsx(qb,{"data-orientation":"vertical",...c,ref:v,sizes:l,style:{top:0,right:d.dir==="ltr"?0:void 0,left:d.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Bd(l)+"px",...s.style},onThumbPointerDown:g=>s.onThumbPointerDown(g.y),onDragScroll:g=>s.onDragScroll(g.y),onWheelScroll:(g,j)=>{if(d.viewport){const b=d.viewport.scrollTop+g.deltaY;s.onWheelScroll(b),Wb(b,j)&&g.preventDefault()}},onResize:()=>{p.current&&d.viewport&&m&&i({content:d.viewport.scrollHeight,viewport:d.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:yd(m.paddingTop),paddingEnd:yd(m.paddingBottom)}})}})}),[LT,Yb]=Lb(Vn),qb=x.forwardRef((s,a)=>{const{__scopeScrollArea:l,sizes:i,hasThumb:c,onThumbChange:d,onThumbPointerUp:m,onThumbPointerDown:h,onThumbPositionChange:p,onDragScroll:v,onWheelScroll:g,onResize:j,...b}=s,w=bn(Vn,l),[S,C]=x.useState(null),N=Tt(a,Y=>C(Y)),T=x.useRef(null),P=x.useRef(""),M=w.viewport,k=i.content-i.viewport,D=ws(g),A=ws(p),E=Ud(j,10);function B(Y){if(T.current){const G=Y.clientX-T.current.left,$=Y.clientY-T.current.top;v({x:G,y:$})}}return x.useEffect(()=>{const Y=G=>{const $=G.target;S?.contains($)&&D(G,k)};return document.addEventListener("wheel",Y,{passive:!1}),()=>document.removeEventListener("wheel",Y,{passive:!1})},[M,S,k,D]),x.useEffect(A,[i,A]),Gr(S,E),Gr(w.content,E),e.jsx(LT,{scope:l,scrollbar:S,hasThumb:c,onThumbChange:ws(d),onThumbPointerUp:ws(m),onThumbPositionChange:A,onThumbPointerDown:ws(h),children:e.jsx(dt.div,{...b,ref:N,style:{position:"absolute",...b.style},onPointerDown:be(s.onPointerDown,Y=>{Y.button===0&&(Y.target.setPointerCapture(Y.pointerId),T.current=S.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),B(Y))}),onPointerMove:be(s.onPointerMove,B),onPointerUp:be(s.onPointerUp,Y=>{const G=Y.target;G.hasPointerCapture(Y.pointerId)&&G.releasePointerCapture(Y.pointerId),document.body.style.webkitUserSelect=P.current,w.viewport&&(w.viewport.style.scrollBehavior=""),T.current=null})})})}),jd="ScrollAreaThumb",Vb=x.forwardRef((s,a)=>{const{forceMount:l,...i}=s,c=Yb(jd,s.__scopeScrollArea);return e.jsx(Is,{present:l||c.hasThumb,children:e.jsx(BT,{ref:a,...i})})}),BT=x.forwardRef((s,a)=>{const{__scopeScrollArea:l,style:i,...c}=s,d=bn(jd,l),m=Yb(jd,l),{onThumbPositionChange:h}=m,p=Tt(a,j=>m.onThumbChange(j)),v=x.useRef(void 0),g=Ud(()=>{v.current&&(v.current(),v.current=void 0)},100);return x.useEffect(()=>{const j=d.viewport;if(j){const b=()=>{if(g(),!v.current){const w=FT(j,h);v.current=w,h()}};return h(),j.addEventListener("scroll",b),()=>j.removeEventListener("scroll",b)}},[d.viewport,g,h]),e.jsx(dt.div,{"data-state":m.hasThumb?"visible":"hidden",...c,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:be(s.onPointerDownCapture,j=>{const w=j.target.getBoundingClientRect(),S=j.clientX-w.left,C=j.clientY-w.top;m.onThumbPointerDown({x:S,y:C})}),onPointerUp:be(s.onPointerUp,m.onThumbPointerUp)})});Vb.displayName=jd;var Eh="ScrollAreaCorner",Gb=x.forwardRef((s,a)=>{const l=bn(Eh,s.__scopeScrollArea),i=!!(l.scrollbarX&&l.scrollbarY);return l.type!=="scroll"&&i?e.jsx(UT,{...s,ref:a}):null});Gb.displayName=Eh;var UT=x.forwardRef((s,a)=>{const{__scopeScrollArea:l,...i}=s,c=bn(Eh,l),[d,m]=x.useState(0),[h,p]=x.useState(0),v=!!(d&&h);return Gr(c.scrollbarX,()=>{const g=c.scrollbarX?.offsetHeight||0;c.onCornerHeightChange(g),p(g)}),Gr(c.scrollbarY,()=>{const g=c.scrollbarY?.offsetWidth||0;c.onCornerWidthChange(g),m(g)}),v?e.jsx(dt.div,{...i,ref:a,style:{width:d,height:h,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...s.style}}):null});function yd(s){return s?parseInt(s,10):0}function $b(s,a){const l=s/a;return isNaN(l)?0:l}function Bd(s){const a=$b(s.viewport,s.content),l=s.scrollbar.paddingStart+s.scrollbar.paddingEnd,i=(s.scrollbar.size-l)*a;return Math.max(i,18)}function HT(s,a,l,i="ltr"){const c=Bd(l),d=c/2,m=a||d,h=c-m,p=l.scrollbar.paddingStart+m,v=l.scrollbar.size-l.scrollbar.paddingEnd-h,g=l.content-l.viewport,j=i==="ltr"?[0,g]:[g*-1,0];return Ib([p,v],j)(s)}function Tj(s,a,l="ltr"){const i=Bd(a),c=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,d=a.scrollbar.size-c,m=a.content-a.viewport,h=d-i,p=l==="ltr"?[0,m]:[m*-1,0],v=rh(s,p);return Ib([0,m],[0,h])(v)}function Ib(s,a){return l=>{if(s[0]===s[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(s[1]-s[0]);return a[0]+i*(l-s[0])}}function Wb(s,a){return s>0&&s<a}var FT=(s,a=()=>{})=>{let l={left:s.scrollLeft,top:s.scrollTop},i=0;return(function c(){const d={left:s.scrollLeft,top:s.scrollTop},m=l.left!==d.left,h=l.top!==d.top;(m||h)&&a(),l=d,i=window.requestAnimationFrame(c)})(),()=>window.cancelAnimationFrame(i)};function Ud(s,a){const l=ws(s),i=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),x.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(l,a)},[l,a])}function Gr(s,a){const l=ws(a);oy(()=>{let i=0;if(s){const c=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(l)});return c.observe(s),()=>{window.cancelAnimationFrame(i),c.unobserve(s)}}},[s,l])}var Xb=Bb,YT=Hb,qT=Gb;const Ct=x.forwardRef(({className:s,children:a,...l},i)=>e.jsxs(Xb,{ref:i,className:Z("relative overflow-hidden",s),...l,children:[e.jsx(YT,{className:"h-full w-full rounded-[inherit]",children:a}),e.jsx(Kb,{}),e.jsx(qT,{})]}));Ct.displayName=Xb.displayName;const Kb=x.forwardRef(({className:s,orientation:a="vertical",...l},i)=>e.jsx(kh,{ref:i,orientation:a,className:Z("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...l,children:e.jsx(Vb,{className:"relative flex-1 rounded-full bg-border"})}));Kb.displayName=kh.displayName;function Ej({className:s,...a}){return e.jsx("div",{className:Z("animate-pulse rounded-md bg-primary/10",s),...a})}function VT(s,a=[]){let l=[];function i(d,m){const h=x.createContext(m);h.displayName=d+"Context";const p=l.length;l=[...l,m];const v=j=>{const{scope:b,children:w,...S}=j,C=b?.[s]?.[p]||h,N=x.useMemo(()=>S,Object.values(S));return e.jsx(C.Provider,{value:N,children:w})};v.displayName=d+"Provider";function g(j,b){const w=b?.[s]?.[p]||h,S=x.useContext(w);if(S)return S;if(m!==void 0)return m;throw new Error(`\`${j}\` must be used within \`${d}\``)}return[v,g]}const c=()=>{const d=l.map(m=>x.createContext(m));return function(h){const p=h?.[s]||d;return x.useMemo(()=>({[`__scope${s}`]:{...h,[s]:p}}),[h,p])}};return c.scopeName=s,[i,GT(c,...a)]}function GT(...s){const a=s[0];if(s.length===1)return a;const l=()=>{const i=s.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=i.reduce((h,{useScope:p,scopeName:v})=>{const j=p(d)[`__scope${v}`];return{...h,...j}},{});return x.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var $T=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qb=$T.reduce((s,a)=>{const l=ih(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:m,...h}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...h,ref:d})});return i.displayName=`Primitive.${a}`,{...s,[a]:i}},{}),Mh="Progress",Dh=100,[IT]=VT(Mh),[WT,XT]=IT(Mh),Zb=x.forwardRef((s,a)=>{const{__scopeProgress:l,value:i=null,max:c,getValueLabel:d=KT,...m}=s;(c||c===0)&&!Mj(c)&&console.error(QT(`${c}`,"Progress"));const h=Mj(c)?c:Dh;i!==null&&!Dj(i,h)&&console.error(ZT(`${i}`,"Progress"));const p=Dj(i,h)?i:null,v=bd(p)?d(p,h):void 0;return e.jsx(WT,{scope:l,value:p,max:h,children:e.jsx(Qb.div,{"aria-valuemax":h,"aria-valuemin":0,"aria-valuenow":bd(p)?p:void 0,"aria-valuetext":v,role:"progressbar","data-state":t0(p,h),"data-value":p??void 0,"data-max":h,...m,ref:a})})});Zb.displayName=Mh;var Jb="ProgressIndicator",e0=x.forwardRef((s,a)=>{const{__scopeProgress:l,...i}=s,c=XT(Jb,l);return e.jsx(Qb.div,{"data-state":t0(c.value,c.max),"data-value":c.value??void 0,"data-max":c.max,...i,ref:a})});e0.displayName=Jb;function KT(s,a){return`${Math.round(s/a*100)}%`}function t0(s,a){return s==null?"indeterminate":s===a?"complete":"loading"}function bd(s){return typeof s=="number"}function Mj(s){return bd(s)&&!isNaN(s)&&s>0}function Dj(s,a){return bd(s)&&!isNaN(s)&&s<=a&&s>=0}function QT(s,a){return`Invalid prop \`max\` of value \`${s}\` supplied to \`${a}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Dh}\`.`}function ZT(s,a){return`Invalid prop \`value\` of value \`${s}\` supplied to \`${a}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${Dh} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var s0=Zb,JT=e0;const _o=x.forwardRef(({className:s,value:a,...l},i)=>e.jsx(s0,{ref:i,className:Z("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...l,children:e.jsx(JT,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));_o.displayName=s0.displayName;const eE={light:"",dark:".dark"},n0=x.createContext(null);function a0(){const s=x.useContext(n0);if(!s)throw new Error("useChart must be used within a <ChartContainer />");return s}const Dr=x.forwardRef(({id:s,className:a,children:l,config:i,...c},d)=>{const m=x.useId(),h=`chart-${s||m.replace(/:/g,"")}`;return e.jsx(n0.Provider,{value:{config:i},children:e.jsxs("div",{"data-chart":h,ref:d,className:Z("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",a),...c,children:[e.jsx(tE,{id:h,config:i}),e.jsx(l2,{children:l})]})})});Dr.displayName="Chart";const tE=({id:s,config:a})=>{const l=Object.entries(a).filter(([,i])=>i.theme||i.color);return l.length?e.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(eE).map(([i,c])=>`
${c} [data-chart=${s}] {
${l.map(([d,m])=>{const h=m.theme?.[i]||m.color;return h?` --color-${d}: ${h};`:null}).join(`
`)}
}
`).join(`
`)}}):null},Qi=r2,Or=x.forwardRef(({active:s,payload:a,className:l,indicator:i="dot",hideLabel:c=!1,hideIndicator:d=!1,label:m,labelFormatter:h,labelClassName:p,formatter:v,color:g,nameKey:j,labelKey:b},w)=>{const{config:S}=a0(),C=x.useMemo(()=>{if(c||!a?.length)return null;const[T]=a,P=`${b||T?.dataKey||T?.name||"value"}`,M=Gf(S,T,P),k=!b&&typeof m=="string"?S[m]?.label||m:M?.label;return h?e.jsx("div",{className:Z("font-medium",p),children:h(k,a)}):k?e.jsx("div",{className:Z("font-medium",p),children:k}):null},[m,h,a,c,p,S,b]);if(!s||!a?.length)return null;const N=a.length===1&&i!=="dot";return e.jsxs("div",{ref:w,className:Z("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",l),children:[N?null:C,e.jsx("div",{className:"grid gap-1.5",children:a.filter(T=>T.type!=="none").map((T,P)=>{const M=`${j||T.name||T.dataKey||"value"}`,k=Gf(S,T,M),D=g||T.payload.fill||T.color;return e.jsx("div",{className:Z("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",i==="dot"&&"items-center"),children:v&&T?.value!==void 0&&T.name?v(T.value,T.name,T,P,T.payload):e.jsxs(e.Fragment,{children:[k?.icon?e.jsx(k.icon,{}):!d&&e.jsx("div",{className:Z("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":i==="dot","w-1":i==="line","w-0 border-[1.5px] border-dashed bg-transparent":i==="dashed","my-0.5":N&&i==="dashed"}),style:{"--color-bg":D,"--color-border":D}}),e.jsxs("div",{className:Z("flex flex-1 justify-between leading-none",N?"items-end":"items-center"),children:[e.jsxs("div",{className:"grid gap-1.5",children:[N?C:null,e.jsx("span",{className:"text-muted-foreground",children:k?.label||T.name})]}),T.value&&e.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:T.value.toLocaleString()})]})]})},T.dataKey)})})]})});Or.displayName="ChartTooltip";const sE=i2,l0=x.forwardRef(({className:s,hideIcon:a=!1,payload:l,verticalAlign:i="bottom",nameKey:c},d)=>{const{config:m}=a0();return l?.length?e.jsx("div",{ref:d,className:Z("flex items-center justify-center gap-4",i==="top"?"pb-3":"pt-3",s),children:l.filter(h=>h.type!=="none").map(h=>{const p=`${c||h.dataKey||"value"}`,v=Gf(m,h,p);return e.jsxs("div",{className:Z("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[v?.icon&&!a?e.jsx(v.icon,{}):e.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:h.color}}),v?.label]},h.value)})}):null});l0.displayName="ChartLegend";function Gf(s,a,l){if(typeof a!="object"||a===null)return;const i="payload"in a&&typeof a.payload=="object"&&a.payload!==null?a.payload:void 0;let c=l;return l in a&&typeof a[l]=="string"?c=a[l]:i&&l in i&&typeof i[l]=="string"&&(c=i[l]),c in s?s[c]:s[l]}const Oj=s=>typeof s=="boolean"?`${s}`:s===0?"0":s,Aj=iy,Jr=(s,a)=>l=>{var i;if(a?.variants==null)return Aj(s,l?.class,l?.className);const{variants:c,defaultVariants:d}=a,m=Object.keys(c).map(v=>{const g=l?.[v],j=d?.[v];if(g===null)return null;const b=Oj(g)||Oj(j);return c[v][b]}),h=l&&Object.entries(l).reduce((v,g)=>{let[j,b]=g;return b===void 0||(v[j]=b),v},{}),p=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((v,g)=>{let{class:j,className:b,...w}=g;return Object.entries(w).every(S=>{let[C,N]=S;return Array.isArray(N)?N.includes({...d,...h}[C]):{...d,...h}[C]===N})?[...v,j,b]:v},[]);return Aj(s,m,p,l?.class,l?.className)},io=Jr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),q=x.forwardRef(({className:s,variant:a,size:l,asChild:i=!1,...c},d)=>{const m=i?f2:"button";return e.jsx(m,{className:Z(io({variant:a,size:l,className:s})),ref:d,...c})});q.displayName="Button";function nE(){const[s,a]=x.useState(null),[l,i]=x.useState(!0),[c,d]=x.useState(0),[m,h]=x.useState(24),[p,v]=x.useState(!0),[g,j]=x.useState(null),[b,w]=x.useState(!0),S=x.useCallback(async()=>{try{w(!0);const Y=await $t.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");j({hitokoto:Y.data.hitokoto,from:Y.data.from||Y.data.from_who||"未知"})}catch(Y){console.error("获取一言失败:",Y),j({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{w(!1)}},[]),C=x.useCallback(async()=>{try{const Y=localStorage.getItem("access-token"),G=await $t.get(`/api/webui/statistics/dashboard?hours=${m}`,{headers:{Authorization:`Bearer ${Y}`}});a(G.data),i(!1),d(100)}catch(Y){console.error("Failed to fetch dashboard data:",Y),i(!1),d(100)}},[m]);if(x.useEffect(()=>{if(!l)return;d(0);const Y=setTimeout(()=>d(15),200),G=setTimeout(()=>d(30),800),$=setTimeout(()=>d(45),2e3),oe=setTimeout(()=>d(60),4e3),je=setTimeout(()=>d(75),6500),ae=setTimeout(()=>d(85),9e3),me=setTimeout(()=>d(92),11e3);return()=>{clearTimeout(Y),clearTimeout(G),clearTimeout($),clearTimeout(oe),clearTimeout(je),clearTimeout(ae),clearTimeout(me)}},[l]),x.useEffect(()=>{C(),S()},[C,S]),x.useEffect(()=>{if(!p)return;const Y=setInterval(()=>{C()},3e4);return()=>clearInterval(Y)},[p,C]),l||!s)return e.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:e.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[e.jsx(xa,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_o,{value:c,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[c,"%"]})]})]})});const{summary:N,model_stats:T,hourly_data:P,daily_data:M,recent_activity:k}=s,D=Y=>{const G=Math.floor(Y/3600),$=Math.floor(Y%3600/60);return`${G}小时${$}分钟`},A=Y=>new Date(Y).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),E=T.slice(0,6).map(Y=>({name:Y.model_name,value:Y.request_count,fill:`hsl(var(--chart-${T.indexOf(Y)%5+1}))`})),B={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ml,{value:m.toString(),onValueChange:Y=>h(Number(Y)),children:e.jsxs($a,{className:"grid grid-cols-3 w-full sm:w-auto",children:[e.jsx(bt,{value:"24",children:"24小时"}),e.jsx(bt,{value:"168",children:"7天"}),e.jsx(bt,{value:"720",children:"30天"})]})}),e.jsxs(q,{variant:p?"default":"outline",size:"sm",onClick:()=>v(!p),className:"gap-2",children:[e.jsx(xa,{className:`h-4 w-4 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),e.jsx(q,{variant:"outline",size:"sm",onClick:C,children:e.jsx(xa,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"总请求数"}),e.jsx(C2,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:N.total_requests.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",m<48?m+"小时":Math.floor(m/24)+"天"]})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"总花费"}),e.jsx(k2,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["¥",N.total_cost.toFixed(2)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:N.cost_per_hour>0?`¥${N.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"Token消耗"}),e.jsx(T2,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[(N.total_tokens/1e3).toFixed(1),"K"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:N.tokens_per_hour>0?`${(N.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"平均响应"}),e.jsx(ao,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:[N.avg_response_time.toFixed(2),"s"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"在线时长"}),e.jsx(_l,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(gt,{children:e.jsx("div",{className:"text-xl font-bold",children:D(N.online_time)})})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"消息处理"}),e.jsx(po,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-xl font-bold",children:N.total_messages.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",N.total_replies.toLocaleString()," 条"]})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"成本效率"}),e.jsx(E2,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-xl font-bold",children:N.total_messages>0?`¥${(N.total_cost/N.total_messages*100).toFixed(2)}`:"¥0.00"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),e.jsxs(Ml,{defaultValue:"trends",className:"space-y-4",children:[e.jsxs($a,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[e.jsx(bt,{value:"trends",children:"趋势"}),e.jsx(bt,{value:"models",children:"模型"}),e.jsx(bt,{value:"activity",children:"活动"}),e.jsx(bt,{value:"daily",children:"日统计"})]}),e.jsxs(Vt,{value:"trends",className:"space-y-4",children:[e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"请求趋势"}),e.jsxs(us,{children:["最近",m,"小时的请求量变化"]})]}),e.jsx(gt,{children:e.jsx(Dr,{config:B,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(o2,{data:P,children:[e.jsx(Xc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Kc,{dataKey:"timestamp",tickFormatter:Y=>A(Y),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Ii,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Qi,{content:e.jsx(Or,{labelFormatter:Y=>A(Y)})}),e.jsx(c2,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"花费趋势"}),e.jsx(us,{children:"API调用成本变化"})]}),e.jsx(gt,{children:e.jsx(Dr,{config:B,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(uf,{data:P,children:[e.jsx(Xc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Kc,{dataKey:"timestamp",tickFormatter:Y=>A(Y),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Ii,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Qi,{content:e.jsx(Or,{labelFormatter:Y=>A(Y)})}),e.jsx(Qc,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"Token消耗"}),e.jsx(us,{children:"Token使用量变化"})]}),e.jsx(gt,{children:e.jsx(Dr,{config:B,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:e.jsxs(uf,{data:P,children:[e.jsx(Xc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Kc,{dataKey:"timestamp",tickFormatter:Y=>A(Y),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Ii,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Qi,{content:e.jsx(Or,{labelFormatter:Y=>A(Y)})}),e.jsx(Qc,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),e.jsx(Vt,{value:"models",className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"模型请求分布"}),e.jsx(us,{children:"各模型使用占比"})]}),e.jsx(gt,{children:e.jsx(Dr,{config:Object.fromEntries(T.slice(0,6).map((Y,G)=>[Y.model_name,{label:Y.model_name,color:`hsl(var(--chart-${G%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:e.jsxs(d2,{children:[e.jsx(Qi,{content:e.jsx(Or,{})}),e.jsx(u2,{data:E,cx:"50%",cy:"50%",labelLine:!1,label:({name:Y,percent:G})=>`${Y} ${G?(G*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:E.map((Y,G)=>e.jsx(m2,{fill:Y.fill},`cell-${G}`))})]})})})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"模型详细统计"}),e.jsx(us,{children:"请求数、花费和性能"})]}),e.jsx(gt,{children:e.jsx(Ct,{className:"h-[300px] sm:h-[400px]",children:e.jsx("div",{className:"space-y-3",children:T.map((Y,G)=>e.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:Y.model_name}),e.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${G%5+1}))`}})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),e.jsx("span",{className:"ml-1 font-medium",children:Y.request_count.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1 font-medium",children:["¥",Y.total_cost.toFixed(2)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[(Y.total_tokens/1e3).toFixed(1),"K"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),e.jsxs("span",{className:"ml-1 font-medium",children:[Y.avg_response_time.toFixed(2),"s"]})]})]})]},G))})})})]})]})}),e.jsx(Vt,{value:"activity",children:e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"最近活动"}),e.jsx(us,{children:"最新的API调用记录"})]}),e.jsx(gt,{children:e.jsx(Ct,{className:"h-[400px] sm:h-[500px]",children:e.jsx("div",{className:"space-y-2",children:k.map((Y,G)=>e.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:Y.model}),e.jsx("div",{className:"text-xs text-muted-foreground",children:Y.request_type})]}),e.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:A(Y.timestamp)})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),e.jsx("span",{className:"ml-1",children:Y.tokens})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"花费:"}),e.jsxs("span",{className:"ml-1",children:["¥",Y.cost.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),e.jsxs("span",{className:"ml-1",children:[Y.time_cost.toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"状态:"}),e.jsx("span",{className:`ml-1 ${Y.status==="success"?"text-green-600":"text-red-600"}`,children:Y.status})]})]})]},G))})})})]})}),e.jsx(Vt,{value:"daily",children:e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"每日统计"}),e.jsx(us,{children:"最近7天的数据汇总"})]}),e.jsx(gt,{children:e.jsx(Dr,{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:e.jsxs(uf,{data:M,children:[e.jsx(Xc,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),e.jsx(Kc,{dataKey:"timestamp",tickFormatter:Y=>{const G=new Date(Y);return`${G.getMonth()+1}/${G.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Ii,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Ii,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),e.jsx(Qi,{content:e.jsx(Or,{labelFormatter:Y=>new Date(Y).toLocaleDateString("zh-CN")})}),e.jsx(sE,{content:e.jsx(l0,{})}),e.jsx(Qc,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),e.jsx(Qc,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),e.jsxs(Ue,{className:"border-2 border-primary/20",children:[e.jsx(ot,{className:"pb-3",children:e.jsx(ct,{className:"text-lg",children:"每日一言"})}),e.jsx(gt,{children:b?e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ej,{className:"h-6 w-3/4"}),e.jsx(Ej,{className:"h-4 w-1/4"})]}):g?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',g.hitokoto,'"']}),e.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",g.from]})]}):null})]})]})})}const aE={theme:"system",setTheme:()=>null},r0=x.createContext(aE),Oh=()=>{const s=x.useContext(r0);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},lE=(s,a,l)=>{const i=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||i){a(s);return}const c=l.clientX,d=l.clientY,m=Math.hypot(Math.max(c,innerWidth-c),Math.max(d,innerHeight-d));document.startViewTransition(()=>{a(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${c}px ${d}px)`,`circle(${m}px at ${c}px ${d}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},i0=x.createContext(void 0),o0=()=>{const s=x.useContext(i0);if(s===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return s};var Hd="Switch",[rE]=Dn(Hd),[iE,oE]=rE(Hd),c0=x.forwardRef((s,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:m,disabled:h,value:p="on",onCheckedChange:v,form:g,...j}=s,[b,w]=x.useState(null),S=Tt(a,M=>w(M)),C=x.useRef(!1),N=b?g||!!b.closest("form"):!0,[T,P]=Qa({prop:c,defaultProp:d??!1,onChange:v,caller:Hd});return e.jsxs(iE,{scope:l,checked:T,disabled:h,children:[e.jsx(dt.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":f0(T),"data-disabled":h?"":void 0,disabled:h,value:p,...j,ref:S,onClick:be(s.onClick,M=>{P(k=>!k),N&&(C.current=M.isPropagationStopped(),C.current||M.stopPropagation())})}),N&&e.jsx(m0,{control:b,bubbles:!C.current,name:i,value:p,checked:T,required:m,disabled:h,form:g,style:{transform:"translateX(-100%)"}})]})});c0.displayName=Hd;var d0="SwitchThumb",u0=x.forwardRef((s,a)=>{const{__scopeSwitch:l,...i}=s,c=oE(d0,l);return e.jsx(dt.span,{"data-state":f0(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});u0.displayName=d0;var cE="SwitchBubbleInput",m0=x.forwardRef(({__scopeSwitch:s,control:a,checked:l,bubbles:i=!0,...c},d)=>{const m=x.useRef(null),h=Tt(m,d),p=cy(l),v=dy(a);return x.useEffect(()=>{const g=m.current;if(!g)return;const j=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(j,"checked").set;if(p!==l&&w){const S=new Event("click",{bubbles:i});w.call(g,l),g.dispatchEvent(S)}},[p,l,i]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:h,style:{...c.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});m0.displayName=cE;function f0(s){return s?"checked":"unchecked"}var h0=c0,dE=u0;const Ze=x.forwardRef(({className:s,...a},l)=>e.jsx(h0,{className:Z("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",s),...a,ref:l,children:e.jsx(dE,{className:Z("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")})}));Ze.displayName=h0.displayName;const uE=Jr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),U=x.forwardRef(({className:s,...a},l)=>e.jsx(uy,{ref:l,className:Z(uE(),s),...a}));U.displayName=uy.displayName;const pe=x.forwardRef(({className:s,type:a,...l},i)=>e.jsx("input",{type:a,className:Z("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",s),ref:i,...l}));pe.displayName="Input";const mE=1,fE=1e6;let bf=0;function hE(){return bf=(bf+1)%Number.MAX_SAFE_INTEGER,bf.toString()}const Nf=new Map,Rj=s=>{if(Nf.has(s))return;const a=setTimeout(()=>{Nf.delete(s),no({type:"REMOVE_TOAST",toastId:s})},fE);Nf.set(s,a)},xE=(s,a)=>{switch(a.type){case"ADD_TOAST":return{...s,toasts:[a.toast,...s.toasts].slice(0,mE)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(l=>l.id===a.toast.id?{...l,...a.toast}:l)};case"DISMISS_TOAST":{const{toastId:l}=a;return l?Rj(l):s.toasts.forEach(i=>{Rj(i.id)}),{...s,toasts:s.toasts.map(i=>i.id===l||l===void 0?{...i,open:!1}:i)}}case"REMOVE_TOAST":return a.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(l=>l.id!==a.toastId)}}},dd=[];let ud={toasts:[]};function no(s){ud=xE(ud,s),dd.forEach(a=>{a(ud)})}function pE({...s}){const a=hE(),l=c=>no({type:"UPDATE_TOAST",toast:{...c,id:a}}),i=()=>no({type:"DISMISS_TOAST",toastId:a});return no({type:"ADD_TOAST",toast:{...s,id:a,open:!0,onOpenChange:c=>{c||i()}}}),{id:a,dismiss:i,update:l}}function Es(){const[s,a]=x.useState(ud);return x.useEffect(()=>(dd.push(a),()=>{const l=dd.indexOf(a);l>-1&&dd.splice(l,1)}),[s]),{...s,toast:pE,dismiss:l=>no({type:"DISMISS_TOAST",toastId:l})}}const gE=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:s=>s.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:s=>/[A-Z]/.test(s)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:s=>/[a-z]/.test(s)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:s=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(s)}];function vE(s){const a=gE.map(i=>({id:i.id,label:i.label,description:i.description,passed:i.validate(s)}));return{isValid:a.every(i=>i.passed),rules:a}}const Ah="0.11.5 Beta",Rh="MaiBot Dashboard",jE=`${Rh} v${Ah}`,yE=(s="v")=>`${s}${Ah}`,bs=mh,x0=my,bE=oh,p0=x.forwardRef(({className:s,...a},l)=>e.jsx(Cd,{ref:l,className:Z("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",s),...a}));p0.displayName=Cd.displayName;const ms=x.forwardRef(({className:s,children:a,...l},i)=>e.jsxs(bE,{children:[e.jsx(p0,{}),e.jsxs(kd,{ref:i,className:Z("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",s),...l,children:[a,e.jsxs(ch,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(go,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ms.displayName=kd.displayName;const fs=({className:s,...a})=>e.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});fs.displayName="DialogHeader";const $s=({className:s,...a})=>e.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});$s.displayName="DialogFooter";const hs=x.forwardRef(({className:s,...a},l)=>e.jsx(dh,{ref:l,className:Z("text-lg font-semibold leading-none tracking-tight",s),...a}));hs.displayName=dh.displayName;const ks=x.forwardRef(({className:s,...a},l)=>e.jsx(uh,{ref:l,className:Z("text-sm text-muted-foreground",s),...a}));ks.displayName=uh.displayName;var NE=Symbol("radix.slottable");function wE(s){const a=({children:l})=>e.jsx(e.Fragment,{children:l});return a.displayName=`${s}.Slottable`,a.__radixId=NE,a}var g0="AlertDialog",[SE]=Dn(g0,[fy]),ga=fy(),v0=s=>{const{__scopeAlertDialog:a,...l}=s,i=ga(a);return e.jsx(mh,{...i,...l,modal:!0})};v0.displayName=g0;var _E="AlertDialogTrigger",j0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...i}=s,c=ga(l);return e.jsx(my,{...c,...i,ref:a})});j0.displayName=_E;var CE="AlertDialogPortal",y0=s=>{const{__scopeAlertDialog:a,...l}=s,i=ga(a);return e.jsx(oh,{...i,...l})};y0.displayName=CE;var kE="AlertDialogOverlay",b0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...i}=s,c=ga(l);return e.jsx(Cd,{...c,...i,ref:a})});b0.displayName=kE;var Br="AlertDialogContent",[TE,EE]=SE(Br),ME=wE("AlertDialogContent"),N0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,children:i,...c}=s,d=ga(l),m=x.useRef(null),h=Tt(a,m),p=x.useRef(null);return e.jsx(h2,{contentName:Br,titleName:w0,docsSlug:"alert-dialog",children:e.jsx(TE,{scope:l,cancelRef:p,children:e.jsxs(kd,{role:"alertdialog",...d,...c,ref:h,onOpenAutoFocus:be(c.onOpenAutoFocus,v=>{v.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:v=>v.preventDefault(),onInteractOutside:v=>v.preventDefault(),children:[e.jsx(ME,{children:i}),e.jsx(OE,{contentRef:m})]})})})});N0.displayName=Br;var w0="AlertDialogTitle",S0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...i}=s,c=ga(l);return e.jsx(dh,{...c,...i,ref:a})});S0.displayName=w0;var _0="AlertDialogDescription",C0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...i}=s,c=ga(l);return e.jsx(uh,{...c,...i,ref:a})});C0.displayName=_0;var DE="AlertDialogAction",k0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...i}=s,c=ga(l);return e.jsx(ch,{...c,...i,ref:a})});k0.displayName=DE;var T0="AlertDialogCancel",E0=x.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...i}=s,{cancelRef:c}=EE(T0,l),d=ga(l),m=Tt(a,c);return e.jsx(ch,{...d,...i,ref:m})});E0.displayName=T0;var OE=({contentRef:s})=>{const a=`\`${Br}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${Br}\` by passing a \`${_0}\` 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 \`${Br}\`. 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 x.useEffect(()=>{document.getElementById(s.current?.getAttribute("aria-describedby"))||console.warn(a)},[a,s]),null},AE=v0,RE=j0,zE=y0,M0=b0,D0=N0,O0=k0,A0=E0,R0=S0,z0=C0;const Ft=AE,_s=RE,PE=zE,P0=x.forwardRef(({className:s,...a},l)=>e.jsx(M0,{className:Z("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",s),...a,ref:l}));P0.displayName=M0.displayName;const Ot=x.forwardRef(({className:s,...a},l)=>e.jsxs(PE,{children:[e.jsx(P0,{}),e.jsx(D0,{ref:l,className:Z("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",s),...a})]}));Ot.displayName=D0.displayName;const At=({className:s,...a})=>e.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",s),...a});At.displayName="AlertDialogHeader";const Rt=({className:s,...a})=>e.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});Rt.displayName="AlertDialogFooter";const zt=x.forwardRef(({className:s,...a},l)=>e.jsx(R0,{ref:l,className:Z("text-lg font-semibold",s),...a}));zt.displayName=R0.displayName;const Pt=x.forwardRef(({className:s,...a},l)=>e.jsx(z0,{ref:l,className:Z("text-sm text-muted-foreground",s),...a}));Pt.displayName=z0.displayName;const Lt=x.forwardRef(({className:s,...a},l)=>e.jsx(O0,{ref:l,className:Z(io(),s),...a}));Lt.displayName=O0.displayName;const Bt=x.forwardRef(({className:s,...a},l)=>e.jsx(A0,{ref:l,className:Z(io({variant:"outline"}),"mt-2 sm:mt-0",s),...a}));Bt.displayName=A0.displayName;function LE(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),e.jsxs(Ml,{defaultValue:"appearance",className:"w-full",children:[e.jsxs($a,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[e.jsxs(bt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Ty,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"外观"})]}),e.jsxs(bt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(M2,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"安全"})]}),e.jsxs(bt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Tn,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"其他"})]}),e.jsxs(bt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[e.jsx(Fr,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),e.jsx("span",{children:"关于"})]})]}),e.jsxs(Ct,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[e.jsx(Vt,{value:"appearance",className:"mt-0",children:e.jsx(BE,{})}),e.jsx(Vt,{value:"security",className:"mt-0",children:e.jsx(UE,{})}),e.jsx(Vt,{value:"other",className:"mt-0",children:e.jsx(HE,{})}),e.jsx(Vt,{value:"about",className:"mt-0",children:e.jsx(FE,{})})]})]})]})}function zj(s){const a=document.documentElement,i={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[s];if(i)a.style.setProperty("--primary",i.hsl),i.gradient?(a.style.setProperty("--primary-gradient",i.gradient),a.classList.add("has-gradient")):(a.style.removeProperty("--primary-gradient"),a.classList.remove("has-gradient"));else if(s.startsWith("#")){const c=d=>{d=d.replace("#","");const m=parseInt(d.substring(0,2),16)/255,h=parseInt(d.substring(2,4),16)/255,p=parseInt(d.substring(4,6),16)/255,v=Math.max(m,h,p),g=Math.min(m,h,p);let j=0,b=0;const w=(v+g)/2;if(v!==g){const S=v-g;switch(b=w>.5?S/(2-v-g):S/(v+g),v){case m:j=((h-p)/S+(h<p?6:0))/6;break;case h:j=((p-m)/S+2)/6;break;case p:j=((m-h)/S+4)/6;break}}return`${Math.round(j*360)} ${Math.round(b*100)}% ${Math.round(w*100)}%`};a.style.setProperty("--primary",c(s)),a.style.removeProperty("--primary-gradient"),a.classList.remove("has-gradient")}}function BE(){const{theme:s,setTheme:a}=Oh(),{enableAnimations:l,setEnableAnimations:i,enableWavesBackground:c,setEnableWavesBackground:d}=o0(),[m,h]=x.useState(()=>localStorage.getItem("accent-color")||"blue");x.useEffect(()=>{const v=localStorage.getItem("accent-color")||"blue";zj(v)},[]);const p=v=>{h(v),localStorage.setItem("accent-color",v),zj(v)};return e.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[e.jsx(wf,{value:"light",current:s,onChange:a,label:"浅色",description:"始终使用浅色主题"}),e.jsx(wf,{value:"dark",current:s,onChange:a,label:"深色",description:"始终使用深色主题"}),e.jsx(wf,{value:"system",current:s,onChange:a,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(vn,{value:"blue",current:m,onChange:p,label:"蓝色",colorClass:"bg-blue-500"}),e.jsx(vn,{value:"purple",current:m,onChange:p,label:"紫色",colorClass:"bg-purple-500"}),e.jsx(vn,{value:"green",current:m,onChange:p,label:"绿色",colorClass:"bg-green-500"}),e.jsx(vn,{value:"orange",current:m,onChange:p,label:"橙色",colorClass:"bg-orange-500"}),e.jsx(vn,{value:"pink",current:m,onChange:p,label:"粉色",colorClass:"bg-pink-500"}),e.jsx(vn,{value:"red",current:m,onChange:p,label:"红色",colorClass:"bg-red-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),e.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[e.jsx(vn,{value:"gradient-sunset",current:m,onChange:p,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),e.jsx(vn,{value:"gradient-ocean",current:m,onChange:p,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),e.jsx(vn,{value:"gradient-forest",current:m,onChange:p,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),e.jsx(vn,{value:"gradient-aurora",current:m,onChange:p,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),e.jsx(vn,{value:"gradient-fire",current:m,onChange:p,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),e.jsx(vn,{value:"gradient-twilight",current:m,onChange:p,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsx("input",{type:"color",value:m.startsWith("#")?m:"#3b82f6",onChange:v=>p(v.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),e.jsx("div",{className:"flex-1",children:e.jsx(pe,{type:"text",value:m,onChange:v=>p(v.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),e.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[e.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(U,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),e.jsx(Ze,{id:"animations",checked:l,onCheckedChange:i})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5 flex-1",children:[e.jsx(U,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),e.jsx(Ze,{id:"waves-background",checked:c,onCheckedChange:d})]})})]})]})]})}function UE(){const s=qn(),[a,l]=x.useState(""),[i,c]=x.useState(""),[d,m]=x.useState(!1),[h,p]=x.useState(!1),[v,g]=x.useState(!1),[j,b]=x.useState(!1),[w,S]=x.useState(!1),[C,N]=x.useState(!1),[T,P]=x.useState(""),[M,k]=x.useState(!1),{toast:D}=Es(),A=x.useMemo(()=>vE(i),[i]),E=()=>localStorage.getItem("access-token")||"",B=async ae=>{try{await navigator.clipboard.writeText(ae),S(!0),D({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>S(!1),2e3)}catch{D({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},Y=async()=>{if(!i.trim()){D({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!A.isValid){const ae=A.rules.filter(me=>!me.passed).map(me=>me.label).join(", ");D({title:"格式错误",description:`Token 不符合要求: ${ae}`,variant:"destructive"});return}g(!0);try{const ae=E(),me=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ae}`},body:JSON.stringify({new_token:i.trim()})}),R=await me.json();me.ok&&R.success?(localStorage.setItem("access-token",i.trim()),c(""),a&&l(i.trim()),D({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),s({to:"/auth"})},1500)):D({title:"更新失败",description:R.message||"无法更新 Token",variant:"destructive"})}catch(ae){console.error("更新 Token 错误:",ae),D({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},G=async()=>{b(!0);try{const ae=E(),me=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ae}`}}),R=await me.json();me.ok&&R.success?(localStorage.setItem("access-token",R.token),l(R.token),P(R.token),N(!0),k(!1),D({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):D({title:"生成失败",description:R.message||"无法生成新 Token",variant:"destructive"})}catch(ae){console.error("生成 Token 错误:",ae),D({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{b(!1)}},$=async()=>{try{await navigator.clipboard.writeText(T),k(!0),D({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{D({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},oe=()=>{N(!1),setTimeout(()=>{P(""),k(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),s({to:"/auth"})},500)},je=ae=>{ae||oe()};return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx(bs,{open:C,onOpenChange:je,children:e.jsxs(ms,{className:"sm:max-w-md",children:[e.jsxs(fs,{children:[e.jsxs(hs,{className:"flex items-center gap-2",children:[e.jsx(Lr,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),e.jsx(ks,{children:"这是您的新 Token请立即保存。关闭此窗口后将跳转到登录页面。"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[e.jsx(U,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),e.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:T})]}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Lr,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"重要提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),e.jsx("li",{children:"请立即复制并保存到安全的位置"}),e.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),e.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),e.jsxs($s,{className:"gap-2 sm:gap-0",children:[e.jsx(q,{variant:"outline",onClick:$,className:"gap-2",children:M?e.jsxs(e.Fragment,{children:[e.jsx(Cl,{className:"h-4 w-4 text-green-500"}),"已复制"]}):e.jsxs(e.Fragment,{children:[e.jsx(Df,{className:"h-4 w-4"}),"复制 Token"]})}),e.jsx(q,{onClick:oe,children:"我已保存,关闭"})]})]})}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),e.jsx("div",{className:"space-y-3 sm:space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(pe,{id:"current-token",type:d?"text":"password",value:a||E(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),e.jsx("button",{onClick:()=>{a||l(E()),m(!d)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:d?"隐藏":"显示",children:d?e.jsx(Of,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Mn,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(q,{variant:"outline",size:"icon",onClick:()=>B(E()),title:"复制到剪贴板",className:"flex-shrink-0",children:w?e.jsx(Cl,{className:"h-4 w-4 text-green-500"}):e.jsx(Df,{className:"h-4 w-4"})}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs(q,{variant:"outline",disabled:j,className:"gap-2 flex-1 sm:flex-none",children:[e.jsx(xa,{className:Z("h-4 w-4",j&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),e.jsx("span",{className:"sm:hidden",children:"生成"})]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认重新生成 Token"}),e.jsx(Pt,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:G,children:"确认生成"})]})]})]})]})]}),e.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token不要泄露给他人"})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),e.jsxs("div",{className:"relative",children:[e.jsx(pe,{id:"new-token",type:h?"text":"password",value:i,onChange:ae=>c(ae.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),e.jsx("button",{onClick:()=>p(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:h?"隐藏":"显示",children:h?e.jsx(Of,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Mn,{className:"h-4 w-4 text-muted-foreground"})})]}),i&&e.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),e.jsx("div",{className:"space-y-1.5",children:A.rules.map(ae=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[ae.passed?e.jsx(Ys,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):e.jsx(Af,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:Z(ae.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:ae.label})]},ae.id))}),A.isValid&&e.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[e.jsx(Cl,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),e.jsx(q,{onClick:Y,disabled:v||!A.isValid||!i,className:"w-full sm:w-auto",children:v?"更新中...":"更新自定义 Token"})]})]}),e.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3 sm:p-4",children:[e.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),e.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),e.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),e.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),e.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),e.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),e.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function HE(){const s=qn(),{toast:a}=Es(),[l,i]=x.useState(!1),c=async()=>{i(!0);try{const d=localStorage.getItem("access-token"),m=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${d}`}}),h=await m.json();m.ok&&h.success?(a({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{s({to:"/setup"})},1e3)):a({title:"重置失败",description:h.message||"无法重置配置状态",variant:"destructive"})}catch(d){console.error("重置配置状态错误:",d),a({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{i(!1)}};return e.jsx("div",{className:"space-y-4 sm:space-y-6",children:e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),e.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs(q,{variant:"outline",disabled:l,className:"gap-2",children:[e.jsx(D2,{className:Z("h-4 w-4",l&&"animate-spin")}),"重新进行初次配置"]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认重新配置"}),e.jsx(Pt,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:c,children:"确认重置"})]})]})]})]})]})})}function FE(){return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",Rh]}),e.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("p",{children:["版本: ",Ah]}),e.jsx("p",{children:"麦麦MaiBot的现代化 Web 管理界面"})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",e.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"React 19.2.0"}),e.jsx("li",{children:"TypeScript 5.7.2"}),e.jsx("li",{children:"Vite 6.0.7"}),e.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"shadcn/ui"}),e.jsx("li",{children:"Radix UI"}),e.jsx("li",{children:"Tailwind CSS 3.4.17"}),e.jsx("li",{children:"Lucide Icons"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"后端"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Python 3.12+"}),e.jsx("li",{children:"FastAPI"}),e.jsx("li",{children:"Uvicorn"}),e.jsx("li",{children:"WebSocket"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),e.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[e.jsx("li",{children:"Bun / npm"}),e.jsx("li",{children:"ESLint 9.17.0"}),e.jsx("li",{children:"PostCSS"})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),e.jsx(Ct,{className:"h-[300px] sm:h-[400px]",children:e.jsxs("div",{className:"space-y-4 pr-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"React",description:"用户界面构建库",license:"MIT"}),e.jsx(qt,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),e.jsx(qt,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),e.jsx(qt,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),e.jsx(qt,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),e.jsx(qt,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),e.jsx(qt,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),e.jsx(qt,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),e.jsx(qt,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),e.jsx(qt,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),e.jsx(qt,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),e.jsx(qt,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),e.jsx(qt,{name:"Pydantic",description:"数据验证库",license:"MIT"}),e.jsx(qt,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),e.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[e.jsx(qt,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),e.jsx(qt,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),e.jsx(qt,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),e.jsx(qt,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[e.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:e.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:e.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function qt({name:s,description:a,license:l}){return e.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:s}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:a})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:l})]})}function wf({value:s,current:a,onChange:l,label:i,description:c}){const d=a===s;return e.jsxs("button",{onClick:()=>l(s),className:Z("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",d?"border-primary bg-accent":"border-border"),children:[d&&e.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm sm:text-base font-medium",children:i}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:c})]}),e.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[s==="light"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),s==="dark"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),s==="system"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),e.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function vn({value:s,current:a,onChange:l,label:i,colorClass:c}){const d=a===s;return e.jsxs("button",{onClick:()=>l(s),className:Z("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",d?"border-primary bg-accent":"border-border"),children:[d&&e.jsx("div",{className:"absolute top-1.5 right-1.5 sm:top-2 sm:right-2 h-1.5 w-1.5 sm:h-2 sm:w-2 rounded-full bg-primary"}),e.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[e.jsx("div",{className:Z("h-8 w-8 sm:h-10 sm:w-10 rounded-full",c)}),e.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:i})]})]})}class YE{grad3;p;perm;constructor(a=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 l=0;l<256;l++)this.p[l]=Math.floor(Math.random()*256);this.perm=[];for(let l=0;l<512;l++)this.perm[l]=this.p[l&255]}dot(a,l,i){return a[0]*l+a[1]*i}mix(a,l,i){return(1-i)*a+i*l}fade(a){return a*a*a*(a*(a*6-15)+10)}perlin2(a,l){const i=Math.floor(a)&255,c=Math.floor(l)&255;a-=Math.floor(a),l-=Math.floor(l);const d=this.fade(a),m=this.fade(l),h=this.perm[i]+c,p=this.perm[h],v=this.perm[h+1],g=this.perm[i+1]+c,j=this.perm[g],b=this.perm[g+1];return this.mix(this.mix(this.dot(this.grad3[p%12],a,l),this.dot(this.grad3[j%12],a-1,l),d),this.mix(this.dot(this.grad3[v%12],a,l-1),this.dot(this.grad3[b%12],a-1,l-1),d),m)}}function qE(){const s=x.useRef(null),a=x.useRef(null),l=x.useRef(void 0),i=x.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 YE(Math.random()),bounding:null});return x.useEffect(()=>{const c=a.current,d=s.current;if(!c||!d)return;const m=i.current,h=()=>{const C=c.getBoundingClientRect();m.bounding=C,d.style.width=`${C.width}px`,d.style.height=`${C.height}px`},p=()=>{if(!m.bounding)return;const{width:C,height:N}=m.bounding;m.lines=[],m.paths.forEach(Y=>Y.remove()),m.paths=[];const T=10,P=32,M=C+200,k=N+30,D=Math.ceil(M/T),A=Math.ceil(k/P),E=(C-T*D)/2,B=(N-P*A)/2;for(let Y=0;Y<=D;Y++){const G=[];for(let oe=0;oe<=A;oe++){const je={x:E+T*Y,y:B+P*oe,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};G.push(je)}const $=document.createElementNS("http://www.w3.org/2000/svg","path");d.appendChild($),m.paths.push($),m.lines.push(G)}},v=C=>{const{lines:N,mouse:T,noise:P}=m;N.forEach(M=>{M.forEach(k=>{const D=P.perlin2((k.x+C*.0125)*.002,(k.y+C*.005)*.0015)*12;k.wave.x=Math.cos(D)*32,k.wave.y=Math.sin(D)*16;const A=k.x-T.sx,E=k.y-T.sy,B=Math.hypot(A,E),Y=Math.max(175,T.vs);if(B<Y){const G=1-B/Y,$=Math.cos(B*.001)*G;k.cursor.vx+=Math.cos(T.a)*$*Y*T.vs*65e-5,k.cursor.vy+=Math.sin(T.a)*$*Y*T.vs*65e-5}k.cursor.vx+=(0-k.cursor.x)*.005,k.cursor.vy+=(0-k.cursor.y)*.005,k.cursor.vx*=.925,k.cursor.vy*=.925,k.cursor.x+=k.cursor.vx*2,k.cursor.y+=k.cursor.vy*2,k.cursor.x=Math.min(100,Math.max(-100,k.cursor.x)),k.cursor.y=Math.min(100,Math.max(-100,k.cursor.y))})})},g=(C,N=!0)=>{const T={x:C.x+C.wave.x+(N?C.cursor.x:0),y:C.y+C.wave.y+(N?C.cursor.y:0)};return T.x=Math.round(T.x*10)/10,T.y=Math.round(T.y*10)/10,T},j=()=>{const{lines:C,paths:N}=m;C.forEach((T,P)=>{let M=g(T[0],!1),k=`M ${M.x} ${M.y}`;T.forEach((D,A)=>{const E=A===T.length-1;M=g(D,!E),k+=`L ${M.x} ${M.y}`}),N[P].setAttribute("d",k)})},b=C=>{const{mouse:N}=m;N.sx+=(N.x-N.sx)*.1,N.sy+=(N.y-N.sy)*.1;const T=N.x-N.lx,P=N.y-N.ly,M=Math.hypot(T,P);N.v=M,N.vs+=(M-N.vs)*.1,N.vs=Math.min(100,N.vs),N.lx=N.x,N.ly=N.y,N.a=Math.atan2(P,T),c&&(c.style.setProperty("--x",`${N.sx}px`),c.style.setProperty("--y",`${N.sy}px`)),v(C),j(),l.current=requestAnimationFrame(b)},w=C=>{if(!m.bounding)return;const{mouse:N}=m;N.x=C.pageX-m.bounding.left,N.y=C.pageY-m.bounding.top+window.scrollY,N.set||(N.sx=N.x,N.sy=N.y,N.lx=N.x,N.ly=N.y,N.set=!0)},S=()=>{h(),p()};return h(),p(),window.addEventListener("resize",S),window.addEventListener("mousemove",w),l.current=requestAnimationFrame(b),()=>{window.removeEventListener("resize",S),window.removeEventListener("mousemove",w),l.current&&cancelAnimationFrame(l.current)}},[]),e.jsxs("div",{ref:a,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[e.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"}}),e.jsx("svg",{ref:s,style:{display:"block",width:"100%",height:"100%"},children:e.jsx("style",{children:`
path {
fill: none;
stroke: hsl(var(--primary) / 0.20);
stroke-width: 1px;
}
`})})]})}function VE(){const s=qn();x.useEffect(()=>{localStorage.getItem("access-token")||s({to:"/auth"})},[s])}function L0(){return!!localStorage.getItem("access-token")}function GE(){const[s,a]=x.useState(""),[l,i]=x.useState(!1),[c,d]=x.useState(""),m=qn(),{enableWavesBackground:h,setEnableWavesBackground:p}=o0(),{theme:v,setTheme:g}=Oh();x.useEffect(()=>{L0()&&m({to:"/"})},[m]);const b=v==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":v,w=()=>{g(b==="dark"?"light":"dark")},S=async C=>{if(C.preventDefault(),d(""),!s.trim()){d("请输入 Access Token");return}i(!0);try{const N=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:s.trim()})}),T=await N.json();if(N.ok&&T.valid){localStorage.setItem("access-token",s.trim());const P=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${s.trim()}`}}),M=await P.json();P.ok&&M.is_first_setup?m({to:"/setup"}):m({to:"/"})}else d(T.message||"Token 验证失败,请检查后重试")}catch(N){console.error("Token 验证错误:",N),d("连接服务器失败,请检查网络连接")}finally{i(!1)}};return e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[h&&e.jsx(qE,{}),e.jsxs(Ue,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[e.jsx("button",{onClick:w,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:b==="dark"?"切换到浅色模式":"切换到深色模式",children:b==="dark"?e.jsx(Rf,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):e.jsx(zf,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),e.jsxs(ot,{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(Zv,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ct,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),e.jsx(us,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),e.jsx(gt,{children:e.jsxs("form",{onSubmit:S,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),e.jsxs("div",{className:"relative",children:[e.jsx(O2,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),e.jsx(pe,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:s,onChange:C=>a(C.target.value),className:Z("pl-10",c&&"border-red-500 focus-visible:ring-red-500"),disabled:l,autoFocus:!0,autoComplete:"off"})]})]}),c&&e.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:[e.jsx(Tl,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),e.jsx("span",{children:c})]}),e.jsx(q,{type:"submit",className:"w-full",disabled:l,children:l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),e.jsxs(bs,{children:[e.jsx(x0,{asChild:!0,children:e.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:[e.jsx(A2,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token我该去哪里获得 Token"]})}),e.jsxs(ms,{className:"sm:max-w-md",children:[e.jsxs(fs,{children:[e.jsxs(hs,{className:"flex items-center gap-2",children:[e.jsx(Zv,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),e.jsx(ks,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(R2,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),e.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),e.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ph,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),e.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:e.jsx("code",{className:"text-primary",children:"data/webui.json"})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",e.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),e.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Tl,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),e.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"安全提示"}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[e.jsx("li",{children:"请妥善保管您的 Token不要泄露给他人"}),e.jsx("li",{children:"如需重置 Token请在登录后前往系统设置"})]})]})]})})]})]})]}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[e.jsx(ao,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsxs(zt,{className:"flex items-center gap-2",children:[e.jsx(ao,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),e.jsx(Pt,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>p(!1),children:"关闭动画"})]})]})]})]})})]}),e.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:e.jsx("p",{children:jE})})]})}const Dt=x.forwardRef(({className:s,...a},l)=>e.jsx("textarea",{className:Z("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",s),ref:l,...a}));Dt.displayName="Textarea";var $E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],IE=$E.reduce((s,a)=>{const l=ih(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:m,...h}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...h,ref:d})});return i.displayName=`Primitive.${a}`,{...s,[a]:i}},{}),WE="Separator",Pj="horizontal",XE=["horizontal","vertical"],B0=x.forwardRef((s,a)=>{const{decorative:l,orientation:i=Pj,...c}=s,d=KE(i)?i:Pj,h=l?{role:"none"}:{"aria-orientation":d==="vertical"?d:void 0,role:"separator"};return e.jsx(IE.div,{"data-orientation":d,...h,...c,ref:a})});B0.displayName=WE;function KE(s){return XE.includes(s)}var U0=B0;const oo=x.forwardRef(({className:s,orientation:a="horizontal",decorative:l=!0,...i},c)=>e.jsx(U0,{ref:c,decorative:l,orientation:a,className:Z("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...i}));oo.displayName=U0.displayName;const QE=Jr("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 _t({className:s,variant:a,...l}){return e.jsx("div",{className:Z(QE({variant:a}),s),...l})}function ZE({config:s,onChange:a}){const l=c=>{c.trim()&&!s.alias_names.includes(c.trim())&&a({...s,alias_names:[...s.alias_names,c.trim()]})},i=c=>{a({...s,alias_names:s.alias_names.filter((d,m)=>m!==c)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"qq_account",children:"QQ账号 *"}),e.jsx(pe,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:s.qq_account||"",onChange:c=>a({...s,qq_account:Number(c.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"nickname",children:"昵称 *"}),e.jsx(pe,{id:"nickname",placeholder:"请输入机器人的昵称",value:s.nickname,onChange:c=>a({...s,nickname:c.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{children:"别名"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:s.alias_names.map((c,d)=>e.jsxs(_t,{variant:"secondary",className:"gap-1",children:[c,e.jsx("button",{type:"button",onClick:()=>i(d),className:"ml-1 hover:text-destructive",children:e.jsx(go,{className:"h-3 w-3"})})]},d))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(pe,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:c=>{c.key==="Enter"&&(l(c.target.value),c.target.value="")}}),e.jsx(q,{type:"button",variant:"outline",onClick:()=>{const c=document.getElementById("alias_input");c&&(l(c.value),c.value="")},children:"添加"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function JE({config:s,onChange:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"personality",children:"人格特征 *"}),e.jsx(Dt,{id:"personality",placeholder:"描述机器人的人格特质和身份特征建议120字以内",value:s.personality,onChange:l=>a({...s,personality:l.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"reply_style",children:"表达风格 *"}),e.jsx(Dt,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:s.reply_style,onChange:l=>a({...s,reply_style:l.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"interest",children:"兴趣 *"}),e.jsx(Dt,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:s.interest,onChange:l=>a({...s,interest:l.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),e.jsx(oo,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"plan_style",children:"群聊说话规则 *"}),e.jsx(Dt,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:s.plan_style,onChange:l=>a({...s,plan_style:l.target.value}),rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),e.jsx(Dt,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:s.private_plan_style,onChange:l=>a({...s,private_plan_style:l.target.value}),rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function e4({config:s,onChange:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(s.emoji_chance*100).toFixed(0),"%"]})]}),e.jsx(pe,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:s.emoji_chance,onChange:l=>a({...s,emoji_chance:Number(l.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"max_reg_num",children:"最大表情包数量"}),e.jsx(pe,{id:"max_reg_num",type:"number",min:"1",max:"200",value:s.max_reg_num,onChange:l=>a({...s,max_reg_num:Number(l.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(U,{htmlFor:"do_replace",children:"达到最大数量时替换"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),e.jsx(Ze,{id:"do_replace",checked:s.do_replace,onCheckedChange:l=>a({...s,do_replace:l})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(pe,{id:"check_interval",type:"number",min:"1",max:"120",value:s.check_interval,onChange:l=>a({...s,check_interval:Number(l.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),e.jsx(oo,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(U,{htmlFor:"steal_emoji",children:"偷取表情包"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),e.jsx(Ze,{id:"steal_emoji",checked:s.steal_emoji,onCheckedChange:l=>a({...s,steal_emoji:l})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(U,{htmlFor:"content_filtration",children:"启用表情包过滤"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),e.jsx(Ze,{id:"content_filtration",checked:s.content_filtration,onCheckedChange:l=>a({...s,content_filtration:l})})]}),s.content_filtration&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(pe,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:s.filtration_prompt,onChange:l=>a({...s,filtration_prompt:l.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function t4({config:s,onChange:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(U,{htmlFor:"enable_tool",children:"启用工具系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),e.jsx(Ze,{id:"enable_tool",checked:s.enable_tool,onCheckedChange:l=>a({...s,enable_tool:l})})]}),e.jsx(oo,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(U,{htmlFor:"enable_mood",children:"启用情绪系统"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),e.jsx(Ze,{id:"enable_mood",checked:s.enable_mood,onCheckedChange:l=>a({...s,enable_mood:l})})]}),s.enable_mood&&e.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),e.jsx(pe,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:s.mood_update_threshold||1,onChange:l=>a({...s,mood_update_threshold:Number(l.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{htmlFor:"emotion_style",children:"情感特征"}),e.jsx(Dt,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:s.emotion_style||"",onChange:l=>a({...s,emotion_style:l.target.value}),rows:2}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),e.jsx(oo,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(U,{htmlFor:"all_global",children:"启用全局黑话模式"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),e.jsx(Ze,{id:"all_global",checked:s.all_global,onCheckedChange:l=>a({...s,all_global:l})})]})]})}async function Fe(s,a){const l=await fetch(s,a);if(l.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return l}function Ie(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function s4(){const s=await Fe("/api/webui/config/bot",{method:"GET",headers:Ie()});if(!s.ok)throw new Error("读取Bot配置失败");const l=(await s.json()).config.bot||{};return{qq_account:l.qq_account||0,nickname:l.nickname||"",alias_names:l.alias_names||[]}}async function n4(){const s=await Fe("/api/webui/config/bot",{method:"GET",headers:Ie()});if(!s.ok)throw new Error("读取人格配置失败");const l=(await s.json()).config.personality||{};return{personality:l.personality||"",reply_style:l.reply_style||"",interest:l.interest||"",plan_style:l.plan_style||"",private_plan_style:l.private_plan_style||""}}async function a4(){const s=await Fe("/api/webui/config/bot",{method:"GET",headers:Ie()});if(!s.ok)throw new Error("读取表情包配置失败");const l=(await s.json()).config.emoji||{};return{emoji_chance:l.emoji_chance??.4,max_reg_num:l.max_reg_num??40,do_replace:l.do_replace??!0,check_interval:l.check_interval??10,steal_emoji:l.steal_emoji??!0,content_filtration:l.content_filtration??!1,filtration_prompt:l.filtration_prompt||""}}async function l4(){const s=await Fe("/api/webui/config/bot",{method:"GET",headers:Ie()});if(!s.ok)throw new Error("读取其他配置失败");const l=(await s.json()).config,i=l.tool||{},c=l.mood||{},d=l.jargon||{};return{enable_tool:i.enable_tool??!0,enable_mood:c.enable_mood??!1,mood_update_threshold:c.mood_update_threshold,emotion_style:c.emotion_style,all_global:d.all_global??!0}}async function r4(s){const a=await Fe("/api/webui/config/bot/section/bot",{method:"POST",headers:Ie(),body:JSON.stringify(s)});if(!a.ok){const l=await a.json();throw new Error(l.detail||"保存Bot基础配置失败")}return await a.json()}async function i4(s){const a=await Fe("/api/webui/config/bot/section/personality",{method:"POST",headers:Ie(),body:JSON.stringify(s)});if(!a.ok){const l=await a.json();throw new Error(l.detail||"保存人格配置失败")}return await a.json()}async function o4(s){const a=await Fe("/api/webui/config/bot/section/emoji",{method:"POST",headers:Ie(),body:JSON.stringify(s)});if(!a.ok){const l=await a.json();throw new Error(l.detail||"保存表情包配置失败")}return await a.json()}async function c4(s){const a=[];a.push(Fe("/api/webui/config/bot/section/tool",{method:"POST",headers:Ie(),body:JSON.stringify({enable_tool:s.enable_tool})})),a.push(Fe("/api/webui/config/bot/section/jargon",{method:"POST",headers:Ie(),body:JSON.stringify({all_global:s.all_global})}));const l={enable_mood:s.enable_mood};s.enable_mood&&(l.mood_update_threshold=s.mood_update_threshold||1,l.emotion_style=s.emotion_style||""),a.push(Fe("/api/webui/config/bot/section/mood",{method:"POST",headers:Ie(),body:JSON.stringify(l)}));const i=await Promise.all(a);for(const c of i)if(!c.ok){const d=await c.json();throw new Error(d.detail||"保存其他配置失败")}return{success:!0}}async function Lj(){const s=localStorage.getItem("access-token"),a=await Fe("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${s}`}});if(!a.ok){const l=await a.json();throw new Error(l.message||"标记配置完成失败")}return await a.json()}function d4(){const s=qn(),{toast:a}=Es(),[l,i]=x.useState(0),[c,d]=x.useState(!1),[m,h]=x.useState(!1),[p,v]=x.useState(!0),[g,j]=x.useState({qq_account:0,nickname:"",alias_names:[]}),[b,w]=x.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
2.如果相同的内容已经被执行,请不要重复执行
3.请控制你的发言频率,不要太过频繁的发言
4.如果有人对你感到厌烦,请减少回复
5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
2.如果相同的内容已经被执行,请不要重复执行
3.某句话如果已经被回复过,不要重复回复`}),[S,C]=x.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[N,T]=x.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),P=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:P2},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:Ey},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:gh},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Tn},{id:"complete",title:"完成设置",description:"后续配置提示",icon:ao}],M=(l+1)/P.length*100;x.useEffect(()=>{(async()=>{try{v(!0);const[$,oe,je,ae]=await Promise.all([s4(),n4(),a4(),l4()]);j($),w(oe),C(je),T(ae)}catch($){a({title:"加载配置失败",description:$ instanceof Error?$.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{v(!1)}})()},[a]);const k=async()=>{h(!0);try{switch(l){case 0:await r4(g);break;case 1:await i4(b);break;case 2:await o4(S);break;case 3:await c4(N);break}return a({title:"保存成功",description:`${P[l].title}配置已保存`}),!0}catch(G){return a({title:"保存失败",description:G instanceof Error?G.message:"未知错误",variant:"destructive"}),!1}finally{h(!1)}},D=async()=>{await k()&&l<P.length-1&&i(l+1)},A=()=>{l>0&&i(l-1)},E=async()=>{d(!0);try{if(!await k()){d(!1);return}await Lj(),a({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{s({to:"/"})},500)}catch(G){a({title:"完成失败",description:G instanceof Error?G.message:"未知错误",variant:"destructive"})}finally{d(!1)}},B=async()=>{try{await Lj(),s({to:"/"})}catch(G){a({title:"跳过失败",description:G instanceof Error?G.message:"未知错误",variant:"destructive"})}},Y=()=>{switch(l){case 0:return e.jsx(ZE,{config:g,onChange:j});case 1:return e.jsx(JE,{config:b,onChange:w});case 2:return e.jsx(e4,{config:S,onChange:C});case 3:return e.jsx(t4,{config:N,onChange:T});case 4:return e.jsxs("div",{className:"space-y-6 text-center py-8",children:[e.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(ao,{className:"h-8 w-8 text-primary",strokeWidth:2})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"1"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"2"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"添加模型"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/20 flex items-center justify-center text-primary text-sm font-semibold",children:"3"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"配置模型任务"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return e.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4 md:p-6",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute left-1/4 top-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute right-1/4 bottom-1/4 h-64 w-64 md:h-96 md:w-96 rounded-full bg-secondary/5 blur-3xl"})]}),p?e.jsxs("div",{className:"relative z-10 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:e.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),e.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[e.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 md:h-16 md:w-16 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(z2,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),e.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),e.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",Rh," 的初始配置"]})]}),e.jsxs("div",{className:"mb-6 md:mb-8",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",l+1," / ",P.length]}),e.jsxs("span",{className:"font-medium text-primary",children:[Math.round(M),"%"]})]}),e.jsx(_o,{value:M,className:"h-2"})]}),e.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:P.map((G,$)=>{const oe=G.icon;return e.jsxs("div",{className:Z("flex flex-1 flex-col items-center gap-1 md:gap-2",$<P.length-1&&"relative"),children:[$<P.length-1&&e.jsx("div",{className:Z("absolute left-1/2 top-3 md:top-4 h-0.5 w-full",$<l?"bg-primary":"bg-border")}),e.jsx("div",{className:Z("relative z-10 flex h-6 w-6 md:h-8 md:w-8 items-center justify-center rounded-full border-2 transition-all",$===l||$<l?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground"),children:$<l?e.jsx(Ys,{className:"h-3 w-3 md:h-4 md:w-4",strokeWidth:2.5,fill:"none"}):e.jsx(oe,{className:"h-3 w-3 md:h-4 md:w-4"})}),e.jsx("span",{className:Z("text-[10px] md:text-xs text-center max-w-[60px] md:max-w-none truncate md:whitespace-normal",$===l?"font-medium text-foreground":"text-muted-foreground"),title:G.title,children:G.title})]},G.id)})}),e.jsx(Ue,{className:"mb-6 md:mb-8 shadow-lg",children:e.jsx(gt,{className:"p-4 md:p-8",children:e.jsxs("div",{className:"min-h-[300px] md:min-h-[400px]",children:[e.jsxs("div",{className:"mb-4 md:mb-6",children:[e.jsx("h2",{className:"mb-2 text-xl md:text-2xl font-semibold",children:P[l].title}),e.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:P[l].description})]}),e.jsx(Ct,{className:"h-[400px] md:h-[500px]",children:e.jsx("div",{className:"pr-2",children:Y()})})]})})}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-3 sm:gap-0",children:[e.jsx(q,{variant:"outline",onClick:A,disabled:l===0||m,className:"w-full sm:w-auto order-2 sm:order-1",children:"上一步"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto order-1 sm:order-2",children:[e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs(q,{variant:"ghost",className:"flex-1 sm:flex-none gap-2",disabled:m||c,children:[e.jsx(L2,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"跳过向导"]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认跳过配置向导"}),e.jsx(Pt,{children:"您可以随时在系统设置中重新进入配置向导。确定要跳过吗?"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:B,children:"确认跳过"})]})]})]}),l===P.length-1?e.jsx(q,{onClick:E,disabled:c||m,className:"flex-1 sm:flex-none",children:c||m?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),m?"保存中...":"完成中..."]}):e.jsxs(e.Fragment,{children:["完成配置",e.jsx(Ys,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})}):e.jsx(q,{onClick:D,disabled:m,className:"flex-1 sm:flex-none",children:m?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"保存中..."]}):e.jsxs(e.Fragment,{children:["下一步",e.jsx(B2,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})})]})]})]}),e.jsx("div",{className:"relative z-10 mt-6 md:mt-8 text-center text-xs text-muted-foreground",children:e.jsx("p",{children:"您可以随时在设置中修改这些配置"})})]})]})}function H0(){const s=qn();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:e.jsxs("div",{className:"w-full max-w-2xl text-center",children:[e.jsxs("div",{className:"relative mb-8",children:[e.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(Gs,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),e.jsxs("div",{className:"space-y-4 mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),e.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[e.jsxs(q,{size:"lg",onClick:()=>s({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[e.jsx(fd,{className:"h-4 w-4"}),"返回首页"]}),e.jsxs(q,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[e.jsx(My,{className:"h-4 w-4"}),"返回上一页"]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var F0=["PageUp","PageDown"],Y0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],q0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ei="Slider",[$f,u4,m4]=_d(ei),[V0]=Dn(ei,[m4]),[f4,Fd]=V0(ei),G0=x.forwardRef((s,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:h=!1,minStepsBetweenThumbs:p=0,defaultValue:v=[i],value:g,onValueChange:j=()=>{},onValueCommit:b=()=>{},inverted:w=!1,form:S,...C}=s,N=x.useRef(new Set),T=x.useRef(0),M=m==="horizontal"?h4:x4,[k=[],D]=Qa({prop:g,defaultProp:v,onChange:$=>{[...N.current][T.current]?.focus(),j($)}}),A=x.useRef(k);function E($){const oe=y4(k,$);G($,oe)}function B($){G($,T.current)}function Y(){const $=A.current[T.current];k[T.current]!==$&&b(k)}function G($,oe,{commit:je}={commit:!1}){const ae=S4(d),me=_4(Math.round(($-i)/d)*d+i,ae),R=rh(me,[i,c]);D((O=[])=>{const L=v4(O,R,oe);if(w4(L,p*d)){T.current=L.indexOf(R);const ee=String(L)!==String(O);return ee&&je&&b(L),ee?L:O}else return O})}return e.jsx(f4,{scope:s.__scopeSlider,name:l,disabled:h,min:i,max:c,valueIndexToChangeRef:T,thumbs:N.current,values:k,orientation:m,form:S,children:e.jsx($f.Provider,{scope:s.__scopeSlider,children:e.jsx($f.Slot,{scope:s.__scopeSlider,children:e.jsx(M,{"aria-disabled":h,"data-disabled":h?"":void 0,...C,ref:a,onPointerDown:be(C.onPointerDown,()=>{h||(A.current=k)}),min:i,max:c,inverted:w,onSlideStart:h?void 0:E,onSlideMove:h?void 0:B,onSlideEnd:h?void 0:Y,onHomeKeyDown:()=>!h&&G(i,0,{commit:!0}),onEndKeyDown:()=>!h&&G(c,k.length-1,{commit:!0}),onStepKeyDown:({event:$,direction:oe})=>{if(!h){const me=F0.includes($.key)||$.shiftKey&&Y0.includes($.key)?10:1,R=T.current,O=k[R],L=d*me*oe;G(O+L,R,{commit:!0})}}})})})})});G0.displayName=ei;var[$0,I0]=V0(ei,{startEdge:"left",endEdge:"right",size:"width",direction:1}),h4=x.forwardRef((s,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:m,onSlideMove:h,onSlideEnd:p,onStepKeyDown:v,...g}=s,[j,b]=x.useState(null),w=Tt(a,M=>b(M)),S=x.useRef(void 0),C=xo(c),N=C==="ltr",T=N&&!d||!N&&d;function P(M){const k=S.current||j.getBoundingClientRect(),D=[0,k.width],E=zh(D,T?[l,i]:[i,l]);return S.current=k,E(M-k.left)}return e.jsx($0,{scope:s.__scopeSlider,startEdge:T?"left":"right",endEdge:T?"right":"left",direction:T?1:-1,size:"width",children:e.jsx(W0,{dir:C,"data-orientation":"horizontal",...g,ref:w,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:M=>{const k=P(M.clientX);m?.(k)},onSlideMove:M=>{const k=P(M.clientX);h?.(k)},onSlideEnd:()=>{S.current=void 0,p?.()},onStepKeyDown:M=>{const D=q0[T?"from-left":"from-right"].includes(M.key);v?.({event:M,direction:D?-1:1})}})})}),x4=x.forwardRef((s,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:h,onStepKeyDown:p,...v}=s,g=x.useRef(null),j=Tt(a,g),b=x.useRef(void 0),w=!c;function S(C){const N=b.current||g.current.getBoundingClientRect(),T=[0,N.height],M=zh(T,w?[i,l]:[l,i]);return b.current=N,M(C-N.top)}return e.jsx($0,{scope:s.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:e.jsx(W0,{"data-orientation":"vertical",...v,ref:j,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const N=S(C.clientY);d?.(N)},onSlideMove:C=>{const N=S(C.clientY);m?.(N)},onSlideEnd:()=>{b.current=void 0,h?.()},onStepKeyDown:C=>{const T=q0[w?"from-bottom":"from-top"].includes(C.key);p?.({event:C,direction:T?-1:1})}})})}),W0=x.forwardRef((s,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:h,onStepKeyDown:p,...v}=s,g=Fd(ei,l);return e.jsx(dt.span,{...v,ref:a,onKeyDown:be(s.onKeyDown,j=>{j.key==="Home"?(m(j),j.preventDefault()):j.key==="End"?(h(j),j.preventDefault()):F0.concat(Y0).includes(j.key)&&(p(j),j.preventDefault())}),onPointerDown:be(s.onPointerDown,j=>{const b=j.target;b.setPointerCapture(j.pointerId),j.preventDefault(),g.thumbs.has(b)?b.focus():i(j)}),onPointerMove:be(s.onPointerMove,j=>{j.target.hasPointerCapture(j.pointerId)&&c(j)}),onPointerUp:be(s.onPointerUp,j=>{const b=j.target;b.hasPointerCapture(j.pointerId)&&(b.releasePointerCapture(j.pointerId),d(j))})})}),X0="SliderTrack",K0=x.forwardRef((s,a)=>{const{__scopeSlider:l,...i}=s,c=Fd(X0,l);return e.jsx(dt.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});K0.displayName=X0;var If="SliderRange",Q0=x.forwardRef((s,a)=>{const{__scopeSlider:l,...i}=s,c=Fd(If,l),d=I0(If,l),m=x.useRef(null),h=Tt(a,m),p=c.values.length,v=c.values.map(b=>eN(b,c.min,c.max)),g=p>1?Math.min(...v):0,j=100-Math.max(...v);return e.jsx(dt.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:h,style:{...s.style,[d.startEdge]:g+"%",[d.endEdge]:j+"%"}})});Q0.displayName=If;var Wf="SliderThumb",Z0=x.forwardRef((s,a)=>{const l=u4(s.__scopeSlider),[i,c]=x.useState(null),d=Tt(a,h=>c(h)),m=x.useMemo(()=>i?l().findIndex(h=>h.ref.current===i):-1,[l,i]);return e.jsx(p4,{...s,ref:d,index:m})}),p4=x.forwardRef((s,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=s,m=Fd(Wf,l),h=I0(Wf,l),[p,v]=x.useState(null),g=Tt(a,P=>v(P)),j=p?m.form||!!p.closest("form"):!0,b=dy(p),w=m.values[i],S=w===void 0?0:eN(w,m.min,m.max),C=j4(i,m.values.length),N=b?.[h.size],T=N?b4(N,S,h.direction):0;return x.useEffect(()=>{if(p)return m.thumbs.add(p),()=>{m.thumbs.delete(p)}},[p,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[h.startEdge]:`calc(${S}% + ${T}px)`},children:[e.jsx($f.ItemSlot,{scope:s.__scopeSlider,children:e.jsx(dt.span,{role:"slider","aria-label":s["aria-label"]||C,"aria-valuemin":m.min,"aria-valuenow":w,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...d,ref:g,style:w===void 0?{display:"none"}:s.style,onFocus:be(s.onFocus,()=>{m.valueIndexToChangeRef.current=i})})}),j&&e.jsx(J0,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:w},i)]})});Z0.displayName=Wf;var g4="RadioBubbleInput",J0=x.forwardRef(({__scopeSlider:s,value:a,...l},i)=>{const c=x.useRef(null),d=Tt(c,i),m=cy(a);return x.useEffect(()=>{const h=c.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const j=new Event("input",{bubbles:!0});g.call(h,a),h.dispatchEvent(j)}},[m,a]),e.jsx(dt.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});J0.displayName=g4;function v4(s=[],a,l){const i=[...s];return i[l]=a,i.sort((c,d)=>c-d)}function eN(s,a,l){const d=100/(l-a)*(s-a);return rh(d,[0,100])}function j4(s,a){return a>2?`Value ${s+1} of ${a}`:a===2?["Minimum","Maximum"][s]:void 0}function y4(s,a){if(s.length===1)return 0;const l=s.map(c=>Math.abs(c-a)),i=Math.min(...l);return l.indexOf(i)}function b4(s,a,l){const i=s/2,d=zh([0,50],[0,i]);return(i-d(a)*l)*l}function N4(s){return s.slice(0,-1).map((a,l)=>s[l+1]-a)}function w4(s,a){if(a>0){const l=N4(s);return Math.min(...l)>=a}return!0}function zh(s,a){return l=>{if(s[0]===s[1]||a[0]===a[1])return a[0];const i=(a[1]-a[0])/(s[1]-s[0]);return a[0]+i*(l-s[0])}}function S4(s){return(String(s).split(".")[1]||"").length}function _4(s,a){const l=Math.pow(10,a);return Math.round(s*l)/l}var tN=G0,C4=K0,k4=Q0,T4=Z0;const Yd=x.forwardRef(({className:s,...a},l)=>e.jsxs(tN,{ref:l,className:Z("relative flex w-full touch-none select-none items-center",s),...a,children:[e.jsx(C4,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(k4,{className:"absolute h-full bg-primary"})}),e.jsx(T4,{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"})]}));Yd.displayName=tN.displayName;const rt=y2,it=b2,at=x.forwardRef(({className:s,children:a,...l},i)=>e.jsxs(hy,{ref:i,className:Z("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",s),...l,children:[a,e.jsx(x2,{asChild:!0,children:e.jsx(lo,{className:"h-4 w-4 opacity-50"})})]}));at.displayName=hy.displayName;const sN=x.forwardRef(({className:s,...a},l)=>e.jsx(xy,{ref:l,className:Z("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(Pf,{className:"h-4 w-4"})}));sN.displayName=xy.displayName;const nN=x.forwardRef(({className:s,...a},l)=>e.jsx(py,{ref:l,className:Z("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(lo,{className:"h-4 w-4"})}));nN.displayName=py.displayName;const lt=x.forwardRef(({className:s,children:a,position:l="popper",...i},c)=>e.jsx(p2,{children:e.jsxs(gy,{ref:c,className:Z("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]",l==="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",s),position:l,...i,children:[e.jsx(sN,{}),e.jsx(g2,{className:Z("p-1",l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(nN,{})]})}));lt.displayName=gy.displayName;const E4=x.forwardRef(({className:s,...a},l)=>e.jsx(vy,{ref:l,className:Z("px-2 py-1.5 text-sm font-semibold",s),...a}));E4.displayName=vy.displayName;const ye=x.forwardRef(({className:s,children:a,...l},i)=>e.jsxs(jy,{ref:i,className:Z("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",s),...l,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(v2,{children:e.jsx(Cl,{className:"h-4 w-4"})})}),e.jsx(j2,{children:a})]}));ye.displayName=jy.displayName;const M4=x.forwardRef(({className:s,...a},l)=>e.jsx(yy,{ref:l,className:Z("-mx-1 my-1 h-px bg-muted",s),...a}));M4.displayName=yy.displayName;function D4(s){const a=O4(s),l=x.forwardRef((i,c)=>{const{children:d,...m}=i,h=x.Children.toArray(d),p=h.find(R4);if(p){const v=p.props.children,g=h.map(j=>j===p?x.Children.count(v)>1?x.Children.only(null):x.isValidElement(v)?v.props.children:null:j);return e.jsx(a,{...m,ref:c,children:x.isValidElement(v)?x.cloneElement(v,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}function O4(s){const a=x.forwardRef((l,i)=>{const{children:c,...d}=l;if(x.isValidElement(c)){const m=P4(c),h=z4(d,c.props);return c.type!==x.Fragment&&(h.ref=i?Ga(i,m):m),x.cloneElement(c,h)}return x.Children.count(c)>1?x.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var A4=Symbol("radix.slottable");function R4(s){return x.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===A4}function z4(s,a){const l={...a};for(const i in a){const c=s[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...h)=>{const p=d(...h);return c(...h),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function P4(s){let a=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=Object.getOwnPropertyDescriptor(s,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var qd="Popover",[aN]=Dn(qd,[Wr]),Co=Wr(),[L4,Za]=aN(qd),lN=s=>{const{__scopePopover:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:m=!1}=s,h=Co(a),p=x.useRef(null),[v,g]=x.useState(!1),[j,b]=Qa({prop:i,defaultProp:c??!1,onChange:d,caller:qd});return e.jsx(Ed,{...h,children:e.jsx(L4,{scope:a,contentId:jn(),triggerRef:p,open:j,onOpenChange:b,onOpenToggle:x.useCallback(()=>b(w=>!w),[b]),hasCustomAnchor:v,onCustomAnchorAdd:x.useCallback(()=>g(!0),[]),onCustomAnchorRemove:x.useCallback(()=>g(!1),[]),modal:m,children:l})})};lN.displayName=qd;var rN="PopoverAnchor",B4=x.forwardRef((s,a)=>{const{__scopePopover:l,...i}=s,c=Za(rN,l),d=Co(l),{onCustomAnchorAdd:m,onCustomAnchorRemove:h}=c;return x.useEffect(()=>(m(),()=>h()),[m,h]),e.jsx(Md,{...d,...i,ref:a})});B4.displayName=rN;var iN="PopoverTrigger",oN=x.forwardRef((s,a)=>{const{__scopePopover:l,...i}=s,c=Za(iN,l),d=Co(l),m=Tt(a,c.triggerRef),h=e.jsx(dt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":fN(c.open),...i,ref:m,onClick:be(s.onClick,c.onOpenToggle)});return c.hasCustomAnchor?h:e.jsx(Md,{asChild:!0,...d,children:h})});oN.displayName=iN;var Ph="PopoverPortal",[U4,H4]=aN(Ph,{forceMount:void 0}),cN=s=>{const{__scopePopover:a,forceMount:l,children:i,container:c}=s,d=Za(Ph,a);return e.jsx(U4,{scope:a,forceMount:l,children:e.jsx(Is,{present:l||d.open,children:e.jsx(Td,{asChild:!0,container:c,children:i})})})};cN.displayName=Ph;var $r="PopoverContent",dN=x.forwardRef((s,a)=>{const l=H4($r,s.__scopePopover),{forceMount:i=l.forceMount,...c}=s,d=Za($r,s.__scopePopover);return e.jsx(Is,{present:i||d.open,children:d.modal?e.jsx(Y4,{...c,ref:a}):e.jsx(q4,{...c,ref:a})})});dN.displayName=$r;var F4=D4("PopoverContent.RemoveScroll"),Y4=x.forwardRef((s,a)=>{const l=Za($r,s.__scopePopover),i=x.useRef(null),c=Tt(a,i),d=x.useRef(!1);return x.useEffect(()=>{const m=i.current;if(m)return by(m)},[]),e.jsx(Ny,{as:F4,allowPinchZoom:!0,children:e.jsx(uN,{...s,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(s.onCloseAutoFocus,m=>{m.preventDefault(),d.current||l.triggerRef.current?.focus()}),onPointerDownOutside:be(s.onPointerDownOutside,m=>{const h=m.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,v=h.button===2||p;d.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:be(s.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})}),q4=x.forwardRef((s,a)=>{const l=Za($r,s.__scopePopover),i=x.useRef(!1),c=x.useRef(!1);return e.jsx(uN,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{s.onCloseAutoFocus?.(d),d.defaultPrevented||(i.current||l.triggerRef.current?.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{s.onInteractOutside?.(d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=d.target;l.triggerRef.current?.contains(m)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),uN=x.forwardRef((s,a)=>{const{__scopePopover:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:m,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:v,onInteractOutside:g,...j}=s,b=Za($r,l),w=Co(l);return wy(),e.jsx(Sy,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(fh,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:g,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:v,onDismiss:()=>b.onOpenChange(!1),children:e.jsx(hh,{"data-state":fN(b.open),role:"dialog",id:b.contentId,...w,...j,ref:a,style:{...j.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)"}})})})}),mN="PopoverClose",V4=x.forwardRef((s,a)=>{const{__scopePopover:l,...i}=s,c=Za(mN,l);return e.jsx(dt.button,{type:"button",...i,ref:a,onClick:be(s.onClick,()=>c.onOpenChange(!1))})});V4.displayName=mN;var G4="PopoverArrow",$4=x.forwardRef((s,a)=>{const{__scopePopover:l,...i}=s,c=Co(l);return e.jsx(xh,{...c,...i,ref:a})});$4.displayName=G4;function fN(s){return s?"open":"closed"}var I4=lN,W4=oN,X4=cN,hN=dN;const Ia=I4,Wa=W4,pa=x.forwardRef(({className:s,align:a="center",sideOffset:l=4,...i},c)=>e.jsx(X4,{children:e.jsx(hN,{ref:c,align:a,sideOffset:l,className:Z("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]",s),...i})}));pa.displayName=hN.displayName;const ti="/api/webui/config";async function K4(){const a=await(await Fe(`${ti}/bot`)).json();if(!a.success)throw new Error("获取配置数据失败");return a.config}async function Ur(){const a=await(await Fe(`${ti}/model`)).json();if(!a.success)throw new Error("获取模型配置数据失败");return a.config}async function Bj(s){const l=await(await Fe(`${ti}/bot`,{method:"POST",headers:Ie(),body:JSON.stringify(s)})).json();if(!l.success)throw new Error(l.message||"保存配置失败")}async function Nd(s){const l=await(await Fe(`${ti}/model`,{method:"POST",headers:Ie(),body:JSON.stringify(s)})).json();if(!l.success)throw new Error(l.message||"保存配置失败")}async function Q4(s,a){const i=await(await Fe(`${ti}/bot/section/${s}`,{method:"POST",headers:Ie(),body:JSON.stringify(a)})).json();if(!i.success)throw new Error(i.message||`保存配置节 ${s} 失败`)}async function Xf(s,a){const i=await(await Fe(`${ti}/model/section/${s}`,{method:"POST",headers:Ie(),body:JSON.stringify(a)})).json();if(!i.success)throw new Error(i.message||`保存配置节 ${s} 失败`)}const Z4=$t.create({baseURL:"",timeout:1e4});async function Lh(){try{return(await Z4.post("/api/webui/system/restart")).data}catch(s){throw console.error("重启麦麦失败:",s),s}}const J4=Jr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Vd=x.forwardRef(({className:s,variant:a,...l},i)=>e.jsx("div",{ref:i,role:"alert",className:Z(J4({variant:a}),s),...l}));Vd.displayName="Alert";const eM=x.forwardRef(({className:s,...a},l)=>e.jsx("h5",{ref:l,className:Z("mb-1 font-medium leading-none tracking-tight",s),...a}));eM.displayName="AlertTitle";const Gd=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:Z("text-sm [&_p]:leading-relaxed",s),...a}));Gd.displayName="AlertDescription";function Bh({onRestartComplete:s,onRestartFailed:a}){const[l,i]=x.useState(0),[c,d]=x.useState("restarting"),[m,h]=x.useState(0),[p,v]=x.useState(0);x.useEffect(()=>{const b=setInterval(()=>{i(C=>C>=90?C:C+1)},200),w=setInterval(()=>{h(C=>C+1)},1e3),S=setTimeout(()=>{d("checking"),g()},3e3);return()=>{clearInterval(b),clearInterval(w),clearTimeout(S)}},[]);const g=()=>{const w=async()=>{try{if(v(C=>C+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)i(100),d("success"),setTimeout(()=>{s?.()},1500);else throw new Error("Status check failed")}catch{p<60?setTimeout(w,2e3):(d("failed"),a?.())}};w()},j=b=>{const w=Math.floor(b/60),S=b%60;return`${w}:${S.toString().padStart(2,"0")}`};return e.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:e.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[c==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx(ro,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),c==="checking"&&e.jsxs(e.Fragment,{children:[e.jsx(ro,{className:"h-16 w-16 text-primary animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),e.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",p,"/60)"]})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(Ys,{className:"h-16 w-16 text-green-500"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),c==="failed"&&e.jsxs(e.Fragment,{children:[e.jsx(Tl,{className:"h-16 w-16 text-destructive"}),e.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),e.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),c!=="failed"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(_o,{value:l,className:"h-2"}),e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[l,"%"]}),e.jsxs("span",{children:["已用时: ",j(m)]})]})]}),e.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[c==="restarting"&&"🔄 配置已保存,正在重启主程序...",c==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",c==="success"&&"✅ 配置已生效,服务运行正常",c==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),c==="failed"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>window.location.reload(),className:"flex-1 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"刷新页面"}),e.jsx("button",{onClick:()=>{d("checking"),v(0),g()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}function tM(){const[s,a]=x.useState(!0),[l,i]=x.useState(!1),[c,d]=x.useState(!1),[m,h]=x.useState(!1),[p,v]=x.useState(!1),[g,j]=x.useState(!1),{toast:b}=Es(),[w,S]=x.useState(null),[C,N]=x.useState(null),[T,P]=x.useState(null),[M,k]=x.useState(null),[D,A]=x.useState(null),[E,B]=x.useState(null),[Y,G]=x.useState(null),[$,oe]=x.useState(null),[je,ae]=x.useState(null),[me,R]=x.useState(null),[O,L]=x.useState(null),[ee,le]=x.useState(null),[xe,F]=x.useState(null),[W,fe]=x.useState(null),[I,ve]=x.useState(null),[de,Ce]=x.useState(null),[Q,Oe]=x.useState(null),[$e,re]=x.useState(null),Pe=x.useRef(null),ze=x.useRef(!0),Zt=x.useRef({}),Rs=x.useCallback(async()=>{try{a(!0);const ke=await K4();Zt.current=ke,S(ke.bot),N(ke.personality);const is=ke.chat;is.talk_value_rules||(is.talk_value_rules=[]),P(is),k(ke.expression),A(ke.emoji),B(ke.memory),G(ke.tool),oe(ke.mood),ae(ke.voice),R(ke.lpmm_knowledge),L(ke.keyword_reaction),le(ke.response_post_process),F(ke.chinese_typo),fe(ke.response_splitter),ve(ke.log),Ce(ke.debug),Oe(ke.maim_message),re(ke.telemetry),h(!1),ze.current=!1}catch(ke){console.error("加载配置失败:",ke),b({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{a(!1)}},[b]);x.useEffect(()=>{Rs()},[Rs]);const An=x.useCallback(async(ke,is)=>{if(!ze.current)try{d(!0),await Q4(ke,is),h(!1)}catch(he){console.error(`自动保存 ${ke} 失败:`,he),h(!0)}finally{d(!1)}},[]),Le=x.useCallback((ke,is)=>{ze.current||(h(!0),Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(()=>{An(ke,is)},2e3))},[An]);x.useEffect(()=>{w&&!ze.current&&Le("bot",w)},[w,Le]),x.useEffect(()=>{C&&!ze.current&&Le("personality",C)},[C,Le]),x.useEffect(()=>{T&&!ze.current&&Le("chat",T)},[T,Le]),x.useEffect(()=>{M&&!ze.current&&Le("expression",M)},[M,Le]),x.useEffect(()=>{D&&!ze.current&&Le("emoji",D)},[D,Le]),x.useEffect(()=>{E&&!ze.current&&Le("memory",E)},[E,Le]),x.useEffect(()=>{Y&&!ze.current&&Le("tool",Y)},[Y,Le]),x.useEffect(()=>{$&&!ze.current&&Le("mood",$)},[$,Le]),x.useEffect(()=>{je&&!ze.current&&Le("voice",je)},[je,Le]),x.useEffect(()=>{me&&!ze.current&&Le("lpmm_knowledge",me)},[me,Le]),x.useEffect(()=>{O&&!ze.current&&Le("keyword_reaction",O)},[O,Le]),x.useEffect(()=>{ee&&!ze.current&&Le("response_post_process",ee)},[ee,Le]),x.useEffect(()=>{xe&&!ze.current&&Le("chinese_typo",xe)},[xe,Le]),x.useEffect(()=>{W&&!ze.current&&Le("response_splitter",W)},[W,Le]),x.useEffect(()=>{I&&!ze.current&&Le("log",I)},[I,Le]),x.useEffect(()=>{de&&!ze.current&&Le("debug",de)},[de,Le]),x.useEffect(()=>{Q&&!ze.current&&Le("maim_message",Q)},[Q,Le]),x.useEffect(()=>{$e&&!ze.current&&Le("telemetry",$e)},[$e,Le]);const Nn=async()=>{try{i(!0),Pe.current&&clearTimeout(Pe.current);const ke={...Zt.current,bot:w,personality:C,chat:T,expression:M,emoji:D,memory:E,tool:Y,mood:$,voice:je,lpmm_knowledge:me,keyword_reaction:O,response_post_process:ee,chinese_typo:xe,response_splitter:W,log:I,debug:de,maim_message:Q,telemetry:$e};await Bj(ke),h(!1),b({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(ke){console.error("保存配置失败:",ke),b({title:"保存失败",description:ke.message,variant:"destructive"})}finally{i(!1)}},ln=async()=>{try{v(!0),Lh().catch(()=>{}),j(!0)}catch(ke){console.error("重启失败:",ke),j(!1),b({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),v(!1)}},rn=async()=>{try{i(!0),Pe.current&&clearTimeout(Pe.current);const ke={...Zt.current,bot:w,personality:C,chat:T,expression:M,emoji:D,memory:E,tool:Y,mood:$,voice:je,lpmm_knowledge:me,keyword_reaction:O,response_post_process:ee,chinese_typo:xe,response_splitter:W,log:I,debug:de,maim_message:Q,telemetry:$e};await Bj(ke),h(!1),b({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(is=>setTimeout(is,500)),await ln()}catch(ke){console.error("保存失败:",ke),b({title:"保存失败",description:ke.message,variant:"destructive"})}finally{i(!1)}},Xt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Ds=()=>{j(!1),v(!1),b({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return s?e.jsx(Ct,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsxs(q,{onClick:Nn,disabled:l||c||!m||p,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[e.jsx(vh,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),l?"保存中...":c?"自动保存中...":m?"保存配置":"已保存"]}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs(q,{disabled:l||c||p,size:"sm",className:"flex-1 sm:flex-none",children:[e.jsx(jh,{className:"mr-2 h-4 w-4"}),p?"重启中...":m?"保存并重启":"重启麦麦"]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认重启麦麦?"}),e.jsx(Pt,{children:m?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:m?rn:ln,children:m?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(Vd,{children:[e.jsx(Fr,{className:"h-4 w-4"}),e.jsxs(Gd,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(Ml,{defaultValue:"bot",className:"w-full",children:[e.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:e.jsxs($a,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[e.jsx(bt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),e.jsx(bt,{value:"personality",className:"flex-shrink-0",children:"人格"}),e.jsx(bt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),e.jsx(bt,{value:"expression",className:"flex-shrink-0",children:"表达"}),e.jsx(bt,{value:"features",className:"flex-shrink-0",children:"功能"}),e.jsx(bt,{value:"processing",className:"flex-shrink-0",children:"处理"}),e.jsx(bt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),e.jsx(bt,{value:"voice",className:"flex-shrink-0",children:"语音"}),e.jsx(bt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),e.jsx(bt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),e.jsx(Vt,{value:"bot",className:"space-y-4",children:w&&e.jsx(sM,{config:w,onChange:S})}),e.jsx(Vt,{value:"personality",className:"space-y-4",children:C&&e.jsx(nM,{config:C,onChange:N})}),e.jsx(Vt,{value:"chat",className:"space-y-4",children:T&&e.jsx(aM,{config:T,onChange:P})}),e.jsx(Vt,{value:"expression",className:"space-y-4",children:M&&e.jsx(lM,{config:M,onChange:k})}),e.jsx(Vt,{value:"features",className:"space-y-4",children:D&&E&&Y&&e.jsx(rM,{emojiConfig:D,memoryConfig:E,toolConfig:Y,onEmojiChange:A,onMemoryChange:B,onToolChange:G})}),e.jsx(Vt,{value:"processing",className:"space-y-4",children:O&&ee&&xe&&W&&e.jsx(iM,{keywordReactionConfig:O,responsePostProcessConfig:ee,chineseTypoConfig:xe,responseSplitterConfig:W,onKeywordReactionChange:L,onResponsePostProcessChange:le,onChineseTypoChange:F,onResponseSplitterChange:fe})}),e.jsx(Vt,{value:"mood",className:"space-y-4",children:$&&e.jsx(oM,{config:$,onChange:oe})}),e.jsx(Vt,{value:"voice",className:"space-y-4",children:je&&e.jsx(cM,{config:je,onChange:ae})}),e.jsx(Vt,{value:"lpmm",className:"space-y-4",children:me&&e.jsx(dM,{config:me,onChange:R})}),e.jsxs(Vt,{value:"other",className:"space-y-4",children:[I&&e.jsx(uM,{config:I,onChange:ve}),de&&e.jsx(mM,{config:de,onChange:Ce}),Q&&e.jsx(fM,{config:Q,onChange:Oe}),$e&&e.jsx(hM,{config:$e,onChange:re})]})]}),g&&e.jsx(Bh,{onRestartComplete:Xt,onRestartFailed:Ds})]})})}function sM({config:s,onChange:a}){const l=()=>{a({...s,platforms:[...s.platforms,""]})},i=p=>{a({...s,platforms:s.platforms.filter((v,g)=>g!==p)})},c=(p,v)=>{const g=[...s.platforms];g[p]=v,a({...s,platforms:g})},d=()=>{a({...s,alias_names:[...s.alias_names,""]})},m=p=>{a({...s,alias_names:s.alias_names.filter((v,g)=>g!==p)})},h=(p,v)=>{const g=[...s.alias_names];g[p]=v,a({...s,alias_names:g})};return e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"platform",children:"平台"}),e.jsx(pe,{id:"platform",value:s.platform,onChange:p=>a({...s,platform:p.target.value}),placeholder:"qq"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"qq_account",children:"QQ账号"}),e.jsx(pe,{id:"qq_account",value:s.qq_account,onChange:p=>a({...s,qq_account:p.target.value}),placeholder:"123456789"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"nickname",children:"昵称"}),e.jsx(pe,{id:"nickname",value:s.nickname,onChange:p=>a({...s,nickname:p.target.value}),placeholder:"麦麦"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{children:"其他平台账号"}),e.jsxs(q,{onClick:l,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[s.platforms.map((p,v)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(pe,{value:p,onChange:g=>c(v,g.target.value),placeholder:"wx:114514"}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"icon",variant:"outline",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除平台账号 "',p||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>i(v),children:"删除"})]})]})]})]},v)),s.platforms.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{children:"别名"}),e.jsxs(q,{onClick:d,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加"]})]}),e.jsxs("div",{className:"space-y-2",children:[s.alias_names.map((p,v)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(pe,{value:p,onChange:g=>h(v,g.target.value),placeholder:"小麦"}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"icon",variant:"outline",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除别名 "',p||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>m(v),children:"删除"})]})]})]})]},v)),s.alias_names.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function nM({config:s,onChange:a}){const l=()=>{a({...s,states:[...s.states,""]})},i=d=>{a({...s,states:s.states.filter((m,h)=>h!==d)})},c=(d,m)=>{const h=[...s.states];h[d]=m,a({...s,states:h})};return e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"personality",children:"人格特质"}),e.jsx(Dt,{id:"personality",value:s.personality,onChange:d=>a({...s,personality:d.target.value}),placeholder:"描述人格特质和身份特征建议120字以内",rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内描述人格特质和身份特征"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"reply_style",children:"表达风格"}),e.jsx(Dt,{id:"reply_style",value:s.reply_style,onChange:d=>a({...s,reply_style:d.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"interest",children:"兴趣"}),e.jsx(Dt,{id:"interest",value:s.interest,onChange:d=>a({...s,interest:d.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"plan_style",children:"说话规则与行为风格"}),e.jsx(Dt,{id:"plan_style",value:s.plan_style,onChange:d=>a({...s,plan_style:d.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"visual_style",children:"识图规则"}),e.jsx(Dt,{id:"visual_style",value:s.visual_style,onChange:d=>a({...s,visual_style:d.target.value}),placeholder:"识图时的处理规则",rows:3})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"private_plan_style",children:"私聊规则"}),e.jsx(Dt,{id:"private_plan_style",value:s.private_plan_style,onChange:d=>a({...s,private_plan_style:d.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{children:"状态列表(人格多样性)"}),e.jsxs(q,{onClick:l,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),e.jsx("div",{className:"space-y-2",children:s.states.map((d,m)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Dt,{value:d,onChange:h=>c(m,h.target.value),placeholder:"描述一个人格状态",rows:2}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"icon",variant:"outline",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsx(Pt,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>i(m),children:"删除"})]})]})]})]},m))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"state_probability",children:"状态替换概率"}),e.jsx(pe,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:s.state_probability,onChange:d=>a({...s,state_probability:parseFloat(d.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率0.0-1.0"})]})]})]})})}function aM({config:s,onChange:a}){const l=()=>{a({...s,talk_value_rules:[...s.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},i=h=>{a({...s,talk_value_rules:s.talk_value_rules.filter((p,v)=>v!==h)})},c=(h,p,v)=>{const g=[...s.talk_value_rules];g[h]={...g[h],[p]:v},a({...s,talk_value_rules:g})},d=({value:h,onChange:p})=>{const[v,g]=x.useState("00"),[j,b]=x.useState("00"),[w,S]=x.useState("23"),[C,N]=x.useState("59");x.useEffect(()=>{const P=h.split("-");if(P.length===2){const[M,k]=P,[D,A]=M.split(":"),[E,B]=k.split(":");D&&g(D.padStart(2,"0")),A&&b(A.padStart(2,"0")),E&&S(E.padStart(2,"0")),B&&N(B.padStart(2,"0"))}},[h]);const T=(P,M,k,D)=>{const A=`${P}:${M}-${k}:${D}`;p(A)};return e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[e.jsx(_l,{className:"h-4 w-4 mr-2"}),h||"选择时间段"]})}),e.jsx(pa,{className:"w-80",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-xs",children:"小时"}),e.jsxs(rt,{value:v,onValueChange:P=>{g(P),T(P,j,w,C)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:Array.from({length:24},(P,M)=>M).map(P=>e.jsx(ye,{value:P.toString().padStart(2,"0"),children:P.toString().padStart(2,"0")},P))})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-xs",children:"分钟"}),e.jsxs(rt,{value:j,onValueChange:P=>{b(P),T(v,P,w,C)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:Array.from({length:60},(P,M)=>M).map(P=>e.jsx(ye,{value:P.toString().padStart(2,"0"),children:P.toString().padStart(2,"0")},P))})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-xs",children:"小时"}),e.jsxs(rt,{value:w,onValueChange:P=>{S(P),T(v,j,P,C)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:Array.from({length:24},(P,M)=>M).map(P=>e.jsx(ye,{value:P.toString().padStart(2,"0"),children:P.toString().padStart(2,"0")},P))})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-xs",children:"分钟"}),e.jsxs(rt,{value:C,onValueChange:P=>{N(P),T(v,j,w,P)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:Array.from({length:60},(P,M)=>M).map(P=>e.jsx(ye,{value:P.toString().padStart(2,"0"),children:P.toString().padStart(2,"0")},P))})]})]})]})]})]})})]})},m=({rule:h})=>{const p=`{ target = "${h.target}", time = "${h.time}", value = ${h.value.toFixed(1)} }`;return e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",children:[e.jsx(Mn,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(pa,{className:"w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:p}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),e.jsx(pe,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:s.talk_value,onChange:h=>a({...s,talk_value:parseFloat(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),e.jsx(pe,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:s.mentioned_bot_reply,onChange:h=>a({...s,mentioned_bot_reply:parseFloat(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅1 为 100% 回复"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"max_context_size",children:"上下文长度"}),e.jsx(pe,{id:"max_context_size",type:"number",min:"1",value:s.max_context_size,onChange:h=>a({...s,max_context_size:parseInt(h.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"planner_smooth",children:"规划器平滑"}),e.jsx(pe,{id:"planner_smooth",type:"number",step:"1",min:"0",value:s.planner_smooth,onChange:h=>a({...s,planner_smooth:parseFloat(h.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-50 为关闭"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"enable_talk_value_rules",checked:s.enable_talk_value_rules,onCheckedChange:h=>a({...s,enable_talk_value_rules:h})}),e.jsx(U,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"include_planner_reasoning",checked:s.include_planner_reasoning,onCheckedChange:h=>a({...s,include_planner_reasoning:h})}),e.jsx(U,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),s.enable_talk_value_rules&&e.jsxs("div",{className:"border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率优先匹配具体聊天再匹配全局规则"})]}),e.jsxs(q,{onClick:l,size:"sm",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),s.talk_value_rules&&s.talk_value_rules.length>0?e.jsx("div",{className:"space-y-4",children:s.talk_value_rules.map((h,p)=>e.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",p+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{rule:h}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{variant:"ghost",size:"sm",children:e.jsx(ft,{className:"h-4 w-4 text-destructive"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:["确定要删除规则 #",p+1," 吗?此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>i(p),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(rt,{value:h.target===""?"global":"specific",onValueChange:v=>{v==="global"?c(p,"target",""):c(p,"target","qq::group")},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"global",children:"全局配置"}),e.jsx(ye,{value:"specific",children:"详细配置"})]})]})]}),h.target!==""&&(()=>{const v=h.target.split(":"),g=v[0]||"qq",j=v[1]||"",b=v[2]||"group";return e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"平台"}),e.jsxs(rt,{value:g,onValueChange:w=>{c(p,"target",`${w}:${j}:${b}`)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"qq",children:"QQ"}),e.jsx(ye,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(pe,{value:j,onChange:w=>{c(p,"target",`${g}:${w.target.value}:${b}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"类型"}),e.jsxs(rt,{value:b,onValueChange:w=>{c(p,"target",`${g}:${j}:${w}`)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"group",children:"群组group"}),e.jsx(ye,{value:"private",children:"私聊private"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID",h.target||"(未设置)"]})]})})(),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"时间段 (Time)"}),e.jsx(d,{value:h.time,onChange:v=>c(p,"time",v)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{htmlFor:`rule-value-${p}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),e.jsx(pe,{id:`rule-value-${p}`,type:"number",step:"0.01",min:"0",max:"1",value:h.value,onChange:v=>{const g=parseFloat(v.target.value);isNaN(g)||c(p,"value",Math.max(0,Math.min(1,g)))},className:"w-20 h-8 text-xs"})]}),e.jsx(Yd,{value:[h.value],onValueChange:v=>c(p,"value",v[0]),min:0,max:1,step:.01,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0 (完全沉默)"}),e.jsx("span",{children:"0.5"}),e.jsx("span",{children:"1.0 (正常)"})]})]})]})]},p))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),e.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:[e.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),e.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"Target 指定"}),"仅对特定聊天流生效格式platform:id:type"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),e.jsxs("li",{children:["• ",e.jsx("strong",{children:"数值范围"}),":建议 0-10 表示完全沉默1 表示正常发言"]})]})]})]})]})}function lM({config:s,onChange:a}){const l=()=>{a({...s,learning_list:[...s.learning_list,["","enable","enable","1.0"]]})},i=b=>{a({...s,learning_list:s.learning_list.filter((w,S)=>S!==b)})},c=(b,w,S)=>{const C=[...s.learning_list];C[b][w]=S,a({...s,learning_list:C})},d=({rule:b})=>{const w=`["${b[0]}", "${b[1]}", "${b[2]}", "${b[3]}"]`;return e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",children:[e.jsx(Mn,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(pa,{className:"w-96",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:w}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},m=({member:b,groupIndex:w,memberIndex:S,availableChatIds:C})=>{const N=C.includes(b)||b==="*",[T,P]=x.useState(!N);return e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 flex gap-2",children:T?e.jsxs(e.Fragment,{children:[e.jsx(pe,{value:b,onChange:M=>j(w,S,M.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),C.length>0&&e.jsx(q,{size:"sm",variant:"outline",onClick:()=>P(!1),title:"切换到下拉选择",children:"下拉"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rt,{value:b,onValueChange:M=>j(w,S,M),children:[e.jsx(at,{className:"flex-1",children:e.jsx(it,{placeholder:"选择聊天流"})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"*",children:"* (全局共享)"}),C.map((M,k)=>e.jsx(ye,{value:M,children:M},k))]})]}),e.jsx(q,{size:"sm",variant:"outline",onClick:()=>P(!0),title:"切换到手动输入",children:"输入"})]})}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"icon",variant:"outline",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除组成员 "',b||"(空)",'" 吗?此操作无法撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>g(w,S),children:"删除"})]})]})]})]})},h=()=>{a({...s,expression_groups:[...s.expression_groups,[]]})},p=b=>{a({...s,expression_groups:s.expression_groups.filter((w,S)=>S!==b)})},v=b=>{const w=[...s.expression_groups];w[b]=[...w[b],""],a({...s,expression_groups:w})},g=(b,w)=>{const S=[...s.expression_groups];S[b]=S[b].filter((C,N)=>N!==w),a({...s,expression_groups:S})},j=(b,w,S)=>{const C=[...s.expression_groups];C[b][w]=S,a({...s,expression_groups:C})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),e.jsxs(q,{onClick:l,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.jsxs("div",{className:"space-y-4",children:[s.learning_list.map((b,w)=>{const S=s.learning_list.some((k,D)=>D!==w&&k[0]===""),C=b[0]==="",N=b[0].split(":"),T=N[0]||"qq",P=N[1]||"",M=N[2]||"group";return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["规则 ",w+1," ",C&&"(全局配置)"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{rule:b}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"sm",variant:"ghost",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:["确定要删除学习规则 ",w+1," 吗?此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>i(w),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"配置类型"}),e.jsxs(rt,{value:C?"global":"specific",onValueChange:k=>{k==="global"?c(w,0,""):c(w,0,"qq::group")},disabled:S&&!C,children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"global",children:"全局配置"}),e.jsx(ye,{value:"specific",disabled:S&&!C,children:"详细配置"})]})]}),S&&!C&&e.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!C&&e.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"平台"}),e.jsxs(rt,{value:T,onValueChange:k=>{c(w,0,`${k}:${P}:${M}`)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"qq",children:"QQ"}),e.jsx(ye,{value:"wx",children:"微信"})]})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"群 ID"}),e.jsx(pe,{value:P,onChange:k=>{c(w,0,`${T}:${k.target.value}:${M}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"类型"}),e.jsxs(rt,{value:M,onValueChange:k=>{c(w,0,`${T}:${P}:${k}`)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"group",children:"群组group"}),e.jsx(ye,{value:"private",children:"私聊private"})]})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID",b[0]||"(未设置)"]})]}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-xs font-medium",children:"使用学到的表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),e.jsx(Ze,{checked:b[1]==="enable",onCheckedChange:k=>c(w,1,k?"enable":"disable")})]})}),e.jsx("div",{className:"grid gap-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-xs font-medium",children:"学习表达"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),e.jsx(Ze,{checked:b[2]==="enable",onCheckedChange:k=>c(w,2,k?"enable":"disable")})]})}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{className:"text-xs font-medium",children:"学习强度"}),e.jsx(pe,{type:"number",step:"0.1",min:"0",max:"5",value:b[3],onChange:k=>{const D=parseFloat(k.target.value);isNaN(D)||c(w,3,Math.max(0,Math.min(5,D)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),e.jsx(Yd,{value:[parseFloat(b[3])||1],onValueChange:k=>c(w,3,k[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"0 (不学习)"}),e.jsx("span",{children:"2.5"}),e.jsx("span",{children:"5.0 (快速学习)"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},w)}),s.learning_list.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),e.jsxs(q,{onClick:h,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),e.jsxs("div",{className:"space-y-4",children:[s.expression_groups.map((b,w)=>{const S=s.learning_list.map(C=>C[0]).filter(C=>C!=="");return e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",w+1,b.length===1&&b[0]==="*"&&"(全局共享)"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(q,{onClick:()=>v(w),size:"sm",variant:"outline",children:e.jsx(ys,{className:"h-4 w-4"})}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"sm",variant:"ghost",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:["确定要删除共享组 ",w+1," 吗?此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>p(w),children:"删除"})]})]})]})]})]}),e.jsx("div",{className:"space-y-2",children:b.map((C,N)=>e.jsx(m,{member:C,groupIndex:w,memberIndex:N,availableChatIds:S},N))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},w)}),s.expression_groups.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function rM({emojiConfig:s,memoryConfig:a,toolConfig:l,onEmojiChange:i,onMemoryChange:c,onToolChange:d}){return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"enable_tool",checked:l.enable_tool,onCheckedChange:m=>d({...l,enable_tool:m})}),e.jsx(U,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),e.jsx(pe,{id:"max_agent_iterations",type:"number",min:"1",value:a.max_agent_iterations,onChange:m=>c({...a,max_agent_iterations:parseInt(m.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1不深入思考"})]})]})}),e.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"emoji_chance",children:"表情包激活概率"}),e.jsx(pe,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:s.emoji_chance,onChange:m=>i({...s,emoji_chance:parseFloat(m.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1越大越容易发送表情包"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"max_reg_num",children:"最大注册数量"}),e.jsx(pe,{id:"max_reg_num",type:"number",min:"1",value:s.max_reg_num,onChange:m=>i({...s,max_reg_num:parseInt(m.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),e.jsx(pe,{id:"check_interval",type:"number",min:"1",value:s.check_interval,onChange:m=>i({...s,check_interval:parseInt(m.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"do_replace",checked:s.do_replace,onCheckedChange:m=>i({...s,do_replace:m})}),e.jsx(U,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"steal_emoji",checked:s.steal_emoji,onCheckedChange:m=>i({...s,steal_emoji:m})}),e.jsx(U,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"content_filtration",checked:s.content_filtration,onCheckedChange:m=>i({...s,content_filtration:m})}),e.jsx(U,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),s.content_filtration&&e.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[e.jsx(U,{htmlFor:"filtration_prompt",children:"过滤要求"}),e.jsx(pe,{id:"filtration_prompt",value:s.filtration_prompt,onChange:m=>i({...s,filtration_prompt:m.target.value}),placeholder:"符合公序良俗"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function iM({keywordReactionConfig:s,responsePostProcessConfig:a,chineseTypoConfig:l,responseSplitterConfig:i,onKeywordReactionChange:c,onResponsePostProcessChange:d,onChineseTypoChange:m,onResponseSplitterChange:h}){const p=()=>{c({...s,regex_rules:[...s.regex_rules,{regex:[""],reaction:""}]})},v=k=>{c({...s,regex_rules:s.regex_rules.filter((D,A)=>A!==k)})},g=(k,D,A)=>{const E=[...s.regex_rules];D==="regex"&&typeof A=="string"?E[k]={...E[k],regex:[A]}:D==="reaction"&&typeof A=="string"&&(E[k]={...E[k],reaction:A}),c({...s,regex_rules:E})},j=({regex:k,reaction:D,onRegexChange:A,onReactionChange:E})=>{const[B,Y]=x.useState(!1),[G,$]=x.useState(""),[oe,je]=x.useState(null),[ae,me]=x.useState(""),[R,O]=x.useState({}),[L,ee]=x.useState(""),le=x.useRef(null),[xe,F]=x.useState("build"),W=de=>de.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),fe=(de,Ce=0)=>{const Q=le.current;if(!Q)return;const Oe=Q.selectionStart||0,$e=Q.selectionEnd||0,re=k.substring(0,Oe)+de+k.substring($e);A(re),setTimeout(()=>{const Pe=Oe+de.length+Ce;Q.setSelectionRange(Pe,Pe),Q.focus()},0)};x.useEffect(()=>{if(!k||!G){je(null),O({}),ee(D),me("");return}try{const de=W(k),Ce=new RegExp(de,"g"),Q=G.match(Ce);je(Q),me("");const $e=new RegExp(de).exec(G);if($e&&$e.groups){O($e.groups);let re=D;Object.entries($e.groups).forEach(([Pe,ze])=>{re=re.replace(new RegExp(`\\[${Pe}\\]`,"g"),ze||"")}),ee(re)}else O({}),ee(D)}catch(de){me(de.message),je(null),O({}),ee(D)}},[k,G,D]);const I=()=>{if(!G||!oe||oe.length===0)return e.jsx("span",{className:"text-muted-foreground",children:G||"请输入测试文本"});try{const de=W(k),Ce=new RegExp(de,"g");let Q=0;const Oe=[];let $e;for(;($e=Ce.exec(G))!==null;)$e.index>Q&&Oe.push(e.jsx("span",{children:G.substring(Q,$e.index)},`text-${Q}`)),Oe.push(e.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:$e[0]},`match-${$e.index}`)),Q=$e.index+$e[0].length;return Q<G.length&&Oe.push(e.jsx("span",{children:G.substring(Q)},`text-${Q}`)),e.jsx(e.Fragment,{children:Oe})}catch{return e.jsx("span",{children:G})}},ve=[{category:"基础匹配",items:[{label:"任意字符",pattern:".",desc:"匹配除换行符外的任意字符"},{label:"数字",pattern:"\\d",desc:"匹配 0-9"},{label:"非数字",pattern:"\\D",desc:"匹配非数字字符"},{label:"字母数字",pattern:"\\w",desc:"匹配字母、数字、下划线"},{label:"非字母数字",pattern:"\\W",desc:"匹配非字母数字字符"},{label:"空白符",pattern:"\\s",desc:"匹配空格、制表符等"},{label:"非空白符",pattern:"\\S",desc:"匹配非空白字符"}]},{category:"位置锚点",items:[{label:"行首",pattern:"^",desc:"匹配行的开始"},{label:"行尾",pattern:"$",desc:"匹配行的结束"},{label:"单词边界",pattern:"\\b",desc:"匹配单词边界"}]},{category:"重复次数",items:[{label:"0或多次",pattern:"*",desc:"匹配前面的元素0次或多次"},{label:"1或多次",pattern:"+",desc:"匹配前面的元素1次或多次"},{label:"0或1次",pattern:"?",desc:"匹配前面的元素0次或1次"},{label:"指定次数",pattern:"{n}",desc:"匹配n次将n替换为数字"},{label:"次数范围",pattern:"{m,n}",desc:"匹配m到n次"}]},{category:"分组和捕获",items:[{label:"普通分组",pattern:"()",desc:"分组但不捕获",moveCursor:-1},{label:"命名捕获",pattern:"(?P<name>)",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<word>\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P<sentence>.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P<num>\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return e.jsxs(bs,{open:B,onOpenChange:Y,children:[e.jsx(x0,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",children:[e.jsx(hd,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),e.jsxs(ms,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"正则表达式编辑器"}),e.jsx(ks,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),e.jsx(Ct,{className:"max-h-[calc(90vh-120px)]",children:e.jsxs(Ml,{value:xe,onValueChange:de=>F(de),className:"w-full",children:[e.jsxs($a,{className:"grid w-full grid-cols-2",children:[e.jsx(bt,{value:"build",children:"🔧 构建器"}),e.jsx(bt,{value:"test",children:"🧪 测试器"})]}),e.jsxs(Vt,{value:"build",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{className:"text-sm font-medium",children:"正则表达式"}),e.jsx(pe,{ref:le,value:k,onChange:de=>A(de.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{className:"text-sm font-medium",children:"Reaction 内容"}),e.jsx(Dt,{value:D,onChange:de=>E(de.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ve.map(de=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:de.category}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:de.items.map(Ce=>e.jsx(q,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>fe(Ce.pattern,Ce.moveCursor||0),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("span",{className:"text-xs font-medium",children:Ce.label}),e.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:Ce.pattern})]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:Ce.desc})]})},Ce.label))})]},de.category)),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(q,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>A("^(?P<n>\\S{1,20})是这样的$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P<n>\\S","{1,20}",")是这样的$"]}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),e.jsx(q,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>A("(?:[^,。.\\s]+\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,]?$"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,]?$"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),e.jsx(q,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>A("(?P<subject>.+?)(?:是|为什么|怎么)"),children:e.jsxs("div",{className:"flex flex-col items-start w-full",children:[e.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P<subject>.+?)(?:是|为什么|怎么)"}),e.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),e.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:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),e.jsxs("li",{children:["命名捕获组格式:",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),e.jsxs("li",{children:["在 reaction 中使用 ",e.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),e.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),e.jsxs(Vt,{value:"test",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{className:"text-sm font-medium",children:"当前正则表达式"}),e.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:k||"(未设置)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),e.jsx(Dt,{id:"test-text",value:G,onChange:de=>$(de.target.value),placeholder:`在此输入要测试的文本...
例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),ae&&e.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[e.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),e.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:ae})]}),!ae&&G&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:oe&&oe.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),e.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",oe.length," 处)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{className:"text-sm font-medium",children:"匹配高亮"}),e.jsx(Ct,{className:"h-40 rounded-md bg-muted p-3",children:e.jsx("div",{className:"text-sm break-words",children:I()})})]}),Object.keys(R).length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{className:"text-sm font-medium",children:"命名捕获组"}),e.jsx(Ct,{className:"h-32 rounded-md border p-3",children:e.jsx("div",{className:"space-y-2",children:Object.entries(R).map(([de,Ce])=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",de,"]"]}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:Ce})]},de))})})]}),Object.keys(R).length>0&&D&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{className:"text-sm font-medium",children:"Reaction 替换预览"}),e.jsx(Ct,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:e.jsx("div",{className:"text-sm break-words",children:L})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),e.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:[e.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),e.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),e.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),e.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),e.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},b=()=>{c({...s,keyword_rules:[...s.keyword_rules,{keywords:[],reaction:""}]})},w=k=>{c({...s,keyword_rules:s.keyword_rules.filter((D,A)=>A!==k)})},S=(k,D,A)=>{const E=[...s.keyword_rules];typeof A=="string"&&(E[k]={...E[k],reaction:A}),c({...s,keyword_rules:E})},C=k=>{const D=[...s.keyword_rules];D[k]={...D[k],keywords:[...D[k].keywords||[],""]},c({...s,keyword_rules:D})},N=(k,D)=>{const A=[...s.keyword_rules];A[k]={...A[k],keywords:(A[k].keywords||[]).filter((E,B)=>B!==D)},c({...s,keyword_rules:A})},T=(k,D,A)=>{const E=[...s.keyword_rules],B=[...E[k].keywords||[]];B[D]=A,E[k]={...E[k],keywords:B},c({...s,keyword_rules:E})},P=({rule:k})=>{const D=`{ regex = [${(k.regex||[]).map(A=>`"${A}"`).join(", ")}], reaction = "${k.reaction}" }`;return e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",children:[e.jsx(Mn,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(pa,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(Ct,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs break-all",children:D})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},M=({rule:k})=>{const D=`[[keyword_reaction.keyword_rules]]
keywords = [${(k.keywords||[]).map(A=>`"${A}"`).join(", ")}]
reaction = "${k.reaction}"`;return e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",children:[e.jsx(Mn,{className:"h-4 w-4 mr-1"}),"预览"]})}),e.jsx(pa,{className:"w-[95vw] sm:w-[500px]",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),e.jsx(Ct,{className:"h-60 rounded-md bg-muted p-3",children:e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:D})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),e.jsxs(q,{onClick:p,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[s.regex_rules.map((k,D)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",D+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{regex:k.regex&&k.regex[0]||"",reaction:k.reaction,onRegexChange:A=>g(D,"regex",A),onReactionChange:A=>g(D,"reaction",A)}),e.jsx(P,{rule:k}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"sm",variant:"ghost",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:["确定要删除正则规则 ",D+1," 吗?此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>v(D),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"正则表达式Python 语法)"}),e.jsx(pe,{value:k.regex&&k.regex[0]||"",onChange:A=>g(D,"regex",A.target.value),placeholder:"例如:^(?P<n>\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?P<name>pattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Dt,{value:k.reaction,onChange:A=>g(D,"reaction",A.target.value),placeholder:`触发后麦麦的反应...
可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},D)),s.regex_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),e.jsxs("div",{className:"space-y-4 border-t pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),e.jsxs(q,{onClick:b,size:"sm",variant:"outline",children:[e.jsx(ys,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),e.jsxs("div",{className:"space-y-3",children:[s.keyword_rules.map((k,D)=>e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",D+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{rule:k}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsx(q,{size:"sm",variant:"ghost",children:e.jsx(ft,{className:"h-4 w-4"})})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:["确定要删除关键词规则 ",D+1," 吗?此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>w(D),children:"删除"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{className:"text-xs font-medium",children:"关键词列表"}),e.jsxs(q,{onClick:()=>C(D),size:"sm",variant:"ghost",children:[e.jsx(ys,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),e.jsxs("div",{className:"space-y-2",children:[(k.keywords||[]).map((A,E)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{value:A,onChange:B=>T(D,E,B.target.value),placeholder:"关键词",className:"flex-1"}),e.jsx(q,{onClick:()=>N(D,E),size:"sm",variant:"ghost",children:e.jsx(ft,{className:"h-4 w-4"})})]},E)),(!k.keywords||k.keywords.length===0)&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{className:"text-xs font-medium",children:"反应内容"}),e.jsx(Dt,{value:k.reaction,onChange:A=>S(D,"reaction",A.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},D)),s.keyword_rules.length===0&&e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"enable_response_post_process",checked:a.enable_response_post_process,onCheckedChange:k=>d({...a,enable_response_post_process:k})}),e.jsx(U,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),a.enable_response_post_process&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(Ze,{id:"enable_chinese_typo",checked:l.enable,onCheckedChange:k=>m({...l,enable:k})}),e.jsx(U,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),l.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),e.jsx(pe,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:l.error_rate,onChange:k=>m({...l,error_rate:parseFloat(k.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),e.jsx(pe,{id:"min_freq",type:"number",min:"0",value:l.min_freq,onChange:k=>m({...l,min_freq:parseInt(k.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),e.jsx(pe,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:l.tone_error_rate,onChange:k=>m({...l,tone_error_rate:parseFloat(k.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),e.jsx(pe,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:l.word_replace_rate,onChange:k=>m({...l,word_replace_rate:parseFloat(k.target.value)})})]})]})]})}),e.jsx("div",{className:"border-t pt-6 space-y-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(Ze,{id:"enable_response_splitter",checked:i.enable,onCheckedChange:k=>h({...i,enable:k})}),e.jsx(U,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),i.enable&&e.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),e.jsx(pe,{id:"max_length",type:"number",min:"1",value:i.max_length,onChange:k=>h({...i,max_length:parseInt(k.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),e.jsx(pe,{id:"max_sentence_num",type:"number",min:"1",value:i.max_sentence_num,onChange:k=>h({...i,max_sentence_num:parseInt(k.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"enable_kaomoji_protection",checked:i.enable_kaomoji_protection,onCheckedChange:k=>h({...i,enable_kaomoji_protection:k})}),e.jsx(U,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"enable_overflow_return_all",checked:i.enable_overflow_return_all,onCheckedChange:k=>h({...i,enable_overflow_return_all:k})}),e.jsx(U,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function oM({config:s,onChange:a}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{checked:s.enable_mood,onCheckedChange:l=>a({...s,enable_mood:l})}),e.jsx(U,{className:"cursor-pointer",children:"启用情绪系统"})]}),s.enable_mood&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"情绪更新阈值"}),e.jsx(pe,{type:"number",min:"1",value:s.mood_update_threshold,onChange:l=>a({...s,mood_update_threshold:parseInt(l.target.value)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"情感特征"}),e.jsx(Dt,{value:s.emotion_style,onChange:l=>a({...s,emotion_style:l.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function cM({config:s,onChange:a}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{checked:s.enable_asr,onCheckedChange:l=>a({...s,enable_asr:l})}),e.jsx(U,{className:"cursor-pointer",children:"启用语音识别"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function dM({config:s,onChange:a}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{checked:s.enable,onCheckedChange:l=>a({...s,enable:l})}),e.jsx(U,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),s.enable&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"LPMM 模式"}),e.jsxs(rt,{value:s.lpmm_mode,onValueChange:l=>a({...s,lpmm_mode:l}),children:[e.jsx(at,{children:e.jsx(it,{placeholder:"选择 LPMM 模式"})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"classic",children:"经典模式"}),e.jsx(ye,{value:"agent",children:"Agent 模式"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"同义词搜索 TopK"}),e.jsx(pe,{type:"number",min:"1",value:s.rag_synonym_search_top_k,onChange:l=>a({...s,rag_synonym_search_top_k:parseInt(l.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"同义词阈值"}),e.jsx(pe,{type:"number",step:"0.1",min:"0",max:"1",value:s.rag_synonym_threshold,onChange:l=>a({...s,rag_synonym_threshold:parseFloat(l.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"实体提取线程数"}),e.jsx(pe,{type:"number",min:"1",value:s.info_extraction_workers,onChange:l=>a({...s,info_extraction_workers:parseInt(l.target.value)})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"嵌入向量维度"}),e.jsx(pe,{type:"number",min:"1",value:s.embedding_dimension,onChange:l=>a({...s,embedding_dimension:parseInt(l.target.value)})})]})]})]})]})]})}function uM({config:s,onChange:a}){const[l,i]=x.useState(""),[c,d]=x.useState("WARNING"),m=()=>{l&&!s.suppress_libraries.includes(l)&&(a({...s,suppress_libraries:[...s.suppress_libraries,l]}),i(""))},h=w=>{a({...s,suppress_libraries:s.suppress_libraries.filter(S=>S!==w)})},p=()=>{l&&!s.library_log_levels[l]&&(a({...s,library_log_levels:{...s.library_log_levels,[l]:c}}),i(""),d("WARNING"))},v=w=>{const S={...s.library_log_levels};delete S[w],a({...s,library_log_levels:S})},g=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],j=["FULL","compact","lite"],b=["none","title","full"];return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"日期格式"}),e.jsx(pe,{value:s.date_style,onChange:w=>a({...s,date_style:w.target.value}),placeholder:"例如: m-d H:i:s"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"日志级别样式"}),e.jsxs(rt,{value:s.log_level_style,onValueChange:w=>a({...s,log_level_style:w}),children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:j.map(w=>e.jsx(ye,{value:w,children:w},w))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"日志文本颜色"}),e.jsxs(rt,{value:s.color_text,onValueChange:w=>a({...s,color_text:w}),children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:b.map(w=>e.jsx(ye,{value:w,children:w},w))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"全局日志级别"}),e.jsxs(rt,{value:s.log_level,onValueChange:w=>a({...s,log_level:w}),children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:g.map(w=>e.jsx(ye,{value:w,children:w},w))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"控制台日志级别"}),e.jsxs(rt,{value:s.console_log_level,onValueChange:w=>a({...s,console_log_level:w}),children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:g.map(w=>e.jsx(ye,{value:w,children:w},w))})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"文件日志级别"}),e.jsxs(rt,{value:s.file_log_level,onValueChange:w=>a({...s,file_log_level:w}),children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsx(lt,{children:g.map(w=>e.jsx(ye,{value:w,children:w},w))})]})]})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"mb-2 block",children:"完全屏蔽的库"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(pe,{value:l,onChange:w=>i(w.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),m())}}),e.jsx(q,{onClick:m,size:"sm",className:"flex-shrink-0",children:e.jsx(ys,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.suppress_libraries.map(w=>e.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[e.jsx("span",{className:"text-sm",children:w}),e.jsx(q,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>h(w),children:e.jsx(ft,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},w))})]}),e.jsxs("div",{children:[e.jsx(U,{className:"mb-2 block",children:"特定库的日志级别"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(pe,{value:l,onChange:w=>i(w.target.value),placeholder:"输入库名",className:"flex-1"}),e.jsxs(rt,{value:c,onValueChange:d,children:[e.jsx(at,{className:"w-32",children:e.jsx(it,{})}),e.jsx(lt,{children:g.map(w=>e.jsx(ye,{value:w,children:w},w))})]}),e.jsx(q,{onClick:p,size:"sm",children:e.jsx(ys,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(s.library_log_levels).map(([w,S])=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-medium",children:w}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:S}),e.jsx(q,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>v(w),children:e.jsx(ft,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},w))})]})]})}function mM({config:s,onChange:a}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(U,{children:"显示 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),e.jsx(Ze,{checked:s.show_prompt,onCheckedChange:l=>a({...s,show_prompt:l})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(U,{children:"显示回复器 Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),e.jsx(Ze,{checked:s.show_replyer_prompt,onCheckedChange:l=>a({...s,show_replyer_prompt:l})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(U,{children:"显示回复器推理"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),e.jsx(Ze,{checked:s.show_replyer_reasoning,onCheckedChange:l=>a({...s,show_replyer_reasoning:l})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(U,{children:"显示 Jargon Prompt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),e.jsx(Ze,{checked:s.show_jargon_prompt,onCheckedChange:l=>a({...s,show_jargon_prompt:l})})]})]})]})}function fM({config:s,onChange:a}){const[l,i]=x.useState(""),c=()=>{l&&!s.auth_token.includes(l)&&(a({...s,auth_token:[...s.auth_token,l]}),i(""))},d=m=>{a({...s,auth_token:s.auth_token.filter((h,p)=>p!==m)})};return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(U,{children:"启用自定义服务器"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),e.jsx(Ze,{checked:s.use_custom,onCheckedChange:m=>a({...s,use_custom:m})})]}),s.use_custom&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"主机地址"}),e.jsx(pe,{value:s.host,onChange:m=>a({...s,host:m.target.value}),placeholder:"127.0.0.1"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"端口号"}),e.jsx(pe,{type:"number",value:s.port,onChange:m=>a({...s,port:parseInt(m.target.value)}),placeholder:"8090"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"连接模式"}),e.jsxs(rt,{value:s.mode,onValueChange:m=>a({...s,mode:m}),children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"ws",children:"WebSocket (ws)"}),e.jsx(ye,{value:"tcp",children:"TCP"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{checked:s.use_wss,onCheckedChange:m=>a({...s,use_wss:m}),disabled:s.mode!=="ws"}),e.jsx(U,{children:"使用 WSS 安全连接"})]})]}),s.use_wss&&s.mode==="ws"&&e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"SSL 证书文件路径"}),e.jsx(pe,{value:s.cert_file,onChange:m=>a({...s,cert_file:m.target.value}),placeholder:"cert.pem"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"SSL 密钥文件路径"}),e.jsx(pe,{value:s.key_file,onChange:m=>a({...s,key_file:m.target.value}),placeholder:"key.pem"})]})]})]})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"mb-2 block",children:"认证令牌"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(pe,{value:l,onChange:m=>i(m.target.value),placeholder:"输入认证令牌",onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),c())}}),e.jsx(q,{onClick:c,size:"sm",children:e.jsx(ys,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),e.jsx("div",{className:"space-y-2",children:s.auth_token.map((m,h)=>e.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[e.jsx("span",{className:"text-sm font-mono",children:m}),e.jsx(q,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>d(h),children:e.jsx(ft,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},h))})]})]})}function hM({config:s,onChange:a}){return e.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(U,{children:"启用统计信息发送"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),e.jsx(Ze,{checked:s.enable,onCheckedChange:l=>a({...s,enable:l})})]})]})}const Rl=x.forwardRef(({className:s,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:Z("w-full caption-bottom text-sm",s),...a})}));Rl.displayName="Table";const zl=x.forwardRef(({className:s,...a},l)=>e.jsx("thead",{ref:l,className:Z("[&_tr]:border-b",s),...a}));zl.displayName="TableHeader";const Pl=x.forwardRef(({className:s,...a},l)=>e.jsx("tbody",{ref:l,className:Z("[&_tr:last-child]:border-0",s),...a}));Pl.displayName="TableBody";const xM=x.forwardRef(({className:s,...a},l)=>e.jsx("tfoot",{ref:l,className:Z("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));xM.displayName="TableFooter";const ns=x.forwardRef(({className:s,...a},l)=>e.jsx("tr",{ref:l,className:Z("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a}));ns.displayName="TableRow";const He=x.forwardRef(({className:s,...a},l)=>e.jsx("th",{ref:l,className:Z("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a}));He.displayName="TableHead";const Ae=x.forwardRef(({className:s,...a},l)=>e.jsx("td",{ref:l,className:Z("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a}));Ae.displayName="TableCell";const pM=x.forwardRef(({className:s,...a},l)=>e.jsx("caption",{ref:l,className:Z("mt-4 text-sm text-muted-foreground",s),...a}));pM.displayName="TableCaption";const Cs=x.forwardRef(({className:s,...a},l)=>e.jsx(_y,{ref:l,className:Z("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...a,children:e.jsx(N2,{className:Z("grid place-content-center text-current"),children:e.jsx(Cl,{className:"h-4 w-4"})})}));Cs.displayName=_y.displayName;function gM(){const[s,a]=x.useState([]),[l,i]=x.useState(!0),[c,d]=x.useState(!1),[m,h]=x.useState(!1),[p,v]=x.useState(!1),[g,j]=x.useState(!1),[b,w]=x.useState(!1),[S,C]=x.useState(!1),[N,T]=x.useState(null),[P,M]=x.useState(null),[k,D]=x.useState(!1),[A,E]=x.useState(null),[B,Y]=x.useState(!1),[G,$]=x.useState(""),[oe,je]=x.useState(new Set),[ae,me]=x.useState(!1),[R,O]=x.useState(1),[L,ee]=x.useState(20),[le,xe]=x.useState(""),{toast:F}=Es(),W=x.useRef(null),fe=x.useRef(!0);x.useEffect(()=>{I()},[]);const I=async()=>{try{i(!0);const he=await Ur();a(he.api_providers||[]),v(!1),fe.current=!1}catch(he){console.error("加载配置失败:",he)}finally{i(!1)}},ve=async()=>{try{j(!0),Lh().catch(()=>{}),w(!0)}catch(he){console.error("重启失败:",he),w(!1),F({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),j(!1)}},de=async()=>{try{d(!0),W.current&&clearTimeout(W.current);const he=await Ur();he.api_providers=s,await Nd(he),v(!1),F({title:"保存成功",description:"正在重启麦麦..."}),await ve()}catch(he){console.error("保存配置失败:",he),F({title:"保存失败",description:he.message,variant:"destructive"}),d(!1)}},Ce=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Q=()=>{w(!1),j(!1),F({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Oe=x.useCallback(async he=>{if(!fe.current)try{h(!0),await Xf("api_providers",he),v(!1)}catch(Ee){console.error("自动保存失败:",Ee),v(!0)}finally{h(!1)}},[]);x.useEffect(()=>{if(!fe.current)return v(!0),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{Oe(s)},2e3),()=>{W.current&&clearTimeout(W.current)}},[s,Oe]);const $e=async()=>{try{d(!0),W.current&&clearTimeout(W.current);const he=await Ur();he.api_providers=s,await Nd(he),v(!1),F({title:"保存成功",description:"模型提供商配置已保存"})}catch(he){console.error("保存配置失败:",he),F({title:"保存失败",description:he.message,variant:"destructive"})}finally{d(!1)}},re=(he,Ee)=>{T(he||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),M(Ee),Y(!1),C(!0)},Pe=async()=>{if(N?.api_key)try{await navigator.clipboard.writeText(N.api_key),F({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{F({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},ze=()=>{if(!N)return;const he={...N,max_retry:N.max_retry??2,timeout:N.timeout??30,retry_interval:N.retry_interval??10};if(P!==null){const Ee=[...s];Ee[P]=he,a(Ee)}else a([...s,he]);C(!1),T(null),M(null)},Zt=he=>{if(!he&&N){const Ee={...N,max_retry:N.max_retry??2,timeout:N.timeout??30,retry_interval:N.retry_interval??10};T(Ee)}C(he)},Rs=he=>{E(he),D(!0)},An=()=>{if(A!==null){const he=s.filter((Ee,Ve)=>Ve!==A);a(he),F({title:"删除成功",description:"提供商已从列表中移除"})}D(!1),E(null)},Le=he=>{const Ee=new Set(oe);Ee.has(he)?Ee.delete(he):Ee.add(he),je(Ee)},Nn=()=>{if(oe.size===Xt.length)je(new Set);else{const he=Xt.map((Ee,Ve)=>s.findIndex(Os=>Os===Xt[Ve]));je(new Set(he))}},ln=()=>{if(oe.size===0){F({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}me(!0)},rn=()=>{const he=s.filter((Ee,Ve)=>!oe.has(Ve));a(he),je(new Set),me(!1),F({title:"批量删除成功",description:`已删除 ${oe.size} 个提供商`})},Xt=s.filter(he=>{if(!G)return!0;const Ee=G.toLowerCase();return he.name.toLowerCase().includes(Ee)||he.base_url.toLowerCase().includes(Ee)||he.client_type.toLowerCase().includes(Ee)}),Ds=Math.ceil(Xt.length/L),ke=Xt.slice((R-1)*L,R*L),is=()=>{const he=parseInt(le);he>=1&&he<=Ds&&(O(he),xe(""))};return l?e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[oe.size>0&&e.jsxs(q,{onClick:ln,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ft,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",oe.size,")"]}),e.jsxs(q,{onClick:()=>re(null,null),size:"sm",className:"w-full sm:w-auto",children:[e.jsx(ys,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),e.jsxs(q,{onClick:$e,disabled:c||m||!p||g,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(vh,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),c?"保存中...":m?"自动保存中...":p?"保存配置":"已保存"]}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs(q,{disabled:c||m||g,size:"sm",className:"w-full sm:w-auto",children:[e.jsx(jh,{className:"mr-2 h-4 w-4"}),g?"重启中...":p?"保存并重启":"重启麦麦"]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认重启麦麦?"}),e.jsx(Pt,{children:p?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:p?de:ve,children:p?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(Vd,{children:[e.jsx(Fr,{className:"h-4 w-4"}),e.jsxs(Gd,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(Ct,{className:"h-[calc(100vh-260px)]",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(Gs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{placeholder:"搜索提供商名称、URL 或类型...",value:G,onChange:he=>$(he.target.value),className:"pl-9"})]}),G&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Xt.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:Xt.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:G?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):ke.map((he,Ee)=>{const Ve=s.findIndex(Os=>Os===he);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-semibold text-base truncate",children:he.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:he.base_url})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>re(he,Ve),children:[e.jsx(Yr,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(q,{size:"sm",onClick:()=>Rs(Ve),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),e.jsx("p",{className:"font-medium",children:he.client_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),e.jsx("p",{className:"font-medium",children:he.max_retry})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),e.jsx("p",{className:"font-medium",children:he.timeout})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),e.jsx("p",{className:"font-medium",children:he.retry_interval})]})]})]},Ee)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsxs(Rl,{children:[e.jsx(zl,{children:e.jsxs(ns,{children:[e.jsx(He,{className:"w-12",children:e.jsx(Cs,{checked:oe.size===Xt.length&&Xt.length>0,onCheckedChange:Nn})}),e.jsx(He,{children:"名称"}),e.jsx(He,{children:"基础URL"}),e.jsx(He,{children:"客户端类型"}),e.jsx(He,{className:"text-right",children:"最大重试"}),e.jsx(He,{className:"text-right",children:"超时(秒)"}),e.jsx(He,{className:"text-right",children:"重试间隔(秒)"}),e.jsx(He,{className:"text-right",children:"操作"})]})}),e.jsx(Pl,{children:ke.length===0?e.jsx(ns,{children:e.jsx(Ae,{colSpan:8,className:"text-center text-muted-foreground py-8",children:G?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):ke.map((he,Ee)=>{const Ve=s.findIndex(Os=>Os===he);return e.jsxs(ns,{children:[e.jsx(Ae,{children:e.jsx(Cs,{checked:oe.has(Ve),onCheckedChange:()=>Le(Ve)})}),e.jsx(Ae,{className:"font-medium",children:he.name}),e.jsx(Ae,{className:"max-w-xs truncate",title:he.base_url,children:he.base_url}),e.jsx(Ae,{children:he.client_type}),e.jsx(Ae,{className:"text-right",children:he.max_retry}),e.jsx(Ae,{className:"text-right",children:he.timeout}),e.jsx(Ae,{className:"text-right",children:he.retry_interval}),e.jsx(Ae,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>re(he,Ve),children:[e.jsx(Yr,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(q,{size:"sm",onClick:()=>Rs(Ve),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Ee)})})]})}),Xt.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(rt,{value:L.toString(),onValueChange:he=>{ee(parseInt(he)),O(1),je(new Set)},children:[e.jsx(at,{id:"page-size-provider",className:"w-20",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"10",children:"10"}),e.jsx(ye,{value:"20",children:"20"}),e.jsx(ye,{value:"50",children:"50"}),e.jsx(ye,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*L+1," 到"," ",Math.min(R*L,Xt.length)," 条,共 ",Xt.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>O(1),disabled:R===1,className:"hidden sm:flex",children:e.jsx(vo,{className:"h-4 w-4"})}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>O(he=>Math.max(1,he-1)),disabled:R===1,children:[e.jsx(Ol,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{type:"number",value:le,onChange:he=>xe(he.target.value),onKeyDown:he=>he.key==="Enter"&&is(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:Ds}),e.jsx(q,{variant:"outline",size:"sm",onClick:is,disabled:!le,className:"h-8",children:"跳转"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>O(he=>he+1),disabled:R>=Ds,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Al,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>O(Ds),disabled:R>=Ds,className:"hidden sm:flex",children:e.jsx(jo,{className:"h-4 w-4"})})]})]})]}),e.jsx(bs,{open:S,onOpenChange:Zt,children:e.jsxs(ms,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:P!==null?"编辑提供商":"添加提供商"}),e.jsx(ks,{children:"配置 API 提供商的连接信息和参数"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"name",children:"名称 *"}),e.jsx(pe,{id:"name",value:N?.name||"",onChange:he=>T(Ee=>Ee?{...Ee,name:he.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"base_url",children:"基础 URL *"}),e.jsx(pe,{id:"base_url",value:N?.base_url||"",onChange:he=>T(Ee=>Ee?{...Ee,base_url:he.target.value}:null),placeholder:"https://api.example.com/v1"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"api_key",children:"API Key *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(pe,{id:"api_key",type:B?"text":"password",value:N?.api_key||"",onChange:he=>T(Ee=>Ee?{...Ee,api_key:he.target.value}:null),placeholder:"sk-...",className:"flex-1"}),e.jsx(q,{type:"button",variant:"outline",size:"icon",onClick:()=>Y(!B),title:B?"隐藏密钥":"显示密钥",children:B?e.jsx(Of,{className:"h-4 w-4"}):e.jsx(Mn,{className:"h-4 w-4"})}),e.jsx(q,{type:"button",variant:"outline",size:"icon",onClick:Pe,title:"复制密钥",children:e.jsx(Df,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"client_type",children:"客户端类型"}),e.jsxs(rt,{value:N?.client_type||"openai",onValueChange:he=>T(Ee=>Ee?{...Ee,client_type:he}:null),children:[e.jsx(at,{id:"client_type",children:e.jsx(it,{placeholder:"选择客户端类型"})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"openai",children:"OpenAI"}),e.jsx(ye,{value:"gemini",children:"Gemini"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"max_retry",children:"最大重试"}),e.jsx(pe,{id:"max_retry",type:"number",min:"0",value:N?.max_retry??"",onChange:he=>{const Ee=he.target.value===""?null:parseInt(he.target.value);T(Ve=>Ve?{...Ve,max_retry:Ee}:null)},placeholder:"默认: 2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"timeout",children:"超时(秒)"}),e.jsx(pe,{id:"timeout",type:"number",min:"1",value:N?.timeout??"",onChange:he=>{const Ee=he.target.value===""?null:parseInt(he.target.value);T(Ve=>Ve?{...Ve,timeout:Ee}:null)},placeholder:"默认: 30"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),e.jsx(pe,{id:"retry_interval",type:"number",min:"1",value:N?.retry_interval??"",onChange:he=>{const Ee=he.target.value===""?null:parseInt(he.target.value);T(Ve=>Ve?{...Ve,retry_interval:Ee}:null)},placeholder:"默认: 10"})]})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>C(!1),children:"取消"}),e.jsx(q,{onClick:ze,children:"保存"})]})]})}),e.jsx(Ft,{open:k,onOpenChange:D,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除提供商 "',A!==null?s[A]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:An,children:"删除"})]})]})}),e.jsx(Ft,{open:ae,onOpenChange:me,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认批量删除"}),e.jsxs(Pt,{children:["确定要删除选中的 ",oe.size," 个提供商吗? 此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:rn,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),b&&e.jsx(Bh,{onRestartComplete:Ce,onRestartFailed:Q})]})}var Uj=1,vM=.9,jM=.8,yM=.17,Sf=.1,_f=.999,bM=.9999,NM=.99,wM=/[\\\/_+.#"@\[\(\{&]/,SM=/[\\\/_+.#"@\[\(\{&]/g,_M=/[\s-]/,xN=/[\s-]/g;function Kf(s,a,l,i,c,d,m){if(d===a.length)return c===s.length?Uj:NM;var h=`${c},${d}`;if(m[h]!==void 0)return m[h];for(var p=i.charAt(d),v=l.indexOf(p,c),g=0,j,b,w,S;v>=0;)j=Kf(s,a,l,i,v+1,d+1,m),j>g&&(v===c?j*=Uj:wM.test(s.charAt(v-1))?(j*=jM,w=s.slice(c,v-1).match(SM),w&&c>0&&(j*=Math.pow(_f,w.length))):_M.test(s.charAt(v-1))?(j*=vM,S=s.slice(c,v-1).match(xN),S&&c>0&&(j*=Math.pow(_f,S.length))):(j*=yM,c>0&&(j*=Math.pow(_f,v-c))),s.charAt(v)!==a.charAt(d)&&(j*=bM)),(j<Sf&&l.charAt(v-1)===i.charAt(d+1)||i.charAt(d+1)===i.charAt(d)&&l.charAt(v-1)!==i.charAt(d))&&(b=Kf(s,a,l,i,v+1,d+2,m),b*Sf>j&&(j=b*Sf)),j>g&&(g=j),v=l.indexOf(p,v+1);return m[h]=g,g}function Hj(s){return s.toLowerCase().replace(xN," ")}function CM(s,a,l){return s=l&&l.length>0?`${s+" "+l.join(" ")}`:s,Kf(s,a,Hj(s),Hj(a),0,0,{})}var kM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ja=kM.reduce((s,a)=>{const l=ih(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:m,...h}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...h,ref:d})});return i.displayName=`Primitive.${a}`,{...s,[a]:i}},{}),Zi='[cmdk-group=""]',Cf='[cmdk-group-items=""]',TM='[cmdk-group-heading=""]',pN='[cmdk-item=""]',Fj=`${pN}:not([aria-disabled="true"])`,Qf="cmdk-item-select",Ar="data-value",EM=(s,a,l)=>CM(s,a,l),gN=x.createContext(void 0),ko=()=>x.useContext(gN),vN=x.createContext(void 0),Uh=()=>x.useContext(vN),jN=x.createContext(void 0),yN=x.forwardRef((s,a)=>{let l=Rr(()=>{var F,W;return{search:"",value:(W=(F=s.value)!=null?F:s.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=Rr(()=>new Set),c=Rr(()=>new Map),d=Rr(()=>new Map),m=Rr(()=>new Set),h=bN(s),{label:p,children:v,value:g,onValueChange:j,filter:b,shouldFilter:w,loop:S,disablePointerSelection:C=!1,vimBindings:N=!0,...T}=s,P=jn(),M=jn(),k=jn(),D=x.useRef(null),A=HM();Dl(()=>{if(g!==void 0){let F=g.trim();l.current.value=F,E.emit()}},[g]),Dl(()=>{A(6,je)},[]);let E=x.useMemo(()=>({subscribe:F=>(m.current.add(F),()=>m.current.delete(F)),snapshot:()=>l.current,setState:(F,W,fe)=>{var I,ve,de,Ce;if(!Object.is(l.current[F],W)){if(l.current[F]=W,F==="search")oe(),G(),A(1,$);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(k);Q?Q.focus():(I=document.getElementById(P))==null||I.focus()}if(A(7,()=>{var Q;l.current.selectedItemId=(Q=ae())==null?void 0:Q.id,E.emit()}),fe||A(5,je),((ve=h.current)==null?void 0:ve.value)!==void 0){let Q=W??"";(Ce=(de=h.current).onValueChange)==null||Ce.call(de,Q);return}}E.emit()}},emit:()=>{m.current.forEach(F=>F())}}),[]),B=x.useMemo(()=>({value:(F,W,fe)=>{var I;W!==((I=d.current.get(F))==null?void 0:I.value)&&(d.current.set(F,{value:W,keywords:fe}),l.current.filtered.items.set(F,Y(W,fe)),A(2,()=>{G(),E.emit()}))},item:(F,W)=>(i.current.add(F),W&&(c.current.has(W)?c.current.get(W).add(F):c.current.set(W,new Set([F]))),A(3,()=>{oe(),G(),l.current.value||$(),E.emit()}),()=>{d.current.delete(F),i.current.delete(F),l.current.filtered.items.delete(F);let fe=ae();A(4,()=>{oe(),fe?.getAttribute("id")===F&&$(),E.emit()})}),group:F=>(c.current.has(F)||c.current.set(F,new Set),()=>{d.current.delete(F),c.current.delete(F)}),filter:()=>h.current.shouldFilter,label:p||s["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:P,inputId:k,labelId:M,listInnerRef:D}),[]);function Y(F,W){var fe,I;let ve=(I=(fe=h.current)==null?void 0:fe.filter)!=null?I:EM;return F?ve(F,l.current.search,W):0}function G(){if(!l.current.search||h.current.shouldFilter===!1)return;let F=l.current.filtered.items,W=[];l.current.filtered.groups.forEach(I=>{let ve=c.current.get(I),de=0;ve.forEach(Ce=>{let Q=F.get(Ce);de=Math.max(Q,de)}),W.push([I,de])});let fe=D.current;me().sort((I,ve)=>{var de,Ce;let Q=I.getAttribute("id"),Oe=ve.getAttribute("id");return((de=F.get(Oe))!=null?de:0)-((Ce=F.get(Q))!=null?Ce:0)}).forEach(I=>{let ve=I.closest(Cf);ve?ve.appendChild(I.parentElement===ve?I:I.closest(`${Cf} > *`)):fe.appendChild(I.parentElement===fe?I:I.closest(`${Cf} > *`))}),W.sort((I,ve)=>ve[1]-I[1]).forEach(I=>{var ve;let de=(ve=D.current)==null?void 0:ve.querySelector(`${Zi}[${Ar}="${encodeURIComponent(I[0])}"]`);de?.parentElement.appendChild(de)})}function $(){let F=me().find(fe=>fe.getAttribute("aria-disabled")!=="true"),W=F?.getAttribute(Ar);E.setState("value",W||void 0)}function oe(){var F,W,fe,I;if(!l.current.search||h.current.shouldFilter===!1){l.current.filtered.count=i.current.size;return}l.current.filtered.groups=new Set;let ve=0;for(let de of i.current){let Ce=(W=(F=d.current.get(de))==null?void 0:F.value)!=null?W:"",Q=(I=(fe=d.current.get(de))==null?void 0:fe.keywords)!=null?I:[],Oe=Y(Ce,Q);l.current.filtered.items.set(de,Oe),Oe>0&&ve++}for(let[de,Ce]of c.current)for(let Q of Ce)if(l.current.filtered.items.get(Q)>0){l.current.filtered.groups.add(de);break}l.current.filtered.count=ve}function je(){var F,W,fe;let I=ae();I&&(((F=I.parentElement)==null?void 0:F.firstChild)===I&&((fe=(W=I.closest(Zi))==null?void 0:W.querySelector(TM))==null||fe.scrollIntoView({block:"nearest"})),I.scrollIntoView({block:"nearest"}))}function ae(){var F;return(F=D.current)==null?void 0:F.querySelector(`${pN}[aria-selected="true"]`)}function me(){var F;return Array.from(((F=D.current)==null?void 0:F.querySelectorAll(Fj))||[])}function R(F){let W=me()[F];W&&E.setState("value",W.getAttribute(Ar))}function O(F){var W;let fe=ae(),I=me(),ve=I.findIndex(Ce=>Ce===fe),de=I[ve+F];(W=h.current)!=null&&W.loop&&(de=ve+F<0?I[I.length-1]:ve+F===I.length?I[0]:I[ve+F]),de&&E.setState("value",de.getAttribute(Ar))}function L(F){let W=ae(),fe=W?.closest(Zi),I;for(;fe&&!I;)fe=F>0?BM(fe,Zi):UM(fe,Zi),I=fe?.querySelector(Fj);I?E.setState("value",I.getAttribute(Ar)):O(F)}let ee=()=>R(me().length-1),le=F=>{F.preventDefault(),F.metaKey?ee():F.altKey?L(1):O(1)},xe=F=>{F.preventDefault(),F.metaKey?R(0):F.altKey?L(-1):O(-1)};return x.createElement(Ja.div,{ref:a,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:F=>{var W;(W=T.onKeyDown)==null||W.call(T,F);let fe=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||fe))switch(F.key){case"n":case"j":{N&&F.ctrlKey&&le(F);break}case"ArrowDown":{le(F);break}case"p":case"k":{N&&F.ctrlKey&&xe(F);break}case"ArrowUp":{xe(F);break}case"Home":{F.preventDefault(),R(0);break}case"End":{F.preventDefault(),ee();break}case"Enter":{F.preventDefault();let I=ae();if(I){let ve=new Event(Qf);I.dispatchEvent(ve)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:YM},p),$d(s,F=>x.createElement(vN.Provider,{value:E},x.createElement(gN.Provider,{value:B},F))))}),MM=x.forwardRef((s,a)=>{var l,i;let c=jn(),d=x.useRef(null),m=x.useContext(jN),h=ko(),p=bN(s),v=(i=(l=p.current)==null?void 0:l.forceMount)!=null?i:m?.forceMount;Dl(()=>{if(!v)return h.item(c,m?.id)},[v]);let g=NN(c,d,[s.value,s.children,d],s.keywords),j=Uh(),b=Xa(A=>A.value&&A.value===g.current),w=Xa(A=>v||h.filter()===!1?!0:A.search?A.filtered.items.get(c)>0:!0);x.useEffect(()=>{let A=d.current;if(!(!A||s.disabled))return A.addEventListener(Qf,S),()=>A.removeEventListener(Qf,S)},[w,s.onSelect,s.disabled]);function S(){var A,E;C(),(E=(A=p.current).onSelect)==null||E.call(A,g.current)}function C(){j.setState("value",g.current,!0)}if(!w)return null;let{disabled:N,value:T,onSelect:P,forceMount:M,keywords:k,...D}=s;return x.createElement(Ja.div,{ref:Ga(d,a),...D,id:c,"cmdk-item":"",role:"option","aria-disabled":!!N,"aria-selected":!!b,"data-disabled":!!N,"data-selected":!!b,onPointerMove:N||h.getDisablePointerSelection()?void 0:C,onClick:N?void 0:S},s.children)}),DM=x.forwardRef((s,a)=>{let{heading:l,children:i,forceMount:c,...d}=s,m=jn(),h=x.useRef(null),p=x.useRef(null),v=jn(),g=ko(),j=Xa(w=>c||g.filter()===!1?!0:w.search?w.filtered.groups.has(m):!0);Dl(()=>g.group(m),[]),NN(m,h,[s.value,s.heading,p]);let b=x.useMemo(()=>({id:m,forceMount:c}),[c]);return x.createElement(Ja.div,{ref:Ga(h,a),...d,"cmdk-group":"",role:"presentation",hidden:j?void 0:!0},l&&x.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:v},l),$d(s,w=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":l?v:void 0},x.createElement(jN.Provider,{value:b},w))))}),OM=x.forwardRef((s,a)=>{let{alwaysRender:l,...i}=s,c=x.useRef(null),d=Xa(m=>!m.search);return!l&&!d?null:x.createElement(Ja.div,{ref:Ga(c,a),...i,"cmdk-separator":"",role:"separator"})}),AM=x.forwardRef((s,a)=>{let{onValueChange:l,...i}=s,c=s.value!=null,d=Uh(),m=Xa(v=>v.search),h=Xa(v=>v.selectedItemId),p=ko();return x.useEffect(()=>{s.value!=null&&d.setState("search",s.value)},[s.value]),x.createElement(Ja.input,{ref:a,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":h,id:p.inputId,type:"text",value:c?s.value:m,onChange:v=>{c||d.setState("search",v.target.value),l?.(v.target.value)}})}),RM=x.forwardRef((s,a)=>{let{children:l,label:i="Suggestions",...c}=s,d=x.useRef(null),m=x.useRef(null),h=Xa(v=>v.selectedItemId),p=ko();return x.useEffect(()=>{if(m.current&&d.current){let v=m.current,g=d.current,j,b=new ResizeObserver(()=>{j=requestAnimationFrame(()=>{let w=v.offsetHeight;g.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return b.observe(v),()=>{cancelAnimationFrame(j),b.unobserve(v)}}},[]),x.createElement(Ja.div,{ref:Ga(d,a),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":i,id:p.listId},$d(s,v=>x.createElement("div",{ref:Ga(m,p.listInnerRef),"cmdk-list-sizer":""},v)))}),zM=x.forwardRef((s,a)=>{let{open:l,onOpenChange:i,overlayClassName:c,contentClassName:d,container:m,...h}=s;return x.createElement(mh,{open:l,onOpenChange:i},x.createElement(oh,{container:m},x.createElement(Cd,{"cmdk-overlay":"",className:c}),x.createElement(kd,{"aria-label":s.label,"cmdk-dialog":"",className:d},x.createElement(yN,{ref:a,...h}))))}),PM=x.forwardRef((s,a)=>Xa(l=>l.filtered.count===0)?x.createElement(Ja.div,{ref:a,...s,"cmdk-empty":"",role:"presentation"}):null),LM=x.forwardRef((s,a)=>{let{progress:l,children:i,label:c="Loading...",...d}=s;return x.createElement(Ja.div,{ref:a,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},$d(s,m=>x.createElement("div",{"aria-hidden":!0},m)))}),Ws=Object.assign(yN,{List:RM,Item:MM,Input:AM,Group:DM,Separator:OM,Dialog:zM,Empty:PM,Loading:LM});function BM(s,a){let l=s.nextElementSibling;for(;l;){if(l.matches(a))return l;l=l.nextElementSibling}}function UM(s,a){let l=s.previousElementSibling;for(;l;){if(l.matches(a))return l;l=l.previousElementSibling}}function bN(s){let a=x.useRef(s);return Dl(()=>{a.current=s}),a}var Dl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Rr(s){let a=x.useRef();return a.current===void 0&&(a.current=s()),a}function Xa(s){let a=Uh(),l=()=>s(a.snapshot());return x.useSyncExternalStore(a.subscribe,l,l)}function NN(s,a,l,i=[]){let c=x.useRef(),d=ko();return Dl(()=>{var m;let h=(()=>{var v;for(let g of l){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(v=g.current.textContent)==null?void 0:v.trim():c.current}})(),p=i.map(v=>v.trim());d.value(s,h,p),(m=a.current)==null||m.setAttribute(Ar,h),c.current=h}),c}var HM=()=>{let[s,a]=x.useState(),l=Rr(()=>new Map);return Dl(()=>{l.current.forEach(i=>i()),l.current=new Map},[s]),(i,c)=>{l.current.set(i,c),a({})}};function FM(s){let a=s.type;return typeof a=="function"?a(s.props):"render"in a?a.render(s.props):s}function $d({asChild:s,children:a},l){return s&&x.isValidElement(a)?x.cloneElement(FM(a),{ref:a.ref},l(a.props.children)):l(a)}var YM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const wN=x.forwardRef(({className:s,...a},l)=>e.jsx(Ws,{ref:l,className:Z("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...a}));wN.displayName=Ws.displayName;const SN=x.forwardRef(({className:s,...a},l)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Gs,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Ws.Input,{ref:l,className:Z("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",s),...a})]}));SN.displayName=Ws.Input.displayName;const _N=x.forwardRef(({className:s,...a},l)=>e.jsx(Ws.List,{ref:l,className:Z("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...a}));_N.displayName=Ws.List.displayName;const CN=x.forwardRef((s,a)=>e.jsx(Ws.Empty,{ref:a,className:"py-6 text-center text-sm",...s}));CN.displayName=Ws.Empty.displayName;const kN=x.forwardRef(({className:s,...a},l)=>e.jsx(Ws.Group,{ref:l,className:Z("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",s),...a}));kN.displayName=Ws.Group.displayName;const qM=x.forwardRef(({className:s,...a},l)=>e.jsx(Ws.Separator,{ref:l,className:Z("-mx-1 h-px bg-border",s),...a}));qM.displayName=Ws.Separator.displayName;const TN=x.forwardRef(({className:s,...a},l)=>e.jsx(Ws.Item,{ref:l,className:Z("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",s),...a}));TN.displayName=Ws.Item.displayName;function VM({options:s,selected:a,onChange:l,placeholder:i="选择选项...",emptyText:c="未找到选项",className:d}){const[m,h]=x.useState(!1),p=g=>{a.includes(g)?l(a.filter(j=>j!==g)):l([...a,g])},v=g=>{l(a.filter(j=>j!==g))};return e.jsxs(Ia,{open:m,onOpenChange:h,children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",role:"combobox","aria-expanded":m,className:Z("w-full justify-between min-h-10 h-auto",d),children:[e.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:a.length===0?e.jsx("span",{className:"text-muted-foreground",children:i}):a.map(g=>{const j=s.find(b=>b.value===g);return e.jsxs(_t,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:b=>{b.stopPropagation(),v(g)},children:[j?.label||g,e.jsx(go,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},g)})}),e.jsx(U2,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),e.jsx(pa,{className:"w-full p-0",align:"start",children:e.jsxs(wN,{children:[e.jsx(SN,{placeholder:"搜索...",className:"h-9"}),e.jsxs(_N,{children:[e.jsx(CN,{children:c}),e.jsx(kN,{children:s.map(g=>{const j=a.includes(g.value);return e.jsxs(TN,{value:g.value,onSelect:()=>p(g.value),children:[e.jsx("div",{className:Z("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",j?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(Cl,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),e.jsx("span",{children:g.label})]},g.value)})})]})]})})]})}function GM(){const[s,a]=x.useState([]),[l,i]=x.useState([]),[c,d]=x.useState([]),[m,h]=x.useState(null),[p,v]=x.useState(!0),[g,j]=x.useState(!1),[b,w]=x.useState(!1),[S,C]=x.useState(!1),[N,T]=x.useState(!1),[P,M]=x.useState(!1),[k,D]=x.useState(!1),[A,E]=x.useState(null),[B,Y]=x.useState(null),[G,$]=x.useState(!1),[oe,je]=x.useState(null),[ae,me]=x.useState(""),[R,O]=x.useState(new Set),[L,ee]=x.useState(!1),[le,xe]=x.useState(1),[F,W]=x.useState(20),[fe,I]=x.useState(""),{toast:ve}=Es(),de=x.useRef(null),Ce=x.useRef(null),Q=x.useRef(!0);x.useEffect(()=>{Oe()},[]);const Oe=async()=>{try{v(!0);const se=await Ur(),ge=se.models||[];a(ge),d(ge.map(pt=>pt.name));const Qe=se.api_providers||[];i(Qe.map(pt=>pt.name)),h(se.model_task_config||null),C(!1),Q.current=!1}catch(se){console.error("加载配置失败:",se)}finally{v(!1)}},$e=async()=>{try{T(!0),Lh().catch(()=>{}),M(!0)}catch(se){console.error("重启失败:",se),M(!1),ve({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),T(!1)}},re=async()=>{try{j(!0),de.current&&clearTimeout(de.current),Ce.current&&clearTimeout(Ce.current);const se=await Ur();se.models=s,se.model_task_config=m,await Nd(se),C(!1),ve({title:"保存成功",description:"正在重启麦麦..."}),await $e()}catch(se){console.error("保存配置失败:",se),ve({title:"保存失败",description:se.message,variant:"destructive"}),j(!1)}},Pe=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ze=()=>{M(!1),T(!1),ve({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Zt=x.useCallback(async se=>{if(!Q.current)try{w(!0),await Xf("models",se),C(!1)}catch(ge){console.error("自动保存模型列表失败:",ge),C(!0)}finally{w(!1)}},[]),Rs=x.useCallback(async se=>{if(!Q.current)try{w(!0),await Xf("model_task_config",se),C(!1)}catch(ge){console.error("自动保存任务配置失败:",ge),C(!0)}finally{w(!1)}},[]);x.useEffect(()=>{if(!Q.current)return C(!0),de.current&&clearTimeout(de.current),de.current=setTimeout(()=>{Zt(s)},2e3),()=>{de.current&&clearTimeout(de.current)}},[s,Zt]),x.useEffect(()=>{if(!(Q.current||!m))return C(!0),Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(()=>{Rs(m)},2e3),()=>{Ce.current&&clearTimeout(Ce.current)}},[m,Rs]);const An=async()=>{try{j(!0),de.current&&clearTimeout(de.current),Ce.current&&clearTimeout(Ce.current);const se=await Ur();se.models=s,se.model_task_config=m,await Nd(se),C(!1),ve({title:"保存成功",description:"模型配置已保存"}),await Oe()}catch(se){console.error("保存配置失败:",se),ve({title:"保存失败",description:se.message,variant:"destructive"})}finally{j(!1)}},Le=(se,ge)=>{E(se||{model_identifier:"",name:"",api_provider:l[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),Y(ge),D(!0)},Nn=()=>{if(!A)return;const se={...A,price_in:A.price_in??0,price_out:A.price_out??0};let ge;B!==null?(ge=[...s],ge[B]=se):ge=[...s,se],a(ge),d(ge.map(Qe=>Qe.name)),D(!1),E(null),Y(null)},ln=se=>{if(!se&&A){const ge={...A,price_in:A.price_in??0,price_out:A.price_out??0};E(ge)}D(se)},rn=se=>{je(se),$(!0)},Xt=()=>{if(oe!==null){const se=s.filter((ge,Qe)=>Qe!==oe);a(se),d(se.map(ge=>ge.name)),ve({title:"删除成功",description:"模型已从列表中移除"})}$(!1),je(null)},Ds=se=>{const ge=new Set(R);ge.has(se)?ge.delete(se):ge.add(se),O(ge)},ke=()=>{if(R.size===Ve.length)O(new Set);else{const se=Ve.map((ge,Qe)=>s.findIndex(pt=>pt===Ve[Qe]));O(new Set(se))}},is=()=>{if(R.size===0){ve({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ee(!0)},he=()=>{const se=s.filter((ge,Qe)=>!R.has(Qe));a(se),d(se.map(ge=>ge.name)),O(new Set),ee(!1),ve({title:"批量删除成功",description:`已删除 ${R.size} 个模型`})},Ee=(se,ge,Qe)=>{m&&h({...m,[se]:{...m[se],[ge]:Qe}})},Ve=s.filter(se=>{if(!ae)return!0;const ge=ae.toLowerCase();return se.name.toLowerCase().includes(ge)||se.model_identifier.toLowerCase().includes(ge)||se.api_provider.toLowerCase().includes(ge)}),Os=Math.ceil(Ve.length/F),$n=Ve.slice((le-1)*F,le*F),Hl=()=>{const se=parseInt(fe);se>=1&&se<=Os&&(xe(se),I(""))},Fl=se=>m?[m.utils?.model_list||[],m.utils_small?.model_list||[],m.tool_use?.model_list||[],m.replyer?.model_list||[],m.planner?.model_list||[],m.vlm?.model_list||[],m.voice?.model_list||[],m.embedding?.model_list||[],m.lpmm_entity_extract?.model_list||[],m.lpmm_rdf_build?.model_list||[],m.lpmm_qa?.model_list||[]].some(Qe=>Qe.includes(se)):!1;return p?e.jsx(Ct,{className:"h-full",children:e.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsxs(q,{onClick:An,disabled:g||b||!S||N,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[e.jsx(vh,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),g?"保存中...":b?"自动保存中...":S?"保存配置":"已保存"]}),e.jsxs(Ft,{children:[e.jsx(_s,{asChild:!0,children:e.jsxs(q,{disabled:g||b||N,size:"sm",className:"flex-1 sm:flex-none",children:[e.jsx(jh,{className:"mr-2 h-4 w-4"}),N?"重启中...":S?"保存并重启":"重启麦麦"]})}),e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认重启麦麦?"}),e.jsx(Pt,{children:S?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:S?re:$e,children:S?"保存并重启":"确认重启"})]})]})]})]})]}),e.jsxs(Vd,{children:[e.jsx(Fr,{className:"h-4 w-4"}),e.jsxs(Gd,{children:["配置更新后需要",e.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),e.jsxs(Ml,{defaultValue:"models",className:"w-full",children:[e.jsxs($a,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[e.jsx(bt,{value:"models",children:"模型配置"}),e.jsx(bt,{value:"tasks",children:"模型任务配置"})]}),e.jsxs(Vt,{value:"models",className:"space-y-4 mt-0",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[R.size>0&&e.jsxs(q,{onClick:is,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[e.jsx(ft,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",R.size,")"]}),e.jsxs(q,{onClick:()=>Le(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[e.jsx(ys,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[e.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[e.jsx(Gs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{placeholder:"搜索模型名称、标识符或提供商...",value:ae,onChange:se=>me(se.target.value),className:"pl-9"})]}),ae&&e.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Ve.length," 个结果"]})]}),e.jsx("div",{className:"md:hidden space-y-3",children:$n.length===0?e.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:ae?"未找到匹配的模型":"暂无模型配置"}):$n.map((se,ge)=>{const Qe=s.findIndex(tl=>tl===se),pt=Fl(se.name);return e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-base",children:se.name}),e.jsx(_t,{variant:pt?"default":"secondary",className:pt?"bg-green-600 hover:bg-green-700":"",children:pt?"已使用":"未使用"})]}),e.jsx("p",{className:"text-xs text-muted-foreground break-all",title:se.model_identifier,children:se.model_identifier})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>Le(se,Qe),children:[e.jsx(Yr,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(q,{size:"sm",onClick:()=>rn(Qe),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),e.jsx("p",{className:"font-medium",children:se.api_provider})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),e.jsx("p",{className:"font-medium",children:se.force_stream_mode?"是":"否"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),e.jsxs("p",{className:"font-medium",children:["¥",se.price_in,"/M"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),e.jsxs("p",{className:"font-medium",children:["¥",se.price_out,"/M"]})]})]})]},ge)})}),e.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:e.jsxs(Rl,{children:[e.jsx(zl,{children:e.jsxs(ns,{children:[e.jsx(He,{className:"w-12",children:e.jsx(Cs,{checked:R.size===Ve.length&&Ve.length>0,onCheckedChange:ke})}),e.jsx(He,{className:"w-24",children:"使用状态"}),e.jsx(He,{children:"模型名称"}),e.jsx(He,{children:"模型标识符"}),e.jsx(He,{children:"提供商"}),e.jsx(He,{className:"text-right",children:"输入价格"}),e.jsx(He,{className:"text-right",children:"输出价格"}),e.jsx(He,{className:"text-center",children:"强制流式"}),e.jsx(He,{className:"text-right",children:"操作"})]})}),e.jsx(Pl,{children:$n.length===0?e.jsx(ns,{children:e.jsx(Ae,{colSpan:9,className:"text-center text-muted-foreground py-8",children:ae?"未找到匹配的模型":"暂无模型配置"})}):$n.map((se,ge)=>{const Qe=s.findIndex(tl=>tl===se),pt=Fl(se.name);return e.jsxs(ns,{children:[e.jsx(Ae,{children:e.jsx(Cs,{checked:R.has(Qe),onCheckedChange:()=>Ds(Qe)})}),e.jsx(Ae,{children:e.jsx(_t,{variant:pt?"default":"secondary",className:pt?"bg-green-600 hover:bg-green-700":"",children:pt?"已使用":"未使用"})}),e.jsx(Ae,{className:"font-medium",children:se.name}),e.jsx(Ae,{className:"max-w-xs truncate",title:se.model_identifier,children:se.model_identifier}),e.jsx(Ae,{children:se.api_provider}),e.jsxs(Ae,{className:"text-right",children:["¥",se.price_in,"/M"]}),e.jsxs(Ae,{className:"text-right",children:["¥",se.price_out,"/M"]}),e.jsx(Ae,{className:"text-center",children:se.force_stream_mode?"是":"否"}),e.jsx(Ae,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>Le(se,Qe),children:[e.jsx(Yr,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),e.jsxs(q,{size:"sm",onClick:()=>rn(Qe),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},ge)})})]})}),Ve.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(rt,{value:F.toString(),onValueChange:se=>{W(parseInt(se)),xe(1),O(new Set)},children:[e.jsx(at,{id:"page-size-model",className:"w-20",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"10",children:"10"}),e.jsx(ye,{value:"20",children:"20"}),e.jsx(ye,{value:"50",children:"50"}),e.jsx(ye,{value:"100",children:"100"})]})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(le-1)*F+1," 到"," ",Math.min(le*F,Ve.length)," 条,共 ",Ve.length," 条"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>xe(1),disabled:le===1,className:"hidden sm:flex",children:e.jsx(vo,{className:"h-4 w-4"})}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>xe(se=>Math.max(1,se-1)),disabled:le===1,children:[e.jsx(Ol,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{type:"number",value:fe,onChange:se=>I(se.target.value),onKeyDown:se=>se.key==="Enter"&&Hl(),placeholder:le.toString(),className:"w-16 h-8 text-center",min:1,max:Os}),e.jsx(q,{variant:"outline",size:"sm",onClick:Hl,disabled:!fe,className:"h-8",children:"跳转"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>xe(se=>se+1),disabled:le>=Os,children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Al,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>xe(Os),disabled:le>=Os,className:"hidden sm:flex",children:e.jsx(jo,{className:"h-4 w-4"})})]})]})]}),e.jsxs(Vt,{value:"tasks",className:"space-y-6 mt-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),m&&e.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[e.jsx(Cn,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:m.utils,modelNames:c,onChange:(se,ge)=>Ee("utils",se,ge)}),e.jsx(Cn,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:m.utils_small,modelNames:c,onChange:(se,ge)=>Ee("utils_small",se,ge)}),e.jsx(Cn,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:m.tool_use,modelNames:c,onChange:(se,ge)=>Ee("tool_use",se,ge)}),e.jsx(Cn,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:m.replyer,modelNames:c,onChange:(se,ge)=>Ee("replyer",se,ge)}),e.jsx(Cn,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:m.planner,modelNames:c,onChange:(se,ge)=>Ee("planner",se,ge)}),e.jsx(Cn,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:m.vlm,modelNames:c,onChange:(se,ge)=>Ee("vlm",se,ge),hideTemperature:!0}),e.jsx(Cn,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:m.voice,modelNames:c,onChange:(se,ge)=>Ee("voice",se,ge),hideTemperature:!0,hideMaxTokens:!0}),e.jsx(Cn,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:m.embedding,modelNames:c,onChange:(se,ge)=>Ee("embedding",se,ge),hideTemperature:!0,hideMaxTokens:!0}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),e.jsx(Cn,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:m.lpmm_entity_extract,modelNames:c,onChange:(se,ge)=>Ee("lpmm_entity_extract",se,ge)}),e.jsx(Cn,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:m.lpmm_rdf_build,modelNames:c,onChange:(se,ge)=>Ee("lpmm_rdf_build",se,ge)}),e.jsx(Cn,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:m.lpmm_qa,modelNames:c,onChange:(se,ge)=>Ee("lpmm_qa",se,ge)})]})]})]})]}),e.jsx(bs,{open:k,onOpenChange:ln,children:e.jsxs(ms,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:B!==null?"编辑模型":"添加模型"}),e.jsx(ks,{children:"配置模型的基本信息和参数"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"model_name",children:"模型名称 *"}),e.jsx(pe,{id:"model_name",value:A?.name||"",onChange:se=>E(ge=>ge?{...ge,name:se.target.value}:null),placeholder:"例如: qwen3-30b"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"model_identifier",children:"模型标识符 *"}),e.jsx(pe,{id:"model_identifier",value:A?.model_identifier||"",onChange:se=>E(ge=>ge?{...ge,model_identifier:se.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"api_provider",children:"API 提供商 *"}),e.jsxs(rt,{value:A?.api_provider||"",onValueChange:se=>E(ge=>ge?{...ge,api_provider:se}:null),children:[e.jsx(at,{id:"api_provider",children:e.jsx(it,{placeholder:"选择提供商"})}),e.jsx(lt,{children:l.map(se=>e.jsx(ye,{value:se,children:se},se))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),e.jsx(pe,{id:"price_in",type:"number",step:"0.1",min:"0",value:A?.price_in??"",onChange:se=>{const ge=se.target.value===""?null:parseFloat(se.target.value);E(Qe=>Qe?{...Qe,price_in:ge}:null)},placeholder:"默认: 0"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),e.jsx(pe,{id:"price_out",type:"number",step:"0.1",min:"0",value:A?.price_out??"",onChange:se=>{const ge=se.target.value===""?null:parseFloat(se.target.value);E(Qe=>Qe?{...Qe,price_out:ge}:null)},placeholder:"默认: 0"})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"force_stream_mode",checked:A?.force_stream_mode||!1,onCheckedChange:se=>E(ge=>ge?{...ge,force_stream_mode:se}:null)}),e.jsx(U,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>D(!1),children:"取消"}),e.jsx(q,{onClick:Nn,children:"保存"})]})]})}),e.jsx(Ft,{open:G,onOpenChange:$,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除模型 "',oe!==null?s[oe]?.name:"",'" 吗? 此操作无法撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:Xt,children:"删除"})]})]})}),e.jsx(Ft,{open:L,onOpenChange:ee,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认批量删除"}),e.jsxs(Pt,{children:["确定要删除选中的 ",R.size," 个模型吗? 此操作无法撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:he,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),P&&e.jsx(Bh,{onRestartComplete:Pe,onRestartFailed:ze})]})})}function Cn({title:s,description:a,taskConfig:l,modelNames:i,onChange:c,hideTemperature:d=!1,hideMaxTokens:m=!1}){const h=p=>{c("model_list",p)};return e.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:s}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:a})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"模型列表"}),e.jsx(VM,{options:i.map(p=>({label:p,value:p})),selected:l.model_list||[],onChange:h,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!d&&e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(U,{children:"温度"}),e.jsx(pe,{type:"number",step:"0.1",min:"0",max:"1",value:l.temperature??.3,onChange:p=>{const v=parseFloat(p.target.value);!isNaN(v)&&v>=0&&v<=1&&c("temperature",v)},className:"w-20 h-8 text-sm"})]}),e.jsx(Yd,{value:[l.temperature??.3],onValueChange:p=>c("temperature",p[0]),min:0,max:1,step:.1,className:"w-full"})]}),!m&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(U,{children:"最大 Token"}),e.jsx(pe,{type:"number",step:"1",min:"1",value:l.max_tokens??1024,onChange:p=>c("max_tokens",parseInt(p.target.value))})]})]})]})]})}const va="/api/webui/emoji";async function $M(s){const a=new URLSearchParams;s.page&&a.append("page",s.page.toString()),s.page_size&&a.append("page_size",s.page_size.toString()),s.search&&a.append("search",s.search),s.is_registered!==void 0&&a.append("is_registered",s.is_registered.toString()),s.is_banned!==void 0&&a.append("is_banned",s.is_banned.toString()),s.format&&a.append("format",s.format),s.sort_by&&a.append("sort_by",s.sort_by),s.sort_order&&a.append("sort_order",s.sort_order);const l=await Fe(`${va}/list?${a}`,{headers:Ie()});if(!l.ok)throw new Error(`获取表情包列表失败: ${l.statusText}`);return l.json()}async function IM(s){const a=await Fe(`${va}/${s}`,{headers:Ie()});if(!a.ok)throw new Error(`获取表情包详情失败: ${a.statusText}`);return a.json()}async function WM(s,a){const l=await Fe(`${va}/${s}`,{method:"PATCH",headers:Ie(),body:JSON.stringify(a)});if(!l.ok)throw new Error(`更新表情包失败: ${l.statusText}`);return l.json()}async function XM(s){const a=await Fe(`${va}/${s}`,{method:"DELETE",headers:Ie()});if(!a.ok)throw new Error(`删除表情包失败: ${a.statusText}`);return a.json()}async function KM(){const s=await Fe(`${va}/stats/summary`,{headers:Ie()});if(!s.ok)throw new Error(`获取统计数据失败: ${s.statusText}`);return s.json()}async function QM(s){const a=await Fe(`${va}/${s}/register`,{method:"POST",headers:Ie()});if(!a.ok)throw new Error(`注册表情包失败: ${a.statusText}`);return a.json()}async function ZM(s){const a=await Fe(`${va}/${s}/ban`,{method:"POST",headers:Ie()});if(!a.ok)throw new Error(`封禁表情包失败: ${a.statusText}`);return a.json()}function Zf(s){const a=localStorage.getItem("access-token");return`${va}/${s}/thumbnail?token=${encodeURIComponent(a||"")}`}async function JM(s){const a=await Fe(`${va}/batch/delete`,{method:"POST",headers:Ie(),body:JSON.stringify({emoji_ids:s})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"批量删除失败")}return a.json()}function eD(){const[s,a]=x.useState([]),[l,i]=x.useState(null),[c,d]=x.useState(!1),[m,h]=x.useState(1),[p,v]=x.useState(0),[g,j]=x.useState(20),[b,w]=x.useState(""),[S,C]=x.useState("all"),[N,T]=x.useState("all"),[P,M]=x.useState("all"),[k,D]=x.useState(null),[A,E]=x.useState(!1),[B,Y]=x.useState(!1),[G,$]=x.useState(!1),[oe,je]=x.useState(new Set),[ae,me]=x.useState(!1),[R,O]=x.useState(""),{toast:L}=Es(),ee=x.useCallback(async()=>{try{d(!0);const re=await $M({page:m,page_size:g,search:b||void 0,is_registered:S==="all"?void 0:S==="registered",is_banned:N==="all"?void 0:N==="banned",format:P==="all"?void 0:P,sort_by:"usage_count",sort_order:"desc"});a(re.data),v(re.total)}catch(re){const Pe=re instanceof Error?re.message:"加载表情包列表失败";L({title:"错误",description:Pe,variant:"destructive"})}finally{d(!1)}},[m,g,b,S,N,P,L]),le=async()=>{try{const re=await KM();i(re.data)}catch(re){console.error("加载统计数据失败:",re)}};x.useEffect(()=>{ee()},[ee]),x.useEffect(()=>{le()},[]);const xe=async re=>{try{const Pe=await IM(re.id);D(Pe.data),E(!0)}catch(Pe){const ze=Pe instanceof Error?Pe.message:"加载详情失败";L({title:"错误",description:ze,variant:"destructive"})}},F=re=>{D(re),Y(!0)},W=re=>{D(re),$(!0)},fe=async()=>{if(k)try{await XM(k.id),L({title:"成功",description:"表情包已删除"}),$(!1),D(null),ee(),le()}catch(re){const Pe=re instanceof Error?re.message:"删除失败";L({title:"错误",description:Pe,variant:"destructive"})}},I=async re=>{try{await QM(re.id),L({title:"成功",description:"表情包已注册"}),ee(),le()}catch(Pe){const ze=Pe instanceof Error?Pe.message:"注册失败";L({title:"错误",description:ze,variant:"destructive"})}},ve=async re=>{try{await ZM(re.id),L({title:"成功",description:"表情包已封禁"}),ee(),le()}catch(Pe){const ze=Pe instanceof Error?Pe.message:"封禁失败";L({title:"错误",description:ze,variant:"destructive"})}},de=re=>{const Pe=new Set(oe);Pe.has(re)?Pe.delete(re):Pe.add(re),je(Pe)},Ce=()=>{oe.size===s.length&&s.length>0?je(new Set):je(new Set(s.map(re=>re.id)))},Q=async()=>{try{const re=await JM(Array.from(oe));L({title:"批量删除完成",description:re.message}),je(new Set),me(!1),ee(),le()}catch(re){L({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},Oe=()=>{const re=parseInt(R),Pe=Math.ceil(p/g);re>=1&&re<=Pe?(h(re),O("")):L({title:"无效的页码",description:`请输入1-${Pe}之间的页码`,variant:"destructive"})},$e=l?.formats?Object.keys(l.formats):[];return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-4 sm:mb-6",children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),e.jsx(Ct,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[l&&e.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[e.jsx(Ue,{children:e.jsxs(ot,{className:"pb-2",children:[e.jsx(us,{children:"总数"}),e.jsx(ct,{className:"text-2xl",children:l.total})]})}),e.jsx(Ue,{children:e.jsxs(ot,{className:"pb-2",children:[e.jsx(us,{children:"已注册"}),e.jsx(ct,{className:"text-2xl text-green-600",children:l.registered})]})}),e.jsx(Ue,{children:e.jsxs(ot,{className:"pb-2",children:[e.jsx(us,{children:"已封禁"}),e.jsx(ct,{className:"text-2xl text-red-600",children:l.banned})]})}),e.jsx(Ue,{children:e.jsxs(ot,{className:"pb-2",children:[e.jsx(us,{children:"未注册"}),e.jsx(ct,{className:"text-2xl text-gray-600",children:l.unregistered})]})})]}),e.jsxs(Ue,{children:[e.jsx(ot,{children:e.jsxs(ct,{className:"flex items-center gap-2",children:[e.jsx(Lf,{className:"h-5 w-5"}),"搜索和筛选"]})}),e.jsxs(gt,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{children:"搜索"}),e.jsxs("div",{className:"relative",children:[e.jsx(Gs,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{placeholder:"描述或哈希值...",value:b,onChange:re=>{w(re.target.value),h(1)},className:"pl-8"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{children:"注册状态"}),e.jsxs(rt,{value:S,onValueChange:re=>{C(re),h(1)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部"}),e.jsx(ye,{value:"registered",children:"已注册"}),e.jsx(ye,{value:"unregistered",children:"未注册"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{children:"封禁状态"}),e.jsxs(rt,{value:N,onValueChange:re=>{T(re),h(1)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部"}),e.jsx(ye,{value:"banned",children:"已封禁"}),e.jsx(ye,{value:"unbanned",children:"未封禁"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{children:"格式"}),e.jsxs(rt,{value:P,onValueChange:re=>{M(re),h(1)},children:[e.jsx(at,{children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部"}),$e.map(re=>e.jsxs(ye,{value:re,children:[re.toUpperCase()," (",l?.formats[re],")"]},re))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:oe.size>0&&e.jsxs("span",{children:["已选择 ",oe.size," 个表情包"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(rt,{value:g.toString(),onValueChange:re=>{j(parseInt(re)),h(1),je(new Set)},children:[e.jsx(at,{id:"emoji-page-size",className:"w-20",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"10",children:"10"}),e.jsx(ye,{value:"20",children:"20"}),e.jsx(ye,{value:"50",children:"50"}),e.jsx(ye,{value:"100",children:"100"})]})]}),oe.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>je(new Set),children:"取消选择"}),e.jsxs(q,{variant:"destructive",size:"sm",onClick:()=>me(!0),children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t",children:e.jsxs(q,{variant:"outline",size:"sm",onClick:ee,disabled:c,children:[e.jsx(xa,{className:`h-4 w-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"表情包列表"}),e.jsxs(us,{children:["共 ",p," 个表情包,当前第 ",m," 页"]})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:e.jsxs(Rl,{children:[e.jsx(zl,{children:e.jsxs(ns,{children:[e.jsx(He,{className:"w-12",children:e.jsx(Cs,{checked:s.length>0&&oe.size===s.length,onCheckedChange:Ce,"aria-label":"全选"})}),e.jsx(He,{className:"w-16",children:"预览"}),e.jsx(He,{children:"描述"}),e.jsx(He,{children:"格式"}),e.jsx(He,{children:"情绪标签"}),e.jsx(He,{className:"text-center",children:"状态"}),e.jsx(He,{className:"text-right",children:"使用次数"}),e.jsx(He,{className:"text-right",children:"操作"})]})}),e.jsx(Pl,{children:s.length===0?e.jsx(ns,{children:e.jsx(Ae,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):s.map(re=>e.jsxs(ns,{children:[e.jsx(Ae,{children:e.jsx(Cs,{checked:oe.has(re.id),onCheckedChange:()=>de(re.id),"aria-label":`选择 ${re.description}`})}),e.jsx(Ae,{children:e.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Zf(re.id),alt:re.description||"表情包",className:"w-full h-full object-cover",onError:Pe=>{const ze=Pe.target;ze.style.display="none";const Zt=ze.parentElement;Zt&&(Zt.innerHTML='<svg class="h-6 w-6 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),e.jsx(Ae,{children:e.jsxs("div",{className:"space-y-1 max-w-xs",children:[e.jsx("div",{className:"font-medium truncate",title:re.description||"无描述",children:re.description||"无描述"}),e.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[re.emoji_hash.slice(0,16),"..."]})]})}),e.jsx(Ae,{children:e.jsx(_t,{variant:"outline",children:re.format.toUpperCase()})}),e.jsx(Ae,{children:e.jsx(Yj,{emotions:re.emotion})}),e.jsx(Ae,{className:"align-middle",children:e.jsxs("div",{className:"flex gap-2 justify-center",children:[re.is_registered&&e.jsxs(_t,{variant:"default",className:"bg-green-600",children:[e.jsx(Ys,{className:"h-3 w-3 mr-1"}),"已注册"]}),re.is_banned&&e.jsxs(_t,{variant:"destructive",children:[e.jsx(Af,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),e.jsx(Ae,{className:"text-right font-mono",children:re.usage_count}),e.jsx(Ae,{children:e.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>xe(re),children:[e.jsx(Fr,{className:"h-4 w-4 mr-1"}),"详情"]}),e.jsxs(q,{variant:"default",size:"sm",onClick:()=>F(re),children:[e.jsx(qr,{className:"h-4 w-4 mr-1"}),"编辑"]}),!re.is_registered&&e.jsxs(q,{size:"sm",onClick:()=>I(re),className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(Ys,{className:"h-4 w-4 mr-1"}),"注册"]}),!re.is_banned&&e.jsxs(q,{size:"sm",onClick:()=>ve(re),className:"bg-orange-600 hover:bg-orange-700 text-white",children:[e.jsx(Jv,{className:"h-4 w-4 mr-1"}),"封禁"]}),e.jsxs(q,{size:"sm",onClick:()=>W(re),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},re.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):s.map(re=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Zf(re.id),alt:re.description||"表情包",className:"w-full h-full object-cover",onError:Pe=>{const ze=Pe.target;ze.style.display="none";const Zt=ze.parentElement;Zt&&(Zt.innerHTML='<svg class="h-6 w-6 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:re.description||"无描述",children:re.description||"无描述"}),e.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[re.emoji_hash.slice(0,16),"..."]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[e.jsx(_t,{variant:"outline",className:"text-xs flex-shrink-0",children:re.format.toUpperCase()}),re.is_registered&&e.jsxs(_t,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[e.jsx(Ys,{className:"h-3 w-3 mr-1"}),"已注册"]}),re.is_banned&&e.jsxs(_t,{variant:"destructive",className:"text-xs flex-shrink-0",children:[e.jsx(Af,{className:"h-3 w-3 mr-1"}),"已封禁"]}),e.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",re.usage_count]})]}),re.emotion&&re.emotion.length>0&&e.jsx("div",{className:"min-w-0 overflow-hidden",children:e.jsx(Yj,{emotions:re.emotion})})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>xe(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Fr,{className:"h-3 w-3 mr-1"}),"详情"]}),e.jsxs(q,{variant:"default",size:"sm",onClick:()=>F(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(qr,{className:"h-3 w-3 mr-1"}),"编辑"]}),!re.is_registered&&e.jsxs(q,{size:"sm",onClick:()=>I(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(Ys,{className:"h-3 w-3 mr-1"}),"注册"]}),!re.is_banned&&e.jsxs(q,{size:"sm",onClick:()=>ve(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-orange-600 hover:bg-orange-700 text-white",children:[e.jsx(Jv,{className:"h-3 w-3 mr-1"}),"封禁"]}),e.jsxs(q,{size:"sm",onClick:()=>W(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},re.id))}),p>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(m-1)*g+1," 到"," ",Math.min(m*g,p)," 条,共 ",p," 条"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>h(1),disabled:m===1,className:"hidden sm:flex",children:e.jsx(vo,{className:"h-4 w-4"})}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(re=>Math.max(1,re-1)),disabled:m===1,children:[e.jsx(Ol,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{type:"number",value:R,onChange:re=>O(re.target.value),onKeyDown:re=>re.key==="Enter"&&Oe(),placeholder:m.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(p/g)}),e.jsx(q,{variant:"outline",size:"sm",onClick:Oe,disabled:!R,className:"h-8",children:"跳转"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(re=>re+1),disabled:m>=Math.ceil(p/g),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Al,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>h(Math.ceil(p/g)),disabled:m>=Math.ceil(p/g),className:"hidden sm:flex",children:e.jsx(jo,{className:"h-4 w-4"})})]})]})]})]}),e.jsx(tD,{emoji:k,open:A,onOpenChange:E}),e.jsx(sD,{emoji:k,open:B,onOpenChange:Y,onSuccess:()=>{ee(),le()}})]})}),e.jsx(Ft,{open:ae,onOpenChange:me,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认批量删除"}),e.jsxs(Pt,{children:["你确定要删除选中的 ",oe.size," 个表情包吗?此操作不可撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:Q,children:"确认删除"})]})]})}),e.jsx(bs,{open:G,onOpenChange:$,children:e.jsxs(ms,{children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"确认删除"}),e.jsx(ks,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>$(!1),children:"取消"}),e.jsx(q,{variant:"destructive",onClick:fe,children:"删除"})]})]})})]})}function tD({emoji:s,open:a,onOpenChange:l}){if(!s)return null;const i=c=>c?new Date(c*1e3).toLocaleString("zh-CN"):"-";return e.jsx(bs,{open:a,onOpenChange:l,children:e.jsxs(ms,{className:"max-w-2xl max-h-[90vh]",children:[e.jsx(fs,{children:e.jsx(hs,{children:"表情包详情"})}),e.jsx(Ct,{className:"max-h-[calc(90vh-8rem)] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Zf(s.id),alt:s.description||"表情包",className:"w-full h-full object-cover",onError:c=>{const d=c.target;d.style.display="none";const m=d.parentElement;m&&(m.innerHTML='<svg class="h-16 w-16 text-muted-foreground" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>')}})})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"ID"}),e.jsx("div",{className:"mt-1 font-mono",children:s.id})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"格式"}),e.jsx("div",{className:"mt-1",children:e.jsx(_t,{variant:"outline",children:s.format.toUpperCase()})})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"文件路径"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:s.full_path})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"哈希值"}),e.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:s.emoji_hash})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"描述"}),e.jsx("div",{className:"mt-1",children:s.description||"-"})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"情绪标签"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(()=>{const c=s.emotion?s.emotion.split(/[,,]/).map(d=>d.trim()).filter(Boolean):[];return c.length>0?c.map((d,m)=>e.jsx(_t,{variant:"secondary",children:d},m)):e.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})()})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"状态"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[s.is_registered&&e.jsx(_t,{variant:"default",className:"bg-green-600",children:"已注册"}),s.is_banned&&e.jsx(_t,{variant:"destructive",children:"已封禁"}),!s.is_registered&&!s.is_banned&&e.jsx(_t,{variant:"outline",children:"未注册"})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"使用次数"}),e.jsx("div",{className:"mt-1 font-mono text-lg",children:s.usage_count})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"记录时间"}),e.jsx("div",{className:"mt-1 text-sm",children:i(s.record_time)})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"注册时间"}),e.jsx("div",{className:"mt-1 text-sm",children:i(s.register_time)})]})]}),e.jsxs("div",{children:[e.jsx(U,{className:"text-muted-foreground",children:"最后使用"}),e.jsx("div",{className:"mt-1 text-sm",children:i(s.last_used_time)})]})]})})]})})}function sD({emoji:s,open:a,onOpenChange:l,onSuccess:i}){const[c,d]=x.useState(""),[m,h]=x.useState(""),[p,v]=x.useState(!1),[g,j]=x.useState(!1),[b,w]=x.useState(!1),{toast:S}=Es();x.useEffect(()=>{s&&(d(s.description||""),h(s.emotion||""),v(s.is_registered),j(s.is_banned))},[s]);const C=async()=>{if(s)try{w(!0);const N=m.split(/[,,]/).map(T=>T.trim()).filter(Boolean).join(",");await WM(s.id,{description:c||void 0,emotion:N||void 0,is_registered:p,is_banned:g}),S({title:"成功",description:"表情包信息已更新"}),l(!1),i()}catch(N){const T=N instanceof Error?N.message:"保存失败";S({title:"错误",description:T,variant:"destructive"})}finally{w(!1)}};return s?e.jsx(bs,{open:a,onOpenChange:l,children:e.jsxs(ms,{className:"max-w-2xl",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"编辑表情包"}),e.jsx(ks,{children:"修改表情包的描述和标签信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(U,{children:"描述"}),e.jsx(Dt,{value:c,onChange:N=>d(N.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(U,{children:"情绪标签"}),e.jsx(pe,{value:m,onChange:N=>h(N.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔(支持中英文逗号)"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Cs,{id:"is_registered",checked:p,onCheckedChange:N=>v(N===!0)}),e.jsx(U,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Cs,{id:"is_banned",checked:g,onCheckedChange:N=>j(N===!0)}),e.jsx(U,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>l(!1),children:"取消"}),e.jsx(q,{onClick:C,disabled:b,children:b?"保存中...":"保存"})]})]})}):null}function Yj({emotions:s}){const a=s?s.split(/[,,]/).map(d=>d.trim()).filter(Boolean):[];if(a.length===0)return e.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const l=(d,m=6)=>d.length<=m?d:d.slice(0,m)+"...",i=a.slice(0,3),c=a.length-3;return e.jsxs("div",{className:"flex flex-wrap gap-1 max-w-full overflow-hidden",children:[i.map((d,m)=>e.jsx(_t,{variant:"secondary",className:"text-xs flex-shrink-0",title:d,children:l(d)},m)),c>0&&e.jsxs(_t,{variant:"outline",className:"text-xs flex-shrink-0",title:`还有 ${c} 个标签: ${a.slice(3).join(", ")}`,children:["+",c]})]})}const Ll="/api/webui/expression";async function nD(s){const a=new URLSearchParams;s.page&&a.append("page",s.page.toString()),s.page_size&&a.append("page_size",s.page_size.toString()),s.search&&a.append("search",s.search),s.chat_id&&a.append("chat_id",s.chat_id);const l=await Fe(`${Ll}/list?${a}`,{headers:Ie()});if(!l.ok){const i=await l.json();throw new Error(i.detail||"获取表达方式列表失败")}return l.json()}async function aD(s){const a=await Fe(`${Ll}/${s}`,{headers:Ie()});if(!a.ok){const l=await a.json();throw new Error(l.detail||"获取表达方式详情失败")}return a.json()}async function lD(s){const a=await Fe(`${Ll}/`,{method:"POST",headers:Ie(),body:JSON.stringify(s)});if(!a.ok){const l=await a.json();throw new Error(l.detail||"创建表达方式失败")}return a.json()}async function rD(s,a){const l=await Fe(`${Ll}/${s}`,{method:"PATCH",headers:Ie(),body:JSON.stringify(a)});if(!l.ok){const i=await l.json();throw new Error(i.detail||"更新表达方式失败")}return l.json()}async function iD(s){const a=await Fe(`${Ll}/${s}`,{method:"DELETE",headers:Ie()});if(!a.ok){const l=await a.json();throw new Error(l.detail||"删除表达方式失败")}return a.json()}async function oD(s){const a=await Fe(`${Ll}/batch/delete`,{method:"POST",headers:Ie(),body:JSON.stringify({ids:s})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"批量删除表达方式失败")}return a.json()}async function cD(){const s=await Fe(`${Ll}/stats/summary`,{headers:Ie()});if(!s.ok){const a=await s.json();throw new Error(a.detail||"获取统计数据失败")}return s.json()}function dD(){const[s,a]=x.useState([]),[l,i]=x.useState(!0),[c,d]=x.useState(0),[m,h]=x.useState(1),[p,v]=x.useState(20),[g,j]=x.useState(""),[b,w]=x.useState(null),[S,C]=x.useState(!1),[N,T]=x.useState(!1),[P,M]=x.useState(!1),[k,D]=x.useState(null),[A,E]=x.useState(new Set),[B,Y]=x.useState(!1),[G,$]=x.useState(""),[oe,je]=x.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:ae}=Es(),me=async()=>{try{i(!0);const I=await nD({page:m,page_size:p,search:g||void 0});a(I.data),d(I.total)}catch(I){ae({title:"加载失败",description:I instanceof Error?I.message:"无法加载表达方式",variant:"destructive"})}finally{i(!1)}},R=async()=>{try{const I=await cD();je(I.data)}catch(I){console.error("加载统计数据失败:",I)}};x.useEffect(()=>{me(),R()},[m,p,g]);const O=async I=>{try{const ve=await aD(I.id);w(ve.data),C(!0)}catch(ve){ae({title:"加载详情失败",description:ve instanceof Error?ve.message:"无法加载表达方式详情",variant:"destructive"})}},L=I=>{w(I),T(!0)},ee=async I=>{try{await iD(I.id),ae({title:"删除成功",description:`已删除表达方式: ${I.situation}`}),D(null),me(),R()}catch(ve){ae({title:"删除失败",description:ve instanceof Error?ve.message:"无法删除表达方式",variant:"destructive"})}},le=I=>{const ve=new Set(A);ve.has(I)?ve.delete(I):ve.add(I),E(ve)},xe=()=>{A.size===s.length&&s.length>0?E(new Set):E(new Set(s.map(I=>I.id)))},F=async()=>{try{await oD(Array.from(A)),ae({title:"批量删除成功",description:`已删除 ${A.size} 个表达方式`}),E(new Set),Y(!1),me(),R()}catch(I){ae({title:"批量删除失败",description:I instanceof Error?I.message:"无法批量删除表达方式",variant:"destructive"})}},W=()=>{const I=parseInt(G),ve=Math.ceil(c/p);I>=1&&I<=ve?(h(I),$("")):ae({title:"无效的页码",description:`请输入1-${ve}之间的页码`,variant:"destructive"})},fe=I=>I?new Date(I*1e3).toLocaleString("zh-CN"):"-";return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(po,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),e.jsxs(q,{onClick:()=>M(!0),className:"gap-2",children:[e.jsx(ys,{className:"h-4 w-4"}),"新增表达方式"]})]})}),e.jsx(Ct,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:oe.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:oe.recent_7days})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:oe.chat_count})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx(U,{htmlFor:"search",children:"搜索"}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Gs,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{id:"search",placeholder:"搜索情境、风格或上下文...",value:g,onChange:I=>j(I.target.value),className:"pl-9"})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:A.size>0&&e.jsxs("span",{children:["已选择 ",A.size," 个表达方式"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(rt,{value:p.toString(),onValueChange:I=>{v(parseInt(I)),h(1),E(new Set)},children:[e.jsx(at,{id:"page-size",className:"w-20",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"10",children:"10"}),e.jsx(ye,{value:"20",children:"20"}),e.jsx(ye,{value:"50",children:"50"}),e.jsx(ye,{value:"100",children:"100"})]})]}),A.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>E(new Set),children:"取消选择"}),e.jsxs(q,{variant:"destructive",size:"sm",onClick:()=>Y(!0),children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(Rl,{children:[e.jsx(zl,{children:e.jsxs(ns,{children:[e.jsx(He,{className:"w-12",children:e.jsx(Cs,{checked:A.size===s.length&&s.length>0,onCheckedChange:xe})}),e.jsx(He,{children:"情境"}),e.jsx(He,{children:"风格"}),e.jsx(He,{children:"聊天ID"}),e.jsx(He,{children:"最后活跃"}),e.jsx(He,{className:"text-right",children:"操作"})]})}),e.jsx(Pl,{children:l?e.jsx(ns,{children:e.jsx(Ae,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):s.length===0?e.jsx(ns,{children:e.jsx(Ae,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):s.map(I=>e.jsxs(ns,{children:[e.jsx(Ae,{children:e.jsx(Cs,{checked:A.has(I.id),onCheckedChange:()=>le(I.id)})}),e.jsx(Ae,{className:"font-medium max-w-xs truncate",children:I.situation}),e.jsx(Ae,{className:"max-w-xs truncate",children:I.style}),e.jsx(Ae,{className:"font-mono text-sm",children:I.chat_id}),e.jsx(Ae,{className:"text-sm text-muted-foreground",children:fe(I.last_active_time)}),e.jsx(Ae,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>O(I),children:[e.jsx(Mn,{className:"h-4 w-4 mr-1"}),"详情"]}),e.jsxs(q,{variant:"default",size:"sm",onClick:()=>L(I),children:[e.jsx(qr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsxs(q,{size:"sm",onClick:()=>D(I),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},I.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:l?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):s.map(I=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Cs,{checked:A.has(I.id),onCheckedChange:()=>le(I.id),className:"mt-1"}),e.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:I.situation,children:I.situation})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),e.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:I.style,children:I.style})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),e.jsx("p",{className:"font-mono text-xs truncate",children:I.chat_id})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),e.jsx("p",{className:"text-xs",children:fe(I.last_active_time)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>O(I),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Mn,{className:"h-3 w-3 mr-1"}),"查看"]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>L(I),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(qr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>D(I),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ft,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},I.id))}),c>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",c," 条记录,第 ",m," / ",Math.ceil(c/p)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>h(1),disabled:m===1,className:"hidden sm:flex",children:e.jsx(vo,{className:"h-4 w-4"})}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(m-1),disabled:m===1,children:[e.jsx(Ol,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{type:"number",value:G,onChange:I=>$(I.target.value),onKeyDown:I=>I.key==="Enter"&&W(),placeholder:m.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/p)}),e.jsx(q,{variant:"outline",size:"sm",onClick:W,disabled:!G,className:"h-8",children:"跳转"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(m+1),disabled:m>=Math.ceil(c/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Al,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>h(Math.ceil(c/p)),disabled:m>=Math.ceil(c/p),className:"hidden sm:flex",children:e.jsx(jo,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(uD,{expression:b,open:S,onOpenChange:C}),e.jsx(mD,{open:P,onOpenChange:M,onSuccess:()=>{me(),R(),M(!1)}}),e.jsx(fD,{expression:b,open:N,onOpenChange:T,onSuccess:()=>{me(),R(),T(!1)}}),e.jsx(Ft,{open:!!k,onOpenChange:()=>D(null),children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除表达方式 "',k?.situation,'" 吗? 此操作不可撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>k&&ee(k),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(hD,{open:B,onOpenChange:Y,onConfirm:F,count:A.size})]})}function uD({expression:s,open:a,onOpenChange:l}){if(!s)return null;const i=c=>c?new Date(c*1e3).toLocaleString("zh-CN"):"-";return e.jsx(bs,{open:a,onOpenChange:l,children:e.jsxs(ms,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"表达方式详情"}),e.jsx(ks,{children:"查看表达方式的完整信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Er,{label:"情境",value:s.situation}),e.jsx(Er,{label:"风格",value:s.style}),e.jsx(Er,{icon:xd,label:"聊天ID",value:s.chat_id,mono:!0}),e.jsx(Er,{icon:xd,label:"记录ID",value:s.id.toString(),mono:!0})]}),s.context&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:"上下文"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:s.context})]}),s.up_content&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:"上文内容"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:s.up_content})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Er,{icon:_l,label:"最后活跃",value:i(s.last_active_time)}),e.jsx(Er,{icon:_l,label:"创建时间",value:i(s.create_date)})]})]}),e.jsx($s,{children:e.jsx(q,{onClick:()=>l(!1),children:"关闭"})})]})})}function Er({icon:s,label:a,value:l,mono:i=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(U,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s&&e.jsx(s,{className:"h-3 w-3"}),a]}),e.jsx("div",{className:Z("text-sm",i&&"font-mono",!l&&"text-muted-foreground"),children:l||"-"})]})}function mD({open:s,onOpenChange:a,onSuccess:l}){const[i,c]=x.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[d,m]=x.useState(!1),{toast:h}=Es(),p=async()=>{if(!i.situation||!i.style||!i.chat_id){h({title:"验证失败",description:"请填写必填字段情境、风格和聊天ID",variant:"destructive"});return}try{m(!0),await lD(i),h({title:"创建成功",description:"表达方式已创建"}),c({situation:"",style:"",context:"",up_content:"",chat_id:""}),l()}catch(v){h({title:"创建失败",description:v instanceof Error?v.message:"无法创建表达方式",variant:"destructive"})}finally{m(!1)}};return e.jsx(bs,{open:s,onOpenChange:a,children:e.jsxs(ms,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"新增表达方式"}),e.jsx(ks,{children:"创建新的表达方式记录"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(U,{htmlFor:"situation",children:["情境 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(pe,{id:"situation",value:i.situation,onChange:v=>c({...i,situation:v.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(U,{htmlFor:"style",children:["风格 ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(pe,{id:"style",value:i.style,onChange:v=>c({...i,style:v.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(U,{htmlFor:"chat_id",children:["聊天ID ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(pe,{id:"chat_id",value:i.chat_id,onChange:v=>c({...i,chat_id:v.target.value}),placeholder:"关联的聊天ID"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"context",children:"上下文"}),e.jsx(Dt,{id:"context",value:i.context,onChange:v=>c({...i,context:v.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"up_content",children:"上文内容"}),e.jsx(Dt,{id:"up_content",value:i.up_content,onChange:v=>c({...i,up_content:v.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>a(!1),children:"取消"}),e.jsx(q,{onClick:p,disabled:d,children:d?"创建中...":"创建"})]})]})})}function fD({expression:s,open:a,onOpenChange:l,onSuccess:i}){const[c,d]=x.useState({}),[m,h]=x.useState(!1),{toast:p}=Es();x.useEffect(()=>{s&&d({situation:s.situation,style:s.style,context:s.context||"",up_content:s.up_content||"",chat_id:s.chat_id})},[s]);const v=async()=>{if(s)try{h(!0),await rD(s.id,c),p({title:"保存成功",description:"表达方式已更新"}),i()}catch(g){p({title:"保存失败",description:g instanceof Error?g.message:"无法更新表达方式",variant:"destructive"})}finally{h(!1)}};return s?e.jsx(bs,{open:a,onOpenChange:l,children:e.jsxs(ms,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"编辑表达方式"}),e.jsx(ks,{children:"修改表达方式的信息"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit_situation",children:"情境"}),e.jsx(pe,{id:"edit_situation",value:c.situation||"",onChange:g=>d({...c,situation:g.target.value}),placeholder:"描述使用场景"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit_style",children:"风格"}),e.jsx(pe,{id:"edit_style",value:c.style||"",onChange:g=>d({...c,style:g.target.value}),placeholder:"描述表达风格"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit_chat_id",children:"聊天ID"}),e.jsx(pe,{id:"edit_chat_id",value:c.chat_id||"",onChange:g=>d({...c,chat_id:g.target.value}),placeholder:"关联的聊天ID"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit_context",children:"上下文"}),e.jsx(Dt,{id:"edit_context",value:c.context||"",onChange:g=>d({...c,context:g.target.value}),placeholder:"上下文信息",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit_up_content",children:"上文内容"}),e.jsx(Dt,{id:"edit_up_content",value:c.up_content||"",onChange:g=>d({...c,up_content:g.target.value}),placeholder:"上文内容",rows:3})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>l(!1),children:"取消"}),e.jsx(q,{onClick:v,disabled:m,children:m?"保存中...":"保存"})]})]})}):null}function hD({open:s,onOpenChange:a,onConfirm:l,count:i}){return e.jsx(Ft,{open:s,onOpenChange:a,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认批量删除"}),e.jsxs(Pt,{children:["您即将删除 ",i," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const si="/api/webui/person";async function xD(s){const a=new URLSearchParams;s.page&&a.append("page",s.page.toString()),s.page_size&&a.append("page_size",s.page_size.toString()),s.search&&a.append("search",s.search),s.is_known!==void 0&&a.append("is_known",s.is_known.toString()),s.platform&&a.append("platform",s.platform);const l=await Fe(`${si}/list?${a}`,{headers:Ie()});if(!l.ok){const i=await l.json();throw new Error(i.detail||"获取人物列表失败")}return l.json()}async function pD(s){const a=await Fe(`${si}/${s}`,{headers:Ie()});if(!a.ok){const l=await a.json();throw new Error(l.detail||"获取人物详情失败")}return a.json()}async function gD(s,a){const l=await Fe(`${si}/${s}`,{method:"PATCH",headers:Ie(),body:JSON.stringify(a)});if(!l.ok){const i=await l.json();throw new Error(i.detail||"更新人物信息失败")}return l.json()}async function vD(s){const a=await Fe(`${si}/${s}`,{method:"DELETE",headers:Ie()});if(!a.ok){const l=await a.json();throw new Error(l.detail||"删除人物信息失败")}return a.json()}async function jD(){const s=await Fe(`${si}/stats/summary`,{headers:Ie()});if(!s.ok){const a=await s.json();throw new Error(a.detail||"获取统计数据失败")}return s.json()}async function yD(s){const a=await Fe(`${si}/batch/delete`,{method:"POST",headers:Ie(),body:JSON.stringify({person_ids:s})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"批量删除失败")}return a.json()}function bD(){const[s,a]=x.useState([]),[l,i]=x.useState(!0),[c,d]=x.useState(0),[m,h]=x.useState(1),[p,v]=x.useState(20),[g,j]=x.useState(""),[b,w]=x.useState(void 0),[S,C]=x.useState(void 0),[N,T]=x.useState(null),[P,M]=x.useState(!1),[k,D]=x.useState(!1),[A,E]=x.useState(null),[B,Y]=x.useState({total:0,known:0,unknown:0,platforms:{}}),[G,$]=x.useState(new Set),[oe,je]=x.useState(!1),[ae,me]=x.useState(""),{toast:R}=Es(),O=async()=>{try{i(!0);const Q=await xD({page:m,page_size:p,search:g||void 0,is_known:b,platform:S});a(Q.data),d(Q.total)}catch(Q){R({title:"加载失败",description:Q instanceof Error?Q.message:"无法加载人物信息",variant:"destructive"})}finally{i(!1)}},L=async()=>{try{const Q=await jD();Y(Q.data)}catch(Q){console.error("加载统计数据失败:",Q)}};x.useEffect(()=>{O(),L()},[m,p,g,b,S]);const ee=async Q=>{try{const Oe=await pD(Q.person_id);T(Oe.data),M(!0)}catch(Oe){R({title:"加载详情失败",description:Oe instanceof Error?Oe.message:"无法加载人物详情",variant:"destructive"})}},le=Q=>{T(Q),D(!0)},xe=async Q=>{try{await vD(Q.person_id),R({title:"删除成功",description:`已删除人物信息: ${Q.person_name||Q.nickname||Q.user_id}`}),E(null),O(),L()}catch(Oe){R({title:"删除失败",description:Oe instanceof Error?Oe.message:"无法删除人物信息",variant:"destructive"})}},F=x.useMemo(()=>Object.keys(B.platforms),[B.platforms]),W=Q=>{const Oe=new Set(G);Oe.has(Q)?Oe.delete(Q):Oe.add(Q),$(Oe)},fe=()=>{G.size===s.length&&s.length>0?$(new Set):$(new Set(s.map(Q=>Q.person_id)))},I=()=>{if(G.size===0){R({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}je(!0)},ve=async()=>{try{const Q=await yD(Array.from(G));R({title:"批量删除完成",description:Q.message}),$(new Set),je(!1),O(),L()}catch(Q){R({title:"批量删除失败",description:Q instanceof Error?Q.message:"批量删除失败",variant:"destructive"})}},de=()=>{const Q=parseInt(ae),Oe=Math.ceil(c/p);Q>=1&&Q<=Oe?(h(Q),me("")):R({title:"无效的页码",description:`请输入1-${Oe}之间的页码`,variant:"destructive"})},Ce=Q=>Q?new Date(Q*1e3).toLocaleString("zh-CN"):"-";return e.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[e.jsx("div",{className:"mb-4 sm:mb-6",children:e.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[e.jsx(H2,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),e.jsx(Ct,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),e.jsx("div",{className:"text-2xl font-bold mt-1",children:B.total})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:B.known})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),e.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:B.unknown})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(U,{htmlFor:"search",children:"搜索"}),e.jsxs("div",{className:"relative mt-1.5",children:[e.jsx(Gs,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:g,onChange:Q=>j(Q.target.value),className:"pl-9"})]})]}),e.jsxs("div",{children:[e.jsx(U,{htmlFor:"filter-known",children:"认识状态"}),e.jsxs(rt,{value:b===void 0?"all":b.toString(),onValueChange:Q=>{w(Q==="all"?void 0:Q==="true"),h(1)},children:[e.jsx(at,{id:"filter-known",className:"mt-1.5",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部"}),e.jsx(ye,{value:"true",children:"已认识"}),e.jsx(ye,{value:"false",children:"未认识"})]})]})]}),e.jsxs("div",{children:[e.jsx(U,{htmlFor:"filter-platform",children:"平台"}),e.jsxs(rt,{value:S||"all",onValueChange:Q=>{C(Q==="all"?void 0:Q),h(1)},children:[e.jsx(at,{id:"filter-platform",className:"mt-1.5",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部平台"}),F.map(Q=>e.jsxs(ye,{value:Q,children:[Q," (",B.platforms[Q],")"]},Q))]})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 mt-4 pt-4 border-t",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:G.size>0&&e.jsxs("span",{children:["已选择 ",G.size," 个人物"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),e.jsxs(rt,{value:p.toString(),onValueChange:Q=>{v(parseInt(Q)),h(1),$(new Set)},children:[e.jsx(at,{id:"page-size",className:"w-20",children:e.jsx(it,{})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"10",children:"10"}),e.jsx(ye,{value:"20",children:"20"}),e.jsx(ye,{value:"50",children:"50"}),e.jsx(ye,{value:"100",children:"100"})]})]}),G.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>$(new Set),children:"取消选择"}),e.jsxs(q,{variant:"destructive",size:"sm",onClick:I,children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),e.jsxs("div",{className:"rounded-lg border bg-card",children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(Rl,{children:[e.jsx(zl,{children:e.jsxs(ns,{children:[e.jsx(He,{className:"w-12",children:e.jsx(Cs,{checked:s.length>0&&G.size===s.length,onCheckedChange:fe,"aria-label":"全选"})}),e.jsx(He,{children:"状态"}),e.jsx(He,{children:"名称"}),e.jsx(He,{children:"昵称"}),e.jsx(He,{children:"平台"}),e.jsx(He,{children:"用户ID"}),e.jsx(He,{children:"最后更新"}),e.jsx(He,{className:"text-right",children:"操作"})]})}),e.jsx(Pl,{children:l?e.jsx(ns,{children:e.jsx(Ae,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):s.length===0?e.jsx(ns,{children:e.jsx(Ae,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):s.map(Q=>e.jsxs(ns,{children:[e.jsx(Ae,{children:e.jsx(Cs,{checked:G.has(Q.person_id),onCheckedChange:()=>W(Q.person_id),"aria-label":`选择 ${Q.person_name||Q.nickname||Q.user_id}`})}),e.jsx(Ae,{children:e.jsx("div",{className:Z("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",Q.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:Q.is_known?"已认识":"未认识"})}),e.jsx(Ae,{className:"font-medium",children:Q.person_name||e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(Ae,{children:Q.nickname||"-"}),e.jsx(Ae,{children:Q.platform}),e.jsx(Ae,{className:"font-mono text-sm",children:Q.user_id}),e.jsx(Ae,{className:"text-sm text-muted-foreground",children:Ce(Q.last_know)}),e.jsx(Ae,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(q,{variant:"default",size:"sm",onClick:()=>ee(Q),children:[e.jsx(Mn,{className:"h-4 w-4 mr-1"}),"详情"]}),e.jsxs(q,{variant:"default",size:"sm",onClick:()=>le(Q),children:[e.jsx(qr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsxs(q,{size:"sm",onClick:()=>E(Q),className:"bg-red-600 hover:bg-red-700 text-white",children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},Q.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3 p-4",children:l?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):s.map(Q=>e.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Cs,{checked:G.has(Q.person_id),onCheckedChange:()=>W(Q.person_id),className:"mt-1"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:Z("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",Q.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:Q.is_known?"已认识":"未认识"}),e.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:Q.person_name||e.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),Q.nickname&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",Q.nickname]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),e.jsx("p",{className:"font-medium text-xs",children:Q.platform})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),e.jsx("p",{className:"font-mono text-xs truncate",title:Q.user_id,children:Q.user_id})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),e.jsx("p",{className:"text-xs",children:Ce(Q.last_know)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>ee(Q),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(Mn,{className:"h-3 w-3 mr-1"}),"查看"]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>le(Q),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[e.jsx(qr,{className:"h-3 w-3 mr-1"}),"编辑"]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>E(Q),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[e.jsx(ft,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},Q.id))}),c>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",c," 条记录,第 ",m," / ",Math.ceil(c/p)," 页"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>h(1),disabled:m===1,className:"hidden sm:flex",children:e.jsx(vo,{className:"h-4 w-4"})}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(m-1),disabled:m===1,children:[e.jsx(Ol,{className:"h-4 w-4 sm:mr-1"}),e.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{type:"number",value:ae,onChange:Q=>me(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&de(),placeholder:m.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/p)}),e.jsx(q,{variant:"outline",size:"sm",onClick:de,disabled:!ae,className:"h-8",children:"跳转"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(m+1),disabled:m>=Math.ceil(c/p),children:[e.jsx("span",{className:"hidden sm:inline",children:"下一页"}),e.jsx(Al,{className:"h-4 w-4 sm:ml-1"})]}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>h(Math.ceil(c/p)),disabled:m>=Math.ceil(c/p),className:"hidden sm:flex",children:e.jsx(jo,{className:"h-4 w-4"})})]})]})]})]})}),e.jsx(ND,{person:N,open:P,onOpenChange:M}),e.jsx(wD,{person:N,open:k,onOpenChange:D,onSuccess:()=>{O(),L(),D(!1)}}),e.jsx(Ft,{open:!!A,onOpenChange:()=>E(null),children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认删除"}),e.jsxs(Pt,{children:['确定要删除人物信息 "',A?.person_name||A?.nickname||A?.user_id,'" 吗? 此操作不可撤销。']})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:()=>A&&xe(A),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),e.jsx(Ft,{open:oe,onOpenChange:je,children:e.jsxs(Ot,{children:[e.jsxs(At,{children:[e.jsx(zt,{children:"确认批量删除"}),e.jsxs(Pt,{children:["确定要删除选中的 ",G.size," 个人物信息吗? 此操作不可撤销。"]})]}),e.jsxs(Rt,{children:[e.jsx(Bt,{children:"取消"}),e.jsx(Lt,{onClick:ve,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function ND({person:s,open:a,onOpenChange:l}){if(!s)return null;const i=c=>c?new Date(c*1e3).toLocaleString("zh-CN"):"-";return e.jsx(bs,{open:a,onOpenChange:l,children:e.jsxs(ms,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"人物详情"}),e.jsxs(ks,{children:["查看 ",s.person_name||s.nickname||s.user_id," 的完整信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(ma,{icon:Ey,label:"人物名称",value:s.person_name}),e.jsx(ma,{icon:po,label:"昵称",value:s.nickname}),e.jsx(ma,{icon:xd,label:"用户ID",value:s.user_id,mono:!0}),e.jsx(ma,{icon:xd,label:"人物ID",value:s.person_id,mono:!0}),e.jsx(ma,{label:"平台",value:s.platform}),e.jsx(ma,{label:"状态",value:s.is_known?"已认识":"未认识"})]}),s.name_reason&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),e.jsx("p",{className:"mt-1 text-sm",children:s.name_reason})]}),s.memory_points&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:"个人印象"}),e.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:s.memory_points})]}),s.group_nick_name&&s.group_nick_name.length>0&&e.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[e.jsx(U,{className:"text-xs text-muted-foreground",children:"群昵称"}),e.jsx("div",{className:"mt-2 space-y-1",children:s.group_nick_name.map((c,d)=>e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:c.group_id}),e.jsx("span",{children:"→"}),e.jsx("span",{children:c.group_nick_name})]},d))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(ma,{icon:_l,label:"认识时间",value:i(s.know_times)}),e.jsx(ma,{icon:_l,label:"首次记录",value:i(s.know_since)}),e.jsx(ma,{icon:_l,label:"最后更新",value:i(s.last_know)})]})]}),e.jsx($s,{children:e.jsx(q,{onClick:()=>l(!1),children:"关闭"})})]})})}function ma({icon:s,label:a,value:l,mono:i=!1}){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs(U,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s&&e.jsx(s,{className:"h-3 w-3"}),a]}),e.jsx("div",{className:Z("text-sm",i&&"font-mono",!l&&"text-muted-foreground"),children:l||"-"})]})}function wD({person:s,open:a,onOpenChange:l,onSuccess:i}){const[c,d]=x.useState({}),[m,h]=x.useState(!1),{toast:p}=Es();x.useEffect(()=>{s&&d({person_name:s.person_name||"",name_reason:s.name_reason||"",nickname:s.nickname||"",memory_points:s.memory_points||"",is_known:s.is_known})},[s]);const v=async()=>{if(s)try{h(!0),await gD(s.person_id,c),p({title:"保存成功",description:"人物信息已更新"}),i()}catch(g){p({title:"保存失败",description:g instanceof Error?g.message:"无法更新人物信息",variant:"destructive"})}finally{h(!1)}};return s?e.jsx(bs,{open:a,onOpenChange:l,children:e.jsxs(ms,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"编辑人物信息"}),e.jsxs(ks,{children:["修改 ",s.person_name||s.nickname||s.user_id," 的信息"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"person_name",children:"人物名称"}),e.jsx(pe,{id:"person_name",value:c.person_name||"",onChange:g=>d({...c,person_name:g.target.value}),placeholder:"为这个人设置一个名称"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"nickname",children:"昵称"}),e.jsx(pe,{id:"nickname",value:c.nickname||"",onChange:g=>d({...c,nickname:g.target.value}),placeholder:"昵称"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"name_reason",children:"名称设定原因"}),e.jsx(Dt,{id:"name_reason",value:c.name_reason||"",onChange:g=>d({...c,name_reason:g.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"memory_points",children:"个人印象"}),e.jsx(Dt,{id:"memory_points",value:c.memory_points||"",onChange:g=>d({...c,memory_points:g.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx(U,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),e.jsx(Ze,{id:"is_known",checked:c.is_known,onCheckedChange:g=>d({...c,is_known:g})})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>l(!1),children:"取消"}),e.jsx(q,{onClick:v,disabled:m,children:m?"保存中...":"保存"})]})]})}):null}function SD(s,a,l="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:l}).format(a).split(/\s/g).slice(2).join(" ")}const _D={},Ji={};function Sl(s,a){try{const i=(_D[s]||=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return i in Ji?Ji[i]:qj(i,i.split(":"))}catch{if(s in Ji)return Ji[s];const l=s?.match(CD);return l?qj(s,l.slice(1)):NaN}}const CD=/([+-]\d\d):?(\d\d)?/;function qj(s,a){const l=+(a[0]||0),i=+(a[1]||0),c=+(a[2]||0)/60;return Ji[s]=l*60+i>0?l*60+i+c:l*60-i-c}class Yn extends Date{constructor(...a){super(),a.length>1&&typeof a[a.length-1]=="string"&&(this.timeZone=a.pop()),this.internal=new Date,isNaN(Sl(this.timeZone,this))?this.setTime(NaN):a.length?typeof a[0]=="number"&&(a.length===1||a.length===2&&typeof a[1]!="number")?this.setTime(a[0]):typeof a[0]=="string"?this.setTime(+new Date(a[0])):a[0]instanceof Date?this.setTime(+a[0]):(this.setTime(+new Date(...a)),EN(this),Jf(this)):this.setTime(Date.now())}static tz(a,...l){return l.length?new Yn(...l,a):new Yn(Date.now(),a)}withTimeZone(a){return new Yn(+this,a)}getTimezoneOffset(){const a=-Sl(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),Jf(this),+this}[Symbol.for("constructDateFrom")](a){return new Yn(+new Date(a),this.timeZone)}}const Vj=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Vj.test(s))return;const a=s.replace(Vj,"$1UTC");Yn.prototype[a]&&(s.startsWith("get")?Yn.prototype[s]=function(){return this.internal[a]()}:(Yn.prototype[s]=function(){return Date.prototype[a].apply(this.internal,arguments),kD(this),+this},Yn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),Jf(this),+this}))});function Jf(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Sl(s.timeZone,s)*60))}function kD(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),EN(s)}function EN(s){const a=Sl(s.timeZone,s),l=a>0?Math.floor(a):Math.ceil(a),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const c=-new Date(+s).getTimezoneOffset(),d=-new Date(+i).getTimezoneOffset(),m=c-d,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();m&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+m);const p=c-l;p&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+p);const v=new Date(+s);v.setUTCSeconds(0);const g=c>0?v.getSeconds():(v.getSeconds()-60)%60,j=Math.round(-(Sl(s.timeZone,s)*60))%60;(j||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+j),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+j+g));const b=Sl(s.timeZone,s),w=b>0?Math.floor(b):Math.ceil(b),C=-new Date(+s).getTimezoneOffset()-w,N=w!==l,T=C-p;if(N&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const P=Sl(s.timeZone,s),M=P>0?Math.floor(P):Math.ceil(P),k=w-M;k&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+k),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+k))}}class Ns extends Yn{static tz(a,...l){return l.length?new Ns(...l,a):new Ns(Date.now(),a)}toISOString(){const[a,l,i]=this.tzComponents(),c=`${a}${l}:${i}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,l,i,c]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${i} ${l} ${c}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[l,i,c]=this.tzComponents();return`${a} GMT${l}${i}${c} (${SD(this.timeZone,this)})`}toLocaleString(a,l){return Date.prototype.toLocaleString.call(this,a,{...l,timeZone:l?.timeZone||this.timeZone})}toLocaleDateString(a,l){return Date.prototype.toLocaleDateString.call(this,a,{...l,timeZone:l?.timeZone||this.timeZone})}toLocaleTimeString(a,l){return Date.prototype.toLocaleTimeString.call(this,a,{...l,timeZone:l?.timeZone||this.timeZone})}tzComponents(){const a=this.getTimezoneOffset(),l=a>0?"-":"+",i=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),c=String(Math.abs(a)%60).padStart(2,"0");return[l,i,c]}withTimeZone(a){return new Ns(+this,a)}[Symbol.for("constructDateFrom")](a){return new Ns(+new Date(a),this.timeZone)}}const MN=6048e5,TD=864e5,Gj=Symbol.for("constructDateFrom");function as(s,a){return typeof s=="function"?s(a):s&&typeof s=="object"&&Gj in s?s[Gj](a):s instanceof Date?new s.constructor(a):new Date(a)}function kt(s,a){return as(a||s,s)}function DN(s,a,l){const i=kt(s,l?.in);return isNaN(a)?as(s,NaN):(a&&i.setDate(i.getDate()+a),i)}function ON(s,a,l){const i=kt(s,l?.in);if(isNaN(a))return as(s,NaN);if(!a)return i;const c=i.getDate(),d=as(s,i.getTime());d.setMonth(i.getMonth()+a+1,0);const m=d.getDate();return c>=m?d:(i.setFullYear(d.getFullYear(),d.getMonth(),c),i)}let ED={};function To(){return ED}function Ka(s,a){const l=To(),i=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??l.weekStartsOn??l.locale?.options?.weekStartsOn??0,c=kt(s,a?.in),d=c.getDay(),m=(d<i?7:0)+d-i;return c.setDate(c.getDate()-m),c.setHours(0,0,0,0),c}function co(s,a){return Ka(s,{...a,weekStartsOn:1})}function AN(s,a){const l=kt(s,a?.in),i=l.getFullYear(),c=as(l,0);c.setFullYear(i+1,0,4),c.setHours(0,0,0,0);const d=co(c),m=as(l,0);m.setFullYear(i,0,4),m.setHours(0,0,0,0);const h=co(m);return l.getTime()>=d.getTime()?i+1:l.getTime()>=h.getTime()?i:i-1}function $j(s){const a=kt(s),l=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return l.setUTCFullYear(a.getFullYear()),+s-+l}function Bl(s,...a){const l=as.bind(null,s||a.find(i=>typeof i=="object"));return a.map(l)}function uo(s,a){const l=kt(s,a?.in);return l.setHours(0,0,0,0),l}function RN(s,a,l){const[i,c]=Bl(l?.in,s,a),d=uo(i),m=uo(c),h=+d-$j(d),p=+m-$j(m);return Math.round((h-p)/TD)}function MD(s,a){const l=AN(s,a),i=as(s,0);return i.setFullYear(l,0,4),i.setHours(0,0,0,0),co(i)}function DD(s,a,l){return DN(s,a*7,l)}function OD(s,a,l){return ON(s,a*12,l)}function AD(s,a){let l,i=a?.in;return s.forEach(c=>{!i&&typeof c=="object"&&(i=as.bind(null,c));const d=kt(c,i);(!l||l<d||isNaN(+d))&&(l=d)}),as(i,l||NaN)}function RD(s,a){let l,i=a?.in;return s.forEach(c=>{!i&&typeof c=="object"&&(i=as.bind(null,c));const d=kt(c,i);(!l||l>d||isNaN(+d))&&(l=d)}),as(i,l||NaN)}function zD(s,a,l){const[i,c]=Bl(l?.in,s,a);return+uo(i)==+uo(c)}function zN(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function PD(s){return!(!zN(s)&&typeof s!="number"||isNaN(+kt(s)))}function LD(s,a,l){const[i,c]=Bl(l?.in,s,a),d=i.getFullYear()-c.getFullYear(),m=i.getMonth()-c.getMonth();return d*12+m}function BD(s,a){const l=kt(s,a?.in),i=l.getMonth();return l.setFullYear(l.getFullYear(),i+1,0),l.setHours(23,59,59,999),l}function PN(s,a){const[l,i]=Bl(s,a.start,a.end);return{start:l,end:i}}function UD(s,a){const{start:l,end:i}=PN(a?.in,s);let c=+l>+i;const d=c?+l:+i,m=c?i:l;m.setHours(0,0,0,0),m.setDate(1);let h=1;const p=[];for(;+m<=d;)p.push(as(l,m)),m.setMonth(m.getMonth()+h);return c?p.reverse():p}function HD(s,a){const l=kt(s,a?.in);return l.setDate(1),l.setHours(0,0,0,0),l}function FD(s,a){const l=kt(s,a?.in),i=l.getFullYear();return l.setFullYear(i+1,0,0),l.setHours(23,59,59,999),l}function LN(s,a){const l=kt(s,a?.in);return l.setFullYear(l.getFullYear(),0,1),l.setHours(0,0,0,0),l}function YD(s,a){const{start:l,end:i}=PN(a?.in,s);let c=+l>+i;const d=c?+l:+i,m=c?i:l;m.setHours(0,0,0,0),m.setMonth(0,1);let h=1;const p=[];for(;+m<=d;)p.push(as(l,m)),m.setFullYear(m.getFullYear()+h);return c?p.reverse():p}function BN(s,a){const l=To(),i=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??l.weekStartsOn??l.locale?.options?.weekStartsOn??0,c=kt(s,a?.in),d=c.getDay(),m=(d<i?-7:0)+6-(d-i);return c.setDate(c.getDate()+m),c.setHours(23,59,59,999),c}function qD(s,a){return BN(s,{...a,weekStartsOn:1})}const VD={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},GD=(s,a,l)=>{let i;const c=VD[s];return typeof c=="string"?i=c:a===1?i=c.one:i=c.other.replace("{{count}}",a.toString()),l?.addSuffix?l.comparison&&l.comparison>0?"in "+i:i+" ago":i};function Hr(s){return(a={})=>{const l=a.width?String(a.width):s.defaultWidth;return s.formats[l]||s.formats[s.defaultWidth]}}const $D={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ID={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},WD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},XD={date:Hr({formats:$D,defaultWidth:"full"}),time:Hr({formats:ID,defaultWidth:"full"}),dateTime:Hr({formats:WD,defaultWidth:"full"})},KD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},QD=(s,a,l,i)=>KD[s];function Hn(s){return(a,l)=>{const i=l?.context?String(l.context):"standalone";let c;if(i==="formatting"&&s.formattingValues){const m=s.defaultFormattingWidth||s.defaultWidth,h=l?.width?String(l.width):m;c=s.formattingValues[h]||s.formattingValues[m]}else{const m=s.defaultWidth,h=l?.width?String(l.width):s.defaultWidth;c=s.values[h]||s.values[m]}const d=s.argumentCallback?s.argumentCallback(a):a;return c[d]}}const ZD={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},JD={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},sO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},aO=(s,a)=>{const l=Number(s),i=l%100;if(i>20||i<10)switch(i%10){case 1:return l+"st";case 2:return l+"nd";case 3:return l+"rd"}return l+"th"},lO={ordinalNumber:aO,era:Hn({values:ZD,defaultWidth:"wide"}),quarter:Hn({values:JD,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Hn({values:eO,defaultWidth:"wide"}),day:Hn({values:tO,defaultWidth:"wide"}),dayPeriod:Hn({values:sO,defaultWidth:"wide",formattingValues:nO,defaultFormattingWidth:"wide"})};function Fn(s){return(a,l={})=>{const i=l.width,c=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],d=a.match(c);if(!d)return null;const m=d[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],p=Array.isArray(h)?iO(h,j=>j.test(m)):rO(h,j=>j.test(m));let v;v=s.valueCallback?s.valueCallback(p):p,v=l.valueCallback?l.valueCallback(v):v;const g=a.slice(m.length);return{value:v,rest:g}}}function rO(s,a){for(const l in s)if(Object.prototype.hasOwnProperty.call(s,l)&&a(s[l]))return l}function iO(s,a){for(let l=0;l<s.length;l++)if(a(s[l]))return l}function UN(s){return(a,l={})=>{const i=a.match(s.matchPattern);if(!i)return null;const c=i[0],d=a.match(s.parsePattern);if(!d)return null;let m=s.valueCallback?s.valueCallback(d[0]):d[0];m=l.valueCallback?l.valueCallback(m):m;const h=a.slice(c.length);return{value:m,rest:h}}}const oO=/^(\d+)(th|st|nd|rd)?/i,cO=/\d+/i,dO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},uO={any:[/^b/i,/^(a|c)/i]},mO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fO={any:[/1/i,/2/i,/3/i,/4/i]},hO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},pO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},yO={ordinalNumber:UN({matchPattern:oO,parsePattern:cO,valueCallback:s=>parseInt(s,10)}),era:Fn({matchPatterns:dO,defaultMatchWidth:"wide",parsePatterns:uO,defaultParseWidth:"any"}),quarter:Fn({matchPatterns:mO,defaultMatchWidth:"wide",parsePatterns:fO,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Fn({matchPatterns:hO,defaultMatchWidth:"wide",parsePatterns:xO,defaultParseWidth:"any"}),day:Fn({matchPatterns:pO,defaultMatchWidth:"wide",parsePatterns:gO,defaultParseWidth:"any"}),dayPeriod:Fn({matchPatterns:vO,defaultMatchWidth:"any",parsePatterns:jO,defaultParseWidth:"any"})},Hh={code:"en-US",formatDistance:GD,formatLong:XD,formatRelative:QD,localize:lO,match:yO,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bO(s,a){const l=kt(s,a?.in);return RN(l,LN(l))+1}function HN(s,a){const l=kt(s,a?.in),i=+co(l)-+MD(l);return Math.round(i/MN)+1}function FN(s,a){const l=kt(s,a?.in),i=l.getFullYear(),c=To(),d=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,m=as(a?.in||s,0);m.setFullYear(i+1,0,d),m.setHours(0,0,0,0);const h=Ka(m,a),p=as(a?.in||s,0);p.setFullYear(i,0,d),p.setHours(0,0,0,0);const v=Ka(p,a);return+l>=+h?i+1:+l>=+v?i:i-1}function NO(s,a){const l=To(),i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,c=FN(s,a),d=as(a?.in||s,0);return d.setFullYear(c,0,i),d.setHours(0,0,0,0),Ka(d,a)}function YN(s,a){const l=kt(s,a?.in),i=+Ka(l,a)-+NO(l,a);return Math.round(i/MN)+1}function yt(s,a){const l=s<0?"-":"",i=Math.abs(s).toString().padStart(a,"0");return l+i}const Va={y(s,a){const l=s.getFullYear(),i=l>0?l:1-l;return yt(a==="yy"?i%100:i,a.length)},M(s,a){const l=s.getMonth();return a==="M"?String(l+1):yt(l+1,2)},d(s,a){return yt(s.getDate(),a.length)},a(s,a){const l=s.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return l.toUpperCase();case"aaa":return l;case"aaaaa":return l[0];case"aaaa":default:return l==="am"?"a.m.":"p.m."}},h(s,a){return yt(s.getHours()%12||12,a.length)},H(s,a){return yt(s.getHours(),a.length)},m(s,a){return yt(s.getMinutes(),a.length)},s(s,a){return yt(s.getSeconds(),a.length)},S(s,a){const l=a.length,i=s.getMilliseconds(),c=Math.trunc(i*Math.pow(10,l-3));return yt(c,a.length)}},Mr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ij={G:function(s,a,l){const i=s.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return l.era(i,{width:"abbreviated"});case"GGGGG":return l.era(i,{width:"narrow"});case"GGGG":default:return l.era(i,{width:"wide"})}},y:function(s,a,l){if(a==="yo"){const i=s.getFullYear(),c=i>0?i:1-i;return l.ordinalNumber(c,{unit:"year"})}return Va.y(s,a)},Y:function(s,a,l,i){const c=FN(s,i),d=c>0?c:1-c;if(a==="YY"){const m=d%100;return yt(m,2)}return a==="Yo"?l.ordinalNumber(d,{unit:"year"}):yt(d,a.length)},R:function(s,a){const l=AN(s);return yt(l,a.length)},u:function(s,a){const l=s.getFullYear();return yt(l,a.length)},Q:function(s,a,l){const i=Math.ceil((s.getMonth()+1)/3);switch(a){case"Q":return String(i);case"QQ":return yt(i,2);case"Qo":return l.ordinalNumber(i,{unit:"quarter"});case"QQQ":return l.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return l.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return l.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,a,l){const i=Math.ceil((s.getMonth()+1)/3);switch(a){case"q":return String(i);case"qq":return yt(i,2);case"qo":return l.ordinalNumber(i,{unit:"quarter"});case"qqq":return l.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return l.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return l.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,a,l){const i=s.getMonth();switch(a){case"M":case"MM":return Va.M(s,a);case"Mo":return l.ordinalNumber(i+1,{unit:"month"});case"MMM":return l.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return l.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return l.month(i,{width:"wide",context:"formatting"})}},L:function(s,a,l){const i=s.getMonth();switch(a){case"L":return String(i+1);case"LL":return yt(i+1,2);case"Lo":return l.ordinalNumber(i+1,{unit:"month"});case"LLL":return l.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(i,{width:"wide",context:"standalone"})}},w:function(s,a,l,i){const c=YN(s,i);return a==="wo"?l.ordinalNumber(c,{unit:"week"}):yt(c,a.length)},I:function(s,a,l){const i=HN(s);return a==="Io"?l.ordinalNumber(i,{unit:"week"}):yt(i,a.length)},d:function(s,a,l){return a==="do"?l.ordinalNumber(s.getDate(),{unit:"date"}):Va.d(s,a)},D:function(s,a,l){const i=bO(s);return a==="Do"?l.ordinalNumber(i,{unit:"dayOfYear"}):yt(i,a.length)},E:function(s,a,l){const i=s.getDay();switch(a){case"E":case"EE":case"EEE":return l.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(i,{width:"short",context:"formatting"});case"EEEE":default:return l.day(i,{width:"wide",context:"formatting"})}},e:function(s,a,l,i){const c=s.getDay(),d=(c-i.weekStartsOn+8)%7||7;switch(a){case"e":return String(d);case"ee":return yt(d,2);case"eo":return l.ordinalNumber(d,{unit:"day"});case"eee":return l.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(c,{width:"short",context:"formatting"});case"eeee":default:return l.day(c,{width:"wide",context:"formatting"})}},c:function(s,a,l,i){const c=s.getDay(),d=(c-i.weekStartsOn+8)%7||7;switch(a){case"c":return String(d);case"cc":return yt(d,a.length);case"co":return l.ordinalNumber(d,{unit:"day"});case"ccc":return l.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(c,{width:"narrow",context:"standalone"});case"cccccc":return l.day(c,{width:"short",context:"standalone"});case"cccc":default:return l.day(c,{width:"wide",context:"standalone"})}},i:function(s,a,l){const i=s.getDay(),c=i===0?7:i;switch(a){case"i":return String(c);case"ii":return yt(c,a.length);case"io":return l.ordinalNumber(c,{unit:"day"});case"iii":return l.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(i,{width:"short",context:"formatting"});case"iiii":default:return l.day(i,{width:"wide",context:"formatting"})}},a:function(s,a,l){const c=s.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return l.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(c,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(c,{width:"wide",context:"formatting"})}},b:function(s,a,l){const i=s.getHours();let c;switch(i===12?c=Mr.noon:i===0?c=Mr.midnight:c=i/12>=1?"pm":"am",a){case"b":case"bb":return l.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(c,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(s,a,l){const i=s.getHours();let c;switch(i>=17?c=Mr.evening:i>=12?c=Mr.afternoon:i>=4?c=Mr.morning:c=Mr.night,a){case"B":case"BB":case"BBB":return l.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(c,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(s,a,l){if(a==="ho"){let i=s.getHours()%12;return i===0&&(i=12),l.ordinalNumber(i,{unit:"hour"})}return Va.h(s,a)},H:function(s,a,l){return a==="Ho"?l.ordinalNumber(s.getHours(),{unit:"hour"}):Va.H(s,a)},K:function(s,a,l){const i=s.getHours()%12;return a==="Ko"?l.ordinalNumber(i,{unit:"hour"}):yt(i,a.length)},k:function(s,a,l){let i=s.getHours();return i===0&&(i=24),a==="ko"?l.ordinalNumber(i,{unit:"hour"}):yt(i,a.length)},m:function(s,a,l){return a==="mo"?l.ordinalNumber(s.getMinutes(),{unit:"minute"}):Va.m(s,a)},s:function(s,a,l){return a==="so"?l.ordinalNumber(s.getSeconds(),{unit:"second"}):Va.s(s,a)},S:function(s,a){return Va.S(s,a)},X:function(s,a,l){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(a){case"X":return Xj(i);case"XXXX":case"XX":return Nl(i);case"XXXXX":case"XXX":default:return Nl(i,":")}},x:function(s,a,l){const i=s.getTimezoneOffset();switch(a){case"x":return Xj(i);case"xxxx":case"xx":return Nl(i);case"xxxxx":case"xxx":default:return Nl(i,":")}},O:function(s,a,l){const i=s.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+Wj(i,":");case"OOOO":default:return"GMT"+Nl(i,":")}},z:function(s,a,l){const i=s.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+Wj(i,":");case"zzzz":default:return"GMT"+Nl(i,":")}},t:function(s,a,l){const i=Math.trunc(+s/1e3);return yt(i,a.length)},T:function(s,a,l){return yt(+s,a.length)}};function Wj(s,a=""){const l=s>0?"-":"+",i=Math.abs(s),c=Math.trunc(i/60),d=i%60;return d===0?l+String(c):l+String(c)+a+yt(d,2)}function Xj(s,a){return s%60===0?(s>0?"-":"+")+yt(Math.abs(s)/60,2):Nl(s,a)}function Nl(s,a=""){const l=s>0?"-":"+",i=Math.abs(s),c=yt(Math.trunc(i/60),2),d=yt(i%60,2);return l+c+a+d}const Kj=(s,a)=>{switch(s){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},qN=(s,a)=>{switch(s){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},wO=(s,a)=>{const l=s.match(/(P+)(p+)?/)||[],i=l[1],c=l[2];if(!c)return Kj(s,a);let d;switch(i){case"P":d=a.dateTime({width:"short"});break;case"PP":d=a.dateTime({width:"medium"});break;case"PPP":d=a.dateTime({width:"long"});break;case"PPPP":default:d=a.dateTime({width:"full"});break}return d.replace("{{date}}",Kj(i,a)).replace("{{time}}",qN(c,a))},SO={p:qN,P:wO},_O=/^D+$/,CO=/^Y+$/,kO=["D","DD","YY","YYYY"];function TO(s){return _O.test(s)}function EO(s){return CO.test(s)}function MO(s,a,l){const i=DO(s,a,l);if(console.warn(i),kO.includes(s))throw new RangeError(i)}function DO(s,a,l){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${a}\`) for formatting ${i} to the input \`${l}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const OO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,AO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RO=/^'([^]*?)'?$/,zO=/''/g,PO=/[a-zA-Z]/;function md(s,a,l){const i=To(),c=l?.locale??i.locale??Hh,d=l?.firstWeekContainsDate??l?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,m=l?.weekStartsOn??l?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,h=kt(s,l?.in);if(!PD(h))throw new RangeError("Invalid time value");let p=a.match(AO).map(g=>{const j=g[0];if(j==="p"||j==="P"){const b=SO[j];return b(g,c.formatLong)}return g}).join("").match(OO).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const j=g[0];if(j==="'")return{isToken:!1,value:LO(g)};if(Ij[j])return{isToken:!0,value:g};if(j.match(PO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:g}});c.localize.preprocessor&&(p=c.localize.preprocessor(h,p));const v={firstWeekContainsDate:d,weekStartsOn:m,locale:c};return p.map(g=>{if(!g.isToken)return g.value;const j=g.value;(!l?.useAdditionalWeekYearTokens&&EO(j)||!l?.useAdditionalDayOfYearTokens&&TO(j))&&MO(j,a,String(s));const b=Ij[j[0]];return b(h,j,c.localize,v)}).join("")}function LO(s){const a=s.match(RO);return a?a[1].replace(zO,"'"):s}function BO(s,a){const l=kt(s,a?.in),i=l.getFullYear(),c=l.getMonth(),d=as(l,0);return d.setFullYear(i,c+1,0),d.setHours(0,0,0,0),d.getDate()}function UO(s,a){return kt(s,a?.in).getMonth()}function HO(s,a){return kt(s,a?.in).getFullYear()}function FO(s,a){return+kt(s)>+kt(a)}function YO(s,a){return+kt(s)<+kt(a)}function qO(s,a,l){const[i,c]=Bl(l?.in,s,a);return+Ka(i,l)==+Ka(c,l)}function VO(s,a,l){const[i,c]=Bl(l?.in,s,a);return i.getFullYear()===c.getFullYear()&&i.getMonth()===c.getMonth()}function GO(s,a,l){const[i,c]=Bl(l?.in,s,a);return i.getFullYear()===c.getFullYear()}function $O(s,a,l){const i=kt(s,l?.in),c=i.getFullYear(),d=i.getDate(),m=as(s,0);m.setFullYear(c,a,15),m.setHours(0,0,0,0);const h=BO(m);return i.setMonth(a,Math.min(d,h)),i}function IO(s,a,l){const i=kt(s,l?.in);return isNaN(+i)?as(s,NaN):(i.setFullYear(a),i)}const Qj=5,WO=4;function XO(s,a){const l=a.startOfMonth(s),i=l.getDay()>0?l.getDay():7,c=a.addDays(s,-i+1),d=a.addDays(c,Qj*7-1);return a.getMonth(s)===a.getMonth(d)?Qj:WO}function VN(s,a){const l=a.startOfMonth(s),i=l.getDay();return i===1?l:i===0?a.addDays(l,-6):a.addDays(l,-1*(i-1))}function KO(s,a){const l=VN(s,a),i=XO(s,a);return a.addDays(l,i*7-1)}class nn{constructor(a,l){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Ns.tz(this.options.timeZone):new this.Date,this.newDate=(i,c,d)=>this.overrides?.newDate?this.overrides.newDate(i,c,d):this.options.timeZone?new Ns(i,c,d,this.options.timeZone):new Date(i,c,d),this.addDays=(i,c)=>this.overrides?.addDays?this.overrides.addDays(i,c):DN(i,c),this.addMonths=(i,c)=>this.overrides?.addMonths?this.overrides.addMonths(i,c):ON(i,c),this.addWeeks=(i,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(i,c):DD(i,c),this.addYears=(i,c)=>this.overrides?.addYears?this.overrides.addYears(i,c):OD(i,c),this.differenceInCalendarDays=(i,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(i,c):RN(i,c),this.differenceInCalendarMonths=(i,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(i,c):LD(i,c),this.eachMonthOfInterval=i=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(i):UD(i),this.eachYearOfInterval=i=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(i):YD(i),d=new Set(c.map(h=>this.getYear(h)));if(d.size===c.length)return c;const m=[];return d.forEach(h=>{m.push(new Date(h,0,1))}),m},this.endOfBroadcastWeek=i=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(i):KO(i,this),this.endOfISOWeek=i=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(i):qD(i),this.endOfMonth=i=>this.overrides?.endOfMonth?this.overrides.endOfMonth(i):BD(i),this.endOfWeek=(i,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(i,c):BN(i,this.options),this.endOfYear=i=>this.overrides?.endOfYear?this.overrides.endOfYear(i):FD(i),this.format=(i,c,d)=>{const m=this.overrides?.format?this.overrides.format(i,c,this.options):md(i,c,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(m):m},this.getISOWeek=i=>this.overrides?.getISOWeek?this.overrides.getISOWeek(i):HN(i),this.getMonth=(i,c)=>this.overrides?.getMonth?this.overrides.getMonth(i,this.options):UO(i,this.options),this.getYear=(i,c)=>this.overrides?.getYear?this.overrides.getYear(i,this.options):HO(i,this.options),this.getWeek=(i,c)=>this.overrides?.getWeek?this.overrides.getWeek(i,this.options):YN(i,this.options),this.isAfter=(i,c)=>this.overrides?.isAfter?this.overrides.isAfter(i,c):FO(i,c),this.isBefore=(i,c)=>this.overrides?.isBefore?this.overrides.isBefore(i,c):YO(i,c),this.isDate=i=>this.overrides?.isDate?this.overrides.isDate(i):zN(i),this.isSameDay=(i,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(i,c):zD(i,c),this.isSameMonth=(i,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(i,c):VO(i,c),this.isSameYear=(i,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(i,c):GO(i,c),this.max=i=>this.overrides?.max?this.overrides.max(i):AD(i),this.min=i=>this.overrides?.min?this.overrides.min(i):RD(i),this.setMonth=(i,c)=>this.overrides?.setMonth?this.overrides.setMonth(i,c):$O(i,c),this.setYear=(i,c)=>this.overrides?.setYear?this.overrides.setYear(i,c):IO(i,c),this.startOfBroadcastWeek=(i,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(i,this):VN(i,this),this.startOfDay=i=>this.overrides?.startOfDay?this.overrides.startOfDay(i):uo(i),this.startOfISOWeek=i=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(i):co(i),this.startOfMonth=i=>this.overrides?.startOfMonth?this.overrides.startOfMonth(i):HD(i),this.startOfWeek=(i,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(i,this.options):Ka(i,this.options),this.startOfYear=i=>this.overrides?.startOfYear?this.overrides.startOfYear(i):LN(i),this.options={locale:Hh,...a},this.overrides=l}getDigitMap(){const{numerals:a="latn"}=this.options,l=new Intl.NumberFormat("en-US",{numberingSystem:a}),i={};for(let c=0;c<10;c++)i[c.toString()]=l.format(c);return i}replaceDigits(a){const l=this.getDigitMap();return a.replace(/\d/g,i=>l[i]||i)}formatNumber(a){return this.replaceDigits(a.toString())}getMonthYearOrder(){const a=this.options.locale?.code;return a&&nn.yearFirstLocales.has(a)?"year-first":"month-first"}formatMonthYear(a){const{locale:l,timeZone:i,numerals:c}=this.options,d=l?.code;if(d&&nn.yearFirstLocales.has(d))try{return new Intl.DateTimeFormat(d,{month:"long",year:"numeric",timeZone:i,numberingSystem:c}).format(a)}catch{}const m=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(a,m)}}nn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Gn=new nn;class GN{constructor(a,l,i=Gn){this.date=a,this.displayMonth=l,this.outside=!!(l&&!i.isSameMonth(a,l)),this.dateLib=i}isEqualTo(a){return this.dateLib.isSameDay(a.date,this.date)&&this.dateLib.isSameMonth(a.displayMonth,this.displayMonth)}}class QO{constructor(a,l){this.date=a,this.weeks=l}}class ZO{constructor(a,l){this.days=l,this.weekNumber=a}}function JO(s){return Ne.createElement("button",{...s})}function eA(s){return Ne.createElement("span",{...s})}function tA(s){const{size:a=24,orientation:l="left",className:i}=s;return Ne.createElement("svg",{className:i,width:a,height:a,viewBox:"0 0 24 24"},l==="up"&&Ne.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),l==="down"&&Ne.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),l==="left"&&Ne.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),l==="right"&&Ne.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function sA(s){const{day:a,modifiers:l,...i}=s;return Ne.createElement("td",{...i})}function nA(s){const{day:a,modifiers:l,...i}=s,c=Ne.useRef(null);return Ne.useEffect(()=>{l.focused&&c.current?.focus()},[l.focused]),Ne.createElement("button",{ref:c,...i})}var Me;(function(s){s.Root="root",s.Chevron="chevron",s.Day="day",s.DayButton="day_button",s.CaptionLabel="caption_label",s.Dropdowns="dropdowns",s.Dropdown="dropdown",s.DropdownRoot="dropdown_root",s.Footer="footer",s.MonthGrid="month_grid",s.MonthCaption="month_caption",s.MonthsDropdown="months_dropdown",s.Month="month",s.Months="months",s.Nav="nav",s.NextMonthButton="button_next",s.PreviousMonthButton="button_previous",s.Week="week",s.Weeks="weeks",s.Weekday="weekday",s.Weekdays="weekdays",s.WeekNumber="week_number",s.WeekNumberHeader="week_number_header",s.YearsDropdown="years_dropdown"})(Me||(Me={}));var Gt;(function(s){s.disabled="disabled",s.hidden="hidden",s.outside="outside",s.focused="focused",s.today="today"})(Gt||(Gt={}));var En;(function(s){s.range_end="range_end",s.range_middle="range_middle",s.range_start="range_start",s.selected="selected"})(En||(En={}));var sn;(function(s){s.weeks_before_enter="weeks_before_enter",s.weeks_before_exit="weeks_before_exit",s.weeks_after_enter="weeks_after_enter",s.weeks_after_exit="weeks_after_exit",s.caption_after_enter="caption_after_enter",s.caption_after_exit="caption_after_exit",s.caption_before_enter="caption_before_enter",s.caption_before_exit="caption_before_exit"})(sn||(sn={}));function aA(s){const{options:a,className:l,components:i,classNames:c,...d}=s,m=[c[Me.Dropdown],l].join(" "),h=a?.find(({value:p})=>p===d.value);return Ne.createElement("span",{"data-disabled":d.disabled,className:c[Me.DropdownRoot]},Ne.createElement(i.Select,{className:m,...d},a?.map(({value:p,label:v,disabled:g})=>Ne.createElement(i.Option,{key:p,value:p,disabled:g},v))),Ne.createElement("span",{className:c[Me.CaptionLabel],"aria-hidden":!0},h?.label,Ne.createElement(i.Chevron,{orientation:"down",size:18,className:c[Me.Chevron]})))}function lA(s){return Ne.createElement("div",{...s})}function rA(s){return Ne.createElement("div",{...s})}function iA(s){const{calendarMonth:a,displayIndex:l,...i}=s;return Ne.createElement("div",{...i},s.children)}function oA(s){const{calendarMonth:a,displayIndex:l,...i}=s;return Ne.createElement("div",{...i})}function cA(s){return Ne.createElement("table",{...s})}function dA(s){return Ne.createElement("div",{...s})}const $N=x.createContext(void 0);function Eo(){const s=x.useContext($N);if(s===void 0)throw new Error("useDayPicker() must be used within a custom component.");return s}function uA(s){const{components:a}=Eo();return Ne.createElement(a.Dropdown,{...s})}function mA(s){const{onPreviousClick:a,onNextClick:l,previousMonth:i,nextMonth:c,...d}=s,{components:m,classNames:h,labels:{labelPrevious:p,labelNext:v}}=Eo(),g=x.useCallback(b=>{c&&l?.(b)},[c,l]),j=x.useCallback(b=>{i&&a?.(b)},[i,a]);return Ne.createElement("nav",{...d},Ne.createElement(m.PreviousMonthButton,{type:"button",className:h[Me.PreviousMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":p(i),onClick:j},Ne.createElement(m.Chevron,{disabled:i?void 0:!0,className:h[Me.Chevron],orientation:"left"})),Ne.createElement(m.NextMonthButton,{type:"button",className:h[Me.NextMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":v(c),onClick:g},Ne.createElement(m.Chevron,{disabled:c?void 0:!0,orientation:"right",className:h[Me.Chevron]})))}function fA(s){const{components:a}=Eo();return Ne.createElement(a.Button,{...s})}function hA(s){return Ne.createElement("option",{...s})}function xA(s){const{components:a}=Eo();return Ne.createElement(a.Button,{...s})}function pA(s){const{rootRef:a,...l}=s;return Ne.createElement("div",{...l,ref:a})}function gA(s){return Ne.createElement("select",{...s})}function vA(s){const{week:a,...l}=s;return Ne.createElement("tr",{...l})}function jA(s){return Ne.createElement("th",{...s})}function yA(s){return Ne.createElement("thead",{"aria-hidden":!0},Ne.createElement("tr",{...s}))}function bA(s){const{week:a,...l}=s;return Ne.createElement("th",{...l})}function NA(s){return Ne.createElement("th",{...s})}function wA(s){return Ne.createElement("tbody",{...s})}function SA(s){const{components:a}=Eo();return Ne.createElement(a.Dropdown,{...s})}const _A=Object.freeze(Object.defineProperty({__proto__:null,Button:JO,CaptionLabel:eA,Chevron:tA,Day:sA,DayButton:nA,Dropdown:aA,DropdownNav:lA,Footer:rA,Month:iA,MonthCaption:oA,MonthGrid:cA,Months:dA,MonthsDropdown:uA,Nav:mA,NextMonthButton:fA,Option:hA,PreviousMonthButton:xA,Root:pA,Select:gA,Week:vA,WeekNumber:bA,WeekNumberHeader:NA,Weekday:jA,Weekdays:yA,Weeks:wA,YearsDropdown:SA},Symbol.toStringTag,{value:"Module"}));function fa(s,a,l=!1,i=Gn){let{from:c,to:d}=s;const{differenceInCalendarDays:m,isSameDay:h}=i;return c&&d?(m(d,c)<0&&([c,d]=[d,c]),m(a,c)>=(l?1:0)&&m(d,a)>=(l?1:0)):!l&&d?h(d,a):!l&&c?h(c,a):!1}function IN(s){return!!(s&&typeof s=="object"&&"before"in s&&"after"in s)}function Fh(s){return!!(s&&typeof s=="object"&&"from"in s)}function WN(s){return!!(s&&typeof s=="object"&&"after"in s)}function XN(s){return!!(s&&typeof s=="object"&&"before"in s)}function KN(s){return!!(s&&typeof s=="object"&&"dayOfWeek"in s)}function QN(s,a){return Array.isArray(s)&&s.every(a.isDate)}function ha(s,a,l=Gn){const i=Array.isArray(a)?a:[a],{isSameDay:c,differenceInCalendarDays:d,isAfter:m}=l;return i.some(h=>{if(typeof h=="boolean")return h;if(l.isDate(h))return c(s,h);if(QN(h,l))return h.includes(s);if(Fh(h))return fa(h,s,!1,l);if(KN(h))return Array.isArray(h.dayOfWeek)?h.dayOfWeek.includes(s.getDay()):h.dayOfWeek===s.getDay();if(IN(h)){const p=d(h.before,s),v=d(h.after,s),g=p>0,j=v<0;return m(h.before,h.after)?j&&g:g||j}return WN(h)?d(s,h.after)>0:XN(h)?d(h.before,s)>0:typeof h=="function"?h(s):!1})}function CA(s,a,l,i,c){const{disabled:d,hidden:m,modifiers:h,showOutsideDays:p,broadcastCalendar:v,today:g}=a,{isSameDay:j,isSameMonth:b,startOfMonth:w,isBefore:S,endOfMonth:C,isAfter:N}=c,T=l&&w(l),P=i&&C(i),M={[Gt.focused]:[],[Gt.outside]:[],[Gt.disabled]:[],[Gt.hidden]:[],[Gt.today]:[]},k={};for(const D of s){const{date:A,displayMonth:E}=D,B=!!(E&&!b(A,E)),Y=!!(T&&S(A,T)),G=!!(P&&N(A,P)),$=!!(d&&ha(A,d,c)),oe=!!(m&&ha(A,m,c))||Y||G||!v&&!p&&B||v&&p===!1&&B,je=j(A,g??c.today());B&&M.outside.push(D),$&&M.disabled.push(D),oe&&M.hidden.push(D),je&&M.today.push(D),h&&Object.keys(h).forEach(ae=>{const me=h?.[ae];me&&ha(A,me,c)&&(k[ae]?k[ae].push(D):k[ae]=[D])})}return D=>{const A={[Gt.focused]:!1,[Gt.disabled]:!1,[Gt.hidden]:!1,[Gt.outside]:!1,[Gt.today]:!1},E={};for(const B in M){const Y=M[B];A[B]=Y.some(G=>G===D)}for(const B in k)E[B]=k[B].some(Y=>Y===D);return{...A,...E}}}function kA(s,a,l={}){return Object.entries(s).filter(([,c])=>c===!0).reduce((c,[d])=>(l[d]?c.push(l[d]):a[Gt[d]]?c.push(a[Gt[d]]):a[En[d]]&&c.push(a[En[d]]),c),[a[Me.Day]])}function TA(s){return{..._A,...s}}function EA(s){const a={"data-mode":s.mode??void 0,"data-required":"required"in s?s.required:void 0,"data-multiple-months":s.numberOfMonths&&s.numberOfMonths>1||void 0,"data-week-numbers":s.showWeekNumber||void 0,"data-broadcast-calendar":s.broadcastCalendar||void 0,"data-nav-layout":s.navLayout||void 0};return Object.entries(s).forEach(([l,i])=>{l.startsWith("data-")&&(a[l]=i)}),a}function Yh(){const s={};for(const a in Me)s[Me[a]]=`rdp-${Me[a]}`;for(const a in Gt)s[Gt[a]]=`rdp-${Gt[a]}`;for(const a in En)s[En[a]]=`rdp-${En[a]}`;for(const a in sn)s[sn[a]]=`rdp-${sn[a]}`;return s}function ZN(s,a,l){return(l??new nn(a)).formatMonthYear(s)}const MA=ZN;function DA(s,a,l){return(l??new nn(a)).format(s,"d")}function OA(s,a=Gn){return a.format(s,"LLLL")}function AA(s,a,l){return(l??new nn(a)).format(s,"cccccc")}function RA(s,a=Gn){return s<10?a.formatNumber(`0${s.toLocaleString()}`):a.formatNumber(`${s.toLocaleString()}`)}function zA(){return""}function JN(s,a=Gn){return a.format(s,"yyyy")}const PA=JN,LA=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:ZN,formatDay:DA,formatMonthCaption:MA,formatMonthDropdown:OA,formatWeekNumber:RA,formatWeekNumberHeader:zA,formatWeekdayName:AA,formatYearCaption:PA,formatYearDropdown:JN},Symbol.toStringTag,{value:"Module"}));function BA(s){return s?.formatMonthCaption&&!s.formatCaption&&(s.formatCaption=s.formatMonthCaption),s?.formatYearCaption&&!s.formatYearDropdown&&(s.formatYearDropdown=s.formatYearCaption),{...LA,...s}}function UA(s,a,l,i,c){const{startOfMonth:d,startOfYear:m,endOfYear:h,eachMonthOfInterval:p,getMonth:v}=c;return p({start:m(s),end:h(s)}).map(b=>{const w=i.formatMonthDropdown(b,c),S=v(b),C=a&&b<d(a)||l&&b>d(l)||!1;return{value:S,label:w,disabled:C}})}function HA(s,a={},l={}){let i={...a?.[Me.Day]};return Object.entries(s).filter(([,c])=>c===!0).forEach(([c])=>{i={...i,...l?.[c]}}),i}function FA(s,a,l){const i=s.today(),c=a?s.startOfISOWeek(i):s.startOfWeek(i),d=[];for(let m=0;m<7;m++){const h=s.addDays(c,m);d.push(h)}return d}function YA(s,a,l,i,c=!1){if(!s||!a)return;const{startOfYear:d,endOfYear:m,eachYearOfInterval:h,getYear:p}=i,v=d(s),g=m(a),j=h({start:v,end:g});return c&&j.reverse(),j.map(b=>{const w=l.formatYearDropdown(b,i);return{value:p(b),label:w,disabled:!1}})}function ew(s,a,l,i){let c=(i??new nn(l)).format(s,"PPPP");return a.today&&(c=`Today, ${c}`),a.selected&&(c=`${c}, selected`),c}const qA=ew;function tw(s,a,l){return(l??new nn(a)).formatMonthYear(s)}const VA=tw;function GA(s,a,l,i){let c=(i??new nn(l)).format(s,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function $A(s){return"Choose the Month"}function IA(){return""}function WA(s){return"Go to the Next Month"}function XA(s){return"Go to the Previous Month"}function KA(s,a,l){return(l??new nn(a)).format(s,"cccc")}function QA(s,a){return`Week ${s}`}function ZA(s){return"Week Number"}function JA(s){return"Choose the Year"}const eR=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:VA,labelDay:qA,labelDayButton:ew,labelGrid:tw,labelGridcell:GA,labelMonthDropdown:$A,labelNav:IA,labelNext:WA,labelPrevious:XA,labelWeekNumber:QA,labelWeekNumberHeader:ZA,labelWeekday:KA,labelYearDropdown:JA},Symbol.toStringTag,{value:"Module"})),Mo=s=>s instanceof HTMLElement?s:null,kf=s=>[...s.querySelectorAll("[data-animated-month]")??[]],tR=s=>Mo(s.querySelector("[data-animated-month]")),Tf=s=>Mo(s.querySelector("[data-animated-caption]")),Ef=s=>Mo(s.querySelector("[data-animated-weeks]")),sR=s=>Mo(s.querySelector("[data-animated-nav]")),nR=s=>Mo(s.querySelector("[data-animated-weekdays]"));function aR(s,a,{classNames:l,months:i,focused:c,dateLib:d}){const m=x.useRef(null),h=x.useRef(i),p=x.useRef(!1);x.useLayoutEffect(()=>{const v=h.current;if(h.current=i,!a||!s.current||!(s.current instanceof HTMLElement)||i.length===0||v.length===0||i.length!==v.length)return;const g=d.isSameMonth(i[0].date,v[0].date),j=d.isAfter(i[0].date,v[0].date),b=j?l[sn.caption_after_enter]:l[sn.caption_before_enter],w=j?l[sn.weeks_after_enter]:l[sn.weeks_before_enter],S=m.current,C=s.current.cloneNode(!0);if(C instanceof HTMLElement?(kf(C).forEach(M=>{if(!(M instanceof HTMLElement))return;const k=tR(M);k&&M.contains(k)&&M.removeChild(k);const D=Tf(M);D&&D.classList.remove(b);const A=Ef(M);A&&A.classList.remove(w)}),m.current=C):m.current=null,p.current||g||c)return;const N=S instanceof HTMLElement?kf(S):[],T=kf(s.current);if(T?.every(P=>P instanceof HTMLElement)&&N&&N.every(P=>P instanceof HTMLElement)){p.current=!0,s.current.style.isolation="isolate";const P=sR(s.current);P&&(P.style.zIndex="1"),T.forEach((M,k)=>{const D=N[k];if(!D)return;M.style.position="relative",M.style.overflow="hidden";const A=Tf(M);A&&A.classList.add(b);const E=Ef(M);E&&E.classList.add(w);const B=()=>{p.current=!1,s.current&&(s.current.style.isolation=""),P&&(P.style.zIndex=""),A&&A.classList.remove(b),E&&E.classList.remove(w),M.style.position="",M.style.overflow="",M.contains(D)&&M.removeChild(D)};D.style.pointerEvents="none",D.style.position="absolute",D.style.overflow="hidden",D.setAttribute("aria-hidden","true");const Y=nR(D);Y&&(Y.style.opacity="0");const G=Tf(D);G&&(G.classList.add(j?l[sn.caption_before_exit]:l[sn.caption_after_exit]),G.addEventListener("animationend",B));const $=Ef(D);$&&$.classList.add(j?l[sn.weeks_before_exit]:l[sn.weeks_after_exit]),M.insertBefore(D,M.firstChild)})}})}function lR(s,a,l,i){const c=s[0],d=s[s.length-1],{ISOWeek:m,fixedWeeks:h,broadcastCalendar:p}=l??{},{addDays:v,differenceInCalendarDays:g,differenceInCalendarMonths:j,endOfBroadcastWeek:b,endOfISOWeek:w,endOfMonth:S,endOfWeek:C,isAfter:N,startOfBroadcastWeek:T,startOfISOWeek:P,startOfWeek:M}=i,k=p?T(c,i):m?P(c):M(c),D=p?b(d):m?w(S(d)):C(S(d)),A=g(D,k),E=j(d,c)+1,B=[];for(let $=0;$<=A;$++){const oe=v(k,$);if(a&&N(oe,a))break;B.push(oe)}const G=(p?35:42)*E;if(h&&B.length<G){const $=G-B.length;for(let oe=0;oe<$;oe++){const je=v(B[B.length-1],1);B.push(je)}}return B}function rR(s){const a=[];return s.reduce((l,i)=>{const c=i.weeks.reduce((d,m)=>d.concat(m.days.slice()),a.slice());return l.concat(c.slice())},a.slice())}function iR(s,a,l,i){const{numberOfMonths:c=1}=l,d=[];for(let m=0;m<c;m++){const h=i.addMonths(s,m);if(a&&h>a)break;d.push(h)}return d}function Zj(s,a,l,i){const{month:c,defaultMonth:d,today:m=i.today(),numberOfMonths:h=1}=s;let p=c||d||m;const{differenceInCalendarMonths:v,addMonths:g,startOfMonth:j}=i;if(l&&v(l,p)<h-1){const b=-1*(h-1);p=g(l,b)}return a&&v(p,a)<0&&(p=a),j(p)}function oR(s,a,l,i){const{addDays:c,endOfBroadcastWeek:d,endOfISOWeek:m,endOfMonth:h,endOfWeek:p,getISOWeek:v,getWeek:g,startOfBroadcastWeek:j,startOfISOWeek:b,startOfWeek:w}=i,S=s.reduce((C,N)=>{const T=l.broadcastCalendar?j(N,i):l.ISOWeek?b(N):w(N),P=l.broadcastCalendar?d(N):l.ISOWeek?m(h(N)):p(h(N)),M=a.filter(E=>E>=T&&E<=P),k=l.broadcastCalendar?35:42;if(l.fixedWeeks&&M.length<k){const E=a.filter(B=>{const Y=k-M.length;return B>P&&B<=c(P,Y)});M.push(...E)}const D=M.reduce((E,B)=>{const Y=l.ISOWeek?v(B):g(B),G=E.find(oe=>oe.weekNumber===Y),$=new GN(B,N,i);return G?G.days.push($):E.push(new ZO(Y,[$])),E},[]),A=new QO(N,D);return C.push(A),C},[]);return l.reverseMonths?S.reverse():S}function cR(s,a){let{startMonth:l,endMonth:i}=s;const{startOfYear:c,startOfDay:d,startOfMonth:m,endOfMonth:h,addYears:p,endOfYear:v,newDate:g,today:j}=a,{fromYear:b,toYear:w,fromMonth:S,toMonth:C}=s;!l&&S&&(l=S),!l&&b&&(l=a.newDate(b,0,1)),!i&&C&&(i=C),!i&&w&&(i=g(w,11,31));const N=s.captionLayout==="dropdown"||s.captionLayout==="dropdown-years";return l?l=m(l):b?l=g(b,0,1):!l&&N&&(l=c(p(s.today??j(),-100))),i?i=h(i):w?i=g(w,11,31):!i&&N&&(i=v(s.today??j())),[l&&d(l),i&&d(i)]}function dR(s,a,l,i){if(l.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d=1}=l,{startOfMonth:m,addMonths:h,differenceInCalendarMonths:p}=i,v=c?d:1,g=m(s);if(!a)return h(g,v);if(!(p(a,s)<d))return h(g,v)}function uR(s,a,l,i){if(l.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d}=l,{startOfMonth:m,addMonths:h,differenceInCalendarMonths:p}=i,v=c?d??1:1,g=m(s);if(!a)return h(g,-v);if(!(p(g,a)<=0))return h(g,-v)}function mR(s){const a=[];return s.reduce((l,i)=>l.concat(i.weeks.slice()),a.slice())}function Id(s,a){const[l,i]=x.useState(s);return[a===void 0?l:a,i]}function fR(s,a){const[l,i]=cR(s,a),{startOfMonth:c,endOfMonth:d}=a,m=Zj(s,l,i,a),[h,p]=Id(m,s.month?m:void 0);x.useEffect(()=>{const A=Zj(s,l,i,a);p(A)},[s.timeZone]);const v=iR(h,i,s,a),g=lR(v,s.endMonth?d(s.endMonth):void 0,s,a),j=oR(v,g,s,a),b=mR(j),w=rR(j),S=uR(h,l,s,a),C=dR(h,i,s,a),{disableNavigation:N,onMonthChange:T}=s,P=A=>b.some(E=>E.days.some(B=>B.isEqualTo(A))),M=A=>{if(N)return;let E=c(A);l&&E<c(l)&&(E=c(l)),i&&E>c(i)&&(E=c(i)),p(E),T?.(E)};return{months:j,weeks:b,days:w,navStart:l,navEnd:i,previousMonth:S,nextMonth:C,goToMonth:M,goToDay:A=>{P(A)||M(A.date)}}}var Un;(function(s){s[s.Today=0]="Today",s[s.Selected=1]="Selected",s[s.LastFocused=2]="LastFocused",s[s.FocusedModifier=3]="FocusedModifier"})(Un||(Un={}));function Jj(s){return!s[Gt.disabled]&&!s[Gt.hidden]&&!s[Gt.outside]}function hR(s,a,l,i){let c,d=-1;for(const m of s){const h=a(m);Jj(h)&&(h[Gt.focused]&&d<Un.FocusedModifier?(c=m,d=Un.FocusedModifier):i?.isEqualTo(m)&&d<Un.LastFocused?(c=m,d=Un.LastFocused):l(m.date)&&d<Un.Selected?(c=m,d=Un.Selected):h[Gt.today]&&d<Un.Today&&(c=m,d=Un.Today))}return c||(c=s.find(m=>Jj(a(m)))),c}function xR(s,a,l,i,c,d,m){const{ISOWeek:h,broadcastCalendar:p}=d,{addDays:v,addMonths:g,addWeeks:j,addYears:b,endOfBroadcastWeek:w,endOfISOWeek:S,endOfWeek:C,max:N,min:T,startOfBroadcastWeek:P,startOfISOWeek:M,startOfWeek:k}=m;let A={day:v,week:j,month:g,year:b,startOfWeek:E=>p?P(E,m):h?M(E):k(E),endOfWeek:E=>p?w(E):h?S(E):C(E)}[s](l,a==="after"?1:-1);return a==="before"&&i?A=N([i,A]):a==="after"&&c&&(A=T([c,A])),A}function sw(s,a,l,i,c,d,m,h=0){if(h>365)return;const p=xR(s,a,l.date,i,c,d,m),v=!!(d.disabled&&ha(p,d.disabled,m)),g=!!(d.hidden&&ha(p,d.hidden,m)),j=p,b=new GN(p,j,m);return!v&&!g?b:sw(s,a,b,i,c,d,m,h+1)}function pR(s,a,l,i,c){const{autoFocus:d}=s,[m,h]=x.useState(),p=hR(a.days,l,i||(()=>!1),m),[v,g]=x.useState(d?p:void 0);return{isFocusTarget:C=>!!p?.isEqualTo(C),setFocused:g,focused:v,blur:()=>{h(v),g(void 0)},moveFocus:(C,N)=>{if(!v)return;const T=sw(C,N,v,a.navStart,a.navEnd,s,c);T&&(s.disableNavigation&&!a.days.some(M=>M.isEqualTo(T))||(a.goToDay(T),g(T)))}}}function gR(s,a){const{selected:l,required:i,onSelect:c}=s,[d,m]=Id(l,c?l:void 0),h=c?l:d,{isSameDay:p}=a,v=w=>h?.some(S=>p(S,w))??!1,{min:g,max:j}=s;return{selected:h,select:(w,S,C)=>{let N=[...h??[]];if(v(w)){if(h?.length===g||i&&h?.length===1)return;N=h?.filter(T=>!p(T,w))}else h?.length===j?N=[w]:N=[...N,w];return c||m(N),c?.(N,w,S,C),N},isSelected:v}}function vR(s,a,l=0,i=0,c=!1,d=Gn){const{from:m,to:h}=a||{},{isSameDay:p,isAfter:v,isBefore:g}=d;let j;if(!m&&!h)j={from:s,to:l>0?void 0:s};else if(m&&!h)p(m,s)?l===0?j={from:m,to:s}:c?j={from:m,to:void 0}:j=void 0:g(s,m)?j={from:s,to:m}:j={from:m,to:s};else if(m&&h)if(p(m,s)&&p(h,s))c?j={from:m,to:h}:j=void 0;else if(p(m,s))j={from:m,to:l>0?void 0:s};else if(p(h,s))j={from:s,to:l>0?void 0:s};else if(g(s,m))j={from:s,to:h};else if(v(s,m))j={from:m,to:s};else if(v(s,h))j={from:m,to:s};else throw new Error("Invalid range");if(j?.from&&j?.to){const b=d.differenceInCalendarDays(j.to,j.from);i>0&&b>i?j={from:s,to:void 0}:l>1&&b<l&&(j={from:s,to:void 0})}return j}function jR(s,a,l=Gn){const i=Array.isArray(a)?a:[a];let c=s.from;const d=l.differenceInCalendarDays(s.to,s.from),m=Math.min(d,6);for(let h=0;h<=m;h++){if(i.includes(c.getDay()))return!0;c=l.addDays(c,1)}return!1}function ey(s,a,l=Gn){return fa(s,a.from,!1,l)||fa(s,a.to,!1,l)||fa(a,s.from,!1,l)||fa(a,s.to,!1,l)}function yR(s,a,l=Gn){const i=Array.isArray(a)?a:[a];if(i.filter(h=>typeof h!="function").some(h=>typeof h=="boolean"?h:l.isDate(h)?fa(s,h,!1,l):QN(h,l)?h.some(p=>fa(s,p,!1,l)):Fh(h)?h.from&&h.to?ey(s,{from:h.from,to:h.to},l):!1:KN(h)?jR(s,h.dayOfWeek,l):IN(h)?l.isAfter(h.before,h.after)?ey(s,{from:l.addDays(h.after,1),to:l.addDays(h.before,-1)},l):ha(s.from,h,l)||ha(s.to,h,l):WN(h)||XN(h)?ha(s.from,h,l)||ha(s.to,h,l):!1))return!0;const m=i.filter(h=>typeof h=="function");if(m.length){let h=s.from;const p=l.differenceInCalendarDays(s.to,s.from);for(let v=0;v<=p;v++){if(m.some(g=>g(h)))return!0;h=l.addDays(h,1)}}return!1}function bR(s,a){const{disabled:l,excludeDisabled:i,selected:c,required:d,onSelect:m}=s,[h,p]=Id(c,m?c:void 0),v=m?c:h;return{selected:v,select:(b,w,S)=>{const{min:C,max:N}=s,T=b?vR(b,v,C,N,d,a):void 0;return i&&l&&T?.from&&T.to&&yR({from:T.from,to:T.to},l,a)&&(T.from=b,T.to=void 0),m||p(T),m?.(T,b,w,S),T},isSelected:b=>v&&fa(v,b,!1,a)}}function NR(s,a){const{selected:l,required:i,onSelect:c}=s,[d,m]=Id(l,c?l:void 0),h=c?l:d,{isSameDay:p}=a;return{selected:h,select:(j,b,w)=>{let S=j;return!i&&h&&h&&p(j,h)&&(S=void 0),c||m(S),c?.(S,j,b,w),S},isSelected:j=>h?p(h,j):!1}}function wR(s,a){const l=NR(s,a),i=gR(s,a),c=bR(s,a);switch(s.mode){case"single":return l;case"multiple":return i;case"range":return c;default:return}}function SR(s){let a=s;a.timeZone&&(a={...s},a.today&&(a.today=new Ns(a.today,a.timeZone)),a.month&&(a.month=new Ns(a.month,a.timeZone)),a.defaultMonth&&(a.defaultMonth=new Ns(a.defaultMonth,a.timeZone)),a.startMonth&&(a.startMonth=new Ns(a.startMonth,a.timeZone)),a.endMonth&&(a.endMonth=new Ns(a.endMonth,a.timeZone)),a.mode==="single"&&a.selected?a.selected=new Ns(a.selected,a.timeZone):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(We=>new Ns(We,a.timeZone)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?new Ns(a.selected.from,a.timeZone):void 0,to:a.selected.to?new Ns(a.selected.to,a.timeZone):void 0}));const{components:l,formatters:i,labels:c,dateLib:d,locale:m,classNames:h}=x.useMemo(()=>{const We={...Hh,...a.locale};return{dateLib:new nn({locale:We,weekStartsOn:a.broadcastCalendar?1:a.weekStartsOn,firstWeekContainsDate:a.firstWeekContainsDate,useAdditionalWeekYearTokens:a.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:a.useAdditionalDayOfYearTokens,timeZone:a.timeZone,numerals:a.numerals},a.dateLib),components:TA(a.components),formatters:BA(a.formatters),labels:{...eR,...a.labels},locale:We,classNames:{...Yh(),...a.classNames}}},[a.locale,a.broadcastCalendar,a.weekStartsOn,a.firstWeekContainsDate,a.useAdditionalWeekYearTokens,a.useAdditionalDayOfYearTokens,a.timeZone,a.numerals,a.dateLib,a.components,a.formatters,a.labels,a.classNames]),{captionLayout:p,mode:v,navLayout:g,numberOfMonths:j=1,onDayBlur:b,onDayClick:w,onDayFocus:S,onDayKeyDown:C,onDayMouseEnter:N,onDayMouseLeave:T,onNextClick:P,onPrevClick:M,showWeekNumber:k,styles:D}=a,{formatCaption:A,formatDay:E,formatMonthDropdown:B,formatWeekNumber:Y,formatWeekNumberHeader:G,formatWeekdayName:$,formatYearDropdown:oe}=i,je=fR(a,d),{days:ae,months:me,navStart:R,navEnd:O,previousMonth:L,nextMonth:ee,goToMonth:le}=je,xe=CA(ae,a,R,O,d),{isSelected:F,select:W,selected:fe}=wR(a,d)??{},{blur:I,focused:ve,isFocusTarget:de,moveFocus:Ce,setFocused:Q}=pR(a,je,xe,F??(()=>!1),d),{labelDayButton:Oe,labelGridcell:$e,labelGrid:re,labelMonthDropdown:Pe,labelNav:ze,labelPrevious:Zt,labelNext:Rs,labelWeekday:An,labelWeekNumber:Le,labelWeekNumberHeader:Nn,labelYearDropdown:ln}=c,rn=x.useMemo(()=>FA(d,a.ISOWeek),[d,a.ISOWeek]),Xt=v!==void 0||w!==void 0,Ds=x.useCallback(()=>{L&&(le(L),M?.(L))},[L,le,M]),ke=x.useCallback(()=>{ee&&(le(ee),P?.(ee))},[le,ee,P]),is=x.useCallback((We,Mt)=>Be=>{Be.preventDefault(),Be.stopPropagation(),Q(We),W?.(We.date,Mt,Be),w?.(We.date,Mt,Be)},[W,w,Q]),he=x.useCallback((We,Mt)=>Be=>{Q(We),S?.(We.date,Mt,Be)},[S,Q]),Ee=x.useCallback((We,Mt)=>Be=>{I(),b?.(We.date,Mt,Be)},[I,b]),Ve=x.useCallback((We,Mt)=>Be=>{const ht={ArrowLeft:[Be.shiftKey?"month":"day",a.dir==="rtl"?"after":"before"],ArrowRight:[Be.shiftKey?"month":"day",a.dir==="rtl"?"before":"after"],ArrowDown:[Be.shiftKey?"year":"week","after"],ArrowUp:[Be.shiftKey?"year":"week","before"],PageUp:[Be.shiftKey?"year":"month","before"],PageDown:[Be.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ht[Be.key]){Be.preventDefault(),Be.stopPropagation();const[os,Xe]=ht[Be.key];Ce(os,Xe)}C?.(We.date,Mt,Be)},[Ce,C,a.dir]),Os=x.useCallback((We,Mt)=>Be=>{N?.(We.date,Mt,Be)},[N]),$n=x.useCallback((We,Mt)=>Be=>{T?.(We.date,Mt,Be)},[T]),Hl=x.useCallback(We=>Mt=>{const Be=Number(Mt.target.value),ht=d.setMonth(d.startOfMonth(We),Be);le(ht)},[d,le]),Fl=x.useCallback(We=>Mt=>{const Be=Number(Mt.target.value),ht=d.setYear(d.startOfMonth(We),Be);le(ht)},[d,le]),{className:se,style:ge}=x.useMemo(()=>({className:[h[Me.Root],a.className].filter(Boolean).join(" "),style:{...D?.[Me.Root],...a.style}}),[h,a.className,a.style,D]),Qe=EA(a),pt=x.useRef(null);aR(pt,!!a.animate,{classNames:h,months:me,focused:ve,dateLib:d});const tl={dayPickerProps:a,selected:fe,select:W,isSelected:F,months:me,nextMonth:ee,previousMonth:L,goToMonth:le,getModifiers:xe,components:l,classNames:h,styles:D,labels:c,formatters:i};return Ne.createElement($N.Provider,{value:tl},Ne.createElement(l.Root,{rootRef:a.animate?pt:void 0,className:se,style:ge,dir:a.dir,id:a.id,lang:a.lang,nonce:a.nonce,title:a.title,role:a.role,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],...Qe},Ne.createElement(l.Months,{className:h[Me.Months],style:D?.[Me.Months]},!a.hideNavigation&&!g&&Ne.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:h[Me.Nav],style:D?.[Me.Nav],"aria-label":ze(),onPreviousClick:Ds,onNextClick:ke,previousMonth:L,nextMonth:ee}),me.map((We,Mt)=>Ne.createElement(l.Month,{"data-animated-month":a.animate?"true":void 0,className:h[Me.Month],style:D?.[Me.Month],key:Mt,displayIndex:Mt,calendarMonth:We},g==="around"&&!a.hideNavigation&&Mt===0&&Ne.createElement(l.PreviousMonthButton,{type:"button",className:h[Me.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":L?void 0:!0,"aria-label":Zt(L),onClick:Ds,"data-animated-button":a.animate?"true":void 0},Ne.createElement(l.Chevron,{disabled:L?void 0:!0,className:h[Me.Chevron],orientation:a.dir==="rtl"?"right":"left"})),Ne.createElement(l.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:h[Me.MonthCaption],style:D?.[Me.MonthCaption],calendarMonth:We,displayIndex:Mt},p?.startsWith("dropdown")?Ne.createElement(l.DropdownNav,{className:h[Me.Dropdowns],style:D?.[Me.Dropdowns]},(()=>{const Be=p==="dropdown"||p==="dropdown-months"?Ne.createElement(l.MonthsDropdown,{key:"month",className:h[Me.MonthsDropdown],"aria-label":Pe(),classNames:h,components:l,disabled:!!a.disableNavigation,onChange:Hl(We.date),options:UA(We.date,R,O,i,d),style:D?.[Me.Dropdown],value:d.getMonth(We.date)}):Ne.createElement("span",{key:"month"},B(We.date,d)),ht=p==="dropdown"||p==="dropdown-years"?Ne.createElement(l.YearsDropdown,{key:"year",className:h[Me.YearsDropdown],"aria-label":ln(d.options),classNames:h,components:l,disabled:!!a.disableNavigation,onChange:Fl(We.date),options:YA(R,O,i,d,!!a.reverseYears),style:D?.[Me.Dropdown],value:d.getYear(We.date)}):Ne.createElement("span",{key:"year"},oe(We.date,d));return d.getMonthYearOrder()==="year-first"?[ht,Be]:[Be,ht]})(),Ne.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},A(We.date,d.options,d))):Ne.createElement(l.CaptionLabel,{className:h[Me.CaptionLabel],role:"status","aria-live":"polite"},A(We.date,d.options,d))),g==="around"&&!a.hideNavigation&&Mt===j-1&&Ne.createElement(l.NextMonthButton,{type:"button",className:h[Me.NextMonthButton],tabIndex:ee?void 0:-1,"aria-disabled":ee?void 0:!0,"aria-label":Rs(ee),onClick:ke,"data-animated-button":a.animate?"true":void 0},Ne.createElement(l.Chevron,{disabled:ee?void 0:!0,className:h[Me.Chevron],orientation:a.dir==="rtl"?"left":"right"})),Mt===j-1&&g==="after"&&!a.hideNavigation&&Ne.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:h[Me.Nav],style:D?.[Me.Nav],"aria-label":ze(),onPreviousClick:Ds,onNextClick:ke,previousMonth:L,nextMonth:ee}),Ne.createElement(l.MonthGrid,{role:"grid","aria-multiselectable":v==="multiple"||v==="range","aria-label":re(We.date,d.options,d)||void 0,className:h[Me.MonthGrid],style:D?.[Me.MonthGrid]},!a.hideWeekdays&&Ne.createElement(l.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:h[Me.Weekdays],style:D?.[Me.Weekdays]},k&&Ne.createElement(l.WeekNumberHeader,{"aria-label":Nn(d.options),className:h[Me.WeekNumberHeader],style:D?.[Me.WeekNumberHeader],scope:"col"},G()),rn.map(Be=>Ne.createElement(l.Weekday,{"aria-label":An(Be,d.options,d),className:h[Me.Weekday],key:String(Be),style:D?.[Me.Weekday],scope:"col"},$(Be,d.options,d)))),Ne.createElement(l.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:h[Me.Weeks],style:D?.[Me.Weeks]},We.weeks.map(Be=>Ne.createElement(l.Week,{className:h[Me.Week],key:Be.weekNumber,style:D?.[Me.Week],week:Be},k&&Ne.createElement(l.WeekNumber,{week:Be,style:D?.[Me.WeekNumber],"aria-label":Le(Be.weekNumber,{locale:m}),className:h[Me.WeekNumber],scope:"row",role:"rowheader"},Y(Be.weekNumber,d)),Be.days.map(ht=>{const{date:os}=ht,Xe=xe(ht);if(Xe[Gt.focused]=!Xe.hidden&&!!ve?.isEqualTo(ht),Xe[En.selected]=F?.(os)||Xe.selected,Fh(fe)){const{from:ql,to:nl}=fe;Xe[En.range_start]=!!(ql&&nl&&d.isSameDay(os,ql)),Xe[En.range_end]=!!(ql&&nl&&d.isSameDay(os,nl)),Xe[En.range_middle]=fa(fe,os,!0,d)}const Yl=HA(Xe,D,a.modifiersStyles),sl=kA(Xe,h,a.modifiersClassNames),Zd=!Xt&&!Xe.hidden?$e(os,Xe,d.options,d):void 0;return Ne.createElement(l.Day,{key:`${d.format(os,"yyyy-MM-dd")}_${d.format(ht.displayMonth,"yyyy-MM")}`,day:ht,modifiers:Xe,className:sl.join(" "),style:Yl,role:"gridcell","aria-selected":Xe.selected||void 0,"aria-label":Zd,"data-day":d.format(os,"yyyy-MM-dd"),"data-month":ht.outside?d.format(os,"yyyy-MM"):void 0,"data-selected":Xe.selected||void 0,"data-disabled":Xe.disabled||void 0,"data-hidden":Xe.hidden||void 0,"data-outside":ht.outside||void 0,"data-focused":Xe.focused||void 0,"data-today":Xe.today||void 0},!Xe.hidden&&Xt?Ne.createElement(l.DayButton,{className:h[Me.DayButton],style:D?.[Me.DayButton],type:"button",day:ht,modifiers:Xe,disabled:Xe.disabled||void 0,tabIndex:de(ht)?0:-1,"aria-label":Oe(os,Xe,d.options,d),onClick:is(ht,Xe),onBlur:Ee(ht,Xe),onFocus:he(ht,Xe),onKeyDown:Ve(ht,Xe),onMouseEnter:Os(ht,Xe),onMouseLeave:$n(ht,Xe)},E(os,d.options,d)):!Xe.hidden&&E(ht.date,d.options,d))})))))))),a.footer&&Ne.createElement(l.Footer,{className:h[Me.Footer],style:D?.[Me.Footer],role:"status","aria-live":"polite"},a.footer)))}function ty({className:s,classNames:a,showOutsideDays:l=!0,captionLayout:i="label",buttonVariant:c="ghost",formatters:d,components:m,...h}){const p=Yh();return e.jsx(SR,{showOutsideDays:l,className:Z("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,s),captionLayout:i,formatters:{formatMonthDropdown:v=>v.toLocaleString("default",{month:"short"}),...d},classNames:{root:Z("w-fit",p.root),months:Z("relative flex flex-col gap-4 md:flex-row",p.months),month:Z("flex w-full flex-col gap-4",p.month),nav:Z("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",p.nav),button_previous:Z(io({variant:c}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_previous),button_next:Z(io({variant:c}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",p.button_next),month_caption:Z("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",p.month_caption),dropdowns:Z("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",p.dropdowns),dropdown_root:Z("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",p.dropdown_root),dropdown:Z("bg-popover absolute inset-0 opacity-0",p.dropdown),caption_label:Z("select-none font-medium",i==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:Z("flex",p.weekdays),weekday:Z("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",p.weekday),week:Z("mt-2 flex w-full",p.week),week_number_header:Z("w-[--cell-size] select-none",p.week_number_header),week_number:Z("text-muted-foreground select-none text-[0.8rem]",p.week_number),day:Z("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",p.day),range_start:Z("bg-accent rounded-l-md",p.range_start),range_middle:Z("rounded-none",p.range_middle),range_end:Z("bg-accent rounded-r-md",p.range_end),today:Z("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:Z("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:Z("text-muted-foreground opacity-50",p.disabled),hidden:Z("invisible",p.hidden),...a},components:{Root:({className:v,rootRef:g,...j})=>e.jsx("div",{"data-slot":"calendar",ref:g,className:Z(v),...j}),Chevron:({className:v,orientation:g,...j})=>g==="left"?e.jsx(Ol,{className:Z("size-4",v),...j}):g==="right"?e.jsx(Al,{className:Z("size-4",v),...j}):e.jsx(lo,{className:Z("size-4",v),...j}),DayButton:_R,WeekNumber:({children:v,...g})=>e.jsx("td",{...g,children:e.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:v})}),...m},...h})}function _R({className:s,day:a,modifiers:l,...i}){const c=Yh(),d=x.useRef(null);return x.useEffect(()=>{l.focused&&d.current?.focus()},[l.focused]),e.jsx(q,{ref:d,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":l.selected&&!l.range_start&&!l.range_end&&!l.range_middle,"data-range-start":l.range_start,"data-range-end":l.range_end,"data-range-middle":l.range_middle,className:Z("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",c.day,s),...i})}class CR{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const a=window.location.protocol==="https:"?"wss:":"ws:",l=window.location.host;return`${a}//${l}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const a=this.getWebSocketUrl();try{this.ws=new WebSocket(a),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=l=>{try{if(l.data==="pong")return;const i=JSON.parse(l.data);this.notifyLog(i)}catch(i){console.error("解析日志消息失败:",i)}},this.ws.onerror=l=>{console.error("❌ WebSocket 错误:",l),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(l){console.error("创建 WebSocket 连接失败:",l),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const a=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},a)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(a){return this.logCallbacks.add(a),()=>this.logCallbacks.delete(a)}onConnectionChange(a){return this.connectionCallbacks.add(a),a(this.isConnected),()=>this.connectionCallbacks.delete(a)}notifyLog(a){this.logCache.some(i=>i.id===a.id)||(this.logCache.push(a),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(i=>{try{i(a)}catch(c){console.error("日志回调执行失败:",c)}}))}notifyConnection(a){this.connectionCallbacks.forEach(l=>{try{l(a)}catch(i){console.error("连接状态回调执行失败:",i)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const zr=new CR;typeof window<"u"&&zr.connect();const kR={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},TR=(s,a,l)=>{let i;const c=kR[s];return typeof c=="string"?i=c:a===1?i=c.one:i=c.other.replace("{{count}}",String(a)),l?.addSuffix?l.comparison&&l.comparison>0?i+"内":i+"前":i},ER={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},MR={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},DR={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},OR={date:Hr({formats:ER,defaultWidth:"full"}),time:Hr({formats:MR,defaultWidth:"full"}),dateTime:Hr({formats:DR,defaultWidth:"full"})};function sy(s,a,l){const i="eeee p";return qO(s,a,l)?i:s.getTime()>a.getTime()?"'下个'"+i:"'上个'"+i}const AR={lastWeek:sy,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:sy,other:"PP p"},RR=(s,a,l,i)=>{const c=AR[s];return typeof c=="function"?c(a,l,i):c},zR={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},PR={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},LR={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},BR={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},UR={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},HR={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},FR=(s,a)=>{const l=Number(s);switch(a?.unit){case"date":return l.toString()+"日";case"hour":return l.toString()+"时";case"minute":return l.toString()+"分";case"second":return l.toString()+"秒";default:return"第 "+l.toString()}},YR={ordinalNumber:FR,era:Hn({values:zR,defaultWidth:"wide"}),quarter:Hn({values:PR,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Hn({values:LR,defaultWidth:"wide"}),day:Hn({values:BR,defaultWidth:"wide"}),dayPeriod:Hn({values:UR,defaultWidth:"wide",formattingValues:HR,defaultFormattingWidth:"wide"})},qR=/^(第\s*)?\d+(日|时|分|秒)?/i,VR=/\d+/i,GR={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},$R={any:[/^(前)/i,/^(公元)/i]},IR={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},WR={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},XR={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},KR={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},QR={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},ZR={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},JR={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},e3={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},t3={ordinalNumber:UN({matchPattern:qR,parsePattern:VR,valueCallback:s=>parseInt(s,10)}),era:Fn({matchPatterns:GR,defaultMatchWidth:"wide",parsePatterns:$R,defaultParseWidth:"any"}),quarter:Fn({matchPatterns:IR,defaultMatchWidth:"wide",parsePatterns:WR,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Fn({matchPatterns:XR,defaultMatchWidth:"wide",parsePatterns:KR,defaultParseWidth:"any"}),day:Fn({matchPatterns:QR,defaultMatchWidth:"wide",parsePatterns:ZR,defaultParseWidth:"any"}),dayPeriod:Fn({matchPatterns:JR,defaultMatchWidth:"any",parsePatterns:e3,defaultParseWidth:"any"})},td={code:"zh-CN",formatDistance:TR,formatLong:OR,formatRelative:RR,localize:YR,match:t3,options:{weekStartsOn:1,firstWeekContainsDate:4}};function s3(){const[s,a]=x.useState([]),[l,i]=x.useState(""),[c,d]=x.useState("all"),[m,h]=x.useState("all"),[p,v]=x.useState(void 0),[g,j]=x.useState(void 0),[b,w]=x.useState(!0),[S,C]=x.useState(!1),N=x.useRef(null),T=x.useRef(null);x.useEffect(()=>{const $=zr.getAllLogs();a($);const oe=zr.onLog(()=>{a(zr.getAllLogs())}),je=zr.onConnectionChange(ae=>{C(ae)});return()=>{oe(),je()}},[]),x.useEffect(()=>{b&&T.current&&T.current.scrollIntoView({behavior:"smooth",block:"end"})},[s,b]);const P=x.useMemo(()=>{const $=new Set(s.map(oe=>oe.module));return Array.from($).sort()},[s]),M=$=>{switch($){case"DEBUG":return"text-muted-foreground";case"INFO":return"text-blue-500 dark:text-blue-400";case"WARNING":return"text-yellow-600 dark:text-yellow-500";case"ERROR":return"text-red-600 dark:text-red-500";case"CRITICAL":return"text-red-700 dark:text-red-400 font-bold";default:return"text-foreground"}},k=$=>{switch($){case"DEBUG":return"bg-gray-800/30 dark:bg-gray-800/50";case"INFO":return"bg-blue-900/20 dark:bg-blue-500/20";case"WARNING":return"bg-yellow-900/20 dark:bg-yellow-500/20";case"ERROR":return"bg-red-900/20 dark:bg-red-500/20";case"CRITICAL":return"bg-red-900/30 dark:bg-red-600/30";default:return"bg-gray-800/20 dark:bg-gray-800/30"}},D=()=>{window.location.reload()},A=()=>{zr.clearLogs(),a([])},E=()=>{const $=G.map(me=>`${me.timestamp} [${me.level.padEnd(8)}] [${me.module}] ${me.message}`).join(`
`),oe=new Blob([$],{type:"text/plain;charset=utf-8"}),je=URL.createObjectURL(oe),ae=document.createElement("a");ae.href=je,ae.download=`logs-${md(new Date,"yyyy-MM-dd-HHmmss")}.txt`,ae.click(),URL.revokeObjectURL(je)},B=()=>{w(!b)},Y=()=>{v(void 0),j(void 0)},G=x.useMemo(()=>s.filter($=>{const oe=l===""||$.message.toLowerCase().includes(l.toLowerCase())||$.module.toLowerCase().includes(l.toLowerCase()),je=c==="all"||$.level===c,ae=m==="all"||$.module===m;let me=!0;if(p||g){const R=new Date($.timestamp);if(p){const O=new Date(p);O.setHours(0,0,0,0),me=me&&R>=O}if(g){const O=new Date(g);O.setHours(23,59,59,999),me=me&&R<=O}}return oe&&je&&ae&&me}),[s,l,c,m,p,g]);return e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:Z("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",S?"bg-green-500 animate-pulse":"bg-red-500")}),e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:S?"已连接":"未连接"})]})]}),e.jsx(Ue,{className:"p-3 sm:p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Gs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{placeholder:"搜索日志...",value:l,onChange:$=>i($.target.value),className:"pl-9 h-9 text-sm"})]}),e.jsxs(rt,{value:c,onValueChange:d,children:[e.jsxs(at,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[e.jsx(Lf,{className:"h-4 w-4 mr-2"}),e.jsx(it,{placeholder:"级别"})]}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部级别"}),e.jsx(ye,{value:"DEBUG",children:"DEBUG"}),e.jsx(ye,{value:"INFO",children:"INFO"}),e.jsx(ye,{value:"WARNING",children:"WARNING"}),e.jsx(ye,{value:"ERROR",children:"ERROR"}),e.jsx(ye,{value:"CRITICAL",children:"CRITICAL"})]})]}),e.jsxs(rt,{value:m,onValueChange:h,children:[e.jsxs(at,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[e.jsx(Lf,{className:"h-4 w-4 mr-2"}),e.jsx(it,{placeholder:"模块"})]}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部模块"}),P.map($=>e.jsx(ye,{value:$,children:$},$))]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",className:Z("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!p&&"text-muted-foreground"),children:[e.jsx(ej,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:p?md(p,"PPP",{locale:td}):"开始日期"})]})}),e.jsx(pa,{className:"w-auto p-0",align:"start",children:e.jsx(ty,{mode:"single",selected:p,onSelect:v,initialFocus:!0,locale:td})})]}),e.jsxs(Ia,{children:[e.jsx(Wa,{asChild:!0,children:e.jsxs(q,{variant:"outline",size:"sm",className:Z("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!g&&"text-muted-foreground"),children:[e.jsx(ej,{className:"mr-2 h-4 w-4"}),e.jsx("span",{className:"text-xs sm:text-sm",children:g?md(g,"PPP",{locale:td}):"结束日期"})]})}),e.jsx(pa,{className:"w-auto p-0",align:"start",children:e.jsx(ty,{mode:"single",selected:g,onSelect:j,initialFocus:!0,locale:td})})]}),(p||g)&&e.jsxs(q,{variant:"outline",size:"sm",onClick:Y,className:"w-full sm:w-auto h-9",children:[e.jsx(go,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),e.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(q,{variant:b?"default":"outline",size:"sm",onClick:B,className:"flex-1 sm:flex-none h-9",children:[b?e.jsx(F2,{className:"h-4 w-4"}):e.jsx(Y2,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:b?"自动滚动":"已暂停"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:D,className:"flex-1 sm:flex-none h-9",children:[e.jsx(xa,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:A,className:"flex-1 sm:flex-none h-9",children:[e.jsx(ft,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),e.jsxs(q,{variant:"outline",size:"sm",onClick:E,className:"flex-1 sm:flex-none h-9",children:[e.jsx(Bf,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),e.jsx("div",{className:"flex-1 hidden sm:block"}),e.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[e.jsxs("span",{className:"font-mono",children:[G.length," / ",s.length]}),e.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),e.jsx(Ue,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:e.jsx(Ct,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:e.jsxs("div",{ref:N,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[G.length===0?e.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):G.map($=>e.jsxs("div",{className:Z("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",k($.level)),children:[e.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:$.timestamp}),e.jsxs("span",{className:Z("text-xs font-semibold",M($.level)),children:["[",$.level,"]"]})]}),e.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:$.module}),e.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:$.message})]}),e.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:$.timestamp}),e.jsxs("span",{className:Z("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",M($.level)),children:["[",$.level,"]"]}),e.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[120px] lg:w-[150px] truncate text-xs lg:text-sm",children:$.module}),e.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:$.message})]})]},$.id)),e.jsx("div",{ref:T,className:"h-4"})]})})})]})})}const n3="Mai-with-u",a3="plugin-repo",l3="main",r3="plugin_details.json";async function i3(){try{const s=await Fe("/api/webui/plugins/fetch-raw",{method:"POST",headers:Ie(),body:JSON.stringify({owner:n3,repo:a3,branch:l3,file_path:r3})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const a=await s.json();if(!a.success||!a.data)throw new Error(a.error||"获取插件列表失败");return JSON.parse(a.data).filter(c=>!c?.id||!c?.manifest?(console.warn("跳过无效插件数据:",c),!1):!c.manifest.name||!c.manifest.version?(console.warn("跳过缺少必需字段的插件:",c.id),!1):!0).map(c=>({id:c.id,manifest:{manifest_version:c.manifest.manifest_version||1,name:c.manifest.name,version:c.manifest.version,description:c.manifest.description||"",author:c.manifest.author||{name:"Unknown"},license:c.manifest.license||"Unknown",host_application:c.manifest.host_application||{min_version:"0.0.0"},homepage_url:c.manifest.homepage_url,repository_url:c.manifest.repository_url,keywords:c.manifest.keywords||[],categories:c.manifest.categories||[],default_locale:c.manifest.default_locale||"zh-CN",locales_path:c.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(s){throw console.error("Failed to fetch plugin list:",s),s}}async function o3(){try{const s=await Fe("/api/webui/plugins/git-status");if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return await s.json()}catch(s){return console.error("Failed to check Git status:",s),{installed:!1,error:"无法检测 Git 安装状态"}}}async function c3(){try{const s=await Fe("/api/webui/plugins/version");if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return await s.json()}catch(s){return console.error("Failed to get Maimai version:",s),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function d3(s,a,l){const i=s.split(".").map(h=>parseInt(h)||0),c=i[0]||0,d=i[1]||0,m=i[2]||0;if(l.version_major<c||l.version_major===c&&l.version_minor<d||l.version_major===c&&l.version_minor===d&&l.version_patch<m)return!1;if(a){const h=a.split(".").map(j=>parseInt(j)||0),p=h[0]||0,v=h[1]||0,g=h[2]||0;if(l.version_major>p||l.version_major===p&&l.version_minor>v||l.version_major===p&&l.version_minor===v&&l.version_patch>g)return!1}return!0}function u3(s,a){const l=window.location.protocol==="https:"?"wss:":"ws:",i=window.location.host,c=new WebSocket(`${l}//${i}/api/webui/ws/plugin-progress`);return c.onopen=()=>{console.log("Plugin progress WebSocket connected");const d=setInterval(()=>{c.readyState===WebSocket.OPEN?c.send("ping"):clearInterval(d)},3e4)},c.onmessage=d=>{try{if(d.data==="pong")return;const m=JSON.parse(d.data);s(m)}catch(m){console.error("Failed to parse progress data:",m)}},c.onerror=d=>{console.error("Plugin progress WebSocket error:",d),a?.(d)},c.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},c}async function sd(){try{const s=await Fe("/api/webui/plugins/installed",{headers:Ie()});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const a=await s.json();if(!a.success)throw new Error(a.message||"获取已安装插件列表失败");return a.plugins||[]}catch(s){return console.error("Failed to get installed plugins:",s),[]}}function nd(s,a){return a.some(l=>l.id===s)}function ad(s,a){const l=a.find(i=>i.id===s);if(l)return l.manifest?.version||l.version}async function m3(s,a,l="main"){const i=await Fe("/api/webui/plugins/install",{method:"POST",headers:Ie(),body:JSON.stringify({plugin_id:s,repository_url:a,branch:l})});if(!i.ok){const c=await i.json();throw new Error(c.detail||"安装失败")}return await i.json()}async function f3(s){const a=await Fe("/api/webui/plugins/uninstall",{method:"POST",headers:Ie(),body:JSON.stringify({plugin_id:s})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"卸载失败")}return await a.json()}async function h3(s,a,l="main"){const i=await Fe("/api/webui/plugins/update",{method:"POST",headers:Ie(),body:JSON.stringify({plugin_id:s,repository_url:a,branch:l})});if(!i.ok){const c=await i.json();throw new Error(c.detail||"更新失败")}return await i.json()}const ny={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function x3(){const s=qn(),[a,l]=x.useState(null),[i,c]=x.useState(""),[d,m]=x.useState("all"),[h,p]=x.useState("all"),[v,g]=x.useState(!1),[j,b]=x.useState([]),[w,S]=x.useState(!0),[C,N]=x.useState(null),[T,P]=x.useState(null),[M,k]=x.useState(null),[D,A]=x.useState(null),[,E]=x.useState([]),{toast:B}=Es();x.useEffect(()=>{let O=null,L=!1;return(async()=>{if(O=u3(le=>{L||(k(le),le.stage==="success"?setTimeout(()=>{L||k(null)},2e3):le.stage==="error"&&(S(!1),N(le.error||"加载失败")))},le=>{console.error("WebSocket error:",le),L||B({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(le=>{if(!O){le();return}const xe=()=>{O&&O.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),le()):O&&O.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),le()):setTimeout(xe,100)};xe()}),!L){const le=await o3();P(le),le.installed||B({title:"Git 未安装",description:le.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!L){const le=await c3();A(le)}if(!L)try{S(!0),N(null);const le=await i3();if(!L){const xe=await sd();E(xe);const F=le.map(W=>{const fe=nd(W.id,xe),I=ad(W.id,xe);return{...W,installed:fe,installed_version:I}});for(const W of xe)!F.some(I=>I.id===W.id)&&W.manifest&&F.push({id:W.id,manifest:{manifest_version:W.manifest.manifest_version||1,name:W.manifest.name,version:W.manifest.version,description:W.manifest.description||"",author:W.manifest.author,license:W.manifest.license||"Unknown",host_application:W.manifest.host_application,homepage_url:W.manifest.homepage_url,repository_url:W.manifest.repository_url,keywords:W.manifest.keywords||[],categories:W.manifest.categories||[],default_locale:W.manifest.default_locale||"zh-CN",locales_path:W.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:W.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});b(F)}}catch(le){if(!L){const xe=le instanceof Error?le.message:"加载插件列表失败";N(xe),B({title:"加载失败",description:xe,variant:"destructive"})}}finally{L||S(!1)}})(),()=>{L=!0,O&&O.close()}},[B]);const Y=O=>{if(!O.installed&&D&&!G(O))return e.jsxs(_t,{variant:"destructive",className:"gap-1",children:[e.jsx(Tl,{className:"h-3 w-3"}),"不兼容"]});if(O.installed){const L=O.installed_version?.trim(),ee=O.manifest.version?.trim();if(L!==ee){const le=L?.split(".").map(Number)||[0,0,0],xe=ee?.split(".").map(Number)||[0,0,0];for(let F=0;F<3;F++){if((xe[F]||0)>(le[F]||0))return e.jsxs(_t,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[e.jsx(Tl,{className:"h-3 w-3"}),"可更新"]});if((xe[F]||0)<(le[F]||0))break}}return e.jsxs(_t,{variant:"default",className:"gap-1",children:[e.jsx(Ys,{className:"h-3 w-3"}),"已安装"]})}return null},G=O=>!D||!O.manifest?.host_application?!0:d3(O.manifest.host_application.min_version,O.manifest.host_application.max_version,D),$=O=>{if(!O.installed||!O.installed_version||!O.manifest?.version)return!1;const L=O.installed_version.trim(),ee=O.manifest.version.trim();if(L===ee)return!1;const le=L.split(".").map(Number),xe=ee.split(".").map(Number);for(let F=0;F<3;F++){if((xe[F]||0)>(le[F]||0))return!0;if((xe[F]||0)<(le[F]||0))return!1}return!1},oe=j.filter(O=>{if(!O.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",O.id),!1;const L=i===""||O.manifest.name?.toLowerCase().includes(i.toLowerCase())||O.manifest.description?.toLowerCase().includes(i.toLowerCase())||O.manifest.keywords&&O.manifest.keywords.some(F=>F.toLowerCase().includes(i.toLowerCase())),ee=d==="all"||O.manifest.categories&&O.manifest.categories.includes(d);let le=!0;h==="installed"?le=O.installed===!0:h==="updates"&&(le=O.installed===!0&&$(O));const xe=!v||!D||G(O);return L&&ee&&le&&xe}),je=()=>{l(null)},ae=async O=>{if(!T?.installed){B({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(D&&!G(O)){B({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await m3(O.id,O.manifest.repository_url||"","main"),B({title:"安装成功",description:`${O.manifest.name} 已成功安装`});const L=await sd();E(L),b(ee=>ee.map(le=>{if(le.id===O.id){const xe=nd(le.id,L),F=ad(le.id,L);return{...le,installed:xe,installed_version:F}}return le}))}catch(L){B({title:"安装失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},me=async O=>{try{await f3(O.id),B({title:"卸载成功",description:`${O.manifest.name} 已成功卸载`});const L=await sd();E(L),b(ee=>ee.map(le=>{if(le.id===O.id){const xe=nd(le.id,L),F=ad(le.id,L);return{...le,installed:xe,installed_version:F}}return le}))}catch(L){B({title:"卸载失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},R=async O=>{if(!T?.installed){B({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const L=await h3(O.id,O.manifest.repository_url||"","main");B({title:"更新成功",description:`${O.manifest.name} 已从 ${L.old_version} 更新到 ${L.new_version}`});const ee=await sd();E(ee),b(le=>le.map(xe=>{if(xe.id===O.id){const F=nd(xe.id,ee),W=ad(xe.id,ee);return{...xe,installed:F,installed_version:W}}return xe}))}catch(L){B({title:"更新失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}};return e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),e.jsxs(q,{onClick:()=>s({to:"/plugin-mirrors"}),children:[e.jsx(q2,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),T&&!T.installed&&e.jsxs(Ue,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[e.jsx(ot,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Lr,{className:"h-5 w-5 text-orange-600"}),e.jsxs("div",{children:[e.jsx(ct,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),e.jsx(us,{className:"text-orange-800 dark:text-orange-200",children:T.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),e.jsx(gt,{children:e.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",e.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),e.jsx(Ue,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Gs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(pe,{placeholder:"搜索插件...",value:i,onChange:O=>c(O.target.value),className:"pl-9"})]}),e.jsxs(rt,{value:d,onValueChange:m,children:[e.jsx(at,{className:"w-full sm:w-[200px]",children:e.jsx(it,{placeholder:"选择分类"})}),e.jsxs(lt,{children:[e.jsx(ye,{value:"all",children:"全部分类"}),e.jsx(ye,{value:"Group Management",children:"群组管理"}),e.jsx(ye,{value:"Entertainment & Interaction",children:"娱乐互动"}),e.jsx(ye,{value:"Utility Tools",children:"实用工具"}),e.jsx(ye,{value:"Content Generation",children:"内容生成"}),e.jsx(ye,{value:"Multimedia",children:"多媒体"}),e.jsx(ye,{value:"External Integration",children:"外部集成"}),e.jsx(ye,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),e.jsx(ye,{value:"Other",children:"其他"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Cs,{id:"compatible-only",checked:v,onCheckedChange:O=>g(O===!0)}),e.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),e.jsx(Ml,{value:h,onValueChange:p,className:"w-full",children:e.jsxs($a,{className:"grid w-full grid-cols-3",children:[e.jsxs(bt,{value:"all",children:["全部插件 (",j.length,")"]}),e.jsxs(bt,{value:"installed",children:["已安装 (",j.filter(O=>O.installed).length,")"]}),e.jsxs(bt,{value:"updates",children:["可更新 (",j.filter(O=>O.installed&&$(O)).length,")"]})]})}),M&&M.stage==="loading"&&e.jsx(Ue,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ro,{className:"h-4 w-4 animate-spin"}),e.jsxs("span",{className:"text-sm font-medium",children:[M.operation==="fetch"&&"加载插件列表",M.operation==="install"&&`安装插件${M.plugin_id?`: ${M.plugin_id}`:""}`,M.operation==="uninstall"&&`卸载插件${M.plugin_id?`: ${M.plugin_id}`:""}`,M.operation==="update"&&`更新插件${M.plugin_id?`: ${M.plugin_id}`:""}`]})]}),e.jsxs("span",{className:"text-sm font-medium",children:[M.progress,"%"]})]}),e.jsx(_o,{value:M.progress,className:"h-2"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:M.message}),M.operation==="fetch"&&M.total_plugins>0&&e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",M.loaded_plugins," / ",M.total_plugins," 个插件"]})]})}),M&&M.stage==="error"&&M.error&&e.jsx(Ue,{className:"border-destructive bg-destructive/10",children:e.jsx(ot,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Lr,{className:"h-5 w-5 text-destructive"}),e.jsxs("div",{children:[e.jsx(ct,{className:"text-lg text-destructive",children:"加载失败"}),e.jsx(us,{className:"text-destructive/80",children:M.error})]})]})})}),w?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(ro,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):C?e.jsx(Ue,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Lr,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:C}),e.jsx(q,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):oe.length===0?e.jsx(Ue,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Gs,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i||d!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:oe.map(O=>e.jsxs(Ue,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[e.jsxs(ot,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(ct,{className:"text-xl",children:O.manifest?.name||O.id}),e.jsxs("div",{className:"flex flex-col gap-1",children:[O.manifest?.categories&&O.manifest.categories[0]&&e.jsx(_t,{variant:"secondary",className:"text-xs whitespace-nowrap",children:ny[O.manifest.categories[0]]||O.manifest.categories[0]}),Y(O)]})]}),e.jsx(us,{className:"line-clamp-2",children:O.manifest?.description||"无描述"})]}),e.jsx(gt,{className:"flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Bf,{className:"h-4 w-4"}),e.jsx("span",{children:O.downloads.toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(tj,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsx("span",{children:O.rating.toFixed(1)})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.manifest?.keywords&&O.manifest.keywords.slice(0,3).map(L=>e.jsx(_t,{variant:"outline",className:"text-xs",children:L},L)),O.manifest?.keywords&&O.manifest.keywords.length>3&&e.jsxs(_t,{variant:"outline",className:"text-xs",children:["+",O.manifest.keywords.length-3]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[e.jsxs("div",{children:["v",O.manifest?.version||"unknown"," · ",O.manifest?.author?.name||"Unknown"]}),O.manifest?.host_application&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"支持:"}),e.jsxs("span",{className:"font-medium",children:[O.manifest.host_application.min_version,O.manifest.host_application.max_version?` - ${O.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),e.jsx(pb,{className:"pt-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[e.jsx(q,{variant:"outline",size:"sm",onClick:()=>l(O),children:"查看详情"}),O.installed?$(O)?e.jsxs(q,{size:"sm",disabled:!T?.installed,title:T?.installed?void 0:"Git 未安装",onClick:()=>R(O),children:[e.jsx(xa,{className:"h-4 w-4 mr-1"}),"更新"]}):e.jsxs(q,{variant:"destructive",size:"sm",disabled:!T?.installed,title:T?.installed?void 0:"Git 未安装",onClick:()=>me(O),children:[e.jsx(ft,{className:"h-4 w-4 mr-1"}),"卸载"]}):e.jsxs(q,{size:"sm",disabled:!T?.installed||M?.operation==="install"||D!==null&&!G(O),title:T?.installed?D!==null&&!G(O)?`不兼容当前版本 (需要 ${O.manifest?.host_application?.min_version||"未知"}${O.manifest?.host_application?.max_version?` - ${O.manifest.host_application.max_version}`:"+"},当前 ${D?.version})`:void 0:"Git 未安装",onClick:()=>ae(O),children:[e.jsx(Bf,{className:"h-4 w-4 mr-1"}),M?.operation==="install"&&M?.plugin_id===O.id?"安装中...":"安装"]})]})})]},O.id))}),e.jsx(bs,{open:a!==null,onOpenChange:je,children:a&&a.manifest&&e.jsxs(ms,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(fs,{children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(hs,{className:"text-2xl",children:a.manifest.name}),e.jsxs(ks,{children:["作者: ",a.manifest.author?.name||"Unknown",a.manifest.author?.url&&e.jsx("a",{href:a.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:e.jsx(so,{className:"h-3 w-3 inline"})})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[a.manifest.categories&&a.manifest.categories[0]&&e.jsx(_t,{variant:"secondary",children:ny[a.manifest.categories[0]]||a.manifest.categories[0]}),Y(a)]})]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",a.manifest?.version||"unknown"]}),a.installed&&a.installed_version&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",a.installed_version]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"下载量"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.downloads.toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"评分"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(tj,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[a.rating.toFixed(1)," (",a.review_count,")"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"许可证"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.manifest.license||"Unknown"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.manifest.host_application?.min_version||"未知",a.manifest.host_application?.max_version?` - ${a.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:a.manifest.keywords&&a.manifest.keywords.map(O=>e.jsx(_t,{variant:"outline",children:O},O))})]}),a.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:a.detailed_description})]}),!a.detailed_description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.manifest.description||"无描述"})]}),e.jsxs("div",{className:"space-y-2",children:[a.manifest.homepage_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"主页: "}),e.jsx("a",{href:a.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:a.manifest.homepage_url})]}),a.manifest.repository_url&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium",children:"仓库: "}),e.jsx("a",{href:a.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:a.manifest.repository_url})]})]})]}),e.jsxs($s,{children:[a.manifest.homepage_url&&e.jsxs(q,{onClick:()=>window.open(a.manifest.homepage_url,"_blank"),children:[e.jsx(so,{className:"h-4 w-4 mr-2"}),"访问主页"]}),a.manifest.repository_url&&e.jsxs(q,{variant:"outline",onClick:()=>window.open(a.manifest.repository_url,"_blank"),children:[e.jsx(so,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function p3(){return e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),e.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(q,{variant:"outline",size:"sm",children:[e.jsx(xa,{className:"h-4 w-4 mr-2"}),"刷新"]}),e.jsxs(q,{size:"sm",children:[e.jsx(Tn,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"已安装插件"}),e.jsx(pd,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"已启用"}),e.jsx(Ys,{className:"h-4 w-4 text-green-600"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"已禁用"}),e.jsx(Tl,{className:"h-4 w-4 text-orange-600"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(ct,{className:"text-sm font-medium",children:"可更新"}),e.jsx(xa,{className:"h-4 w-4 text-blue-600"})]}),e.jsxs(gt,{children:[e.jsx("div",{className:"text-2xl font-bold",children:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),e.jsxs(Ue,{children:[e.jsxs(ot,{children:[e.jsx(ct,{children:"已安装的插件"}),e.jsx(us,{children:"查看和管理已安装插件的配置"})]}),e.jsx(gt,{children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx(pd,{className:"h-16 w-16 text-muted-foreground/50"}),e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(q,{variant:"outline",asChild:!0,children:e.jsxs("a",{href:"/plugins",children:[e.jsx(so,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsxs(Ue,{children:[e.jsx(ot,{children:e.jsx(ct,{className:"text-base",children:"即将推出的功能"})}),e.jsx(gt,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:e.jsx(Ys,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"插件启用/禁用"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"快速切换插件运行状态"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:e.jsx(Ys,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"配置参数编辑"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"可视化编辑插件配置文件"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:e.jsx(Ys,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"依赖管理"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"查看和安装插件依赖包"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:e.jsx(Ys,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"插件日志"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"查看插件运行日志和错误信息"})]})]})]})})]}),e.jsxs(Ue,{children:[e.jsx(ot,{children:e.jsx(ct,{className:"text-base",children:"开发者工具"})}),e.jsx(gt,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:e.jsx(Tn,{className:"h-4 w-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"热重载"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"无需重启即可重新加载插件"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:e.jsx(Tn,{className:"h-4 w-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"配置验证"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"检查配置文件格式和完整性"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:e.jsx(Tn,{className:"h-4 w-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"性能监控"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"监控插件的资源占用情况"})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:e.jsx(Tn,{className:"h-4 w-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"调试模式"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"详细的调试信息和错误追踪"})]})]})]})})]})]}),e.jsx(Ue,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:e.jsx(gt,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Tl,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),e.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",e.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function g3(){const s=qn(),{toast:a}=Es(),[l,i]=x.useState([]),[c,d]=x.useState(!0),[m,h]=x.useState(null),[p,v]=x.useState(null),[g,j]=x.useState(!1),[b,w]=x.useState(!1),[S,C]=x.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),N=x.useCallback(async()=>{try{d(!0),h(null);const E=localStorage.getItem("access-token"),B=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${E}`}});if(!B.ok)throw new Error("获取镜像源列表失败");const Y=await B.json();i(Y.mirrors||[])}catch(E){const B=E instanceof Error?E.message:"加载镜像源失败";h(B),a({title:"加载失败",description:B,variant:"destructive"})}finally{d(!1)}},[a]);x.useEffect(()=>{N()},[N]);const T=async()=>{try{const E=localStorage.getItem("access-token"),B=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${E}`,"Content-Type":"application/json"},body:JSON.stringify(S)});if(!B.ok){const Y=await B.json();throw new Error(Y.detail||"添加镜像源失败")}a({title:"添加成功",description:"镜像源已添加"}),j(!1),C({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),N()}catch(E){a({title:"添加失败",description:E instanceof Error?E.message:"未知错误",variant:"destructive"})}},P=async()=>{if(p)try{const E=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${p.id}`,{method:"PUT",headers:{Authorization:`Bearer ${E}`,"Content-Type":"application/json"},body:JSON.stringify({name:S.name,raw_prefix:S.raw_prefix,clone_prefix:S.clone_prefix,enabled:S.enabled,priority:S.priority})})).ok)throw new Error("更新镜像源失败");a({title:"更新成功",description:"镜像源已更新"}),w(!1),v(null),N()}catch(E){a({title:"更新失败",description:E instanceof Error?E.message:"未知错误",variant:"destructive"})}},M=async E=>{if(confirm("确定要删除这个镜像源吗?"))try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${E}`,{method:"DELETE",headers:{Authorization:`Bearer ${B}`}})).ok)throw new Error("删除镜像源失败");a({title:"删除成功",description:"镜像源已删除"}),N()}catch(B){a({title:"删除失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}},k=async E=>{try{const B=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${E.id}`,{method:"PUT",headers:{Authorization:`Bearer ${B}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!E.enabled})})).ok)throw new Error("更新状态失败");N()}catch(B){a({title:"更新失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}},D=E=>{v(E),C({id:E.id,name:E.name,raw_prefix:E.raw_prefix,clone_prefix:E.clone_prefix,enabled:E.enabled,priority:E.priority}),w(!0)},A=async(E,B)=>{const Y=B==="up"?E.priority-1:E.priority+1;if(!(Y<1))try{const G=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${E.id}`,{method:"PUT",headers:{Authorization:`Bearer ${G}`,"Content-Type":"application/json"},body:JSON.stringify({priority:Y})})).ok)throw new Error("更新优先级失败");N()}catch(G){a({title:"更新失败",description:G instanceof Error?G.message:"未知错误",variant:"destructive"})}};return e.jsx(Ct,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(q,{variant:"ghost",size:"icon",onClick:()=>s({to:"/plugins"}),children:e.jsx(My,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),e.jsxs(q,{onClick:()=>j(!0),children:[e.jsx(ys,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),c?e.jsx(Ue,{className:"p-6",children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(ro,{className:"h-8 w-8 animate-spin text-primary"})})}):m?e.jsx(Ue,{className:"p-6",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx(Lr,{className:"h-12 w-12 text-destructive mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:m}),e.jsx(q,{onClick:N,children:"重新加载"})]})}):e.jsxs(Ue,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsxs(Rl,{children:[e.jsx(zl,{children:e.jsxs(ns,{children:[e.jsx(He,{children:"状态"}),e.jsx(He,{children:"名称"}),e.jsx(He,{children:"ID"}),e.jsx(He,{children:"优先级"}),e.jsx(He,{className:"text-right",children:"操作"})]})}),e.jsx(Pl,{children:l.map(E=>e.jsxs(ns,{children:[e.jsx(Ae,{children:e.jsx(Ze,{checked:E.enabled,onCheckedChange:()=>k(E)})}),e.jsx(Ae,{children:e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:E.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",E.raw_prefix]})]})}),e.jsx(Ae,{children:e.jsx(_t,{variant:"outline",children:E.id})}),e.jsx(Ae,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono",children:E.priority}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(q,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>A(E,"up"),disabled:E.priority===1,children:e.jsx(Pf,{className:"h-3 w-3"})}),e.jsx(q,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>A(E,"down"),children:e.jsx(lo,{className:"h-3 w-3"})})]})]})}),e.jsx(Ae,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(q,{variant:"ghost",size:"icon",onClick:()=>D(E),children:e.jsx(Yr,{className:"h-4 w-4"})}),e.jsx(q,{variant:"ghost",size:"icon",onClick:()=>M(E.id),children:e.jsx(ft,{className:"h-4 w-4 text-destructive"})})]})})]},E.id))})]})}),e.jsx("div",{className:"md:hidden p-4 space-y-4",children:l.map(E=>e.jsx(Ue,{className:"p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold",children:E.name}),E.enabled&&e.jsx(_t,{variant:"default",className:"text-xs",children:"启用"})]}),e.jsx(_t,{variant:"outline",className:"mt-1 text-xs",children:E.id})]}),e.jsx(Ze,{checked:E.enabled,onCheckedChange:()=>k(E)})]}),e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Raw: "}),e.jsx("span",{className:"break-all",children:E.raw_prefix})]}),e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"优先级: "}),e.jsx("span",{className:"font-mono",children:E.priority})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[e.jsxs(q,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>D(E),children:[e.jsx(Yr,{className:"h-4 w-4 mr-1"}),"编辑"]}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>A(E,"up"),disabled:E.priority===1,children:e.jsx(Pf,{className:"h-4 w-4"})}),e.jsx(q,{variant:"outline",size:"sm",onClick:()=>A(E,"down"),children:e.jsx(lo,{className:"h-4 w-4"})}),e.jsx(q,{variant:"destructive",size:"sm",onClick:()=>M(E.id),children:e.jsx(ft,{className:"h-4 w-4"})})]})]})},E.id))})]}),e.jsx(bs,{open:g,onOpenChange:j,children:e.jsxs(ms,{className:"max-w-lg",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"添加镜像源"}),e.jsx(ks,{children:"添加新的 Git 镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"add-id",children:"镜像源 ID *"}),e.jsx(pe,{id:"add-id",placeholder:"例如: my-mirror",value:S.id,onChange:E=>C({...S,id:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"add-name",children:"名称 *"}),e.jsx(pe,{id:"add-name",placeholder:"例如: 我的镜像源",value:S.name,onChange:E=>C({...S,name:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),e.jsx(pe,{id:"add-raw",placeholder:"https://example.com/raw",value:S.raw_prefix,onChange:E=>C({...S,raw_prefix:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"add-clone",children:"克隆前缀 *"}),e.jsx(pe,{id:"add-clone",placeholder:"https://example.com/clone",value:S.clone_prefix,onChange:E=>C({...S,clone_prefix:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"add-priority",children:"优先级"}),e.jsx(pe,{id:"add-priority",type:"number",min:"1",value:S.priority,onChange:E=>C({...S,priority:parseInt(E.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"add-enabled",checked:S.enabled,onCheckedChange:E=>C({...S,enabled:E})}),e.jsx(U,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>j(!1),children:"取消"}),e.jsx(q,{onClick:T,children:"添加"})]})]})}),e.jsx(bs,{open:b,onOpenChange:w,children:e.jsxs(ms,{className:"max-w-lg",children:[e.jsxs(fs,{children:[e.jsx(hs,{children:"编辑镜像源"}),e.jsx(ks,{children:"修改镜像源配置"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{children:"镜像源 ID"}),e.jsx(pe,{value:S.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit-name",children:"名称 *"}),e.jsx(pe,{id:"edit-name",value:S.name,onChange:E=>C({...S,name:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),e.jsx(pe,{id:"edit-raw",value:S.raw_prefix,onChange:E=>C({...S,raw_prefix:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit-clone",children:"克隆前缀 *"}),e.jsx(pe,{id:"edit-clone",value:S.clone_prefix,onChange:E=>C({...S,clone_prefix:E.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{htmlFor:"edit-priority",children:"优先级"}),e.jsx(pe,{id:"edit-priority",type:"number",min:"1",value:S.priority,onChange:E=>C({...S,priority:parseInt(E.target.value)||1})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{id:"edit-enabled",checked:S.enabled,onCheckedChange:E=>C({...S,enabled:E})}),e.jsx(U,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),e.jsxs($s,{children:[e.jsx(q,{variant:"outline",onClick:()=>w(!1),children:"取消"}),e.jsx(q,{onClick:P,children:"保存"})]})]})})]})})}const v3=Jr("pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono font-medium opacity-100",{variants:{size:{sm:"h-5 text-[10px]",default:"h-6 text-xs",lg:"h-7 text-sm"}},defaultVariants:{size:"default"}}),nw=x.forwardRef(({className:s,size:a,abbrTitle:l,children:i,...c},d)=>e.jsx("kbd",{className:Z(v3({size:a,className:s})),ref:d,...c,children:l?e.jsx("abbr",{title:l,children:i}):i}));nw.displayName="Kbd";const j3=[{icon:fd,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:ph,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:Dy,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:Oy,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:gh,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:po,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:Ay,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:V2,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:pd,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:hd,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Tn,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function y3({open:s,onOpenChange:a}){const[l,i]=x.useState(""),[c,d]=x.useState(0),m=qn(),h=j3.filter(g=>g.title.toLowerCase().includes(l.toLowerCase())||g.description.toLowerCase().includes(l.toLowerCase())||g.category.toLowerCase().includes(l.toLowerCase()));x.useEffect(()=>{s&&(i(""),d(0))},[s]);const p=x.useCallback(g=>{m({to:g}),a(!1)},[m,a]),v=x.useCallback(g=>{g.key==="ArrowDown"?(g.preventDefault(),d(j=>(j+1)%h.length)):g.key==="ArrowUp"?(g.preventDefault(),d(j=>(j-1+h.length)%h.length)):g.key==="Enter"&&h[c]&&(g.preventDefault(),p(h[c].path))},[h,c,p]);return e.jsx(bs,{open:s,onOpenChange:a,children:e.jsxs(ms,{className:"max-w-2xl p-0 gap-0",children:[e.jsxs(fs,{className:"px-4 pt-4 pb-0",children:[e.jsx(hs,{className:"sr-only",children:"搜索"}),e.jsxs("div",{className:"relative",children:[e.jsx(Gs,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(pe,{value:l,onChange:g=>{i(g.target.value),d(0)},onKeyDown:v,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),e.jsx("div",{className:"border-t",children:e.jsx(Ct,{className:"h-[400px]",children:h.length>0?e.jsx("div",{className:"p-2",children:h.map((g,j)=>{const b=g.icon;return e.jsxs("button",{onClick:()=>p(g.path),onMouseEnter:()=>d(j),className:Z("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",j===c?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[e.jsx(b,{className:"h-5 w-5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm",children:g.title}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:g.description})]}),e.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:g.category})]},g.path)})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Gs,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),e.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function b3(s){const a=N3(s),l=x.forwardRef((i,c)=>{const{children:d,...m}=i,h=x.Children.toArray(d),p=h.find(S3);if(p){const v=p.props.children,g=h.map(j=>j===p?x.Children.count(v)>1?x.Children.only(null):x.isValidElement(v)?v.props.children:null:j);return e.jsx(a,{...m,ref:c,children:x.isValidElement(v)?x.cloneElement(v,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}function N3(s){const a=x.forwardRef((l,i)=>{const{children:c,...d}=l;if(x.isValidElement(c)){const m=C3(c),h=_3(d,c.props);return c.type!==x.Fragment&&(h.ref=i?Ga(i,m):m),x.cloneElement(c,h)}return x.Children.count(c)>1?x.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var w3=Symbol("radix.slottable");function S3(s){return x.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===w3}function _3(s,a){const l={...a};for(const i in a){const c=s[i],d=a[i];/^on[A-Z]/.test(i)?c&&d?l[i]=(...h)=>{const p=d(...h);return c(...h),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function C3(s){let a=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=Object.getOwnPropertyDescriptor(s,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var eh=["Enter"," "],k3=["ArrowDown","PageUp","Home"],aw=["ArrowUp","PageDown","End"],T3=[...k3,...aw],E3={ltr:[...eh,"ArrowRight"],rtl:[...eh,"ArrowLeft"]},M3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Do="Menu",[mo,D3,O3]=_d(Do),[Ul,lw]=Dn(Do,[O3,Wr,Pd]),Oo=Wr(),rw=Pd(),[iw,el]=Ul(Do),[A3,Ao]=Ul(Do),ow=s=>{const{__scopeMenu:a,open:l=!1,children:i,dir:c,onOpenChange:d,modal:m=!0}=s,h=Oo(a),[p,v]=x.useState(null),g=x.useRef(!1),j=ws(d),b=xo(c);return x.useEffect(()=>{const w=()=>{g.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>g.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),e.jsx(Ed,{...h,children:e.jsx(iw,{scope:a,open:l,onOpenChange:j,content:p,onContentChange:v,children:e.jsx(A3,{scope:a,onClose:x.useCallback(()=>j(!1),[j]),isUsingKeyboardRef:g,dir:b,modal:m,children:i})})})};ow.displayName=Do;var R3="MenuAnchor",qh=x.forwardRef((s,a)=>{const{__scopeMenu:l,...i}=s,c=Oo(l);return e.jsx(Md,{...c,...i,ref:a})});qh.displayName=R3;var Vh="MenuPortal",[z3,cw]=Ul(Vh,{forceMount:void 0}),dw=s=>{const{__scopeMenu:a,forceMount:l,children:i,container:c}=s,d=el(Vh,a);return e.jsx(z3,{scope:a,forceMount:l,children:e.jsx(Is,{present:l||d.open,children:e.jsx(Td,{asChild:!0,container:c,children:i})})})};dw.displayName=Vh;var yn="MenuContent",[P3,Gh]=Ul(yn),uw=x.forwardRef((s,a)=>{const l=cw(yn,s.__scopeMenu),{forceMount:i=l.forceMount,...c}=s,d=el(yn,s.__scopeMenu),m=Ao(yn,s.__scopeMenu);return e.jsx(mo.Provider,{scope:s.__scopeMenu,children:e.jsx(Is,{present:i||d.open,children:e.jsx(mo.Slot,{scope:s.__scopeMenu,children:m.modal?e.jsx(L3,{...c,ref:a}):e.jsx(B3,{...c,ref:a})})})})}),L3=x.forwardRef((s,a)=>{const l=el(yn,s.__scopeMenu),i=x.useRef(null),c=Tt(a,i);return x.useEffect(()=>{const d=i.current;if(d)return by(d)},[]),e.jsx($h,{...s,ref:c,trapFocus:l.open,disableOutsidePointerEvents:l.open,disableOutsideScroll:!0,onFocusOutside:be(s.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>l.onOpenChange(!1)})}),B3=x.forwardRef((s,a)=>{const l=el(yn,s.__scopeMenu);return e.jsx($h,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>l.onOpenChange(!1)})}),U3=b3("MenuContent.ScrollLock"),$h=x.forwardRef((s,a)=>{const{__scopeMenu:l,loop:i=!1,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:m,disableOutsidePointerEvents:h,onEntryFocus:p,onEscapeKeyDown:v,onPointerDownOutside:g,onFocusOutside:j,onInteractOutside:b,onDismiss:w,disableOutsideScroll:S,...C}=s,N=el(yn,l),T=Ao(yn,l),P=Oo(l),M=rw(l),k=D3(l),[D,A]=x.useState(null),E=x.useRef(null),B=Tt(a,E,N.onContentChange),Y=x.useRef(0),G=x.useRef(""),$=x.useRef(0),oe=x.useRef(null),je=x.useRef("right"),ae=x.useRef(0),me=S?Ny:x.Fragment,R=S?{as:U3,allowPinchZoom:!0}:void 0,O=ee=>{const le=G.current+ee,xe=k().filter(de=>!de.disabled),F=document.activeElement,W=xe.find(de=>de.ref.current===F)?.textValue,fe=xe.map(de=>de.textValue),I=Q3(fe,le,W),ve=xe.find(de=>de.textValue===I)?.ref.current;(function de(Ce){G.current=Ce,window.clearTimeout(Y.current),Ce!==""&&(Y.current=window.setTimeout(()=>de(""),1e3))})(le),ve&&setTimeout(()=>ve.focus())};x.useEffect(()=>()=>window.clearTimeout(Y.current),[]),wy();const L=x.useCallback(ee=>je.current===oe.current?.side&&J3(ee,oe.current?.area),[]);return e.jsx(P3,{scope:l,searchRef:G,onItemEnter:x.useCallback(ee=>{L(ee)&&ee.preventDefault()},[L]),onItemLeave:x.useCallback(ee=>{L(ee)||(E.current?.focus(),A(null))},[L]),onTriggerLeave:x.useCallback(ee=>{L(ee)&&ee.preventDefault()},[L]),pointerGraceTimerRef:$,onPointerGraceIntentChange:x.useCallback(ee=>{oe.current=ee},[]),children:e.jsx(me,{...R,children:e.jsx(Sy,{asChild:!0,trapped:c,onMountAutoFocus:be(d,ee=>{ee.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:e.jsx(fh,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:v,onPointerDownOutside:g,onFocusOutside:j,onInteractOutside:b,onDismiss:w,children:e.jsx(Nb,{asChild:!0,...M,dir:T.dir,orientation:"vertical",loop:i,currentTabStopId:D,onCurrentTabStopIdChange:A,onEntryFocus:be(p,ee=>{T.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(hh,{role:"menu","aria-orientation":"vertical","data-state":Tw(N.open),"data-radix-menu-content":"",dir:T.dir,...P,...C,ref:B,style:{outline:"none",...C.style},onKeyDown:be(C.onKeyDown,ee=>{const xe=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,F=ee.ctrlKey||ee.altKey||ee.metaKey,W=ee.key.length===1;xe&&(ee.key==="Tab"&&ee.preventDefault(),!F&&W&&O(ee.key));const fe=E.current;if(ee.target!==fe||!T3.includes(ee.key))return;ee.preventDefault();const ve=k().filter(de=>!de.disabled).map(de=>de.ref.current);aw.includes(ee.key)&&ve.reverse(),X3(ve)}),onBlur:be(s.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(Y.current),G.current="")}),onPointerMove:be(s.onPointerMove,fo(ee=>{const le=ee.target,xe=ae.current!==ee.clientX;if(ee.currentTarget.contains(le)&&xe){const F=ee.clientX>ae.current?"right":"left";je.current=F,ae.current=ee.clientX}}))})})})})})})});uw.displayName=yn;var H3="MenuGroup",Ih=x.forwardRef((s,a)=>{const{__scopeMenu:l,...i}=s;return e.jsx(dt.div,{role:"group",...i,ref:a})});Ih.displayName=H3;var F3="MenuLabel",mw=x.forwardRef((s,a)=>{const{__scopeMenu:l,...i}=s;return e.jsx(dt.div,{...i,ref:a})});mw.displayName=F3;var wd="MenuItem",ay="menu.itemSelect",Wd=x.forwardRef((s,a)=>{const{disabled:l=!1,onSelect:i,...c}=s,d=x.useRef(null),m=Ao(wd,s.__scopeMenu),h=Gh(wd,s.__scopeMenu),p=Tt(a,d),v=x.useRef(!1),g=()=>{const j=d.current;if(!l&&j){const b=new CustomEvent(ay,{bubbles:!0,cancelable:!0});j.addEventListener(ay,w=>i?.(w),{once:!0}),Cy(j,b),b.defaultPrevented?v.current=!1:m.onClose()}};return e.jsx(fw,{...c,ref:p,disabled:l,onClick:be(s.onClick,g),onPointerDown:j=>{s.onPointerDown?.(j),v.current=!0},onPointerUp:be(s.onPointerUp,j=>{v.current||j.currentTarget?.click()}),onKeyDown:be(s.onKeyDown,j=>{const b=h.searchRef.current!=="";l||b&&j.key===" "||eh.includes(j.key)&&(j.currentTarget.click(),j.preventDefault())})})});Wd.displayName=wd;var fw=x.forwardRef((s,a)=>{const{__scopeMenu:l,disabled:i=!1,textValue:c,...d}=s,m=Gh(wd,l),h=rw(l),p=x.useRef(null),v=Tt(a,p),[g,j]=x.useState(!1),[b,w]=x.useState("");return x.useEffect(()=>{const S=p.current;S&&w((S.textContent??"").trim())},[d.children]),e.jsx(mo.ItemSlot,{scope:l,disabled:i,textValue:c??b,children:e.jsx(wb,{asChild:!0,...h,focusable:!i,children:e.jsx(dt.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...d,ref:v,onPointerMove:be(s.onPointerMove,fo(S=>{i?m.onItemLeave(S):(m.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(s.onPointerLeave,fo(S=>m.onItemLeave(S))),onFocus:be(s.onFocus,()=>j(!0)),onBlur:be(s.onBlur,()=>j(!1))})})})}),Y3="MenuCheckboxItem",hw=x.forwardRef((s,a)=>{const{checked:l=!1,onCheckedChange:i,...c}=s;return e.jsx(jw,{scope:s.__scopeMenu,checked:l,children:e.jsx(Wd,{role:"menuitemcheckbox","aria-checked":Sd(l)?"mixed":l,...c,ref:a,"data-state":Kh(l),onSelect:be(c.onSelect,()=>i?.(Sd(l)?!0:!l),{checkForDefaultPrevented:!1})})})});hw.displayName=Y3;var xw="MenuRadioGroup",[q3,V3]=Ul(xw,{value:void 0,onValueChange:()=>{}}),pw=x.forwardRef((s,a)=>{const{value:l,onValueChange:i,...c}=s,d=ws(i);return e.jsx(q3,{scope:s.__scopeMenu,value:l,onValueChange:d,children:e.jsx(Ih,{...c,ref:a})})});pw.displayName=xw;var gw="MenuRadioItem",vw=x.forwardRef((s,a)=>{const{value:l,...i}=s,c=V3(gw,s.__scopeMenu),d=l===c.value;return e.jsx(jw,{scope:s.__scopeMenu,checked:d,children:e.jsx(Wd,{role:"menuitemradio","aria-checked":d,...i,ref:a,"data-state":Kh(d),onSelect:be(i.onSelect,()=>c.onValueChange?.(l),{checkForDefaultPrevented:!1})})})});vw.displayName=gw;var Wh="MenuItemIndicator",[jw,G3]=Ul(Wh,{checked:!1}),yw=x.forwardRef((s,a)=>{const{__scopeMenu:l,forceMount:i,...c}=s,d=G3(Wh,l);return e.jsx(Is,{present:i||Sd(d.checked)||d.checked===!0,children:e.jsx(dt.span,{...c,ref:a,"data-state":Kh(d.checked)})})});yw.displayName=Wh;var $3="MenuSeparator",bw=x.forwardRef((s,a)=>{const{__scopeMenu:l,...i}=s;return e.jsx(dt.div,{role:"separator","aria-orientation":"horizontal",...i,ref:a})});bw.displayName=$3;var I3="MenuArrow",Nw=x.forwardRef((s,a)=>{const{__scopeMenu:l,...i}=s,c=Oo(l);return e.jsx(xh,{...c,...i,ref:a})});Nw.displayName=I3;var Xh="MenuSub",[W3,ww]=Ul(Xh),Sw=s=>{const{__scopeMenu:a,children:l,open:i=!1,onOpenChange:c}=s,d=el(Xh,a),m=Oo(a),[h,p]=x.useState(null),[v,g]=x.useState(null),j=ws(c);return x.useEffect(()=>(d.open===!1&&j(!1),()=>j(!1)),[d.open,j]),e.jsx(Ed,{...m,children:e.jsx(iw,{scope:a,open:i,onOpenChange:j,content:v,onContentChange:g,children:e.jsx(W3,{scope:a,contentId:jn(),triggerId:jn(),trigger:h,onTriggerChange:p,children:l})})})};Sw.displayName=Xh;var eo="MenuSubTrigger",_w=x.forwardRef((s,a)=>{const l=el(eo,s.__scopeMenu),i=Ao(eo,s.__scopeMenu),c=ww(eo,s.__scopeMenu),d=Gh(eo,s.__scopeMenu),m=x.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:p}=d,v={__scopeMenu:s.__scopeMenu},g=x.useCallback(()=>{m.current&&window.clearTimeout(m.current),m.current=null},[]);return x.useEffect(()=>g,[g]),x.useEffect(()=>{const j=h.current;return()=>{window.clearTimeout(j),p(null)}},[h,p]),e.jsx(qh,{asChild:!0,...v,children:e.jsx(fw,{id:c.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":c.contentId,"data-state":Tw(l.open),...s,ref:Ga(a,c.onTriggerChange),onClick:j=>{s.onClick?.(j),!(s.disabled||j.defaultPrevented)&&(j.currentTarget.focus(),l.open||l.onOpenChange(!0))},onPointerMove:be(s.onPointerMove,fo(j=>{d.onItemEnter(j),!j.defaultPrevented&&!s.disabled&&!l.open&&!m.current&&(d.onPointerGraceIntentChange(null),m.current=window.setTimeout(()=>{l.onOpenChange(!0),g()},100))})),onPointerLeave:be(s.onPointerLeave,fo(j=>{g();const b=l.content?.getBoundingClientRect();if(b){const w=l.content?.dataset.side,S=w==="right",C=S?-5:5,N=b[S?"left":"right"],T=b[S?"right":"left"];d.onPointerGraceIntentChange({area:[{x:j.clientX+C,y:j.clientY},{x:N,y:b.top},{x:T,y:b.top},{x:T,y:b.bottom},{x:N,y:b.bottom}],side:w}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(j),j.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:be(s.onKeyDown,j=>{const b=d.searchRef.current!=="";s.disabled||b&&j.key===" "||E3[i.dir].includes(j.key)&&(l.onOpenChange(!0),l.content?.focus(),j.preventDefault())})})})});_w.displayName=eo;var Cw="MenuSubContent",kw=x.forwardRef((s,a)=>{const l=cw(yn,s.__scopeMenu),{forceMount:i=l.forceMount,...c}=s,d=el(yn,s.__scopeMenu),m=Ao(yn,s.__scopeMenu),h=ww(Cw,s.__scopeMenu),p=x.useRef(null),v=Tt(a,p);return e.jsx(mo.Provider,{scope:s.__scopeMenu,children:e.jsx(Is,{present:i||d.open,children:e.jsx(mo.Slot,{scope:s.__scopeMenu,children:e.jsx($h,{id:h.contentId,"aria-labelledby":h.triggerId,...c,ref:v,align:"start",side:m.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{m.isUsingKeyboardRef.current&&p.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:be(s.onFocusOutside,g=>{g.target!==h.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:be(s.onEscapeKeyDown,g=>{m.onClose(),g.preventDefault()}),onKeyDown:be(s.onKeyDown,g=>{const j=g.currentTarget.contains(g.target),b=M3[m.dir].includes(g.key);j&&b&&(d.onOpenChange(!1),h.trigger?.focus(),g.preventDefault())})})})})})});kw.displayName=Cw;function Tw(s){return s?"open":"closed"}function Sd(s){return s==="indeterminate"}function Kh(s){return Sd(s)?"indeterminate":s?"checked":"unchecked"}function X3(s){const a=document.activeElement;for(const l of s)if(l===a||(l.focus(),document.activeElement!==a))return}function K3(s,a){return s.map((l,i)=>s[(a+i)%s.length])}function Q3(s,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,d=l?s.indexOf(l):-1;let m=K3(s,Math.max(d,0));c.length===1&&(m=m.filter(v=>v!==l));const p=m.find(v=>v.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function Z3(s,a){const{x:l,y:i}=s;let c=!1;for(let d=0,m=a.length-1;d<a.length;m=d++){const h=a[d],p=a[m],v=h.x,g=h.y,j=p.x,b=p.y;g>i!=b>i&&l<(j-v)*(i-g)/(b-g)+v&&(c=!c)}return c}function J3(s,a){if(!a)return!1;const l={x:s.clientX,y:s.clientY};return Z3(l,a)}function fo(s){return a=>a.pointerType==="mouse"?s(a):void 0}var e5=ow,t5=qh,s5=dw,n5=uw,a5=Ih,l5=mw,r5=Wd,i5=hw,o5=pw,c5=vw,d5=yw,u5=bw,m5=Nw,f5=Sw,h5=_w,x5=kw,Qh="ContextMenu",[p5]=Dn(Qh,[lw]),Ms=lw(),[g5,Ew]=p5(Qh),Mw=s=>{const{__scopeContextMenu:a,children:l,onOpenChange:i,dir:c,modal:d=!0}=s,[m,h]=x.useState(!1),p=Ms(a),v=ws(i),g=x.useCallback(j=>{h(j),v(j)},[v]);return e.jsx(g5,{scope:a,open:m,onOpenChange:g,modal:d,children:e.jsx(e5,{...p,dir:c,open:m,onOpenChange:g,modal:d,children:l})})};Mw.displayName=Qh;var Dw="ContextMenuTrigger",Ow=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,disabled:i=!1,...c}=s,d=Ew(Dw,l),m=Ms(l),h=x.useRef({x:0,y:0}),p=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...h.current})}),v=x.useRef(0),g=x.useCallback(()=>window.clearTimeout(v.current),[]),j=b=>{h.current={x:b.clientX,y:b.clientY},d.onOpenChange(!0)};return x.useEffect(()=>g,[g]),x.useEffect(()=>void(i&&g()),[i,g]),e.jsxs(e.Fragment,{children:[e.jsx(t5,{...m,virtualRef:p}),e.jsx(dt.span,{"data-state":d.open?"open":"closed","data-disabled":i?"":void 0,...c,ref:a,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:i?s.onContextMenu:be(s.onContextMenu,b=>{g(),j(b),b.preventDefault()}),onPointerDown:i?s.onPointerDown:be(s.onPointerDown,ld(b=>{g(),v.current=window.setTimeout(()=>j(b),700)})),onPointerMove:i?s.onPointerMove:be(s.onPointerMove,ld(g)),onPointerCancel:i?s.onPointerCancel:be(s.onPointerCancel,ld(g)),onPointerUp:i?s.onPointerUp:be(s.onPointerUp,ld(g))})]})});Ow.displayName=Dw;var v5="ContextMenuPortal",Aw=s=>{const{__scopeContextMenu:a,...l}=s,i=Ms(a);return e.jsx(s5,{...i,...l})};Aw.displayName=v5;var Rw="ContextMenuContent",zw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ew(Rw,l),d=Ms(l),m=x.useRef(!1);return e.jsx(n5,{...d,...i,ref:a,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:h=>{s.onCloseAutoFocus?.(h),!h.defaultPrevented&&m.current&&h.preventDefault(),m.current=!1},onInteractOutside:h=>{s.onInteractOutside?.(h),!h.defaultPrevented&&!c.modal&&(m.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});zw.displayName=Rw;var j5="ContextMenuGroup",y5=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(a5,{...c,...i,ref:a})});y5.displayName=j5;var b5="ContextMenuLabel",Pw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(l5,{...c,...i,ref:a})});Pw.displayName=b5;var N5="ContextMenuItem",Lw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(r5,{...c,...i,ref:a})});Lw.displayName=N5;var w5="ContextMenuCheckboxItem",Bw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(i5,{...c,...i,ref:a})});Bw.displayName=w5;var S5="ContextMenuRadioGroup",_5=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(o5,{...c,...i,ref:a})});_5.displayName=S5;var C5="ContextMenuRadioItem",Uw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(c5,{...c,...i,ref:a})});Uw.displayName=C5;var k5="ContextMenuItemIndicator",Hw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(d5,{...c,...i,ref:a})});Hw.displayName=k5;var T5="ContextMenuSeparator",Fw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(u5,{...c,...i,ref:a})});Fw.displayName=T5;var E5="ContextMenuArrow",M5=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(m5,{...c,...i,ref:a})});M5.displayName=E5;var Yw="ContextMenuSub",qw=s=>{const{__scopeContextMenu:a,children:l,onOpenChange:i,open:c,defaultOpen:d}=s,m=Ms(a),[h,p]=Qa({prop:c,defaultProp:d??!1,onChange:i,caller:Yw});return e.jsx(f5,{...m,open:h,onOpenChange:p,children:l})};qw.displayName=Yw;var D5="ContextMenuSubTrigger",Vw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(h5,{...c,...i,ref:a})});Vw.displayName=D5;var O5="ContextMenuSubContent",Gw=x.forwardRef((s,a)=>{const{__scopeContextMenu:l,...i}=s,c=Ms(l);return e.jsx(x5,{...c,...i,ref:a,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gw.displayName=O5;function ld(s){return a=>a.pointerType!=="mouse"?s(a):void 0}var A5=Mw,R5=Ow,z5=Aw,$w=zw,Iw=Pw,Ww=Lw,Xw=Bw,Kw=Uw,Qw=Hw,Zw=Fw,P5=qw,Jw=Vw,e1=Gw;const L5=A5,B5=R5,U5=P5,t1=x.forwardRef(({className:s,inset:a,children:l,...i},c)=>e.jsxs(Jw,{ref:c,className:Z("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",a&&"pl-8",s),...i,children:[l,e.jsx(Al,{className:"ml-auto h-4 w-4"})]}));t1.displayName=Jw.displayName;const s1=x.forwardRef(({className:s,...a},l)=>e.jsx(e1,{ref:l,className:Z("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",s),...a}));s1.displayName=e1.displayName;const n1=x.forwardRef(({className:s,...a},l)=>e.jsx(z5,{children:e.jsx($w,{ref:l,className:Z("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",s),...a})}));n1.displayName=$w.displayName;const kn=x.forwardRef(({className:s,inset:a,...l},i)=>e.jsx(Ww,{ref:i,className:Z("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",s),...l}));kn.displayName=Ww.displayName;const H5=x.forwardRef(({className:s,children:a,checked:l,...i},c)=>e.jsxs(Xw,{ref:c,className:Z("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:l,...i,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Qw,{children:e.jsx(Cl,{className:"h-4 w-4"})})}),a]}));H5.displayName=Xw.displayName;const F5=x.forwardRef(({className:s,children:a,...l},i)=>e.jsxs(Kw,{ref:i,className:Z("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Qw,{children:e.jsx(G2,{className:"h-2 w-2 fill-current"})})}),a]}));F5.displayName=Kw.displayName;const Y5=x.forwardRef(({className:s,inset:a,...l},i)=>e.jsx(Iw,{ref:i,className:Z("px-2 py-1.5 text-sm font-semibold text-foreground",a&&"pl-8",s),...l}));Y5.displayName=Iw.displayName;const to=x.forwardRef(({className:s,...a},l)=>e.jsx(Zw,{ref:l,className:Z("-mx-1 my-1 h-px bg-border",s),...a}));to.displayName=Zw.displayName;const Pr=({className:s,...a})=>e.jsx("span",{className:Z("ml-auto text-xs tracking-widest text-muted-foreground",s),...a});Pr.displayName="ContextMenuShortcut";var q5=Symbol("radix.slottable");function V5(s){const a=({children:l})=>e.jsx(e.Fragment,{children:l});return a.displayName=`${s}.Slottable`,a.__radixId=q5,a}var[Xd]=Dn("Tooltip",[Wr]),Kd=Wr(),a1="TooltipProvider",G5=700,th="tooltip.open",[$5,Zh]=Xd(a1),l1=s=>{const{__scopeTooltip:a,delayDuration:l=G5,skipDelayDuration:i=300,disableHoverableContent:c=!1,children:d}=s,m=x.useRef(!0),h=x.useRef(!1),p=x.useRef(0);return x.useEffect(()=>{const v=p.current;return()=>window.clearTimeout(v)},[]),e.jsx($5,{scope:a,isOpenDelayedRef:m,delayDuration:l,onOpen:x.useCallback(()=>{window.clearTimeout(p.current),m.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>m.current=!0,i)},[i]),isPointerInTransitRef:h,onPointerInTransitChange:x.useCallback(v=>{h.current=v},[]),disableHoverableContent:c,children:d})};l1.displayName=a1;var ho="Tooltip",[I5,Ro]=Xd(ho),r1=s=>{const{__scopeTooltip:a,children:l,open:i,defaultOpen:c,onOpenChange:d,disableHoverableContent:m,delayDuration:h}=s,p=Zh(ho,s.__scopeTooltip),v=Kd(a),[g,j]=x.useState(null),b=jn(),w=x.useRef(0),S=m??p.disableHoverableContent,C=h??p.delayDuration,N=x.useRef(!1),[T,P]=Qa({prop:i,defaultProp:c??!1,onChange:E=>{E?(p.onOpen(),document.dispatchEvent(new CustomEvent(th))):p.onClose(),d?.(E)},caller:ho}),M=x.useMemo(()=>T?N.current?"delayed-open":"instant-open":"closed",[T]),k=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,N.current=!1,P(!0)},[P]),D=x.useCallback(()=>{window.clearTimeout(w.current),w.current=0,P(!1)},[P]),A=x.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{N.current=!0,P(!0),w.current=0},C)},[C,P]);return x.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),e.jsx(Ed,{...v,children:e.jsx(I5,{scope:a,contentId:b,open:T,stateAttribute:M,trigger:g,onTriggerChange:j,onTriggerEnter:x.useCallback(()=>{p.isOpenDelayedRef.current?A():k()},[p.isOpenDelayedRef,A,k]),onTriggerLeave:x.useCallback(()=>{S?D():(window.clearTimeout(w.current),w.current=0)},[D,S]),onOpen:k,onClose:D,disableHoverableContent:S,children:l})})};r1.displayName=ho;var sh="TooltipTrigger",i1=x.forwardRef((s,a)=>{const{__scopeTooltip:l,...i}=s,c=Ro(sh,l),d=Zh(sh,l),m=Kd(l),h=x.useRef(null),p=Tt(a,h,c.onTriggerChange),v=x.useRef(!1),g=x.useRef(!1),j=x.useCallback(()=>v.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",j),[j]),e.jsx(Md,{asChild:!0,...m,children:e.jsx(dt.button,{"aria-describedby":c.open?c.contentId:void 0,"data-state":c.stateAttribute,...i,ref:p,onPointerMove:be(s.onPointerMove,b=>{b.pointerType!=="touch"&&!g.current&&!d.isPointerInTransitRef.current&&(c.onTriggerEnter(),g.current=!0)}),onPointerLeave:be(s.onPointerLeave,()=>{c.onTriggerLeave(),g.current=!1}),onPointerDown:be(s.onPointerDown,()=>{c.open&&c.onClose(),v.current=!0,document.addEventListener("pointerup",j,{once:!0})}),onFocus:be(s.onFocus,()=>{v.current||c.onOpen()}),onBlur:be(s.onBlur,c.onClose),onClick:be(s.onClick,c.onClose)})})});i1.displayName=sh;var Jh="TooltipPortal",[W5,X5]=Xd(Jh,{forceMount:void 0}),o1=s=>{const{__scopeTooltip:a,forceMount:l,children:i,container:c}=s,d=Ro(Jh,a);return e.jsx(W5,{scope:a,forceMount:l,children:e.jsx(Is,{present:l||d.open,children:e.jsx(Td,{asChild:!0,container:c,children:i})})})};o1.displayName=Jh;var Ir="TooltipContent",c1=x.forwardRef((s,a)=>{const l=X5(Ir,s.__scopeTooltip),{forceMount:i=l.forceMount,side:c="top",...d}=s,m=Ro(Ir,s.__scopeTooltip);return e.jsx(Is,{present:i||m.open,children:m.disableHoverableContent?e.jsx(d1,{side:c,...d,ref:a}):e.jsx(K5,{side:c,...d,ref:a})})}),K5=x.forwardRef((s,a)=>{const l=Ro(Ir,s.__scopeTooltip),i=Zh(Ir,s.__scopeTooltip),c=x.useRef(null),d=Tt(a,c),[m,h]=x.useState(null),{trigger:p,onClose:v}=l,g=c.current,{onPointerInTransitChange:j}=i,b=x.useCallback(()=>{h(null),j(!1)},[j]),w=x.useCallback((S,C)=>{const N=S.currentTarget,T={x:S.clientX,y:S.clientY},P=tz(T,N.getBoundingClientRect()),M=sz(T,P),k=nz(C.getBoundingClientRect()),D=lz([...M,...k]);h(D),j(!0)},[j]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(p&&g){const S=N=>w(N,g),C=N=>w(N,p);return p.addEventListener("pointerleave",S),g.addEventListener("pointerleave",C),()=>{p.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",C)}}},[p,g,w,b]),x.useEffect(()=>{if(m){const S=C=>{const N=C.target,T={x:C.clientX,y:C.clientY},P=p?.contains(N)||g?.contains(N),M=!az(T,m);P?b():M&&(b(),v())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[p,g,m,v,b]),e.jsx(d1,{...s,ref:d})}),[Q5,Z5]=Xd(ho,{isInside:!1}),J5=V5("TooltipContent"),d1=x.forwardRef((s,a)=>{const{__scopeTooltip:l,children:i,"aria-label":c,onEscapeKeyDown:d,onPointerDownOutside:m,...h}=s,p=Ro(Ir,l),v=Kd(l),{onClose:g}=p;return x.useEffect(()=>(document.addEventListener(th,g),()=>document.removeEventListener(th,g)),[g]),x.useEffect(()=>{if(p.trigger){const j=b=>{b.target?.contains(p.trigger)&&g()};return window.addEventListener("scroll",j,{capture:!0}),()=>window.removeEventListener("scroll",j,{capture:!0})}},[p.trigger,g]),e.jsx(fh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:j=>j.preventDefault(),onDismiss:g,children:e.jsxs(hh,{"data-state":p.stateAttribute,...v,...h,ref:a,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(J5,{children:i}),e.jsx(Q5,{scope:l,isInside:!0,children:e.jsx(w2,{id:p.contentId,role:"tooltip",children:c||i})})]})})});c1.displayName=Ir;var u1="TooltipArrow",ez=x.forwardRef((s,a)=>{const{__scopeTooltip:l,...i}=s,c=Kd(l);return Z5(u1,l).isInside?null:e.jsx(xh,{...c,...i,ref:a})});ez.displayName=u1;function tz(s,a){const l=Math.abs(a.top-s.y),i=Math.abs(a.bottom-s.y),c=Math.abs(a.right-s.x),d=Math.abs(a.left-s.x);switch(Math.min(l,i,c,d)){case d:return"left";case c:return"right";case l:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function sz(s,a,l=5){const i=[];switch(a){case"top":i.push({x:s.x-l,y:s.y+l},{x:s.x+l,y:s.y+l});break;case"bottom":i.push({x:s.x-l,y:s.y-l},{x:s.x+l,y:s.y-l});break;case"left":i.push({x:s.x+l,y:s.y-l},{x:s.x+l,y:s.y+l});break;case"right":i.push({x:s.x-l,y:s.y-l},{x:s.x-l,y:s.y+l});break}return i}function nz(s){const{top:a,right:l,bottom:i,left:c}=s;return[{x:c,y:a},{x:l,y:a},{x:l,y:i},{x:c,y:i}]}function az(s,a){const{x:l,y:i}=s;let c=!1;for(let d=0,m=a.length-1;d<a.length;m=d++){const h=a[d],p=a[m],v=h.x,g=h.y,j=p.x,b=p.y;g>i!=b>i&&l<(j-v)*(i-g)/(b-g)+v&&(c=!c)}return c}function lz(s){const a=s.slice();return a.sort((l,i)=>l.x<i.x?-1:l.x>i.x?1:l.y<i.y?-1:l.y>i.y?1:0),rz(a)}function rz(s){if(s.length<=1)return s.slice();const a=[];for(let i=0;i<s.length;i++){const c=s[i];for(;a.length>=2;){const d=a[a.length-1],m=a[a.length-2];if((d.x-m.x)*(c.y-m.y)>=(d.y-m.y)*(c.x-m.x))a.pop();else break}a.push(c)}a.pop();const l=[];for(let i=s.length-1;i>=0;i--){const c=s[i];for(;l.length>=2;){const d=l[l.length-1],m=l[l.length-2];if((d.x-m.x)*(c.y-m.y)>=(d.y-m.y)*(c.x-m.x))l.pop();else break}l.push(c)}return l.pop(),a.length===1&&l.length===1&&a[0].x===l[0].x&&a[0].y===l[0].y?a:a.concat(l)}var iz=l1,oz=r1,cz=i1,dz=o1,m1=c1;const uz=iz,mz=oz,fz=cz,f1=x.forwardRef(({className:s,sideOffset:a=4,...l},i)=>e.jsx(dz,{children:e.jsx(m1,{ref:i,sideOffset:a,className:Z("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",s),...l})}));f1.displayName=m1.displayName;function hz({children:s}){VE();const[a,l]=x.useState(!0),[i,c]=x.useState(!1),[d,m]=x.useState(!1),{theme:h,setTheme:p}=Oh(),v=K_(),g=qn();x.useEffect(()=>{const C=N=>{(N.metaKey||N.ctrlKey)&&N.key==="k"&&(N.preventDefault(),m(!0))};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[]);const j=[{title:"概览",items:[{icon:fd,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:ph,label:"麦麦主程序配置",path:"/config/bot"},{icon:Dy,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:Oy,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:gh,label:"表情包管理",path:"/resource/emoji"},{icon:po,label:"表达方式管理",path:"/resource/expression"},{icon:Ay,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:pd,label:"插件市场",path:"/plugins"},{icon:$2,label:"插件配置",path:"/plugin-config"},{icon:hd,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Tn,label:"系统设置",path:"/settings"}]}],w=h==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h,S=()=>{localStorage.removeItem("access-token"),g({to:"/auth"})};return e.jsx(uz,{delayDuration:300,children:e.jsxs("div",{className:"flex h-screen overflow-hidden",children:[e.jsxs("aside",{className:Z("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",a?"lg:w-64":"lg:w-16",i?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[e.jsx("div",{className:"flex h-16 items-center border-b px-4",children:e.jsxs("div",{className:Z("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!a&&"lg:flex-none lg:w-8"),children:[e.jsxs("div",{className:Z("flex items-baseline gap-2",!a&&"lg:hidden"),children:[e.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),e.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:yE()})]}),!a&&e.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),e.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:e.jsx("ul",{className:Z("space-y-6",!a&&"lg:space-y-3"),children:j.map((C,N)=>e.jsxs("li",{children:[e.jsx("div",{className:Z("px-3 h-[1.25rem]","mb-2",!a&&"lg:mb-1 lg:invisible"),children:e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:C.title})}),!a&&N>0&&e.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),e.jsx("ul",{className:"space-y-1",children:C.items.map(T=>{const P=v({to:T.path}),M=T.icon,k=e.jsxs(e.Fragment,{children:[P&&e.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary transition-opacity duration-300"}),e.jsxs("div",{className:Z("flex items-center transition-all duration-300",a?"gap-3":"lg:gap-0"),children:[e.jsx(M,{className:Z("h-5 w-5 flex-shrink-0",P&&"text-primary"),strokeWidth:2,fill:"none"}),e.jsx("span",{className:Z("text-sm font-medium whitespace-nowrap transition-all duration-300",P&&"font-semibold",a?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:T.label})]})]});return e.jsx("li",{className:"relative",children:e.jsxs(mz,{children:[e.jsx(fz,{asChild:!0,children:e.jsx(Q_,{to:T.path,className:Z("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",P?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",a?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>c(!1),children:k})}),!a&&e.jsx(f1,{side:"right",className:"hidden lg:block",children:e.jsx("p",{children:T.label})})]})},T.path)})})]},C.title))})})]}),i&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>c(!1)}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card/80 backdrop-blur-md px-4 sticky top-0 z-10",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:()=>c(!i),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:e.jsx(I2,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>l(!a),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:a?"收起侧边栏":"展开侧边栏",children:e.jsx(Ol,{className:Z("h-5 w-5 transition-transform",!a&&"rotate-180")})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>m(!0),className:"relative hidden md:flex items-center w-64 h-9 pl-9 pr-16 bg-background/50 border rounded-md hover:bg-accent/50 transition-colors text-left",children:[e.jsx(Gs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),e.jsxs(nw,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[e.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsx(y3,{open:d,onOpenChange:m}),e.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[e.jsx(W2,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),e.jsx("button",{onClick:C=>{lE(w==="dark"?"light":"dark",p,C)},className:"rounded-lg p-2 hover:bg-accent",title:w==="dark"?"切换到浅色模式":"切换到深色模式",children:w==="dark"?e.jsx(Rf,{className:"h-5 w-5"}):e.jsx(zf,{className:"h-5 w-5"})}),e.jsx("div",{className:"h-6 w-px bg-border"}),e.jsxs(q,{variant:"ghost",size:"sm",onClick:S,className:"gap-2",title:"登出系统",children:[e.jsx(sj,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),e.jsxs(L5,{children:[e.jsx(B5,{asChild:!0,children:e.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:s})}),e.jsxs(n1,{className:"w-64",children:[e.jsxs(kn,{onClick:()=>g({to:"/"}),children:[e.jsx(fd,{className:"mr-2 h-4 w-4"}),"首页"]}),e.jsxs(kn,{onClick:()=>g({to:"/settings"}),children:[e.jsx(Tn,{className:"mr-2 h-4 w-4"}),"系统设置"]}),e.jsxs(kn,{onClick:()=>g({to:"/logs"}),children:[e.jsx(hd,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),e.jsx(to,{}),e.jsxs(U5,{children:[e.jsxs(t1,{children:[e.jsx(Ty,{className:"mr-2 h-4 w-4"}),"切换主题"]}),e.jsxs(s1,{className:"w-48",children:[e.jsxs(kn,{onClick:()=>p("light"),disabled:h==="light",children:[e.jsx(Rf,{className:"mr-2 h-4 w-4"}),"浅色",h==="light"&&e.jsx(Pr,{children:"✓"})]}),e.jsxs(kn,{onClick:()=>p("dark"),disabled:h==="dark",children:[e.jsx(zf,{className:"mr-2 h-4 w-4"}),"深色",h==="dark"&&e.jsx(Pr,{children:"✓"})]}),e.jsxs(kn,{onClick:()=>p("system"),disabled:h==="system",children:[e.jsx(Tn,{className:"mr-2 h-4 w-4"}),"跟随系统",h==="system"&&e.jsx(Pr,{children:"✓"})]})]})]}),e.jsx(to,{}),e.jsxs(kn,{onClick:()=>window.location.reload(),children:[e.jsx(X2,{className:"mr-2 h-4 w-4"}),"刷新页面",e.jsx(Pr,{children:"⌘R"})]}),e.jsxs(kn,{onClick:()=>m(!0),children:[e.jsx(Gs,{className:"mr-2 h-4 w-4"}),"搜索",e.jsx(Pr,{children:"⌘K"})]}),e.jsx(to,{}),e.jsxs(kn,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[e.jsx(so,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),e.jsx(to,{}),e.jsxs(kn,{onClick:S,className:"text-destructive focus:text-destructive",children:[e.jsx(sj,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const zo=Z_({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(ry,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!L0())throw e2({to:"/auth"})}}),xz=Ts({getParentRoute:()=>zo,path:"/auth",component:GE}),pz=Ts({getParentRoute:()=>zo,path:"/setup",component:d4}),an=Ts({getParentRoute:()=>zo,id:"protected",component:()=>e.jsx(hz,{children:e.jsx(ry,{})})}),gz=Ts({getParentRoute:()=>an,path:"/",component:nE}),vz=Ts({getParentRoute:()=>an,path:"/config/bot",component:tM}),jz=Ts({getParentRoute:()=>an,path:"/config/modelProvider",component:gM}),yz=Ts({getParentRoute:()=>an,path:"/config/model",component:GM}),bz=Ts({getParentRoute:()=>an,path:"/resource/emoji",component:eD}),Nz=Ts({getParentRoute:()=>an,path:"/resource/expression",component:dD}),wz=Ts({getParentRoute:()=>an,path:"/resource/person",component:bD}),Sz=Ts({getParentRoute:()=>an,path:"/logs",component:s3}),_z=Ts({getParentRoute:()=>an,path:"/plugins",component:x3}),Cz=Ts({getParentRoute:()=>an,path:"/plugin-config",component:p3}),kz=Ts({getParentRoute:()=>an,path:"/plugin-mirrors",component:g3}),Tz=Ts({getParentRoute:()=>an,path:"/settings",component:LE}),Ez=Ts({getParentRoute:()=>zo,path:"*",component:H0}),Mz=zo.addChildren([xz,pz,an.addChildren([gz,vz,jz,yz,bz,Nz,wz,_z,Cz,kz,Sz,Tz]),Ez]),Dz=J_({routeTree:Mz,defaultNotFoundComponent:H0});function Oz({children:s,defaultTheme:a="system",storageKey:l="ui-theme",...i}){const[c,d]=x.useState(()=>localStorage.getItem(l)||a);x.useEffect(()=>{const h=window.document.documentElement;if(h.classList.remove("light","dark"),c==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";h.classList.add(p);return}h.classList.add(c)},[c]),x.useEffect(()=>{const h=localStorage.getItem("accent-color");if(h){const p=document.documentElement,g={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[h];g&&(p.style.setProperty("--primary",g.hsl),g.gradient?(p.style.setProperty("--primary-gradient",g.gradient),p.classList.add("has-gradient")):(p.style.removeProperty("--primary-gradient"),p.classList.remove("has-gradient")))}},[]);const m={theme:c,setTheme:h=>{localStorage.setItem(l,h),d(h)}};return e.jsx(r0.Provider,{...i,value:m,children:s})}function Az({children:s,defaultEnabled:a=!0,defaultWavesEnabled:l=!0,storageKey:i="enable-animations",wavesStorageKey:c="enable-waves-background"}){const[d,m]=x.useState(()=>{const g=localStorage.getItem(i);return g!==null?g==="true":a}),[h,p]=x.useState(()=>{const g=localStorage.getItem(c);return g!==null?g==="true":l});x.useEffect(()=>{const g=document.documentElement;d?g.classList.remove("no-animations"):g.classList.add("no-animations"),localStorage.setItem(i,String(d))},[d,i]),x.useEffect(()=>{localStorage.setItem(c,String(h))},[h,c]);const v={enableAnimations:d,setEnableAnimations:m,enableWavesBackground:h,setEnableWavesBackground:p};return e.jsx(i0.Provider,{value:v,children:s})}var ex="ToastProvider",[tx,Rz,zz]=_d("Toast"),[h1]=Dn("Toast",[zz]),[Pz,Qd]=h1(ex),x1=s=>{const{__scopeToast:a,label:l="Notification",duration:i=5e3,swipeDirection:c="right",swipeThreshold:d=50,children:m}=s,[h,p]=x.useState(null),[v,g]=x.useState(0),j=x.useRef(!1),b=x.useRef(!1);return l.trim()||console.error(`Invalid prop \`label\` supplied to \`${ex}\`. Expected non-empty \`string\`.`),e.jsx(tx.Provider,{scope:a,children:e.jsx(Pz,{scope:a,label:l,duration:i,swipeDirection:c,swipeThreshold:d,toastCount:v,viewport:h,onViewportChange:p,onToastAdd:x.useCallback(()=>g(w=>w+1),[]),onToastRemove:x.useCallback(()=>g(w=>w-1),[]),isFocusedToastEscapeKeyDownRef:j,isClosePausedRef:b,children:m})})};x1.displayName=ex;var p1="ToastViewport",Lz=["F8"],nh="toast.viewportPause",ah="toast.viewportResume",g1=x.forwardRef((s,a)=>{const{__scopeToast:l,hotkey:i=Lz,label:c="Notifications ({hotkey})",...d}=s,m=Qd(p1,l),h=Rz(l),p=x.useRef(null),v=x.useRef(null),g=x.useRef(null),j=x.useRef(null),b=Tt(a,j,m.onViewportChange),w=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=m.toastCount>0;x.useEffect(()=>{const N=T=>{i.length!==0&&i.every(M=>T[M]||T.code===M)&&j.current?.focus()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[i]),x.useEffect(()=>{const N=p.current,T=j.current;if(S&&N&&T){const P=()=>{if(!m.isClosePausedRef.current){const A=new CustomEvent(nh);T.dispatchEvent(A),m.isClosePausedRef.current=!0}},M=()=>{if(m.isClosePausedRef.current){const A=new CustomEvent(ah);T.dispatchEvent(A),m.isClosePausedRef.current=!1}},k=A=>{!N.contains(A.relatedTarget)&&M()},D=()=>{N.contains(document.activeElement)||M()};return N.addEventListener("focusin",P),N.addEventListener("focusout",k),N.addEventListener("pointermove",P),N.addEventListener("pointerleave",D),window.addEventListener("blur",P),window.addEventListener("focus",M),()=>{N.removeEventListener("focusin",P),N.removeEventListener("focusout",k),N.removeEventListener("pointermove",P),N.removeEventListener("pointerleave",D),window.removeEventListener("blur",P),window.removeEventListener("focus",M)}}},[S,m.isClosePausedRef]);const C=x.useCallback(({tabbingDirection:N})=>{const P=h().map(M=>{const k=M.ref.current,D=[k,...Kz(k)];return N==="forwards"?D:D.reverse()});return(N==="forwards"?P.reverse():P).flat()},[h]);return x.useEffect(()=>{const N=j.current;if(N){const T=P=>{const M=P.altKey||P.ctrlKey||P.metaKey;if(P.key==="Tab"&&!M){const D=document.activeElement,A=P.shiftKey;if(P.target===N&&A){v.current?.focus();return}const Y=C({tabbingDirection:A?"backwards":"forwards"}),G=Y.findIndex($=>$===D);Mf(Y.slice(G+1))?P.preventDefault():A?v.current?.focus():g.current?.focus()}};return N.addEventListener("keydown",T),()=>N.removeEventListener("keydown",T)}},[h,C]),e.jsxs(S2,{ref:p,role:"region","aria-label":c.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&e.jsx(lh,{ref:v,onFocusFromOutsideViewport:()=>{const N=C({tabbingDirection:"forwards"});Mf(N)}}),e.jsx(tx.Slot,{scope:l,children:e.jsx(dt.ol,{tabIndex:-1,...d,ref:b})}),S&&e.jsx(lh,{ref:g,onFocusFromOutsideViewport:()=>{const N=C({tabbingDirection:"backwards"});Mf(N)}})]})});g1.displayName=p1;var v1="ToastFocusProxy",lh=x.forwardRef((s,a)=>{const{__scopeToast:l,onFocusFromOutsideViewport:i,...c}=s,d=Qd(v1,l);return e.jsx(ky,{tabIndex:0,...c,ref:a,style:{position:"fixed"},onFocus:m=>{const h=m.relatedTarget;!d.viewport?.contains(h)&&i()}})});lh.displayName=v1;var Po="Toast",Bz="toast.swipeStart",Uz="toast.swipeMove",Hz="toast.swipeCancel",Fz="toast.swipeEnd",j1=x.forwardRef((s,a)=>{const{forceMount:l,open:i,defaultOpen:c,onOpenChange:d,...m}=s,[h,p]=Qa({prop:i,defaultProp:c??!0,onChange:d,caller:Po});return e.jsx(Is,{present:l||h,children:e.jsx(Vz,{open:h,...m,ref:a,onClose:()=>p(!1),onPause:ws(s.onPause),onResume:ws(s.onResume),onSwipeStart:be(s.onSwipeStart,v=>{v.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:be(s.onSwipeMove,v=>{const{x:g,y:j}=v.detail.delta;v.currentTarget.setAttribute("data-swipe","move"),v.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${g}px`),v.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${j}px`)}),onSwipeCancel:be(s.onSwipeCancel,v=>{v.currentTarget.setAttribute("data-swipe","cancel"),v.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),v.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),v.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),v.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:be(s.onSwipeEnd,v=>{const{x:g,y:j}=v.detail.delta;v.currentTarget.setAttribute("data-swipe","end"),v.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),v.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),v.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${g}px`),v.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${j}px`),p(!1)})})})});j1.displayName=Po;var[Yz,qz]=h1(Po,{onClose(){}}),Vz=x.forwardRef((s,a)=>{const{__scopeToast:l,type:i="foreground",duration:c,open:d,onClose:m,onEscapeKeyDown:h,onPause:p,onResume:v,onSwipeStart:g,onSwipeMove:j,onSwipeCancel:b,onSwipeEnd:w,...S}=s,C=Qd(Po,l),[N,T]=x.useState(null),P=Tt(a,ae=>T(ae)),M=x.useRef(null),k=x.useRef(null),D=c||C.duration,A=x.useRef(0),E=x.useRef(D),B=x.useRef(0),{onToastAdd:Y,onToastRemove:G}=C,$=ws(()=>{N?.contains(document.activeElement)&&C.viewport?.focus(),m()}),oe=x.useCallback(ae=>{!ae||ae===1/0||(window.clearTimeout(B.current),A.current=new Date().getTime(),B.current=window.setTimeout($,ae))},[$]);x.useEffect(()=>{const ae=C.viewport;if(ae){const me=()=>{oe(E.current),v?.()},R=()=>{const O=new Date().getTime()-A.current;E.current=E.current-O,window.clearTimeout(B.current),p?.()};return ae.addEventListener(nh,R),ae.addEventListener(ah,me),()=>{ae.removeEventListener(nh,R),ae.removeEventListener(ah,me)}}},[C.viewport,D,p,v,oe]),x.useEffect(()=>{d&&!C.isClosePausedRef.current&&oe(D)},[d,D,C.isClosePausedRef,oe]),x.useEffect(()=>(Y(),()=>G()),[Y,G]);const je=x.useMemo(()=>N?C1(N):null,[N]);return C.viewport?e.jsxs(e.Fragment,{children:[je&&e.jsx(Gz,{__scopeToast:l,role:"status","aria-live":i==="foreground"?"assertive":"polite",children:je}),e.jsx(Yz,{scope:l,onClose:$,children:t2.createPortal(e.jsx(tx.ItemSlot,{scope:l,children:e.jsx(_2,{asChild:!0,onEscapeKeyDown:be(h,()=>{C.isFocusedToastEscapeKeyDownRef.current||$(),C.isFocusedToastEscapeKeyDownRef.current=!1}),children:e.jsx(dt.li,{tabIndex:0,"data-state":d?"open":"closed","data-swipe-direction":C.swipeDirection,...S,ref:P,style:{userSelect:"none",touchAction:"none",...s.style},onKeyDown:be(s.onKeyDown,ae=>{ae.key==="Escape"&&(h?.(ae.nativeEvent),ae.nativeEvent.defaultPrevented||(C.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:be(s.onPointerDown,ae=>{ae.button===0&&(M.current={x:ae.clientX,y:ae.clientY})}),onPointerMove:be(s.onPointerMove,ae=>{if(!M.current)return;const me=ae.clientX-M.current.x,R=ae.clientY-M.current.y,O=!!k.current,L=["left","right"].includes(C.swipeDirection),ee=["left","up"].includes(C.swipeDirection)?Math.min:Math.max,le=L?ee(0,me):0,xe=L?0:ee(0,R),F=ae.pointerType==="touch"?10:2,W={x:le,y:xe},fe={originalEvent:ae,delta:W};O?(k.current=W,rd(Uz,j,fe,{discrete:!1})):ly(W,C.swipeDirection,F)?(k.current=W,rd(Bz,g,fe,{discrete:!1}),ae.target.setPointerCapture(ae.pointerId)):(Math.abs(me)>F||Math.abs(R)>F)&&(M.current=null)}),onPointerUp:be(s.onPointerUp,ae=>{const me=k.current,R=ae.target;if(R.hasPointerCapture(ae.pointerId)&&R.releasePointerCapture(ae.pointerId),k.current=null,M.current=null,me){const O=ae.currentTarget,L={originalEvent:ae,delta:me};ly(me,C.swipeDirection,C.swipeThreshold)?rd(Fz,w,L,{discrete:!0}):rd(Hz,b,L,{discrete:!0}),O.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),C.viewport)})]}):null}),Gz=s=>{const{__scopeToast:a,children:l,...i}=s,c=Qd(Po,a),[d,m]=x.useState(!1),[h,p]=x.useState(!1);return Wz(()=>m(!0)),x.useEffect(()=>{const v=window.setTimeout(()=>p(!0),1e3);return()=>window.clearTimeout(v)},[]),h?null:e.jsx(Td,{asChild:!0,children:e.jsx(ky,{...i,children:d&&e.jsxs(e.Fragment,{children:[c.label," ",l]})})})},$z="ToastTitle",y1=x.forwardRef((s,a)=>{const{__scopeToast:l,...i}=s;return e.jsx(dt.div,{...i,ref:a})});y1.displayName=$z;var Iz="ToastDescription",b1=x.forwardRef((s,a)=>{const{__scopeToast:l,...i}=s;return e.jsx(dt.div,{...i,ref:a})});b1.displayName=Iz;var N1="ToastAction",w1=x.forwardRef((s,a)=>{const{altText:l,...i}=s;return l.trim()?e.jsx(_1,{altText:l,asChild:!0,children:e.jsx(sx,{...i,ref:a})}):(console.error(`Invalid prop \`altText\` supplied to \`${N1}\`. Expected non-empty \`string\`.`),null)});w1.displayName=N1;var S1="ToastClose",sx=x.forwardRef((s,a)=>{const{__scopeToast:l,...i}=s,c=qz(S1,l);return e.jsx(_1,{asChild:!0,children:e.jsx(dt.button,{type:"button",...i,ref:a,onClick:be(s.onClick,c.onClose)})})});sx.displayName=S1;var _1=x.forwardRef((s,a)=>{const{__scopeToast:l,altText:i,...c}=s;return e.jsx(dt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...c,ref:a})});function C1(s){const a=[];return Array.from(s.childNodes).forEach(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent&&a.push(i.textContent),Xz(i)){const c=i.ariaHidden||i.hidden||i.style.display==="none",d=i.dataset.radixToastAnnounceExclude==="";if(!c)if(d){const m=i.dataset.radixToastAnnounceAlt;m&&a.push(m)}else a.push(...C1(i))}}),a}function rd(s,a,l,{discrete:i}){const c=l.originalEvent.currentTarget,d=new CustomEvent(s,{bubbles:!0,cancelable:!0,detail:l});a&&c.addEventListener(s,a,{once:!0}),i?Cy(c,d):c.dispatchEvent(d)}var ly=(s,a,l=0)=>{const i=Math.abs(s.x),c=Math.abs(s.y),d=i>c;return a==="left"||a==="right"?d&&i>l:!d&&c>l};function Wz(s=()=>{}){const a=ws(s);oy(()=>{let l=0,i=0;return l=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(a)),()=>{window.cancelAnimationFrame(l),window.cancelAnimationFrame(i)}},[a])}function Xz(s){return s.nodeType===s.ELEMENT_NODE}function Kz(s){const a=[],l=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Mf(s){const a=document.activeElement;return s.some(l=>l===a?!0:(l.focus(),document.activeElement!==a))}var Qz=x1,k1=g1,T1=j1,E1=y1,M1=b1,D1=w1,O1=sx;const Zz=Qz,A1=x.forwardRef(({className:s,...a},l)=>e.jsx(k1,{ref:l,className:Z("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]",s),...a}));A1.displayName=k1.displayName;const Jz=Jr("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"}}),R1=x.forwardRef(({className:s,variant:a,...l},i)=>e.jsx(T1,{ref:i,className:Z(Jz({variant:a}),s),...l}));R1.displayName=T1.displayName;const e6=x.forwardRef(({className:s,...a},l)=>e.jsx(D1,{ref:l,className:Z("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",s),...a}));e6.displayName=D1.displayName;const z1=x.forwardRef(({className:s,...a},l)=>e.jsx(O1,{ref:l,className:Z("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",s),"toast-close":"",...a,children:e.jsx(go,{className:"h-4 w-4"})}));z1.displayName=O1.displayName;const P1=x.forwardRef(({className:s,...a},l)=>e.jsx(E1,{ref:l,className:Z("text-sm font-semibold [&+div]:text-xs",s),...a}));P1.displayName=E1.displayName;const L1=x.forwardRef(({className:s,...a},l)=>e.jsx(M1,{ref:l,className:Z("text-sm opacity-90",s),...a}));L1.displayName=M1.displayName;function t6(){const{toasts:s}=Es();return e.jsxs(Zz,{children:[s.map(function({id:a,title:l,description:i,action:c,...d}){return e.jsxs(R1,{...d,children:[e.jsxs("div",{className:"grid gap-1",children:[l&&e.jsx(P1,{children:l}),i&&e.jsx(L1,{children:i})]}),c,e.jsx(z1,{})]},a)}),e.jsx(A1,{})]})}eC.createRoot(document.getElementById("root")).render(e.jsx(x.StrictMode,{children:e.jsx(Oz,{defaultTheme:"system",children:e.jsxs(Az,{children:[e.jsx(s2,{router:Dz}),e.jsx(t6,{})]})})}));