MaiBot/webui/dist/assets/index-BExEVKIA.js

345 lines
1.2 MiB
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{r as w,j as r,u as as,R as Fe,d as LC,L as BC,e as PC,f as gr,g as FC,h as IC,O as L5,b as qC,k as HC}from"./router-BWgTyY51.js";import{a as UC,b as $C,g as B5}from"./react-vendor-Dtc2IqVY.js";import{c as P5,R as VC,T as GC,L as YC,a as WC,C as y0,X as b0,Y as Wc,b as XC,B as vp,d as w0,P as KC,e as QC,f as ZC}from"./charts-DU5SeejN.js";import{c as Ua,a as bm,u as Ta,P as It,b as Pe,d as mn,e as Eu,f as zl,g as yr,h as Wr,i as F5,j as h1,k as f1,S as JC,l as I5,m as q5,R as H5,O as wm,n as p1,C as jm,o as x1,T as g1,D as v1,p as y1,q as U5,r as $5,W as eT,s as V5,I as tT,t as G5,v as Y5,w as nT,x as W5,V as rT,L as X5,y as K5,z as aT,A as sT,B as Q5,E as lT,F as iT,G as Sl,H as Nm,J as Vo,K as Z5,M as J5,N as e6,Q as t6,U as b1,X as w1,Y as Sm,Z as km,_ as j1,$ as n6,a0 as oT,a1 as r6,a2 as cT,a3 as uT,a4 as a6,a5 as dT}from"./ui-vendor-nTGLnMlb.js";import{R as Ia,A as mT,D as hT,a as fT,Z as fu,C as di,M as Mu,T as pT,X as Au,P as s6,S as xT,b as Pa,I as pi,c as Ao,d as mi,e as vx,E as yx,f as Ha,g as $r,h as bx,i as gT,j as wx,k as jx,L as $y,K as vT,l as xi,m as yT,n as bT,F as Nl,o as wT,B as jT,U as l6,p as N1,q as NT,r as ST,s as Yr,H as J0,t as i6,u as pu,v as Nx,w as xu,x as Cm,y as S1,z as pr,G as zt,J as em,N as Bo,O as Du,Q as bi,V as wi,W as zu,Y as kT,_ as Vy,$ as CT,a0 as hi,a1 as Sx,a2 as Po,a3 as Gy,a4 as tm,a5 as TT,a6 as Yy,a7 as _T,a8 as ET,a9 as wl,aa as yp,ab as Wy,ac as MT,ad as ou,ae as nm,af as o6,ag as c6,ah as u6,ai as AT,aj as DT,ak as Xy,al as zT,am as OT,an as Ky,ao as RT}from"./icons-8vbl1orV.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();var bp={exports:{}},Xc={},wp={exports:{}},jp={};var Qy;function LT(){return Qy||(Qy=1,(function(e){function t(H,le){var re=H.length;H.push(le);e:for(;0<re;){var ge=re-1>>>1,E=H[ge];if(0<l(E,le))H[ge]=le,H[re]=E,re=ge;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var le=H[0],re=H.pop();if(re!==le){H[0]=re;e:for(var ge=0,E=H.length,we=E>>>1;ge<we;){var Z=2*(ge+1)-1,z=H[Z],X=Z+1,q=H[X];if(0>l(z,re))X<E&&0>l(q,z)?(H[ge]=q,H[X]=re,ge=X):(H[ge]=z,H[Z]=re,ge=Z);else if(X<E&&0>l(q,re))H[ge]=q,H[X]=re,ge=X;else break e}}return le}function l(H,le){var re=H.sortIndex-le.sortIndex;return re!==0?re:H.id-le.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],f=[],p=1,x=null,y=3,b=!1,N=!1,k=!1,S=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(H){for(var le=n(f);le!==null;){if(le.callback===null)a(f);else if(le.startTime<=H)a(f),le.sortIndex=le.expirationTime,t(m,le);else break;le=n(f)}}function B(H){if(k=!1,R(H),!N)if(n(m)!==null)N=!0,O||(O=!0,ee());else{var le=n(f);le!==null&&se(B,le.startTime-H)}}var O=!1,L=-1,$=5,U=-1;function I(){return S?!0:!(e.unstable_now()-U<$)}function G(){if(S=!1,O){var H=e.unstable_now();U=H;var le=!0;try{e:{N=!1,k&&(k=!1,M(L),L=-1),b=!0;var re=y;try{t:{for(R(H),x=n(m);x!==null&&!(x.expirationTime>H&&I());){var ge=x.callback;if(typeof ge=="function"){x.callback=null,y=x.priorityLevel;var E=ge(x.expirationTime<=H);if(H=e.unstable_now(),typeof E=="function"){x.callback=E,R(H),le=!0;break t}x===n(m)&&a(m),R(H)}else a(m);x=n(m)}if(x!==null)le=!0;else{var we=n(f);we!==null&&se(B,we.startTime-H),le=!1}}break e}finally{x=null,y=re,b=!1}le=void 0}}finally{le?ee():O=!1}}}var ee;if(typeof A=="function")ee=function(){A(G)};else if(typeof MessageChannel<"u"){var Ne=new MessageChannel,J=Ne.port2;Ne.port1.onmessage=G,ee=function(){J.postMessage(null)}}else ee=function(){T(G,0)};function se(H,le){L=T(function(){H(e.unstable_now())},le)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var le=3;break;default:le=y}var re=y;y=le;try{return H()}finally{y=re}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(H,le){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var re=y;y=H;try{return le()}finally{y=re}},e.unstable_scheduleCallback=function(H,le,re){var ge=e.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?ge+re:ge):re=ge,H){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=re+E,H={id:p++,callback:le,priorityLevel:H,startTime:re,expirationTime:E,sortIndex:-1},re>ge?(H.sortIndex=re,t(f,H),n(m)===null&&H===n(f)&&(k?(M(L),L=-1):k=!0,se(B,re-ge))):(H.sortIndex=E,t(m,H),N||b||(N=!0,O||(O=!0,ee()))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var le=y;return function(){var re=y;y=le;try{return H.apply(this,arguments)}finally{y=re}}}})(jp)),jp}var Zy;function BT(){return Zy||(Zy=1,wp.exports=LT()),wp.exports}var Jy;function PT(){if(Jy)return Xc;Jy=1;var e=BT(),t=UC(),n=$C();function a(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function c(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function d(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function m(s){if(o(s)!==s)throw Error(a(188))}function f(s){var i=s.alternate;if(!i){if(i=o(s),i===null)throw Error(a(188));return i!==s?null:s}for(var u=s,h=i;;){var g=u.return;if(g===null)break;var v=g.alternate;if(v===null){if(h=g.return,h!==null){u=h;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===u)return m(g),s;if(v===h)return m(g),i;v=v.sibling}throw Error(a(188))}if(u.return!==h.return)u=g,h=v;else{for(var _=!1,P=g.child;P;){if(P===u){_=!0,u=g,h=v;break}if(P===h){_=!0,h=g,u=v;break}P=P.sibling}if(!_){for(P=v.child;P;){if(P===u){_=!0,u=v,h=g;break}if(P===h){_=!0,h=v,u=g;break}P=P.sibling}if(!_)throw Error(a(189))}}if(u.alternate!==h)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?s:i}function p(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=p(s),i!==null)return i;s=s.sibling}return null}var x=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function ee(s){return s===null||typeof s!="object"?null:(s=G&&s[G]||s["@@iterator"],typeof s=="function"?s:null)}var Ne=Symbol.for("react.client.reference");function J(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Ne?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case T:return"Profiler";case S:return"StrictMode";case B:return"Suspense";case O:return"SuspenseList";case U:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case N:return"Portal";case A:return s.displayName||"Context";case M:return(s._context.displayName||"Context")+".Consumer";case R:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case L:return i=s.displayName||null,i!==null?i:J(s.type)||"Memo";case $:i=s._payload,s=s._init;try{return J(s(i))}catch{}}return null}var se=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ge=[],E=-1;function we(s){return{current:s}}function Z(s){0>E||(s.current=ge[E],ge[E]=null,E--)}function z(s,i){E++,ge[E]=s.current,s.current=i}var X=we(null),q=we(null),ce=we(null),fe=we(null);function De(s,i){switch(z(ce,i),z(q,s),z(X,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?hy(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=hy(i),s=fy(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Z(X),z(X,s)}function oe(){Z(X),Z(q),Z(ce)}function He(s){s.memoizedState!==null&&z(fe,s);var i=X.current,u=fy(i,s.type);i!==u&&(z(q,s),z(X,u))}function at(s){q.current===s&&(Z(X),Z(q)),fe.current===s&&(Z(fe),$c._currentValue=re)}var je,Ze;function qe(s){if(je===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);je=i&&i[1]||"",Ze=-1<u.stack.indexOf(`
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
`+je+s+Ze}var Ot=!1;function bn(s,i){if(!s||Ot)return"";Ot=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(i){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(ye){var xe=ye}Reflect.construct(s,[],Ce)}else{try{Ce.call()}catch(ye){xe=ye}s.call(Ce.prototype)}}else{try{throw Error()}catch(ye){xe=ye}(Ce=s())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(ye){if(ye&&xe&&typeof ye.stack=="string")return[ye.stack,xe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=h.DetermineComponentFrameRoot(),_=v[0],P=v[1];if(_&&P){var W=_.split(`
`),me=P.split(`
`);for(g=h=0;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;for(;g<me.length&&!me[g].includes("DetermineComponentFrameRoot");)g++;if(h===W.length||g===me.length)for(h=W.length-1,g=me.length-1;1<=h&&0<=g&&W[h]!==me[g];)g--;for(;1<=h&&0<=g;h--,g--)if(W[h]!==me[g]){if(h!==1||g!==1)do if(h--,g--,0>g||W[h]!==me[g]){var Se=`
`+W[h].replace(" at new "," at ");return s.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",s.displayName)),Se}while(1<=h&&0<=g);break}}}finally{Ot=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?qe(u):""}function Dn(s,i){switch(s.tag){case 26:case 27:case 5:return qe(s.type);case 16:return qe("Lazy");case 13:return s.child!==i&&i!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return bn(s.type,!1);case 11:return bn(s.type.render,!1);case 1:return bn(s.type,!0);case 31:return qe("Activity");default:return""}}function Xe(s){try{var i="",u=null;do i+=Dn(s,u),u=s,s=s.return;while(s);return i}catch(h){return`
Error generating stack: `+h.message+`
`+h.stack}}var wn=Object.prototype.hasOwnProperty,Wn=e.unstable_scheduleCallback,Ar=e.unstable_cancelCallback,Cn=e.unstable_shouldYield,cr=e.unstable_requestPaint,$e=e.unstable_now,Fn=e.unstable_getCurrentPriorityLevel,K=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,nt=e.unstable_LowPriority,kt=e.unstable_IdlePriority,rr=e.log,Dr=e.unstable_setDisableYieldValue,pe=null,Ee=null;function dt(s){if(typeof rr=="function"&&Dr(s),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(pe,s)}catch{}}var mt=Math.clz32?Math.clz32:gn,zr=Math.log,st=Math.LN2;function gn(s){return s>>>=0,s===0?32:31-(zr(s)/st|0)|0}var ot=256,$t=262144,ar=4194304;function bt(s){var i=s&42;if(i!==0)return i;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ai(s,i,u){var h=s.pendingLanes;if(h===0)return 0;var g=0,v=s.suspendedLanes,_=s.pingedLanes;s=s.warmLanes;var P=h&134217727;return P!==0?(h=P&~v,h!==0?g=bt(h):(_&=P,_!==0?g=bt(_):u||(u=P&~s,u!==0&&(g=bt(u))))):(P=h&~v,P!==0?g=bt(P):_!==0?g=bt(_):u||(u=h&~s,u!==0&&(g=bt(u)))),g===0?0:i!==0&&i!==g&&(i&v)===0&&(v=g&-g,u=i&-i,v>=u||v===32&&(u&4194048)!==0)?i:g}function Fl(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function sh(s,i){switch(s){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Di(){var s=ar;return ar<<=1,(ar&62914560)===0&&(ar=4194304),s}function Il(s){for(var i=[],u=0;31>u;u++)i.push(s);return i}function ac(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function SS(s,i,u,h,g,v){var _=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var P=s.entanglements,W=s.expirationTimes,me=s.hiddenUpdates;for(u=_&~u;0<u;){var Se=31-mt(u),Ce=1<<Se;P[Se]=0,W[Se]=-1;var xe=me[Se];if(xe!==null)for(me[Se]=null,Se=0;Se<xe.length;Se++){var ye=xe[Se];ye!==null&&(ye.lane&=-536870913)}u&=~Ce}h!==0&&Xg(s,h,0),v!==0&&g===0&&s.tag!==0&&(s.suspendedLanes|=v&~(_&~i))}function Xg(s,i,u){s.pendingLanes|=i,s.suspendedLanes&=~i;var h=31-mt(i);s.entangledLanes|=i,s.entanglements[h]=s.entanglements[h]|1073741824|u&261930}function Kg(s,i){var u=s.entangledLanes|=i;for(s=s.entanglements;u;){var h=31-mt(u),g=1<<h;g&i|s[h]&i&&(s[h]|=i),u&=~g}}function Qg(s,i){var u=i&-i;return u=(u&42)!==0?1:lh(u),(u&(s.suspendedLanes|i))!==0?0:u}function lh(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ih(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Zg(){var s=le.p;return s!==0?s:(s=window.event,s===void 0?32:By(s.type))}function Jg(s,i){var u=le.p;try{return le.p=s,i()}finally{le.p=u}}var Gs=Math.random().toString(36).slice(2),ur="__reactFiber$"+Gs,Or="__reactProps$"+Gs,zi="__reactContainer$"+Gs,oh="__reactEvents$"+Gs,kS="__reactListeners$"+Gs,CS="__reactHandles$"+Gs,ev="__reactResources$"+Gs,sc="__reactMarker$"+Gs;function ch(s){delete s[ur],delete s[Or],delete s[oh],delete s[kS],delete s[CS]}function Oi(s){var i=s[ur];if(i)return i;for(var u=s.parentNode;u;){if(i=u[zi]||u[ur]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(s=wy(s);s!==null;){if(u=s[ur])return u;s=wy(s)}return i}s=u,u=s.parentNode}return null}function Ri(s){if(s=s[ur]||s[zi]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function lc(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(a(33))}function Li(s){var i=s[ev];return i||(i=s[ev]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function sr(s){s[sc]=!0}var tv=new Set,nv={};function ql(s,i){Bi(s,i),Bi(s+"Capture",i)}function Bi(s,i){for(nv[s]=i,s=0;s<i.length;s++)tv.add(i[s])}var TS=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]*$"),rv={},av={};function _S(s){return wn.call(av,s)?!0:wn.call(rv,s)?!1:TS.test(s)?av[s]=!0:(rv[s]=!0,!1)}function id(s,i,u){if(_S(i))if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var h=i.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+u)}}function od(s,i,u){if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+u)}}function ds(s,i,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(i,u,""+h)}}function fa(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function sv(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ES(s,i,u){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var g=h.get,v=h.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return g.call(this)},set:function(_){u=""+_,v.call(this,_)}}),Object.defineProperty(s,i,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(_){u=""+_},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function uh(s){if(!s._valueTracker){var i=sv(s)?"checked":"value";s._valueTracker=ES(s,i,""+s[i])}}function lv(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var u=i.getValue(),h="";return s&&(h=sv(s)?s.checked?"true":"false":s.value),s=h,s!==u?(i.setValue(s),!0):!1}function cd(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var MS=/[\n"\\]/g;function pa(s){return s.replace(MS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function dh(s,i,u,h,g,v,_,P){s.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?s.type=_:s.removeAttribute("type"),i!=null?_==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+fa(i)):s.value!==""+fa(i)&&(s.value=""+fa(i)):_!=="submit"&&_!=="reset"||s.removeAttribute("value"),i!=null?mh(s,_,fa(i)):u!=null?mh(s,_,fa(u)):h!=null&&s.removeAttribute("value"),g==null&&v!=null&&(s.defaultChecked=!!v),g!=null&&(s.checked=g&&typeof g!="function"&&typeof g!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.name=""+fa(P):s.removeAttribute("name")}function iv(s,i,u,h,g,v,_,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(s.type=v),i!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){uh(s);return}u=u!=null?""+fa(u):"",i=i!=null?""+fa(i):u,P||i===s.value||(s.value=i),s.defaultValue=i}h=h??g,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=P?s.checked:!!h,s.defaultChecked=!!h,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.name=_),uh(s)}function mh(s,i,u){i==="number"&&cd(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function Pi(s,i,u,h){if(s=s.options,i){i={};for(var g=0;g<u.length;g++)i["$"+u[g]]=!0;for(u=0;u<s.length;u++)g=i.hasOwnProperty("$"+s[u].value),s[u].selected!==g&&(s[u].selected=g),g&&h&&(s[u].defaultSelected=!0)}else{for(u=""+fa(u),i=null,g=0;g<s.length;g++){if(s[g].value===u){s[g].selected=!0,h&&(s[g].defaultSelected=!0);return}i!==null||s[g].disabled||(i=s[g])}i!==null&&(i.selected=!0)}}function ov(s,i,u){if(i!=null&&(i=""+fa(i),i!==s.value&&(s.value=i),u==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=u!=null?""+fa(u):""}function cv(s,i,u,h){if(i==null){if(h!=null){if(u!=null)throw Error(a(92));if(se(h)){if(1<h.length)throw Error(a(93));h=h[0]}u=h}u==null&&(u=""),i=u}u=fa(i),s.defaultValue=u,h=s.textContent,h===u&&h!==""&&h!==null&&(s.value=h),uh(s)}function Fi(s,i){if(i){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=i;return}}s.textContent=i}var AS=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 uv(s,i,u){var h=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":h?s.setProperty(i,u):typeof u!="number"||u===0||AS.has(i)?i==="float"?s.cssFloat=u:s[i]=(""+u).trim():s[i]=u+"px"}function dv(s,i,u){if(i!=null&&typeof i!="object")throw Error(a(62));if(s=s.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||i!=null&&i.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var g in i)h=i[g],i.hasOwnProperty(g)&&u[g]!==h&&uv(s,g,h)}else for(var v in i)i.hasOwnProperty(v)&&uv(s,v,i[v])}function hh(s){if(s.indexOf("-")===-1)return!1;switch(s){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 DS=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"]]),zS=/^[\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 ud(s){return zS.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ms(){}var fh=null;function ph(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ii=null,qi=null;function mv(s){var i=Ri(s);if(i&&(s=i.stateNode)){var u=s[Or]||null;e:switch(s=i.stateNode,i.type){case"input":if(dh(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+pa(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var h=u[i];if(h!==s&&h.form===s.form){var g=h[Or]||null;if(!g)throw Error(a(90));dh(h,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<u.length;i++)h=u[i],h.form===s.form&&lv(h)}break e;case"textarea":ov(s,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Pi(s,!!u.multiple,i,!1)}}}var xh=!1;function hv(s,i,u){if(xh)return s(i,u);xh=!0;try{var h=s(i);return h}finally{if(xh=!1,(Ii!==null||qi!==null)&&(Qd(),Ii&&(i=Ii,s=qi,qi=Ii=null,mv(i),s)))for(i=0;i<s.length;i++)mv(s[i])}}function ic(s,i){var u=s.stateNode;if(u===null)return null;var h=u[Or]||null;if(h===null)return null;u=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(a(231,i,typeof u));return u}var hs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gh=!1;if(hs)try{var oc={};Object.defineProperty(oc,"passive",{get:function(){gh=!0}}),window.addEventListener("test",oc,oc),window.removeEventListener("test",oc,oc)}catch{gh=!1}var Ys=null,vh=null,dd=null;function fv(){if(dd)return dd;var s,i=vh,u=i.length,h,g="value"in Ys?Ys.value:Ys.textContent,v=g.length;for(s=0;s<u&&i[s]===g[s];s++);var _=u-s;for(h=1;h<=_&&i[u-h]===g[v-h];h++);return dd=g.slice(s,1<h?1-h:void 0)}function md(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function hd(){return!0}function pv(){return!1}function Rr(s){function i(u,h,g,v,_){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=v,this.target=_,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(u=s[P],this[P]=u?u(v):v[P]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?hd:pv,this.isPropagationStopped=pv,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=hd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=hd)},persist:function(){},isPersistent:hd}),i}var Hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fd=Rr(Hl),cc=x({},Hl,{view:0,detail:0}),OS=Rr(cc),yh,bh,uc,pd=x({},cc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jh,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==uc&&(uc&&s.type==="mousemove"?(yh=s.screenX-uc.screenX,bh=s.screenY-uc.screenY):bh=yh=0,uc=s),yh)},movementY:function(s){return"movementY"in s?s.movementY:bh}}),xv=Rr(pd),RS=x({},pd,{dataTransfer:0}),LS=Rr(RS),BS=x({},cc,{relatedTarget:0}),wh=Rr(BS),PS=x({},Hl,{animationName:0,elapsedTime:0,pseudoElement:0}),FS=Rr(PS),IS=x({},Hl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),qS=Rr(IS),HS=x({},Hl,{data:0}),gv=Rr(HS),US={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$S={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"},VS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GS(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=VS[s])?!!i[s]:!1}function jh(){return GS}var YS=x({},cc,{key:function(s){if(s.key){var i=US[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=md(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?$S[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jh,charCode:function(s){return s.type==="keypress"?md(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?md(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),WS=Rr(YS),XS=x({},pd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vv=Rr(XS),KS=x({},cc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jh}),QS=Rr(KS),ZS=x({},Hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),JS=Rr(ZS),ek=x({},pd,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),tk=Rr(ek),nk=x({},Hl,{newState:0,oldState:0}),rk=Rr(nk),ak=[9,13,27,32],Nh=hs&&"CompositionEvent"in window,dc=null;hs&&"documentMode"in document&&(dc=document.documentMode);var sk=hs&&"TextEvent"in window&&!dc,yv=hs&&(!Nh||dc&&8<dc&&11>=dc),bv=" ",wv=!1;function jv(s,i){switch(s){case"keyup":return ak.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Hi=!1;function lk(s,i){switch(s){case"compositionend":return Nv(i);case"keypress":return i.which!==32?null:(wv=!0,bv);case"textInput":return s=i.data,s===bv&&wv?null:s;default:return null}}function ik(s,i){if(Hi)return s==="compositionend"||!Nh&&jv(s,i)?(s=fv(),dd=vh=Ys=null,Hi=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return yv&&i.locale!=="ko"?null:i.data;default:return null}}var ok={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 Sv(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!ok[s.type]:i==="textarea"}function kv(s,i,u,h){Ii?qi?qi.push(h):qi=[h]:Ii=h,i=a0(i,"onChange"),0<i.length&&(u=new fd("onChange","change",null,u,h),s.push({event:u,listeners:i}))}var mc=null,hc=null;function ck(s){iy(s,0)}function xd(s){var i=lc(s);if(lv(i))return s}function Cv(s,i){if(s==="change")return i}var Tv=!1;if(hs){var Sh;if(hs){var kh="oninput"in document;if(!kh){var _v=document.createElement("div");_v.setAttribute("oninput","return;"),kh=typeof _v.oninput=="function"}Sh=kh}else Sh=!1;Tv=Sh&&(!document.documentMode||9<document.documentMode)}function Ev(){mc&&(mc.detachEvent("onpropertychange",Mv),hc=mc=null)}function Mv(s){if(s.propertyName==="value"&&xd(hc)){var i=[];kv(i,hc,s,ph(s)),hv(ck,i)}}function uk(s,i,u){s==="focusin"?(Ev(),mc=i,hc=u,mc.attachEvent("onpropertychange",Mv)):s==="focusout"&&Ev()}function dk(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return xd(hc)}function mk(s,i){if(s==="click")return xd(i)}function hk(s,i){if(s==="input"||s==="change")return xd(i)}function fk(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var Jr=typeof Object.is=="function"?Object.is:fk;function fc(s,i){if(Jr(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var u=Object.keys(s),h=Object.keys(i);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!wn.call(i,g)||!Jr(s[g],i[g]))return!1}return!0}function Av(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Dv(s,i){var u=Av(s);s=0;for(var h;u;){if(u.nodeType===3){if(h=s+u.textContent.length,s<=i&&h>=i)return{node:u,offset:i-s};s=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Av(u)}}function zv(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?zv(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function Ov(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=cd(s.document);i instanceof s.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)s=i.contentWindow;else break;i=cd(s.document)}return i}function Ch(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var pk=hs&&"documentMode"in document&&11>=document.documentMode,Ui=null,Th=null,pc=null,_h=!1;function Rv(s,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;_h||Ui==null||Ui!==cd(h)||(h=Ui,"selectionStart"in h&&Ch(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),pc&&fc(pc,h)||(pc=h,h=a0(Th,"onSelect"),0<h.length&&(i=new fd("onSelect","select",null,i,u),s.push({event:i,listeners:h}),i.target=Ui)))}function Ul(s,i){var u={};return u[s.toLowerCase()]=i.toLowerCase(),u["Webkit"+s]="webkit"+i,u["Moz"+s]="moz"+i,u}var $i={animationend:Ul("Animation","AnimationEnd"),animationiteration:Ul("Animation","AnimationIteration"),animationstart:Ul("Animation","AnimationStart"),transitionrun:Ul("Transition","TransitionRun"),transitionstart:Ul("Transition","TransitionStart"),transitioncancel:Ul("Transition","TransitionCancel"),transitionend:Ul("Transition","TransitionEnd")},Eh={},Lv={};hs&&(Lv=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function $l(s){if(Eh[s])return Eh[s];if(!$i[s])return s;var i=$i[s],u;for(u in i)if(i.hasOwnProperty(u)&&u in Lv)return Eh[s]=i[u];return s}var Bv=$l("animationend"),Pv=$l("animationiteration"),Fv=$l("animationstart"),xk=$l("transitionrun"),gk=$l("transitionstart"),vk=$l("transitioncancel"),Iv=$l("transitionend"),qv=new Map,Mh="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(" ");Mh.push("scrollEnd");function Da(s,i){qv.set(s,i),ql(i,[s])}var gd=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},xa=[],Vi=0,Ah=0;function vd(){for(var s=Vi,i=Ah=Vi=0;i<s;){var u=xa[i];xa[i++]=null;var h=xa[i];xa[i++]=null;var g=xa[i];xa[i++]=null;var v=xa[i];if(xa[i++]=null,h!==null&&g!==null){var _=h.pending;_===null?g.next=g:(g.next=_.next,_.next=g),h.pending=g}v!==0&&Hv(u,g,v)}}function yd(s,i,u,h){xa[Vi++]=s,xa[Vi++]=i,xa[Vi++]=u,xa[Vi++]=h,Ah|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function Dh(s,i,u,h){return yd(s,i,u,h),bd(s)}function Vl(s,i){return yd(s,null,null,i),bd(s)}function Hv(s,i,u){s.lanes|=u;var h=s.alternate;h!==null&&(h.lanes|=u);for(var g=!1,v=s.return;v!==null;)v.childLanes|=u,h=v.alternate,h!==null&&(h.childLanes|=u),v.tag===22&&(s=v.stateNode,s===null||s._visibility&1||(g=!0)),s=v,v=v.return;return s.tag===3?(v=s.stateNode,g&&i!==null&&(g=31-mt(u),s=v.hiddenUpdates,h=s[g],h===null?s[g]=[i]:h.push(i),i.lane=u|536870912),v):null}function bd(s){if(50<Bc)throw Bc=0,Hf=null,Error(a(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var Gi={};function yk(s,i,u,h){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(s,i,u,h){return new yk(s,i,u,h)}function zh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function fs(s,i){var u=s.alternate;return u===null?(u=ea(s.tag,i,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=i,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,i=s.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function Uv(s,i){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,i=u.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function wd(s,i,u,h,g,v){var _=0;if(h=s,typeof s=="function")zh(s)&&(_=1);else if(typeof s=="string")_=SC(s,u,X.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case U:return s=ea(31,u,i,g),s.elementType=U,s.lanes=v,s;case k:return Gl(u.children,g,v,i);case S:_=8,g|=24;break;case T:return s=ea(12,u,i,g|2),s.elementType=T,s.lanes=v,s;case B:return s=ea(13,u,i,g),s.elementType=B,s.lanes=v,s;case O:return s=ea(19,u,i,g),s.elementType=O,s.lanes=v,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case A:_=10;break e;case M:_=9;break e;case R:_=11;break e;case L:_=14;break e;case $:_=16,h=null;break e}_=29,u=Error(a(130,s===null?"null":typeof s,"")),h=null}return i=ea(_,u,i,g),i.elementType=s,i.type=h,i.lanes=v,i}function Gl(s,i,u,h){return s=ea(7,s,h,i),s.lanes=u,s}function Oh(s,i,u){return s=ea(6,s,null,i),s.lanes=u,s}function $v(s){var i=ea(18,null,null,0);return i.stateNode=s,i}function Rh(s,i,u){return i=ea(4,s.children!==null?s.children:[],s.key,i),i.lanes=u,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var Vv=new WeakMap;function ga(s,i){if(typeof s=="object"&&s!==null){var u=Vv.get(s);return u!==void 0?u:(i={value:s,source:i,stack:Xe(i)},Vv.set(s,i),i)}return{value:s,source:i,stack:Xe(i)}}var Yi=[],Wi=0,jd=null,xc=0,va=[],ya=0,Ws=null,Va=1,Ga="";function ps(s,i){Yi[Wi++]=xc,Yi[Wi++]=jd,jd=s,xc=i}function Gv(s,i,u){va[ya++]=Va,va[ya++]=Ga,va[ya++]=Ws,Ws=s;var h=Va;s=Ga;var g=32-mt(h)-1;h&=~(1<<g),u+=1;var v=32-mt(i)+g;if(30<v){var _=g-g%5;v=(h&(1<<_)-1).toString(32),h>>=_,g-=_,Va=1<<32-mt(i)+g|u<<g|h,Ga=v+s}else Va=1<<v|u<<g|h,Ga=s}function Lh(s){s.return!==null&&(ps(s,1),Gv(s,1,0))}function Bh(s){for(;s===jd;)jd=Yi[--Wi],Yi[Wi]=null,xc=Yi[--Wi],Yi[Wi]=null;for(;s===Ws;)Ws=va[--ya],va[ya]=null,Ga=va[--ya],va[ya]=null,Va=va[--ya],va[ya]=null}function Yv(s,i){va[ya++]=Va,va[ya++]=Ga,va[ya++]=Ws,Va=i.id,Ga=i.overflow,Ws=s}var dr=null,jn=null,Rt=!1,Xs=null,ba=!1,Ph=Error(a(519));function Ks(s){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gc(ga(i,s)),Ph}function Wv(s){var i=s.stateNode,u=s.type,h=s.memoizedProps;switch(i[ur]=s,i[Or]=h,u){case"dialog":Tt("cancel",i),Tt("close",i);break;case"iframe":case"object":case"embed":Tt("load",i);break;case"video":case"audio":for(u=0;u<Fc.length;u++)Tt(Fc[u],i);break;case"source":Tt("error",i);break;case"img":case"image":case"link":Tt("error",i),Tt("load",i);break;case"details":Tt("toggle",i);break;case"input":Tt("invalid",i),iv(i,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Tt("invalid",i);break;case"textarea":Tt("invalid",i),cv(i,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||h.suppressHydrationWarning===!0||dy(i.textContent,u)?(h.popover!=null&&(Tt("beforetoggle",i),Tt("toggle",i)),h.onScroll!=null&&Tt("scroll",i),h.onScrollEnd!=null&&Tt("scrollend",i),h.onClick!=null&&(i.onclick=ms),i=!0):i=!1,i||Ks(s,!0)}function Xv(s){for(dr=s.return;dr;)switch(dr.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:dr=dr.return}}function Xi(s){if(s!==dr)return!1;if(!Rt)return Xv(s),Rt=!0,!1;var i=s.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||rp(s.type,s.memoizedProps)),u=!u),u&&jn&&Ks(s),Xv(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));jn=by(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));jn=by(s)}else i===27?(i=jn,ul(s.type)?(s=op,op=null,jn=s):jn=i):jn=dr?ja(s.stateNode.nextSibling):null;return!0}function Yl(){jn=dr=null,Rt=!1}function Fh(){var s=Xs;return s!==null&&(Fr===null?Fr=s:Fr.push.apply(Fr,s),Xs=null),s}function gc(s){Xs===null?Xs=[s]:Xs.push(s)}var Ih=we(null),Wl=null,xs=null;function Qs(s,i,u){z(Ih,i._currentValue),i._currentValue=u}function gs(s){s._currentValue=Ih.current,Z(Ih)}function qh(s,i,u){for(;s!==null;){var h=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),s===u)break;s=s.return}}function Hh(s,i,u,h){var g=s.child;for(g!==null&&(g.return=s);g!==null;){var v=g.dependencies;if(v!==null){var _=g.child;v=v.firstContext;e:for(;v!==null;){var P=v;v=g;for(var W=0;W<i.length;W++)if(P.context===i[W]){v.lanes|=u,P=v.alternate,P!==null&&(P.lanes|=u),qh(v.return,u,s),h||(_=null);break e}v=P.next}}else if(g.tag===18){if(_=g.return,_===null)throw Error(a(341));_.lanes|=u,v=_.alternate,v!==null&&(v.lanes|=u),qh(_,u,s),_=null}else _=g.child;if(_!==null)_.return=g;else for(_=g;_!==null;){if(_===s){_=null;break}if(g=_.sibling,g!==null){g.return=_.return,_=g;break}_=_.return}g=_}}function Ki(s,i,u,h){s=null;for(var g=i,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var _=g.alternate;if(_===null)throw Error(a(387));if(_=_.memoizedProps,_!==null){var P=g.type;Jr(g.pendingProps.value,_.value)||(s!==null?s.push(P):s=[P])}}else if(g===fe.current){if(_=g.alternate,_===null)throw Error(a(387));_.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(s!==null?s.push($c):s=[$c])}g=g.return}s!==null&&Hh(i,s,u,h),i.flags|=262144}function Nd(s){for(s=s.firstContext;s!==null;){if(!Jr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Xl(s){Wl=s,xs=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function mr(s){return Kv(Wl,s)}function Sd(s,i){return Wl===null&&Xl(s),Kv(s,i)}function Kv(s,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},xs===null){if(s===null)throw Error(a(308));xs=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else xs=xs.next=i;return u}var bk=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(u,h){s.push(h)}};this.abort=function(){i.aborted=!0,s.forEach(function(u){return u()})}},wk=e.unstable_scheduleCallback,jk=e.unstable_NormalPriority,In={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uh(){return{controller:new bk,data:new Map,refCount:0}}function vc(s){s.refCount--,s.refCount===0&&wk(jk,function(){s.controller.abort()})}var yc=null,$h=0,Qi=0,Zi=null;function Nk(s,i){if(yc===null){var u=yc=[];$h=0,Qi=Wf(),Zi={status:"pending",value:void 0,then:function(h){u.push(h)}}}return $h++,i.then(Qv,Qv),i}function Qv(){if(--$h===0&&yc!==null){Zi!==null&&(Zi.status="fulfilled");var s=yc;yc=null,Qi=0,Zi=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function Sk(s,i){var u=[],h={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return s.then(function(){h.status="fulfilled",h.value=i;for(var g=0;g<u.length;g++)(0,u[g])(i)},function(g){for(h.status="rejected",h.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),h}var Zv=H.S;H.S=function(s,i){R2=$e(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Nk(s,i),Zv!==null&&Zv(s,i)};var Kl=we(null);function Vh(){var s=Kl.current;return s!==null?s:hn.pooledCache}function kd(s,i){i===null?z(Kl,Kl.current):z(Kl,i.pool)}function Jv(){var s=Vh();return s===null?null:{parent:In._currentValue,pool:s}}var Ji=Error(a(460)),Gh=Error(a(474)),Cd=Error(a(542)),Td={then:function(){}};function e4(s){return s=s.status,s==="fulfilled"||s==="rejected"}function t4(s,i,u){switch(u=s[u],u===void 0?s.push(i):u!==i&&(i.then(ms,ms),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,r4(s),s;default:if(typeof i.status=="string")i.then(ms,ms);else{if(s=hn,s!==null&&100<s.shellSuspendCounter)throw Error(a(482));s=i,s.status="pending",s.then(function(h){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=h}},function(h){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=h}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,r4(s),s}throw Zl=i,Ji}}function Ql(s){try{var i=s._init;return i(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Zl=u,Ji):u}}var Zl=null;function n4(){if(Zl===null)throw Error(a(459));var s=Zl;return Zl=null,s}function r4(s){if(s===Ji||s===Cd)throw Error(a(483))}var eo=null,bc=0;function _d(s){var i=bc;return bc+=1,eo===null&&(eo=[]),t4(eo,s,i)}function wc(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function Ed(s,i){throw i.$$typeof===y?Error(a(525)):(s=Object.prototype.toString.call(i),Error(a(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function a4(s){function i(ie,te){if(s){var ue=ie.deletions;ue===null?(ie.deletions=[te],ie.flags|=16):ue.push(te)}}function u(ie,te){if(!s)return null;for(;te!==null;)i(ie,te),te=te.sibling;return null}function h(ie){for(var te=new Map;ie!==null;)ie.key!==null?te.set(ie.key,ie):te.set(ie.index,ie),ie=ie.sibling;return te}function g(ie,te){return ie=fs(ie,te),ie.index=0,ie.sibling=null,ie}function v(ie,te,ue){return ie.index=ue,s?(ue=ie.alternate,ue!==null?(ue=ue.index,ue<te?(ie.flags|=67108866,te):ue):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function _(ie){return s&&ie.alternate===null&&(ie.flags|=67108866),ie}function P(ie,te,ue,ke){return te===null||te.tag!==6?(te=Oh(ue,ie.mode,ke),te.return=ie,te):(te=g(te,ue),te.return=ie,te)}function W(ie,te,ue,ke){var Qe=ue.type;return Qe===k?Se(ie,te,ue.props.children,ke,ue.key):te!==null&&(te.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===$&&Ql(Qe)===te.type)?(te=g(te,ue.props),wc(te,ue),te.return=ie,te):(te=wd(ue.type,ue.key,ue.props,null,ie.mode,ke),wc(te,ue),te.return=ie,te)}function me(ie,te,ue,ke){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=Rh(ue,ie.mode,ke),te.return=ie,te):(te=g(te,ue.children||[]),te.return=ie,te)}function Se(ie,te,ue,ke,Qe){return te===null||te.tag!==7?(te=Gl(ue,ie.mode,ke,Qe),te.return=ie,te):(te=g(te,ue),te.return=ie,te)}function Ce(ie,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Oh(""+te,ie.mode,ue),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return ue=wd(te.type,te.key,te.props,null,ie.mode,ue),wc(ue,te),ue.return=ie,ue;case N:return te=Rh(te,ie.mode,ue),te.return=ie,te;case $:return te=Ql(te),Ce(ie,te,ue)}if(se(te)||ee(te))return te=Gl(te,ie.mode,ue,null),te.return=ie,te;if(typeof te.then=="function")return Ce(ie,_d(te),ue);if(te.$$typeof===A)return Ce(ie,Sd(ie,te),ue);Ed(ie,te)}return null}function xe(ie,te,ue,ke){var Qe=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Qe!==null?null:P(ie,te,""+ue,ke);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case b:return ue.key===Qe?W(ie,te,ue,ke):null;case N:return ue.key===Qe?me(ie,te,ue,ke):null;case $:return ue=Ql(ue),xe(ie,te,ue,ke)}if(se(ue)||ee(ue))return Qe!==null?null:Se(ie,te,ue,ke,null);if(typeof ue.then=="function")return xe(ie,te,_d(ue),ke);if(ue.$$typeof===A)return xe(ie,te,Sd(ie,ue),ke);Ed(ie,ue)}return null}function ye(ie,te,ue,ke,Qe){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return ie=ie.get(ue)||null,P(te,ie,""+ke,Qe);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case b:return ie=ie.get(ke.key===null?ue:ke.key)||null,W(te,ie,ke,Qe);case N:return ie=ie.get(ke.key===null?ue:ke.key)||null,me(te,ie,ke,Qe);case $:return ke=Ql(ke),ye(ie,te,ue,ke,Qe)}if(se(ke)||ee(ke))return ie=ie.get(ue)||null,Se(te,ie,ke,Qe,null);if(typeof ke.then=="function")return ye(ie,te,ue,_d(ke),Qe);if(ke.$$typeof===A)return ye(ie,te,ue,Sd(te,ke),Qe);Ed(te,ke)}return null}function Ue(ie,te,ue,ke){for(var Qe=null,qt=null,Ye=te,xt=te=0,Dt=null;Ye!==null&&xt<ue.length;xt++){Ye.index>xt?(Dt=Ye,Ye=null):Dt=Ye.sibling;var Ht=xe(ie,Ye,ue[xt],ke);if(Ht===null){Ye===null&&(Ye=Dt);break}s&&Ye&&Ht.alternate===null&&i(ie,Ye),te=v(Ht,te,xt),qt===null?Qe=Ht:qt.sibling=Ht,qt=Ht,Ye=Dt}if(xt===ue.length)return u(ie,Ye),Rt&&ps(ie,xt),Qe;if(Ye===null){for(;xt<ue.length;xt++)Ye=Ce(ie,ue[xt],ke),Ye!==null&&(te=v(Ye,te,xt),qt===null?Qe=Ye:qt.sibling=Ye,qt=Ye);return Rt&&ps(ie,xt),Qe}for(Ye=h(Ye);xt<ue.length;xt++)Dt=ye(Ye,ie,xt,ue[xt],ke),Dt!==null&&(s&&Dt.alternate!==null&&Ye.delete(Dt.key===null?xt:Dt.key),te=v(Dt,te,xt),qt===null?Qe=Dt:qt.sibling=Dt,qt=Dt);return s&&Ye.forEach(function(pl){return i(ie,pl)}),Rt&&ps(ie,xt),Qe}function rt(ie,te,ue,ke){if(ue==null)throw Error(a(151));for(var Qe=null,qt=null,Ye=te,xt=te=0,Dt=null,Ht=ue.next();Ye!==null&&!Ht.done;xt++,Ht=ue.next()){Ye.index>xt?(Dt=Ye,Ye=null):Dt=Ye.sibling;var pl=xe(ie,Ye,Ht.value,ke);if(pl===null){Ye===null&&(Ye=Dt);break}s&&Ye&&pl.alternate===null&&i(ie,Ye),te=v(pl,te,xt),qt===null?Qe=pl:qt.sibling=pl,qt=pl,Ye=Dt}if(Ht.done)return u(ie,Ye),Rt&&ps(ie,xt),Qe;if(Ye===null){for(;!Ht.done;xt++,Ht=ue.next())Ht=Ce(ie,Ht.value,ke),Ht!==null&&(te=v(Ht,te,xt),qt===null?Qe=Ht:qt.sibling=Ht,qt=Ht);return Rt&&ps(ie,xt),Qe}for(Ye=h(Ye);!Ht.done;xt++,Ht=ue.next())Ht=ye(Ye,ie,xt,Ht.value,ke),Ht!==null&&(s&&Ht.alternate!==null&&Ye.delete(Ht.key===null?xt:Ht.key),te=v(Ht,te,xt),qt===null?Qe=Ht:qt.sibling=Ht,qt=Ht);return s&&Ye.forEach(function(RC){return i(ie,RC)}),Rt&&ps(ie,xt),Qe}function on(ie,te,ue,ke){if(typeof ue=="object"&&ue!==null&&ue.type===k&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case b:e:{for(var Qe=ue.key;te!==null;){if(te.key===Qe){if(Qe=ue.type,Qe===k){if(te.tag===7){u(ie,te.sibling),ke=g(te,ue.props.children),ke.return=ie,ie=ke;break e}}else if(te.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===$&&Ql(Qe)===te.type){u(ie,te.sibling),ke=g(te,ue.props),wc(ke,ue),ke.return=ie,ie=ke;break e}u(ie,te);break}else i(ie,te);te=te.sibling}ue.type===k?(ke=Gl(ue.props.children,ie.mode,ke,ue.key),ke.return=ie,ie=ke):(ke=wd(ue.type,ue.key,ue.props,null,ie.mode,ke),wc(ke,ue),ke.return=ie,ie=ke)}return _(ie);case N:e:{for(Qe=ue.key;te!==null;){if(te.key===Qe)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){u(ie,te.sibling),ke=g(te,ue.children||[]),ke.return=ie,ie=ke;break e}else{u(ie,te);break}else i(ie,te);te=te.sibling}ke=Rh(ue,ie.mode,ke),ke.return=ie,ie=ke}return _(ie);case $:return ue=Ql(ue),on(ie,te,ue,ke)}if(se(ue))return Ue(ie,te,ue,ke);if(ee(ue)){if(Qe=ee(ue),typeof Qe!="function")throw Error(a(150));return ue=Qe.call(ue),rt(ie,te,ue,ke)}if(typeof ue.then=="function")return on(ie,te,_d(ue),ke);if(ue.$$typeof===A)return on(ie,te,Sd(ie,ue),ke);Ed(ie,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(u(ie,te.sibling),ke=g(te,ue),ke.return=ie,ie=ke):(u(ie,te),ke=Oh(ue,ie.mode,ke),ke.return=ie,ie=ke),_(ie)):u(ie,te)}return function(ie,te,ue,ke){try{bc=0;var Qe=on(ie,te,ue,ke);return eo=null,Qe}catch(Ye){if(Ye===Ji||Ye===Cd)throw Ye;var qt=ea(29,Ye,null,ie.mode);return qt.lanes=ke,qt.return=ie,qt}finally{}}}var Jl=a4(!0),s4=a4(!1),Zs=!1;function Yh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wh(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function el(s,i,u){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(Vt&2)!==0){var g=h.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),h.pending=i,i=bd(s),Hv(s,null,u),i}return yd(s,h,i,u),bd(s)}function jc(s,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var h=i.lanes;h&=s.pendingLanes,u|=h,i.lanes=u,Kg(s,u)}}function Xh(s,i){var u=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var _={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?g=v=_:v=v.next=_,u=u.next}while(u!==null);v===null?g=v=i:v=v.next=i}else g=v=i;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:h.shared,callbacks:h.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=i:s.next=i,u.lastBaseUpdate=i}var Kh=!1;function Nc(){if(Kh){var s=Zi;if(s!==null)throw s}}function Sc(s,i,u,h){Kh=!1;var g=s.updateQueue;Zs=!1;var v=g.firstBaseUpdate,_=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var W=P,me=W.next;W.next=null,_===null?v=me:_.next=me,_=W;var Se=s.alternate;Se!==null&&(Se=Se.updateQueue,P=Se.lastBaseUpdate,P!==_&&(P===null?Se.firstBaseUpdate=me:P.next=me,Se.lastBaseUpdate=W))}if(v!==null){var Ce=g.baseState;_=0,Se=me=W=null,P=v;do{var xe=P.lane&-536870913,ye=xe!==P.lane;if(ye?(At&xe)===xe:(h&xe)===xe){xe!==0&&xe===Qi&&(Kh=!0),Se!==null&&(Se=Se.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ue=s,rt=P;xe=i;var on=u;switch(rt.tag){case 1:if(Ue=rt.payload,typeof Ue=="function"){Ce=Ue.call(on,Ce,xe);break e}Ce=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=rt.payload,xe=typeof Ue=="function"?Ue.call(on,Ce,xe):Ue,xe==null)break e;Ce=x({},Ce,xe);break e;case 2:Zs=!0}}xe=P.callback,xe!==null&&(s.flags|=64,ye&&(s.flags|=8192),ye=g.callbacks,ye===null?g.callbacks=[xe]:ye.push(xe))}else ye={lane:xe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},Se===null?(me=Se=ye,W=Ce):Se=Se.next=ye,_|=xe;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;ye=P,P=ye.next,ye.next=null,g.lastBaseUpdate=ye,g.shared.pending=null}}while(!0);Se===null&&(W=Ce),g.baseState=W,g.firstBaseUpdate=me,g.lastBaseUpdate=Se,v===null&&(g.shared.lanes=0),sl|=_,s.lanes=_,s.memoizedState=Ce}}function l4(s,i){if(typeof s!="function")throw Error(a(191,s));s.call(i)}function i4(s,i){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)l4(u[s],i)}var to=we(null),Md=we(0);function o4(s,i){s=Cs,z(Md,s),z(to,i),Cs=s|i.baseLanes}function Qh(){z(Md,Cs),z(to,to.current)}function Zh(){Cs=Md.current,Z(to),Z(Md)}var ta=we(null),wa=null;function tl(s){var i=s.alternate;z(Ln,Ln.current&1),z(ta,s),wa===null&&(i===null||to.current!==null||i.memoizedState!==null)&&(wa=s)}function Jh(s){z(Ln,Ln.current),z(ta,s),wa===null&&(wa=s)}function c4(s){s.tag===22?(z(Ln,Ln.current),z(ta,s),wa===null&&(wa=s)):nl()}function nl(){z(Ln,Ln.current),z(ta,ta.current)}function na(s){Z(ta),wa===s&&(wa=null),Z(Ln)}var Ln=we(0);function Ad(s){for(var i=s;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||lp(u)||ip(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var vs=0,ht=null,sn=null,qn=null,Dd=!1,no=!1,ei=!1,zd=0,kc=0,ro=null,kk=0;function zn(){throw Error(a(321))}function ef(s,i){if(i===null)return!1;for(var u=0;u<i.length&&u<s.length;u++)if(!Jr(s[u],i[u]))return!1;return!0}function tf(s,i,u,h,g,v){return vs=v,ht=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=s===null||s.memoizedState===null?G4:gf,ei=!1,v=u(h,g),ei=!1,no&&(v=d4(i,u,h,g)),u4(s),v}function u4(s){H.H=_c;var i=sn!==null&&sn.next!==null;if(vs=0,qn=sn=ht=null,Dd=!1,kc=0,ro=null,i)throw Error(a(300));s===null||Hn||(s=s.dependencies,s!==null&&Nd(s)&&(Hn=!0))}function d4(s,i,u,h){ht=s;var g=0;do{if(no&&(ro=null),kc=0,no=!1,25<=g)throw Error(a(301));if(g+=1,qn=sn=null,s.updateQueue!=null){var v=s.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}H.H=Y4,v=i(u,h)}while(no);return v}function Ck(){var s=H.H,i=s.useState()[0];return i=typeof i.then=="function"?Cc(i):i,s=s.useState()[0],(sn!==null?sn.memoizedState:null)!==s&&(ht.flags|=1024),i}function nf(){var s=zd!==0;return zd=0,s}function rf(s,i,u){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~u}function af(s){if(Dd){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}Dd=!1}vs=0,qn=sn=ht=null,no=!1,kc=zd=0,ro=null}function kr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qn===null?ht.memoizedState=qn=s:qn=qn.next=s,qn}function Bn(){if(sn===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=sn.next;var i=qn===null?ht.memoizedState:qn.next;if(i!==null)qn=i,sn=s;else{if(s===null)throw ht.alternate===null?Error(a(467)):Error(a(310));sn=s,s={memoizedState:sn.memoizedState,baseState:sn.baseState,baseQueue:sn.baseQueue,queue:sn.queue,next:null},qn===null?ht.memoizedState=qn=s:qn=qn.next=s}return qn}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cc(s){var i=kc;return kc+=1,ro===null&&(ro=[]),s=t4(ro,s,i),i=ht,(qn===null?i.memoizedState:qn.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?G4:gf),s}function Rd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Cc(s);if(s.$$typeof===A)return mr(s)}throw Error(a(438,String(s)))}function sf(s){var i=null,u=ht.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var h=ht.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(i={data:h.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Od(),ht.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(s),h=0;h<s;h++)u[h]=I;return i.index++,u}function ys(s,i){return typeof i=="function"?i(s):i}function Ld(s){var i=Bn();return lf(i,sn,s)}function lf(s,i,u){var h=s.queue;if(h===null)throw Error(a(311));h.lastRenderedReducer=u;var g=s.baseQueue,v=h.pending;if(v!==null){if(g!==null){var _=g.next;g.next=v.next,v.next=_}i.baseQueue=g=v,h.pending=null}if(v=s.baseState,g===null)s.memoizedState=v;else{i=g.next;var P=_=null,W=null,me=i,Se=!1;do{var Ce=me.lane&-536870913;if(Ce!==me.lane?(At&Ce)===Ce:(vs&Ce)===Ce){var xe=me.revertLane;if(xe===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),Ce===Qi&&(Se=!0);else if((vs&xe)===xe){me=me.next,xe===Qi&&(Se=!0);continue}else Ce={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},W===null?(P=W=Ce,_=v):W=W.next=Ce,ht.lanes|=xe,sl|=xe;Ce=me.action,ei&&u(v,Ce),v=me.hasEagerState?me.eagerState:u(v,Ce)}else xe={lane:Ce,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},W===null?(P=W=xe,_=v):W=W.next=xe,ht.lanes|=Ce,sl|=Ce;me=me.next}while(me!==null&&me!==i);if(W===null?_=v:W.next=P,!Jr(v,s.memoizedState)&&(Hn=!0,Se&&(u=Zi,u!==null)))throw u;s.memoizedState=v,s.baseState=_,s.baseQueue=W,h.lastRenderedState=v}return g===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function of(s){var i=Bn(),u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=s;var h=u.dispatch,g=u.pending,v=i.memoizedState;if(g!==null){u.pending=null;var _=g=g.next;do v=s(v,_.action),_=_.next;while(_!==g);Jr(v,i.memoizedState)||(Hn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),u.lastRenderedState=v}return[v,h]}function m4(s,i,u){var h=ht,g=Bn(),v=Rt;if(v){if(u===void 0)throw Error(a(407));u=u()}else u=i();var _=!Jr((sn||g).memoizedState,u);if(_&&(g.memoizedState=u,Hn=!0),g=g.queue,df(p4.bind(null,h,g,s),[s]),g.getSnapshot!==i||_||qn!==null&&qn.memoizedState.tag&1){if(h.flags|=2048,ao(9,{destroy:void 0},f4.bind(null,h,g,u,i),null),hn===null)throw Error(a(349));v||(vs&127)!==0||h4(h,i,u)}return u}function h4(s,i,u){s.flags|=16384,s={getSnapshot:i,value:u},i=ht.updateQueue,i===null?(i=Od(),ht.updateQueue=i,i.stores=[s]):(u=i.stores,u===null?i.stores=[s]:u.push(s))}function f4(s,i,u,h){i.value=u,i.getSnapshot=h,x4(i)&&g4(s)}function p4(s,i,u){return u(function(){x4(i)&&g4(s)})}function x4(s){var i=s.getSnapshot;s=s.value;try{var u=i();return!Jr(s,u)}catch{return!0}}function g4(s){var i=Vl(s,2);i!==null&&Ir(i,s,2)}function cf(s){var i=kr();if(typeof s=="function"){var u=s;if(s=u(),ei){dt(!0);try{u()}finally{dt(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:s},i}function v4(s,i,u,h){return s.baseState=u,lf(s,sn,typeof h=="function"?h:ys)}function Tk(s,i,u,h,g){if(Fd(s))throw Error(a(485));if(s=i.action,s!==null){var v={payload:g,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){v.listeners.push(_)}};H.T!==null?u(!0):v.isTransition=!1,h(v),u=i.pending,u===null?(v.next=i.pending=v,y4(i,v)):(v.next=u.next,i.pending=u.next=v)}}function y4(s,i){var u=i.action,h=i.payload,g=s.state;if(i.isTransition){var v=H.T,_={};H.T=_;try{var P=u(g,h),W=H.S;W!==null&&W(_,P),b4(s,i,P)}catch(me){uf(s,i,me)}finally{v!==null&&_.types!==null&&(v.types=_.types),H.T=v}}else try{v=u(g,h),b4(s,i,v)}catch(me){uf(s,i,me)}}function b4(s,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){w4(s,i,h)},function(h){return uf(s,i,h)}):w4(s,i,u)}function w4(s,i,u){i.status="fulfilled",i.value=u,j4(i),s.state=u,i=s.pending,i!==null&&(u=i.next,u===i?s.pending=null:(u=u.next,i.next=u,y4(s,u)))}function uf(s,i,u){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do i.status="rejected",i.reason=u,j4(i),i=i.next;while(i!==h)}s.action=null}function j4(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function N4(s,i){return i}function S4(s,i){if(Rt){var u=hn.formState;if(u!==null){e:{var h=ht;if(Rt){if(jn){t:{for(var g=jn,v=ba;g.nodeType!==8;){if(!v){g=null;break t}if(g=ja(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){jn=ja(g.nextSibling),h=g.data==="F!";break e}}Ks(h)}h=!1}h&&(i=u[0])}}return u=kr(),u.memoizedState=u.baseState=i,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N4,lastRenderedState:i},u.queue=h,u=U4.bind(null,ht,h),h.dispatch=u,h=cf(!1),v=xf.bind(null,ht,!1,h.queue),h=kr(),g={state:i,dispatch:null,action:s,pending:null},h.queue=g,u=Tk.bind(null,ht,g,v,u),g.dispatch=u,h.memoizedState=s,[i,u,!1]}function k4(s){var i=Bn();return C4(i,sn,s)}function C4(s,i,u){if(i=lf(s,i,N4)[0],s=Ld(ys)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var h=Cc(i)}catch(_){throw _===Ji?Cd:_}else h=i;i=Bn();var g=i.queue,v=g.dispatch;return u!==i.memoizedState&&(ht.flags|=2048,ao(9,{destroy:void 0},_k.bind(null,g,u),null)),[h,v,s]}function _k(s,i){s.action=i}function T4(s){var i=Bn(),u=sn;if(u!==null)return C4(i,u,s);Bn(),i=i.memoizedState,u=Bn();var h=u.queue.dispatch;return u.memoizedState=s,[i,h,!1]}function ao(s,i,u,h){return s={tag:s,create:u,deps:h,inst:i,next:null},i=ht.updateQueue,i===null&&(i=Od(),ht.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=s.next=s:(h=u.next,u.next=s,s.next=h,i.lastEffect=s),s}function _4(){return Bn().memoizedState}function Bd(s,i,u,h){var g=kr();ht.flags|=s,g.memoizedState=ao(1|i,{destroy:void 0},u,h===void 0?null:h)}function Pd(s,i,u,h){var g=Bn();h=h===void 0?null:h;var v=g.memoizedState.inst;sn!==null&&h!==null&&ef(h,sn.memoizedState.deps)?g.memoizedState=ao(i,v,u,h):(ht.flags|=s,g.memoizedState=ao(1|i,v,u,h))}function E4(s,i){Bd(8390656,8,s,i)}function df(s,i){Pd(2048,8,s,i)}function Ek(s){ht.flags|=4;var i=ht.updateQueue;if(i===null)i=Od(),ht.updateQueue=i,i.events=[s];else{var u=i.events;u===null?i.events=[s]:u.push(s)}}function M4(s){var i=Bn().memoizedState;return Ek({ref:i,nextImpl:s}),function(){if((Vt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function A4(s,i){return Pd(4,2,s,i)}function D4(s,i){return Pd(4,4,s,i)}function z4(s,i){if(typeof i=="function"){s=s();var u=i(s);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function O4(s,i,u){u=u!=null?u.concat([s]):null,Pd(4,4,z4.bind(null,i,s),u)}function mf(){}function R4(s,i){var u=Bn();i=i===void 0?null:i;var h=u.memoizedState;return i!==null&&ef(i,h[1])?h[0]:(u.memoizedState=[s,i],s)}function L4(s,i){var u=Bn();i=i===void 0?null:i;var h=u.memoizedState;if(i!==null&&ef(i,h[1]))return h[0];if(h=s(),ei){dt(!0);try{s()}finally{dt(!1)}}return u.memoizedState=[h,i],h}function hf(s,i,u){return u===void 0||(vs&1073741824)!==0&&(At&261930)===0?s.memoizedState=i:(s.memoizedState=u,s=B2(),ht.lanes|=s,sl|=s,u)}function B4(s,i,u,h){return Jr(u,i)?u:to.current!==null?(s=hf(s,u,h),Jr(s,i)||(Hn=!0),s):(vs&42)===0||(vs&1073741824)!==0&&(At&261930)===0?(Hn=!0,s.memoizedState=u):(s=B2(),ht.lanes|=s,sl|=s,i)}function P4(s,i,u,h,g){var v=le.p;le.p=v!==0&&8>v?v:8;var _=H.T,P={};H.T=P,xf(s,!1,i,u);try{var W=g(),me=H.S;if(me!==null&&me(P,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var Se=Sk(W,h);Tc(s,i,Se,sa(s))}else Tc(s,i,h,sa(s))}catch(Ce){Tc(s,i,{then:function(){},status:"rejected",reason:Ce},sa())}finally{le.p=v,_!==null&&P.types!==null&&(_.types=P.types),H.T=_}}function Mk(){}function ff(s,i,u,h){if(s.tag!==5)throw Error(a(476));var g=F4(s).queue;P4(s,g,i,re,u===null?Mk:function(){return I4(s),u(h)})}function F4(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:re},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:u},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function I4(s){var i=F4(s);i.next===null&&(i=s.alternate.memoizedState),Tc(s,i.next.queue,{},sa())}function pf(){return mr($c)}function q4(){return Bn().memoizedState}function H4(){return Bn().memoizedState}function Ak(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var u=sa();s=Js(u);var h=el(i,s,u);h!==null&&(Ir(h,i,u),jc(h,i,u)),i={cache:Uh()},s.payload=i;return}i=i.return}}function Dk(s,i,u){var h=sa();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Fd(s)?$4(i,u):(u=Dh(s,i,u,h),u!==null&&(Ir(u,s,h),V4(u,i,h)))}function U4(s,i,u){var h=sa();Tc(s,i,u,h)}function Tc(s,i,u,h){var g={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Fd(s))$4(i,g);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var _=i.lastRenderedState,P=v(_,u);if(g.hasEagerState=!0,g.eagerState=P,Jr(P,_))return yd(s,i,g,0),hn===null&&vd(),!1}catch{}finally{}if(u=Dh(s,i,g,h),u!==null)return Ir(u,s,h),V4(u,i,h),!0}return!1}function xf(s,i,u,h){if(h={lane:2,revertLane:Wf(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Fd(s)){if(i)throw Error(a(479))}else i=Dh(s,u,h,2),i!==null&&Ir(i,s,2)}function Fd(s){var i=s.alternate;return s===ht||i!==null&&i===ht}function $4(s,i){no=Dd=!0;var u=s.pending;u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i}function V4(s,i,u){if((u&4194048)!==0){var h=i.lanes;h&=s.pendingLanes,u|=h,i.lanes=u,Kg(s,u)}}var _c={readContext:mr,use:Rd,useCallback:zn,useContext:zn,useEffect:zn,useImperativeHandle:zn,useLayoutEffect:zn,useInsertionEffect:zn,useMemo:zn,useReducer:zn,useRef:zn,useState:zn,useDebugValue:zn,useDeferredValue:zn,useTransition:zn,useSyncExternalStore:zn,useId:zn,useHostTransitionStatus:zn,useFormState:zn,useActionState:zn,useOptimistic:zn,useMemoCache:zn,useCacheRefresh:zn};_c.useEffectEvent=zn;var G4={readContext:mr,use:Rd,useCallback:function(s,i){return kr().memoizedState=[s,i===void 0?null:i],s},useContext:mr,useEffect:E4,useImperativeHandle:function(s,i,u){u=u!=null?u.concat([s]):null,Bd(4194308,4,z4.bind(null,i,s),u)},useLayoutEffect:function(s,i){return Bd(4194308,4,s,i)},useInsertionEffect:function(s,i){Bd(4,2,s,i)},useMemo:function(s,i){var u=kr();i=i===void 0?null:i;var h=s();if(ei){dt(!0);try{s()}finally{dt(!1)}}return u.memoizedState=[h,i],h},useReducer:function(s,i,u){var h=kr();if(u!==void 0){var g=u(i);if(ei){dt(!0);try{u(i)}finally{dt(!1)}}}else g=i;return h.memoizedState=h.baseState=g,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:g},h.queue=s,s=s.dispatch=Dk.bind(null,ht,s),[h.memoizedState,s]},useRef:function(s){var i=kr();return s={current:s},i.memoizedState=s},useState:function(s){s=cf(s);var i=s.queue,u=U4.bind(null,ht,i);return i.dispatch=u,[s.memoizedState,u]},useDebugValue:mf,useDeferredValue:function(s,i){var u=kr();return hf(u,s,i)},useTransition:function(){var s=cf(!1);return s=P4.bind(null,ht,s.queue,!0,!1),kr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,u){var h=ht,g=kr();if(Rt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),hn===null)throw Error(a(349));(At&127)!==0||h4(h,i,u)}g.memoizedState=u;var v={value:u,getSnapshot:i};return g.queue=v,E4(p4.bind(null,h,v,s),[s]),h.flags|=2048,ao(9,{destroy:void 0},f4.bind(null,h,v,u,i),null),u},useId:function(){var s=kr(),i=hn.identifierPrefix;if(Rt){var u=Ga,h=Va;u=(h&~(1<<32-mt(h)-1)).toString(32)+u,i="_"+i+"R_"+u,u=zd++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=kk++,i="_"+i+"r_"+u.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:pf,useFormState:S4,useActionState:S4,useOptimistic:function(s){var i=kr();i.memoizedState=i.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=xf.bind(null,ht,!0,u),u.dispatch=i,[s,i]},useMemoCache:sf,useCacheRefresh:function(){return kr().memoizedState=Ak.bind(null,ht)},useEffectEvent:function(s){var i=kr(),u={impl:s};return i.memoizedState=u,function(){if((Vt&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},gf={readContext:mr,use:Rd,useCallback:R4,useContext:mr,useEffect:df,useImperativeHandle:O4,useInsertionEffect:A4,useLayoutEffect:D4,useMemo:L4,useReducer:Ld,useRef:_4,useState:function(){return Ld(ys)},useDebugValue:mf,useDeferredValue:function(s,i){var u=Bn();return B4(u,sn.memoizedState,s,i)},useTransition:function(){var s=Ld(ys)[0],i=Bn().memoizedState;return[typeof s=="boolean"?s:Cc(s),i]},useSyncExternalStore:m4,useId:q4,useHostTransitionStatus:pf,useFormState:k4,useActionState:k4,useOptimistic:function(s,i){var u=Bn();return v4(u,sn,s,i)},useMemoCache:sf,useCacheRefresh:H4};gf.useEffectEvent=M4;var Y4={readContext:mr,use:Rd,useCallback:R4,useContext:mr,useEffect:df,useImperativeHandle:O4,useInsertionEffect:A4,useLayoutEffect:D4,useMemo:L4,useReducer:of,useRef:_4,useState:function(){return of(ys)},useDebugValue:mf,useDeferredValue:function(s,i){var u=Bn();return sn===null?hf(u,s,i):B4(u,sn.memoizedState,s,i)},useTransition:function(){var s=of(ys)[0],i=Bn().memoizedState;return[typeof s=="boolean"?s:Cc(s),i]},useSyncExternalStore:m4,useId:q4,useHostTransitionStatus:pf,useFormState:T4,useActionState:T4,useOptimistic:function(s,i){var u=Bn();return sn!==null?v4(u,sn,s,i):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:sf,useCacheRefresh:H4};Y4.useEffectEvent=M4;function vf(s,i,u,h){i=s.memoizedState,u=u(h,i),u=u==null?i:x({},i,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var yf={enqueueSetState:function(s,i,u){s=s._reactInternals;var h=sa(),g=Js(h);g.payload=i,u!=null&&(g.callback=u),i=el(s,g,h),i!==null&&(Ir(i,s,h),jc(i,s,h))},enqueueReplaceState:function(s,i,u){s=s._reactInternals;var h=sa(),g=Js(h);g.tag=1,g.payload=i,u!=null&&(g.callback=u),i=el(s,g,h),i!==null&&(Ir(i,s,h),jc(i,s,h))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var u=sa(),h=Js(u);h.tag=2,i!=null&&(h.callback=i),i=el(s,h,u),i!==null&&(Ir(i,s,u),jc(i,s,u))}};function W4(s,i,u,h,g,v,_){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,v,_):i.prototype&&i.prototype.isPureReactComponent?!fc(u,h)||!fc(g,v):!0}function X4(s,i,u,h){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,h),i.state!==s&&yf.enqueueReplaceState(i,i.state,null)}function ti(s,i){var u=i;if("ref"in i){u={};for(var h in i)h!=="ref"&&(u[h]=i[h])}if(s=s.defaultProps){u===i&&(u=x({},u));for(var g in s)u[g]===void 0&&(u[g]=s[g])}return u}function K4(s){gd(s)}function Q4(s){console.error(s)}function Z4(s){gd(s)}function Id(s,i){try{var u=s.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(h){setTimeout(function(){throw h})}}function J4(s,i,u){try{var h=s.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function bf(s,i,u){return u=Js(u),u.tag=3,u.payload={element:null},u.callback=function(){Id(s,i)},u}function e2(s){return s=Js(s),s.tag=3,s}function t2(s,i,u,h){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var v=h.value;s.payload=function(){return g(v)},s.callback=function(){J4(i,u,h)}}var _=u.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(s.callback=function(){J4(i,u,h),typeof g!="function"&&(ll===null?ll=new Set([this]):ll.add(this));var P=h.stack;this.componentDidCatch(h.value,{componentStack:P!==null?P:""})})}function zk(s,i,u,h,g){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(i=u.alternate,i!==null&&Ki(i,u,g,!0),u=ta.current,u!==null){switch(u.tag){case 31:case 13:return wa===null?Zd():u.alternate===null&&On===0&&(On=3),u.flags&=-257,u.flags|=65536,u.lanes=g,h===Td?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([h]):i.add(h),Vf(s,h,g)),!1;case 22:return u.flags|=65536,h===Td?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([h]):u.add(h)),Vf(s,h,g)),!1}throw Error(a(435,u.tag))}return Vf(s,h,g),Zd(),!1}if(Rt)return i=ta.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,h!==Ph&&(s=Error(a(422),{cause:h}),gc(ga(s,u)))):(h!==Ph&&(i=Error(a(423),{cause:h}),gc(ga(i,u))),s=s.current.alternate,s.flags|=65536,g&=-g,s.lanes|=g,h=ga(h,u),g=bf(s.stateNode,h,g),Xh(s,g),On!==4&&(On=2)),!1;var v=Error(a(520),{cause:h});if(v=ga(v,u),Lc===null?Lc=[v]:Lc.push(v),On!==4&&(On=2),i===null)return!0;h=ga(h,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,s=g&-g,u.lanes|=s,s=bf(u.stateNode,h,s),Xh(u,s),!1;case 1:if(i=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ll===null||!ll.has(v))))return u.flags|=65536,g&=-g,u.lanes|=g,g=e2(g),t2(g,s,u,h),Xh(u,g),!1}u=u.return}while(u!==null);return!1}var wf=Error(a(461)),Hn=!1;function hr(s,i,u,h){i.child=s===null?s4(i,null,u,h):Jl(i,s.child,u,h)}function n2(s,i,u,h,g){u=u.render;var v=i.ref;if("ref"in h){var _={};for(var P in h)P!=="ref"&&(_[P]=h[P])}else _=h;return Xl(i),h=tf(s,i,u,_,v,g),P=nf(),s!==null&&!Hn?(rf(s,i,g),bs(s,i,g)):(Rt&&P&&Lh(i),i.flags|=1,hr(s,i,h,g),i.child)}function r2(s,i,u,h,g){if(s===null){var v=u.type;return typeof v=="function"&&!zh(v)&&v.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=v,a2(s,i,v,h,g)):(s=wd(u.type,null,h,i,i.mode,g),s.ref=i.ref,s.return=i,i.child=s)}if(v=s.child,!Ef(s,g)){var _=v.memoizedProps;if(u=u.compare,u=u!==null?u:fc,u(_,h)&&s.ref===i.ref)return bs(s,i,g)}return i.flags|=1,s=fs(v,h),s.ref=i.ref,s.return=i,i.child=s}function a2(s,i,u,h,g){if(s!==null){var v=s.memoizedProps;if(fc(v,h)&&s.ref===i.ref)if(Hn=!1,i.pendingProps=h=v,Ef(s,g))(s.flags&131072)!==0&&(Hn=!0);else return i.lanes=s.lanes,bs(s,i,g)}return jf(s,i,u,h,g)}function s2(s,i,u,h){var g=h.children,v=s!==null?s.memoizedState:null;if(s===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,s!==null){for(h=i.child=s.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;h=g&~v}else h=0,i.child=null;return l2(s,i,v,u,h)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&kd(i,v!==null?v.cachePool:null),v!==null?o4(i,v):Qh(),c4(i);else return h=i.lanes=536870912,l2(s,i,v!==null?v.baseLanes|u:u,u,h)}else v!==null?(kd(i,v.cachePool),o4(i,v),nl(),i.memoizedState=null):(s!==null&&kd(i,null),Qh(),nl());return hr(s,i,g,u),i.child}function Ec(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function l2(s,i,u,h,g){var v=Vh();return v=v===null?null:{parent:In._currentValue,pool:v},i.memoizedState={baseLanes:u,cachePool:v},s!==null&&kd(i,null),Qh(),c4(i),s!==null&&Ki(s,i,h,!0),i.childLanes=g,null}function qd(s,i){return i=Ud({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function i2(s,i,u){return Jl(i,s.child,null,u),s=qd(i,i.pendingProps),s.flags|=2,na(i),i.memoizedState=null,s}function Ok(s,i,u){var h=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(Rt){if(h.mode==="hidden")return s=qd(i,h),i.lanes=536870912,Ec(null,s);if(Jh(i),(s=jn)?(s=yy(s,ba),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Ws!==null?{id:Va,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},u=$v(s),u.return=i,i.child=u,dr=i,jn=null)):s=null,s===null)throw Ks(i);return i.lanes=536870912,null}return qd(i,h)}var v=s.memoizedState;if(v!==null){var _=v.dehydrated;if(Jh(i),g)if(i.flags&256)i.flags&=-257,i=i2(s,i,u);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(a(558));else if(Hn||Ki(s,i,u,!1),g=(u&s.childLanes)!==0,Hn||g){if(h=hn,h!==null&&(_=Qg(h,u),_!==0&&_!==v.retryLane))throw v.retryLane=_,Vl(s,_),Ir(h,s,_),wf;Zd(),i=i2(s,i,u)}else s=v.treeContext,jn=ja(_.nextSibling),dr=i,Rt=!0,Xs=null,ba=!1,s!==null&&Yv(i,s),i=qd(i,h),i.flags|=4096;return i}return s=fs(s.child,{mode:h.mode,children:h.children}),s.ref=i.ref,i.child=s,s.return=i,s}function Hd(s,i){var u=i.ref;if(u===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(s===null||s.ref!==u)&&(i.flags|=4194816)}}function jf(s,i,u,h,g){return Xl(i),u=tf(s,i,u,h,void 0,g),h=nf(),s!==null&&!Hn?(rf(s,i,g),bs(s,i,g)):(Rt&&h&&Lh(i),i.flags|=1,hr(s,i,u,g),i.child)}function o2(s,i,u,h,g,v){return Xl(i),i.updateQueue=null,u=d4(i,h,u,g),u4(s),h=nf(),s!==null&&!Hn?(rf(s,i,v),bs(s,i,v)):(Rt&&h&&Lh(i),i.flags|=1,hr(s,i,u,v),i.child)}function c2(s,i,u,h,g){if(Xl(i),i.stateNode===null){var v=Gi,_=u.contextType;typeof _=="object"&&_!==null&&(v=mr(_)),v=new u(h,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=yf,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=h,v.state=i.memoizedState,v.refs={},Yh(i),_=u.contextType,v.context=typeof _=="object"&&_!==null?mr(_):Gi,v.state=i.memoizedState,_=u.getDerivedStateFromProps,typeof _=="function"&&(vf(i,u,_,h),v.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(_=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),_!==v.state&&yf.enqueueReplaceState(v,v.state,null),Sc(i,h,v,g),Nc(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),h=!0}else if(s===null){v=i.stateNode;var P=i.memoizedProps,W=ti(u,P);v.props=W;var me=v.context,Se=u.contextType;_=Gi,typeof Se=="object"&&Se!==null&&(_=mr(Se));var Ce=u.getDerivedStateFromProps;Se=typeof Ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",P=i.pendingProps!==P,Se||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(P||me!==_)&&X4(i,v,h,_),Zs=!1;var xe=i.memoizedState;v.state=xe,Sc(i,h,v,g),Nc(),me=i.memoizedState,P||xe!==me||Zs?(typeof Ce=="function"&&(vf(i,u,Ce,h),me=i.memoizedState),(W=Zs||W4(i,u,W,h,xe,me,_))?(Se||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=me),v.props=h,v.state=me,v.context=_,h=W):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{v=i.stateNode,Wh(s,i),_=i.memoizedProps,Se=ti(u,_),v.props=Se,Ce=i.pendingProps,xe=v.context,me=u.contextType,W=Gi,typeof me=="object"&&me!==null&&(W=mr(me)),P=u.getDerivedStateFromProps,(me=typeof P=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_!==Ce||xe!==W)&&X4(i,v,h,W),Zs=!1,xe=i.memoizedState,v.state=xe,Sc(i,h,v,g),Nc();var ye=i.memoizedState;_!==Ce||xe!==ye||Zs||s!==null&&s.dependencies!==null&&Nd(s.dependencies)?(typeof P=="function"&&(vf(i,u,P,h),ye=i.memoizedState),(Se=Zs||W4(i,u,Se,h,xe,ye,W)||s!==null&&s.dependencies!==null&&Nd(s.dependencies))?(me||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(h,ye,W),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(h,ye,W)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||_===s.memoizedProps&&xe===s.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||_===s.memoizedProps&&xe===s.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=ye),v.props=h,v.state=ye,v.context=W,h=Se):(typeof v.componentDidUpdate!="function"||_===s.memoizedProps&&xe===s.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||_===s.memoizedProps&&xe===s.memoizedState||(i.flags|=1024),h=!1)}return v=h,Hd(s,i),h=(i.flags&128)!==0,v||h?(v=i.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,s!==null&&h?(i.child=Jl(i,s.child,null,g),i.child=Jl(i,null,u,g)):hr(s,i,u,g),i.memoizedState=v.state,s=i.child):s=bs(s,i,g),s}function u2(s,i,u,h){return Yl(),i.flags|=256,hr(s,i,u,h),i.child}var Nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sf(s){return{baseLanes:s,cachePool:Jv()}}function kf(s,i,u){return s=s!==null?s.childLanes&~u:0,i&&(s|=aa),s}function d2(s,i,u){var h=i.pendingProps,g=!1,v=(i.flags&128)!==0,_;if((_=v)||(_=s!==null&&s.memoizedState===null?!1:(Ln.current&2)!==0),_&&(g=!0,i.flags&=-129),_=(i.flags&32)!==0,i.flags&=-33,s===null){if(Rt){if(g?tl(i):nl(),(s=jn)?(s=yy(s,ba),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Ws!==null?{id:Va,overflow:Ga}:null,retryLane:536870912,hydrationErrors:null},u=$v(s),u.return=i,i.child=u,dr=i,jn=null)):s=null,s===null)throw Ks(i);return ip(s)?i.lanes=32:i.lanes=536870912,null}var P=h.children;return h=h.fallback,g?(nl(),g=i.mode,P=Ud({mode:"hidden",children:P},g),h=Gl(h,g,u,null),P.return=i,h.return=i,P.sibling=h,i.child=P,h=i.child,h.memoizedState=Sf(u),h.childLanes=kf(s,_,u),i.memoizedState=Nf,Ec(null,h)):(tl(i),Cf(i,P))}var W=s.memoizedState;if(W!==null&&(P=W.dehydrated,P!==null)){if(v)i.flags&256?(tl(i),i.flags&=-257,i=Tf(s,i,u)):i.memoizedState!==null?(nl(),i.child=s.child,i.flags|=128,i=null):(nl(),P=h.fallback,g=i.mode,h=Ud({mode:"visible",children:h.children},g),P=Gl(P,g,u,null),P.flags|=2,h.return=i,P.return=i,h.sibling=P,i.child=h,Jl(i,s.child,null,u),h=i.child,h.memoizedState=Sf(u),h.childLanes=kf(s,_,u),i.memoizedState=Nf,i=Ec(null,h));else if(tl(i),ip(P)){if(_=P.nextSibling&&P.nextSibling.dataset,_)var me=_.dgst;_=me,h=Error(a(419)),h.stack="",h.digest=_,gc({value:h,source:null,stack:null}),i=Tf(s,i,u)}else if(Hn||Ki(s,i,u,!1),_=(u&s.childLanes)!==0,Hn||_){if(_=hn,_!==null&&(h=Qg(_,u),h!==0&&h!==W.retryLane))throw W.retryLane=h,Vl(s,h),Ir(_,s,h),wf;lp(P)||Zd(),i=Tf(s,i,u)}else lp(P)?(i.flags|=192,i.child=s.child,i=null):(s=W.treeContext,jn=ja(P.nextSibling),dr=i,Rt=!0,Xs=null,ba=!1,s!==null&&Yv(i,s),i=Cf(i,h.children),i.flags|=4096);return i}return g?(nl(),P=h.fallback,g=i.mode,W=s.child,me=W.sibling,h=fs(W,{mode:"hidden",children:h.children}),h.subtreeFlags=W.subtreeFlags&65011712,me!==null?P=fs(me,P):(P=Gl(P,g,u,null),P.flags|=2),P.return=i,h.return=i,h.sibling=P,i.child=h,Ec(null,h),h=i.child,P=s.child.memoizedState,P===null?P=Sf(u):(g=P.cachePool,g!==null?(W=In._currentValue,g=g.parent!==W?{parent:W,pool:W}:g):g=Jv(),P={baseLanes:P.baseLanes|u,cachePool:g}),h.memoizedState=P,h.childLanes=kf(s,_,u),i.memoizedState=Nf,Ec(s.child,h)):(tl(i),u=s.child,s=u.sibling,u=fs(u,{mode:"visible",children:h.children}),u.return=i,u.sibling=null,s!==null&&(_=i.deletions,_===null?(i.deletions=[s],i.flags|=16):_.push(s)),i.child=u,i.memoizedState=null,u)}function Cf(s,i){return i=Ud({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function Ud(s,i){return s=ea(22,s,null,i),s.lanes=0,s}function Tf(s,i,u){return Jl(i,s.child,null,u),s=Cf(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function m2(s,i,u){s.lanes|=i;var h=s.alternate;h!==null&&(h.lanes|=i),qh(s.return,i,u)}function _f(s,i,u,h,g,v){var _=s.memoizedState;_===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g,treeForkCount:v}:(_.isBackwards=i,_.rendering=null,_.renderingStartTime=0,_.last=h,_.tail=u,_.tailMode=g,_.treeForkCount=v)}function h2(s,i,u){var h=i.pendingProps,g=h.revealOrder,v=h.tail;h=h.children;var _=Ln.current,P=(_&2)!==0;if(P?(_=_&1|2,i.flags|=128):_&=1,z(Ln,_),hr(s,i,h,u),h=Rt?xc:0,!P&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&m2(s,u,i);else if(s.tag===19)m2(s,u,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(g){case"forwards":for(u=i.child,g=null;u!==null;)s=u.alternate,s!==null&&Ad(s)===null&&(g=u),u=u.sibling;u=g,u===null?(g=i.child,i.child=null):(g=u.sibling,u.sibling=null),_f(i,!1,g,u,v,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,g=i.child,i.child=null;g!==null;){if(s=g.alternate,s!==null&&Ad(s)===null){i.child=g;break}s=g.sibling,g.sibling=u,u=g,g=s}_f(i,!0,u,null,v,h);break;case"together":_f(i,!1,null,null,void 0,h);break;default:i.memoizedState=null}return i.child}function bs(s,i,u){if(s!==null&&(i.dependencies=s.dependencies),sl|=i.lanes,(u&i.childLanes)===0)if(s!==null){if(Ki(s,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(a(153));if(i.child!==null){for(s=i.child,u=fs(s,s.pendingProps),i.child=u,u.return=i;s.sibling!==null;)s=s.sibling,u=u.sibling=fs(s,s.pendingProps),u.return=i;u.sibling=null}return i.child}function Ef(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&Nd(s)))}function Rk(s,i,u){switch(i.tag){case 3:De(i,i.stateNode.containerInfo),Qs(i,In,s.memoizedState.cache),Yl();break;case 27:case 5:He(i);break;case 4:De(i,i.stateNode.containerInfo);break;case 10:Qs(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Jh(i),null;break;case 13:var h=i.memoizedState;if(h!==null)return h.dehydrated!==null?(tl(i),i.flags|=128,null):(u&i.child.childLanes)!==0?d2(s,i,u):(tl(i),s=bs(s,i,u),s!==null?s.sibling:null);tl(i);break;case 19:var g=(s.flags&128)!==0;if(h=(u&i.childLanes)!==0,h||(Ki(s,i,u,!1),h=(u&i.childLanes)!==0),g){if(h)return h2(s,i,u);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),z(Ln,Ln.current),h)break;return null;case 22:return i.lanes=0,s2(s,i,u,i.pendingProps);case 24:Qs(i,In,s.memoizedState.cache)}return bs(s,i,u)}function f2(s,i,u){if(s!==null)if(s.memoizedProps!==i.pendingProps)Hn=!0;else{if(!Ef(s,u)&&(i.flags&128)===0)return Hn=!1,Rk(s,i,u);Hn=(s.flags&131072)!==0}else Hn=!1,Rt&&(i.flags&1048576)!==0&&Gv(i,xc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var h=i.pendingProps;if(s=Ql(i.elementType),i.type=s,typeof s=="function")zh(s)?(h=ti(s,h),i.tag=1,i=c2(null,i,s,h,u)):(i.tag=0,i=jf(null,i,s,h,u));else{if(s!=null){var g=s.$$typeof;if(g===R){i.tag=11,i=n2(null,i,s,h,u);break e}else if(g===L){i.tag=14,i=r2(null,i,s,h,u);break e}}throw i=J(s)||s,Error(a(306,i,""))}}return i;case 0:return jf(s,i,i.type,i.pendingProps,u);case 1:return h=i.type,g=ti(h,i.pendingProps),c2(s,i,h,g,u);case 3:e:{if(De(i,i.stateNode.containerInfo),s===null)throw Error(a(387));h=i.pendingProps;var v=i.memoizedState;g=v.element,Wh(s,i),Sc(i,h,null,u);var _=i.memoizedState;if(h=_.cache,Qs(i,In,h),h!==v.cache&&Hh(i,[In],u,!0),Nc(),h=_.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:_.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=u2(s,i,h,u);break e}else if(h!==g){g=ga(Error(a(424)),i),gc(g),i=u2(s,i,h,u);break e}else{switch(s=i.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(jn=ja(s.firstChild),dr=i,Rt=!0,Xs=null,ba=!0,u=s4(i,null,h,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Yl(),h===g){i=bs(s,i,u);break e}hr(s,i,h,u)}i=i.child}return i;case 26:return Hd(s,i),s===null?(u=ky(i.type,null,i.pendingProps,null))?i.memoizedState=u:Rt||(u=i.type,s=i.pendingProps,h=s0(ce.current).createElement(u),h[ur]=i,h[Or]=s,fr(h,u,s),sr(h),i.stateNode=h):i.memoizedState=ky(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return He(i),s===null&&Rt&&(h=i.stateNode=jy(i.type,i.pendingProps,ce.current),dr=i,ba=!0,g=jn,ul(i.type)?(op=g,jn=ja(h.firstChild)):jn=g),hr(s,i,i.pendingProps.children,u),Hd(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&Rt&&((g=h=jn)&&(h=dC(h,i.type,i.pendingProps,ba),h!==null?(i.stateNode=h,dr=i,jn=ja(h.firstChild),ba=!1,g=!0):g=!1),g||Ks(i)),He(i),g=i.type,v=i.pendingProps,_=s!==null?s.memoizedProps:null,h=v.children,rp(g,v)?h=null:_!==null&&rp(g,_)&&(i.flags|=32),i.memoizedState!==null&&(g=tf(s,i,Ck,null,null,u),$c._currentValue=g),Hd(s,i),hr(s,i,h,u),i.child;case 6:return s===null&&Rt&&((s=u=jn)&&(u=mC(u,i.pendingProps,ba),u!==null?(i.stateNode=u,dr=i,jn=null,s=!0):s=!1),s||Ks(i)),null;case 13:return d2(s,i,u);case 4:return De(i,i.stateNode.containerInfo),h=i.pendingProps,s===null?i.child=Jl(i,null,h,u):hr(s,i,h,u),i.child;case 11:return n2(s,i,i.type,i.pendingProps,u);case 7:return hr(s,i,i.pendingProps,u),i.child;case 8:return hr(s,i,i.pendingProps.children,u),i.child;case 12:return hr(s,i,i.pendingProps.children,u),i.child;case 10:return h=i.pendingProps,Qs(i,i.type,h.value),hr(s,i,h.children,u),i.child;case 9:return g=i.type._context,h=i.pendingProps.children,Xl(i),g=mr(g),h=h(g),i.flags|=1,hr(s,i,h,u),i.child;case 14:return r2(s,i,i.type,i.pendingProps,u);case 15:return a2(s,i,i.type,i.pendingProps,u);case 19:return h2(s,i,u);case 31:return Ok(s,i,u);case 22:return s2(s,i,u,i.pendingProps);case 24:return Xl(i),h=mr(In),s===null?(g=Vh(),g===null&&(g=hn,v=Uh(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=u),g=v),i.memoizedState={parent:h,cache:g},Yh(i),Qs(i,In,g)):((s.lanes&u)!==0&&(Wh(s,i),Sc(i,null,null,u),Nc()),g=s.memoizedState,v=i.memoizedState,g.parent!==h?(g={parent:h,cache:h},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),Qs(i,In,h)):(h=v.cache,Qs(i,In,h),h!==g.cache&&Hh(i,[In],u,!0))),hr(s,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ws(s){s.flags|=4}function Mf(s,i,u,h,g){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(g&335544128)===g)if(s.stateNode.complete)s.flags|=8192;else if(q2())s.flags|=8192;else throw Zl=Td,Gh}else s.flags&=-16777217}function p2(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!My(i))if(q2())s.flags|=8192;else throw Zl=Td,Gh}function $d(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?Di():536870912,s.lanes|=i,oo|=i)}function Mc(s,i){if(!Rt)switch(s.tailMode){case"hidden":i=s.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Nn(s){var i=s.alternate!==null&&s.alternate.child===s.child,u=0,h=0;if(i)for(var g=s.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&65011712,h|=g.flags&65011712,g.return=s,g=g.sibling;else for(g=s.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=s,g=g.sibling;return s.subtreeFlags|=h,s.childLanes=u,i}function Lk(s,i,u){var h=i.pendingProps;switch(Bh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nn(i),null;case 1:return Nn(i),null;case 3:return u=i.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),i.memoizedState.cache!==h&&(i.flags|=2048),gs(In),oe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Xi(i)?ws(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Fh())),Nn(i),null;case 26:var g=i.type,v=i.memoizedState;return s===null?(ws(i),v!==null?(Nn(i),p2(i,v)):(Nn(i),Mf(i,g,null,h,u))):v?v!==s.memoizedState?(ws(i),Nn(i),p2(i,v)):(Nn(i),i.flags&=-16777217):(s=s.memoizedProps,s!==h&&ws(i),Nn(i),Mf(i,g,s,h,u)),null;case 27:if(at(i),u=ce.current,g=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==h&&ws(i);else{if(!h){if(i.stateNode===null)throw Error(a(166));return Nn(i),null}s=X.current,Xi(i)?Wv(i):(s=jy(g,h,u),i.stateNode=s,ws(i))}return Nn(i),null;case 5:if(at(i),g=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==h&&ws(i);else{if(!h){if(i.stateNode===null)throw Error(a(166));return Nn(i),null}if(v=X.current,Xi(i))Wv(i);else{var _=s0(ce.current);switch(v){case 1:v=_.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=_.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=_.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=_.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=_.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof h.is=="string"?_.createElement("select",{is:h.is}):_.createElement("select"),h.multiple?v.multiple=!0:h.size&&(v.size=h.size);break;default:v=typeof h.is=="string"?_.createElement(g,{is:h.is}):_.createElement(g)}}v[ur]=i,v[Or]=h;e:for(_=i.child;_!==null;){if(_.tag===5||_.tag===6)v.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===i)break e;for(;_.sibling===null;){if(_.return===null||_.return===i)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}i.stateNode=v;e:switch(fr(v,g,h),g){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&ws(i)}}return Nn(i),Mf(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,u),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==h&&ws(i);else{if(typeof h!="string"&&i.stateNode===null)throw Error(a(166));if(s=ce.current,Xi(i)){if(s=i.stateNode,u=i.memoizedProps,h=null,g=dr,g!==null)switch(g.tag){case 27:case 5:h=g.memoizedProps}s[ur]=i,s=!!(s.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||dy(s.nodeValue,u)),s||Ks(i,!0)}else s=s0(s).createTextNode(h),s[ur]=i,i.stateNode=s}return Nn(i),null;case 31:if(u=i.memoizedState,s===null||s.memoizedState!==null){if(h=Xi(i),u!==null){if(s===null){if(!h)throw Error(a(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(557));s[ur]=i}else Yl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nn(i),s=!1}else u=Fh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return i.flags&256?(na(i),i):(na(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nn(i),null;case 13:if(h=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(g=Xi(i),h!==null&&h.dehydrated!==null){if(s===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[ur]=i}else Yl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nn(i),g=!1}else g=Fh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(na(i),i):(na(i),null)}return na(i),(i.flags&128)!==0?(i.lanes=u,i):(u=h!==null,s=s!==null&&s.memoizedState!==null,u&&(h=i.child,g=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(g=h.alternate.memoizedState.cachePool.pool),v=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(v=h.memoizedState.cachePool.pool),v!==g&&(h.flags|=2048)),u!==s&&u&&(i.child.flags|=8192),$d(i,i.updateQueue),Nn(i),null);case 4:return oe(),s===null&&Zf(i.stateNode.containerInfo),Nn(i),null;case 10:return gs(i.type),Nn(i),null;case 19:if(Z(Ln),h=i.memoizedState,h===null)return Nn(i),null;if(g=(i.flags&128)!==0,v=h.rendering,v===null)if(g)Mc(h,!1);else{if(On!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(v=Ad(s),v!==null){for(i.flags|=128,Mc(h,!1),s=v.updateQueue,i.updateQueue=s,$d(i,s),i.subtreeFlags=0,s=u,u=i.child;u!==null;)Uv(u,s),u=u.sibling;return z(Ln,Ln.current&1|2),Rt&&ps(i,h.treeForkCount),i.child}s=s.sibling}h.tail!==null&&$e()>Xd&&(i.flags|=128,g=!0,Mc(h,!1),i.lanes=4194304)}else{if(!g)if(s=Ad(v),s!==null){if(i.flags|=128,g=!0,s=s.updateQueue,i.updateQueue=s,$d(i,s),Mc(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!Rt)return Nn(i),null}else 2*$e()-h.renderingStartTime>Xd&&u!==536870912&&(i.flags|=128,g=!0,Mc(h,!1),i.lanes=4194304);h.isBackwards?(v.sibling=i.child,i.child=v):(s=h.last,s!==null?s.sibling=v:i.child=v,h.last=v)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=$e(),s.sibling=null,u=Ln.current,z(Ln,g?u&1|2:u&1),Rt&&ps(i,h.treeForkCount),s):(Nn(i),null);case 22:case 23:return na(i),Zh(),h=i.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(i.flags|=8192):h&&(i.flags|=8192),h?(u&536870912)!==0&&(i.flags&128)===0&&(Nn(i),i.subtreeFlags&6&&(i.flags|=8192)):Nn(i),u=i.updateQueue,u!==null&&$d(i,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==u&&(i.flags|=2048),s!==null&&Z(Kl),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),gs(In),Nn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Bk(s,i){switch(Bh(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return gs(In),oe(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return at(i),null;case 31:if(i.memoizedState!==null){if(na(i),i.alternate===null)throw Error(a(340));Yl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(na(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Yl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return Z(Ln),null;case 4:return oe(),null;case 10:return gs(i.type),null;case 22:case 23:return na(i),Zh(),s!==null&&Z(Kl),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return gs(In),null;case 25:return null;default:return null}}function x2(s,i){switch(Bh(i),i.tag){case 3:gs(In),oe();break;case 26:case 27:case 5:at(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&na(i);break;case 13:na(i);break;case 19:Z(Ln);break;case 10:gs(i.type);break;case 22:case 23:na(i),Zh(),s!==null&&Z(Kl);break;case 24:gs(In)}}function Ac(s,i){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&s)===s){h=void 0;var v=u.create,_=u.inst;h=v(),_.destroy=h}u=u.next}while(u!==g)}}catch(P){nn(i,i.return,P)}}function rl(s,i,u){try{var h=i.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var v=g.next;h=v;do{if((h.tag&s)===s){var _=h.inst,P=_.destroy;if(P!==void 0){_.destroy=void 0,g=i;var W=u,me=P;try{me()}catch(Se){nn(g,W,Se)}}}h=h.next}while(h!==v)}}catch(Se){nn(i,i.return,Se)}}function g2(s){var i=s.updateQueue;if(i!==null){var u=s.stateNode;try{i4(i,u)}catch(h){nn(s,s.return,h)}}}function v2(s,i,u){u.props=ti(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(h){nn(s,i,h)}}function Dc(s,i){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof u=="function"?s.refCleanup=u(h):u.current=h}}catch(g){nn(s,i,g)}}function Ya(s,i){var u=s.ref,h=s.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(g){nn(s,i,g)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){nn(s,i,g)}else u.current=null}function y2(s){var i=s.type,u=s.memoizedProps,h=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(g){nn(s,s.return,g)}}function Af(s,i,u){try{var h=s.stateNode;sC(h,s.type,u,i),h[Or]=i}catch(g){nn(s,s.return,g)}}function b2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ul(s.type)||s.tag===4}function Df(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||b2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ul(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function zf(s,i,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(s),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=ms));else if(h!==4&&(h===27&&ul(s.type)&&(u=s.stateNode,i=null),s=s.child,s!==null))for(zf(s,i,u),s=s.sibling;s!==null;)zf(s,i,u),s=s.sibling}function Vd(s,i,u){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?u.insertBefore(s,i):u.appendChild(s);else if(h!==4&&(h===27&&ul(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Vd(s,i,u),s=s.sibling;s!==null;)Vd(s,i,u),s=s.sibling}function w2(s){var i=s.stateNode,u=s.memoizedProps;try{for(var h=s.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);fr(i,h,u),i[ur]=s,i[Or]=u}catch(v){nn(s,s.return,v)}}var js=!1,Un=!1,Of=!1,j2=typeof WeakSet=="function"?WeakSet:Set,lr=null;function Pk(s,i){if(s=s.containerInfo,tp=m0,s=Ov(s),Ch(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var _=0,P=-1,W=-1,me=0,Se=0,Ce=s,xe=null;t:for(;;){for(var ye;Ce!==u||g!==0&&Ce.nodeType!==3||(P=_+g),Ce!==v||h!==0&&Ce.nodeType!==3||(W=_+h),Ce.nodeType===3&&(_+=Ce.nodeValue.length),(ye=Ce.firstChild)!==null;)xe=Ce,Ce=ye;for(;;){if(Ce===s)break t;if(xe===u&&++me===g&&(P=_),xe===v&&++Se===h&&(W=_),(ye=Ce.nextSibling)!==null)break;Ce=xe,xe=Ce.parentNode}Ce=ye}u=P===-1||W===-1?null:{start:P,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(np={focusedElem:s,selectionRange:u},m0=!1,lr=i;lr!==null;)if(i=lr,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,lr=s;else for(;lr!==null;){switch(i=lr,v=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)g=s[u],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&v!==null){s=void 0,u=i,g=v.memoizedProps,v=v.memoizedState,h=u.stateNode;try{var Ue=ti(u.type,g);s=h.getSnapshotBeforeUpdate(Ue,v),h.__reactInternalSnapshotBeforeUpdate=s}catch(rt){nn(u,u.return,rt)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,u=s.nodeType,u===9)sp(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":sp(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(a(163))}if(s=i.sibling,s!==null){s.return=i.return,lr=s;break}lr=i.return}}function N2(s,i,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Ss(s,u),h&4&&Ac(5,u);break;case 1:if(Ss(s,u),h&4)if(s=u.stateNode,i===null)try{s.componentDidMount()}catch(_){nn(u,u.return,_)}else{var g=ti(u.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(g,i,s.__reactInternalSnapshotBeforeUpdate)}catch(_){nn(u,u.return,_)}}h&64&&g2(u),h&512&&Dc(u,u.return);break;case 3:if(Ss(s,u),h&64&&(s=u.updateQueue,s!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{i4(s,i)}catch(_){nn(u,u.return,_)}}break;case 27:i===null&&h&4&&w2(u);case 26:case 5:Ss(s,u),i===null&&h&4&&y2(u),h&512&&Dc(u,u.return);break;case 12:Ss(s,u);break;case 31:Ss(s,u),h&4&&C2(s,u);break;case 13:Ss(s,u),h&4&&T2(s,u),h&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=Yk.bind(null,u),hC(s,u))));break;case 22:if(h=u.memoizedState!==null||js,!h){i=i!==null&&i.memoizedState!==null||Un,g=js;var v=Un;js=h,(Un=i)&&!v?ks(s,u,(u.subtreeFlags&8772)!==0):Ss(s,u),js=g,Un=v}break;case 30:break;default:Ss(s,u)}}function S2(s){var i=s.alternate;i!==null&&(s.alternate=null,S2(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&ch(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Sn=null,Lr=!1;function Ns(s,i,u){for(u=u.child;u!==null;)k2(s,i,u),u=u.sibling}function k2(s,i,u){if(Ee&&typeof Ee.onCommitFiberUnmount=="function")try{Ee.onCommitFiberUnmount(pe,u)}catch{}switch(u.tag){case 26:Un||Ya(u,i),Ns(s,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Un||Ya(u,i);var h=Sn,g=Lr;ul(u.type)&&(Sn=u.stateNode,Lr=!1),Ns(s,i,u),qc(u.stateNode),Sn=h,Lr=g;break;case 5:Un||Ya(u,i);case 6:if(h=Sn,g=Lr,Sn=null,Ns(s,i,u),Sn=h,Lr=g,Sn!==null)if(Lr)try{(Sn.nodeType===9?Sn.body:Sn.nodeName==="HTML"?Sn.ownerDocument.body:Sn).removeChild(u.stateNode)}catch(v){nn(u,i,v)}else try{Sn.removeChild(u.stateNode)}catch(v){nn(u,i,v)}break;case 18:Sn!==null&&(Lr?(s=Sn,gy(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),go(s)):gy(Sn,u.stateNode));break;case 4:h=Sn,g=Lr,Sn=u.stateNode.containerInfo,Lr=!0,Ns(s,i,u),Sn=h,Lr=g;break;case 0:case 11:case 14:case 15:rl(2,u,i),Un||rl(4,u,i),Ns(s,i,u);break;case 1:Un||(Ya(u,i),h=u.stateNode,typeof h.componentWillUnmount=="function"&&v2(u,i,h)),Ns(s,i,u);break;case 21:Ns(s,i,u);break;case 22:Un=(h=Un)||u.memoizedState!==null,Ns(s,i,u),Un=h;break;default:Ns(s,i,u)}}function C2(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{go(s)}catch(u){nn(i,i.return,u)}}}function T2(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{go(s)}catch(u){nn(i,i.return,u)}}function Fk(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new j2),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new j2),i;default:throw Error(a(435,s.tag))}}function Gd(s,i){var u=Fk(s);i.forEach(function(h){if(!u.has(h)){u.add(h);var g=Wk.bind(null,s,h);h.then(g,g)}})}function Br(s,i){var u=i.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h],v=s,_=i,P=_;e:for(;P!==null;){switch(P.tag){case 27:if(ul(P.type)){Sn=P.stateNode,Lr=!1;break e}break;case 5:Sn=P.stateNode,Lr=!1;break e;case 3:case 4:Sn=P.stateNode.containerInfo,Lr=!0;break e}P=P.return}if(Sn===null)throw Error(a(160));k2(v,_,g),Sn=null,Lr=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)_2(i,s),i=i.sibling}var za=null;function _2(s,i){var u=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Br(i,s),Pr(s),h&4&&(rl(3,s,s.return),Ac(3,s),rl(5,s,s.return));break;case 1:Br(i,s),Pr(s),h&512&&(Un||u===null||Ya(u,u.return)),h&64&&js&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var g=za;if(Br(i,s),Pr(s),h&512&&(Un||u===null||Ya(u,u.return)),h&4){var v=u!==null?u.memoizedState:null;if(h=s.memoizedState,u===null)if(h===null)if(s.stateNode===null){e:{h=s.type,u=s.memoizedProps,g=g.ownerDocument||g;t:switch(h){case"title":v=g.getElementsByTagName("title")[0],(!v||v[sc]||v[ur]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(h),g.head.insertBefore(v,g.querySelector("head > title"))),fr(v,h,u),v[ur]=s,sr(v),h=v;break e;case"link":var _=_y("link","href",g).get(h+(u.href||""));if(_){for(var P=0;P<_.length;P++)if(v=_[P],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){_.splice(P,1);break t}}v=g.createElement(h),fr(v,h,u),g.head.appendChild(v);break;case"meta":if(_=_y("meta","content",g).get(h+(u.content||""))){for(P=0;P<_.length;P++)if(v=_[P],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){_.splice(P,1);break t}}v=g.createElement(h),fr(v,h,u),g.head.appendChild(v);break;default:throw Error(a(468,h))}v[ur]=s,sr(v),h=v}s.stateNode=h}else Ey(g,s.type,s.stateNode);else s.stateNode=Ty(g,h,s.memoizedProps);else v!==h?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,h===null?Ey(g,s.type,s.stateNode):Ty(g,h,s.memoizedProps)):h===null&&s.stateNode!==null&&Af(s,s.memoizedProps,u.memoizedProps)}break;case 27:Br(i,s),Pr(s),h&512&&(Un||u===null||Ya(u,u.return)),u!==null&&h&4&&Af(s,s.memoizedProps,u.memoizedProps);break;case 5:if(Br(i,s),Pr(s),h&512&&(Un||u===null||Ya(u,u.return)),s.flags&32){g=s.stateNode;try{Fi(g,"")}catch(Ue){nn(s,s.return,Ue)}}h&4&&s.stateNode!=null&&(g=s.memoizedProps,Af(s,g,u!==null?u.memoizedProps:g)),h&1024&&(Of=!0);break;case 6:if(Br(i,s),Pr(s),h&4){if(s.stateNode===null)throw Error(a(162));h=s.memoizedProps,u=s.stateNode;try{u.nodeValue=h}catch(Ue){nn(s,s.return,Ue)}}break;case 3:if(o0=null,g=za,za=l0(i.containerInfo),Br(i,s),za=g,Pr(s),h&4&&u!==null&&u.memoizedState.isDehydrated)try{go(i.containerInfo)}catch(Ue){nn(s,s.return,Ue)}Of&&(Of=!1,E2(s));break;case 4:h=za,za=l0(s.stateNode.containerInfo),Br(i,s),Pr(s),za=h;break;case 12:Br(i,s),Pr(s);break;case 31:Br(i,s),Pr(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Gd(s,h)));break;case 13:Br(i,s),Pr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Wd=$e()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Gd(s,h)));break;case 22:g=s.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,me=js,Se=Un;if(js=me||g,Un=Se||W,Br(i,s),Un=Se,js=me,Pr(s),h&8192)e:for(i=s.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(u===null||W||js||Un||ni(s)),u=null,i=s;;){if(i.tag===5||i.tag===26){if(u===null){W=u=i;try{if(v=W.stateNode,g)_=v.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{P=W.stateNode;var Ce=W.memoizedProps.style,xe=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;P.style.display=xe==null||typeof xe=="boolean"?"":(""+xe).trim()}}catch(Ue){nn(W,W.return,Ue)}}}else if(i.tag===6){if(u===null){W=i;try{W.stateNode.nodeValue=g?"":W.memoizedProps}catch(Ue){nn(W,W.return,Ue)}}}else if(i.tag===18){if(u===null){W=i;try{var ye=W.stateNode;g?vy(ye,!0):vy(W.stateNode,!1)}catch(Ue){nn(W,W.return,Ue)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}h&4&&(h=s.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Gd(s,u))));break;case 19:Br(i,s),Pr(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,Gd(s,h)));break;case 30:break;case 21:break;default:Br(i,s),Pr(s)}}function Pr(s){var i=s.flags;if(i&2){try{for(var u,h=s.return;h!==null;){if(b2(h)){u=h;break}h=h.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var g=u.stateNode,v=Df(s);Vd(s,v,g);break;case 5:var _=u.stateNode;u.flags&32&&(Fi(_,""),u.flags&=-33);var P=Df(s);Vd(s,P,_);break;case 3:case 4:var W=u.stateNode.containerInfo,me=Df(s);zf(s,me,W);break;default:throw Error(a(161))}}catch(Se){nn(s,s.return,Se)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function E2(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;E2(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function Ss(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)N2(s,i.alternate,i),i=i.sibling}function ni(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:rl(4,i,i.return),ni(i);break;case 1:Ya(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&v2(i,i.return,u),ni(i);break;case 27:qc(i.stateNode);case 26:case 5:Ya(i,i.return),ni(i);break;case 22:i.memoizedState===null&&ni(i);break;case 30:ni(i);break;default:ni(i)}s=s.sibling}}function ks(s,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var h=i.alternate,g=s,v=i,_=v.flags;switch(v.tag){case 0:case 11:case 15:ks(g,v,u),Ac(4,v);break;case 1:if(ks(g,v,u),h=v,g=h.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(me){nn(h,h.return,me)}if(h=v,g=h.updateQueue,g!==null){var P=h.stateNode;try{var W=g.shared.hiddenCallbacks;if(W!==null)for(g.shared.hiddenCallbacks=null,g=0;g<W.length;g++)l4(W[g],P)}catch(me){nn(h,h.return,me)}}u&&_&64&&g2(v),Dc(v,v.return);break;case 27:w2(v);case 26:case 5:ks(g,v,u),u&&h===null&&_&4&&y2(v),Dc(v,v.return);break;case 12:ks(g,v,u);break;case 31:ks(g,v,u),u&&_&4&&C2(g,v);break;case 13:ks(g,v,u),u&&_&4&&T2(g,v);break;case 22:v.memoizedState===null&&ks(g,v,u),Dc(v,v.return);break;case 30:break;default:ks(g,v,u)}i=i.sibling}}function Rf(s,i){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&vc(u))}function Lf(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&vc(s))}function Oa(s,i,u,h){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)M2(s,i,u,h),i=i.sibling}function M2(s,i,u,h){var g=i.flags;switch(i.tag){case 0:case 11:case 15:Oa(s,i,u,h),g&2048&&Ac(9,i);break;case 1:Oa(s,i,u,h);break;case 3:Oa(s,i,u,h),g&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&vc(s)));break;case 12:if(g&2048){Oa(s,i,u,h),s=i.stateNode;try{var v=i.memoizedProps,_=v.id,P=v.onPostCommit;typeof P=="function"&&P(_,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(W){nn(i,i.return,W)}}else Oa(s,i,u,h);break;case 31:Oa(s,i,u,h);break;case 13:Oa(s,i,u,h);break;case 23:break;case 22:v=i.stateNode,_=i.alternate,i.memoizedState!==null?v._visibility&2?Oa(s,i,u,h):zc(s,i):v._visibility&2?Oa(s,i,u,h):(v._visibility|=2,so(s,i,u,h,(i.subtreeFlags&10256)!==0||!1)),g&2048&&Rf(_,i);break;case 24:Oa(s,i,u,h),g&2048&&Lf(i.alternate,i);break;default:Oa(s,i,u,h)}}function so(s,i,u,h,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=s,_=i,P=u,W=h,me=_.flags;switch(_.tag){case 0:case 11:case 15:so(v,_,P,W,g),Ac(8,_);break;case 23:break;case 22:var Se=_.stateNode;_.memoizedState!==null?Se._visibility&2?so(v,_,P,W,g):zc(v,_):(Se._visibility|=2,so(v,_,P,W,g)),g&&me&2048&&Rf(_.alternate,_);break;case 24:so(v,_,P,W,g),g&&me&2048&&Lf(_.alternate,_);break;default:so(v,_,P,W,g)}i=i.sibling}}function zc(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=s,h=i,g=h.flags;switch(h.tag){case 22:zc(u,h),g&2048&&Rf(h.alternate,h);break;case 24:zc(u,h),g&2048&&Lf(h.alternate,h);break;default:zc(u,h)}i=i.sibling}}var Oc=8192;function lo(s,i,u){if(s.subtreeFlags&Oc)for(s=s.child;s!==null;)A2(s,i,u),s=s.sibling}function A2(s,i,u){switch(s.tag){case 26:lo(s,i,u),s.flags&Oc&&s.memoizedState!==null&&kC(u,za,s.memoizedState,s.memoizedProps);break;case 5:lo(s,i,u);break;case 3:case 4:var h=za;za=l0(s.stateNode.containerInfo),lo(s,i,u),za=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=Oc,Oc=16777216,lo(s,i,u),Oc=h):lo(s,i,u));break;default:lo(s,i,u)}}function D2(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function Rc(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var h=i[u];lr=h,O2(h,s)}D2(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)z2(s),s=s.sibling}function z2(s){switch(s.tag){case 0:case 11:case 15:Rc(s),s.flags&2048&&rl(9,s,s.return);break;case 3:Rc(s);break;case 12:Rc(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,Yd(s)):Rc(s);break;default:Rc(s)}}function Yd(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var h=i[u];lr=h,O2(h,s)}D2(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:rl(8,i,i.return),Yd(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Yd(i));break;default:Yd(i)}s=s.sibling}}function O2(s,i){for(;lr!==null;){var u=lr;switch(u.tag){case 0:case 11:case 15:rl(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:vc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,lr=h;else e:for(u=s;lr!==null;){h=lr;var g=h.sibling,v=h.return;if(S2(h),h===u){lr=null;break e}if(g!==null){g.return=v,lr=g;break e}lr=v}}}var Ik={getCacheForType:function(s){var i=mr(In),u=i.data.get(s);return u===void 0&&(u=s(),i.data.set(s,u)),u},cacheSignal:function(){return mr(In).controller.signal}},qk=typeof WeakMap=="function"?WeakMap:Map,Vt=0,hn=null,Ct=null,At=0,tn=0,ra=null,al=!1,io=!1,Bf=!1,Cs=0,On=0,sl=0,ri=0,Pf=0,aa=0,oo=0,Lc=null,Fr=null,Ff=!1,Wd=0,R2=0,Xd=1/0,Kd=null,ll=null,Xn=0,il=null,co=null,Ts=0,If=0,qf=null,L2=null,Bc=0,Hf=null;function sa(){return(Vt&2)!==0&&At!==0?At&-At:H.T!==null?Wf():Zg()}function B2(){if(aa===0)if((At&536870912)===0||Rt){var s=$t;$t<<=1,($t&3932160)===0&&($t=262144),aa=s}else aa=536870912;return s=ta.current,s!==null&&(s.flags|=32),aa}function Ir(s,i,u){(s===hn&&(tn===2||tn===9)||s.cancelPendingCommit!==null)&&(uo(s,0),ol(s,At,aa,!1)),ac(s,u),((Vt&2)===0||s!==hn)&&(s===hn&&((Vt&2)===0&&(ri|=u),On===4&&ol(s,At,aa,!1)),Wa(s))}function P2(s,i,u){if((Vt&6)!==0)throw Error(a(327));var h=!u&&(i&127)===0&&(i&s.expiredLanes)===0||Fl(s,i),g=h?$k(s,i):$f(s,i,!0),v=h;do{if(g===0){io&&!h&&ol(s,i,0,!1);break}else{if(u=s.current.alternate,v&&!Hk(u)){g=$f(s,i,!1),v=!1;continue}if(g===2){if(v=i,s.errorRecoveryDisabledLanes&v)var _=0;else _=s.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){i=_;e:{var P=s;g=Lc;var W=P.current.memoizedState.isDehydrated;if(W&&(uo(P,_).flags|=256),_=$f(P,_,!1),_!==2){if(Bf&&!W){P.errorRecoveryDisabledLanes|=v,ri|=v,g=4;break e}v=Fr,Fr=g,v!==null&&(Fr===null?Fr=v:Fr.push.apply(Fr,v))}g=_}if(v=!1,g!==2)continue}}if(g===1){uo(s,0),ol(s,i,0,!0);break}e:{switch(h=s,v=g,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ol(h,i,aa,!al);break e;case 2:Fr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(g=Wd+300-$e(),10<g)){if(ol(h,i,aa,!al),Ai(h,0,!0)!==0)break e;Ts=i,h.timeoutHandle=py(F2.bind(null,h,u,Fr,Kd,Ff,i,aa,ri,oo,al,v,"Throttled",-0,0),g);break e}F2(h,u,Fr,Kd,Ff,i,aa,ri,oo,al,v,null,-0,0)}}break}while(!0);Wa(s)}function F2(s,i,u,h,g,v,_,P,W,me,Se,Ce,xe,ye){if(s.timeoutHandle=-1,Ce=i.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ms},A2(i,v,Ce);var Ue=(v&62914560)===v?Wd-$e():(v&4194048)===v?R2-$e():0;if(Ue=CC(Ce,Ue),Ue!==null){Ts=v,s.cancelPendingCommit=Ue(Y2.bind(null,s,i,v,u,h,g,_,P,W,Se,Ce,null,xe,ye)),ol(s,v,_,!me);return}}Y2(s,i,v,u,h,g,_,P,W)}function Hk(s){for(var i=s;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var g=u[h],v=g.getSnapshot;g=g.value;try{if(!Jr(v(),g))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ol(s,i,u,h){i&=~Pf,i&=~ri,s.suspendedLanes|=i,s.pingedLanes&=~i,h&&(s.warmLanes|=i),h=s.expirationTimes;for(var g=i;0<g;){var v=31-mt(g),_=1<<v;h[v]=-1,g&=~_}u!==0&&Xg(s,u,i)}function Qd(){return(Vt&6)===0?(Pc(0),!1):!0}function Uf(){if(Ct!==null){if(tn===0)var s=Ct.return;else s=Ct,xs=Wl=null,af(s),eo=null,bc=0,s=Ct;for(;s!==null;)x2(s.alternate,s),s=s.return;Ct=null}}function uo(s,i){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,oC(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Ts=0,Uf(),hn=s,Ct=u=fs(s.current,null),At=i,tn=0,ra=null,al=!1,io=Fl(s,i),Bf=!1,oo=aa=Pf=ri=sl=On=0,Fr=Lc=null,Ff=!1,(i&8)!==0&&(i|=i&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=i;0<h;){var g=31-mt(h),v=1<<g;i|=s[g],h&=~v}return Cs=i,vd(),u}function I2(s,i){ht=null,H.H=_c,i===Ji||i===Cd?(i=n4(),tn=3):i===Gh?(i=n4(),tn=4):tn=i===wf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ra=i,Ct===null&&(On=1,Id(s,ga(i,s.current)))}function q2(){var s=ta.current;return s===null?!0:(At&4194048)===At?wa===null:(At&62914560)===At||(At&536870912)!==0?s===wa:!1}function H2(){var s=H.H;return H.H=_c,s===null?_c:s}function U2(){var s=H.A;return H.A=Ik,s}function Zd(){On=4,al||(At&4194048)!==At&&ta.current!==null||(io=!0),(sl&134217727)===0&&(ri&134217727)===0||hn===null||ol(hn,At,aa,!1)}function $f(s,i,u){var h=Vt;Vt|=2;var g=H2(),v=U2();(hn!==s||At!==i)&&(Kd=null,uo(s,i)),i=!1;var _=On;e:do try{if(tn!==0&&Ct!==null){var P=Ct,W=ra;switch(tn){case 8:Uf(),_=6;break e;case 3:case 2:case 9:case 6:ta.current===null&&(i=!0);var me=tn;if(tn=0,ra=null,mo(s,P,W,me),u&&io){_=0;break e}break;default:me=tn,tn=0,ra=null,mo(s,P,W,me)}}Uk(),_=On;break}catch(Se){I2(s,Se)}while(!0);return i&&s.shellSuspendCounter++,xs=Wl=null,Vt=h,H.H=g,H.A=v,Ct===null&&(hn=null,At=0,vd()),_}function Uk(){for(;Ct!==null;)$2(Ct)}function $k(s,i){var u=Vt;Vt|=2;var h=H2(),g=U2();hn!==s||At!==i?(Kd=null,Xd=$e()+500,uo(s,i)):io=Fl(s,i);e:do try{if(tn!==0&&Ct!==null){i=Ct;var v=ra;t:switch(tn){case 1:tn=0,ra=null,mo(s,i,v,1);break;case 2:case 9:if(e4(v)){tn=0,ra=null,V2(i);break}i=function(){tn!==2&&tn!==9||hn!==s||(tn=7),Wa(s)},v.then(i,i);break e;case 3:tn=7;break e;case 4:tn=5;break e;case 7:e4(v)?(tn=0,ra=null,V2(i)):(tn=0,ra=null,mo(s,i,v,7));break;case 5:var _=null;switch(Ct.tag){case 26:_=Ct.memoizedState;case 5:case 27:var P=Ct;if(_?My(_):P.stateNode.complete){tn=0,ra=null;var W=P.sibling;if(W!==null)Ct=W;else{var me=P.return;me!==null?(Ct=me,Jd(me)):Ct=null}break t}}tn=0,ra=null,mo(s,i,v,5);break;case 6:tn=0,ra=null,mo(s,i,v,6);break;case 8:Uf(),On=6;break e;default:throw Error(a(462))}}Vk();break}catch(Se){I2(s,Se)}while(!0);return xs=Wl=null,H.H=h,H.A=g,Vt=u,Ct!==null?0:(hn=null,At=0,vd(),On)}function Vk(){for(;Ct!==null&&!Cn();)$2(Ct)}function $2(s){var i=f2(s.alternate,s,Cs);s.memoizedProps=s.pendingProps,i===null?Jd(s):Ct=i}function V2(s){var i=s,u=i.alternate;switch(i.tag){case 15:case 0:i=o2(u,i,i.pendingProps,i.type,void 0,At);break;case 11:i=o2(u,i,i.pendingProps,i.type.render,i.ref,At);break;case 5:af(i);default:x2(u,i),i=Ct=Uv(i,Cs),i=f2(u,i,Cs)}s.memoizedProps=s.pendingProps,i===null?Jd(s):Ct=i}function mo(s,i,u,h){xs=Wl=null,af(i),eo=null,bc=0;var g=i.return;try{if(zk(s,g,i,u,At)){On=1,Id(s,ga(u,s.current)),Ct=null;return}}catch(v){if(g!==null)throw Ct=g,v;On=1,Id(s,ga(u,s.current)),Ct=null;return}i.flags&32768?(Rt||h===1?s=!0:io||(At&536870912)!==0?s=!1:(al=s=!0,(h===2||h===9||h===3||h===6)&&(h=ta.current,h!==null&&h.tag===13&&(h.flags|=16384))),G2(i,s)):Jd(i)}function Jd(s){var i=s;do{if((i.flags&32768)!==0){G2(i,al);return}s=i.return;var u=Lk(i.alternate,i,Cs);if(u!==null){Ct=u;return}if(i=i.sibling,i!==null){Ct=i;return}Ct=i=s}while(i!==null);On===0&&(On=5)}function G2(s,i){do{var u=Bk(s.alternate,s);if(u!==null){u.flags&=32767,Ct=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(s=s.sibling,s!==null)){Ct=s;return}Ct=s=u}while(s!==null);On=6,Ct=null}function Y2(s,i,u,h,g,v,_,P,W){s.cancelPendingCommit=null;do e0();while(Xn!==0);if((Vt&6)!==0)throw Error(a(327));if(i!==null){if(i===s.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Ah,SS(s,u,v,_,P,W),s===hn&&(Ct=hn=null,At=0),co=i,il=s,Ts=u,If=v,qf=g,L2=h,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,Xk(Re,function(){return Z2(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,g=le.p,le.p=2,_=Vt,Vt|=4;try{Pk(s,i,u)}finally{Vt=_,le.p=g,H.T=h}}Xn=1,W2(),X2(),K2()}}function W2(){if(Xn===1){Xn=0;var s=il,i=co,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var h=le.p;le.p=2;var g=Vt;Vt|=4;try{_2(i,s);var v=np,_=Ov(s.containerInfo),P=v.focusedElem,W=v.selectionRange;if(_!==P&&P&&P.ownerDocument&&zv(P.ownerDocument.documentElement,P)){if(W!==null&&Ch(P)){var me=W.start,Se=W.end;if(Se===void 0&&(Se=me),"selectionStart"in P)P.selectionStart=me,P.selectionEnd=Math.min(Se,P.value.length);else{var Ce=P.ownerDocument||document,xe=Ce&&Ce.defaultView||window;if(xe.getSelection){var ye=xe.getSelection(),Ue=P.textContent.length,rt=Math.min(W.start,Ue),on=W.end===void 0?rt:Math.min(W.end,Ue);!ye.extend&&rt>on&&(_=on,on=rt,rt=_);var ie=Dv(P,rt),te=Dv(P,on);if(ie&&te&&(ye.rangeCount!==1||ye.anchorNode!==ie.node||ye.anchorOffset!==ie.offset||ye.focusNode!==te.node||ye.focusOffset!==te.offset)){var ue=Ce.createRange();ue.setStart(ie.node,ie.offset),ye.removeAllRanges(),rt>on?(ye.addRange(ue),ye.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),ye.addRange(ue))}}}}for(Ce=[],ye=P;ye=ye.parentNode;)ye.nodeType===1&&Ce.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Ce.length;P++){var ke=Ce[P];ke.element.scrollLeft=ke.left,ke.element.scrollTop=ke.top}}m0=!!tp,np=tp=null}finally{Vt=g,le.p=h,H.T=u}}s.current=i,Xn=2}}function X2(){if(Xn===2){Xn=0;var s=il,i=co,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var h=le.p;le.p=2;var g=Vt;Vt|=4;try{N2(s,i.alternate,i)}finally{Vt=g,le.p=h,H.T=u}}Xn=3}}function K2(){if(Xn===4||Xn===3){Xn=0,cr();var s=il,i=co,u=Ts,h=L2;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Xn=5:(Xn=0,co=il=null,Q2(s,s.pendingLanes));var g=s.pendingLanes;if(g===0&&(ll=null),ih(u),i=i.stateNode,Ee&&typeof Ee.onCommitFiberRoot=="function")try{Ee.onCommitFiberRoot(pe,i,void 0,(i.current.flags&128)===128)}catch{}if(h!==null){i=H.T,g=le.p,le.p=2,H.T=null;try{for(var v=s.onRecoverableError,_=0;_<h.length;_++){var P=h[_];v(P.value,{componentStack:P.stack})}}finally{H.T=i,le.p=g}}(Ts&3)!==0&&e0(),Wa(s),g=s.pendingLanes,(u&261930)!==0&&(g&42)!==0?s===Hf?Bc++:(Bc=0,Hf=s):Bc=0,Pc(0)}}function Q2(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,vc(i)))}function e0(){return W2(),X2(),K2(),Z2()}function Z2(){if(Xn!==5)return!1;var s=il,i=If;If=0;var u=ih(Ts),h=H.T,g=le.p;try{le.p=32>u?32:u,H.T=null,u=qf,qf=null;var v=il,_=Ts;if(Xn=0,co=il=null,Ts=0,(Vt&6)!==0)throw Error(a(331));var P=Vt;if(Vt|=4,z2(v.current),M2(v,v.current,_,u),Vt=P,Pc(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot=="function")try{Ee.onPostCommitFiberRoot(pe,v)}catch{}return!0}finally{le.p=g,H.T=h,Q2(s,i)}}function J2(s,i,u){i=ga(u,i),i=bf(s.stateNode,i,2),s=el(s,i,2),s!==null&&(ac(s,2),Wa(s))}function nn(s,i,u){if(s.tag===3)J2(s,s,u);else for(;i!==null;){if(i.tag===3){J2(i,s,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ll===null||!ll.has(h))){s=ga(u,s),u=e2(2),h=el(i,u,2),h!==null&&(t2(u,h,i,s),ac(h,2),Wa(h));break}}i=i.return}}function Vf(s,i,u){var h=s.pingCache;if(h===null){h=s.pingCache=new qk;var g=new Set;h.set(i,g)}else g=h.get(i),g===void 0&&(g=new Set,h.set(i,g));g.has(u)||(Bf=!0,g.add(u),s=Gk.bind(null,s,i,u),i.then(s,s))}function Gk(s,i,u){var h=s.pingCache;h!==null&&h.delete(i),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,hn===s&&(At&u)===u&&(On===4||On===3&&(At&62914560)===At&&300>$e()-Wd?(Vt&2)===0&&uo(s,0):Pf|=u,oo===At&&(oo=0)),Wa(s)}function ey(s,i){i===0&&(i=Di()),s=Vl(s,i),s!==null&&(ac(s,i),Wa(s))}function Yk(s){var i=s.memoizedState,u=0;i!==null&&(u=i.retryLane),ey(s,u)}function Wk(s,i){var u=0;switch(s.tag){case 31:case 13:var h=s.stateNode,g=s.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(a(314))}h!==null&&h.delete(i),ey(s,u)}function Xk(s,i){return Wn(s,i)}var t0=null,ho=null,Gf=!1,n0=!1,Yf=!1,cl=0;function Wa(s){s!==ho&&s.next===null&&(ho===null?t0=ho=s:ho=ho.next=s),n0=!0,Gf||(Gf=!0,Qk())}function Pc(s,i){if(!Yf&&n0){Yf=!0;do for(var u=!1,h=t0;h!==null;){if(s!==0){var g=h.pendingLanes;if(g===0)var v=0;else{var _=h.suspendedLanes,P=h.pingedLanes;v=(1<<31-mt(42|s)+1)-1,v&=g&~(_&~P),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,ay(h,v))}else v=At,v=Ai(h,h===hn?v:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(v&3)===0||Fl(h,v)||(u=!0,ay(h,v));h=h.next}while(u);Yf=!1}}function Kk(){ty()}function ty(){n0=Gf=!1;var s=0;cl!==0&&iC()&&(s=cl);for(var i=$e(),u=null,h=t0;h!==null;){var g=h.next,v=ny(h,i);v===0?(h.next=null,u===null?t0=g:u.next=g,g===null&&(ho=u)):(u=h,(s!==0||(v&3)!==0)&&(n0=!0)),h=g}Xn!==0&&Xn!==5||Pc(s),cl!==0&&(cl=0)}function ny(s,i){for(var u=s.suspendedLanes,h=s.pingedLanes,g=s.expirationTimes,v=s.pendingLanes&-62914561;0<v;){var _=31-mt(v),P=1<<_,W=g[_];W===-1?((P&u)===0||(P&h)!==0)&&(g[_]=sh(P,i)):W<=i&&(s.expiredLanes|=P),v&=~P}if(i=hn,u=At,u=Ai(s,s===i?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,u===0||s===i&&(tn===2||tn===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&Ar(h),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||Fl(s,u)){if(i=u&-u,i===s.callbackPriority)return i;switch(h!==null&&Ar(h),ih(u)){case 2:case 8:u=be;break;case 32:u=Re;break;case 268435456:u=kt;break;default:u=Re}return h=ry.bind(null,s),u=Wn(u,h),s.callbackPriority=i,s.callbackNode=u,i}return h!==null&&h!==null&&Ar(h),s.callbackPriority=2,s.callbackNode=null,2}function ry(s,i){if(Xn!==0&&Xn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(e0()&&s.callbackNode!==u)return null;var h=At;return h=Ai(s,s===hn?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(P2(s,h,i),ny(s,$e()),s.callbackNode!=null&&s.callbackNode===u?ry.bind(null,s):null)}function ay(s,i){if(e0())return null;P2(s,i,!0)}function Qk(){cC(function(){(Vt&6)!==0?Wn(K,Kk):ty()})}function Wf(){if(cl===0){var s=Qi;s===0&&(s=ot,ot<<=1,(ot&261888)===0&&(ot=256)),cl=s}return cl}function sy(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:ud(""+s)}function ly(s,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,s.id&&u.setAttribute("form",s.id),i.parentNode.insertBefore(u,i),s=new FormData(s),u.parentNode.removeChild(u),s}function Zk(s,i,u,h,g){if(i==="submit"&&u&&u.stateNode===g){var v=sy((g[Or]||null).action),_=h.submitter;_&&(i=(i=_[Or]||null)?sy(i.formAction):_.getAttribute("formAction"),i!==null&&(v=i,_=null));var P=new fd("action","action",null,h,g);s.push({event:P,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(cl!==0){var W=_?ly(g,_):new FormData(g);ff(u,{pending:!0,data:W,method:g.method,action:v},null,W)}}else typeof v=="function"&&(P.preventDefault(),W=_?ly(g,_):new FormData(g),ff(u,{pending:!0,data:W,method:g.method,action:v},v,W))},currentTarget:g}]})}}for(var Xf=0;Xf<Mh.length;Xf++){var Kf=Mh[Xf],Jk=Kf.toLowerCase(),eC=Kf[0].toUpperCase()+Kf.slice(1);Da(Jk,"on"+eC)}Da(Bv,"onAnimationEnd"),Da(Pv,"onAnimationIteration"),Da(Fv,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da(xk,"onTransitionRun"),Da(gk,"onTransitionStart"),Da(vk,"onTransitionCancel"),Da(Iv,"onTransitionEnd"),Bi("onMouseEnter",["mouseout","mouseover"]),Bi("onMouseLeave",["mouseout","mouseover"]),Bi("onPointerEnter",["pointerout","pointerover"]),Bi("onPointerLeave",["pointerout","pointerover"]),ql("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ql("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ql("onBeforeInput",["compositionend","keypress","textInput","paste"]),ql("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fc="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(" "),tC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fc));function iy(s,i){i=(i&4)!==0;for(var u=0;u<s.length;u++){var h=s[u],g=h.event;h=h.listeners;e:{var v=void 0;if(i)for(var _=h.length-1;0<=_;_--){var P=h[_],W=P.instance,me=P.currentTarget;if(P=P.listener,W!==v&&g.isPropagationStopped())break e;v=P,g.currentTarget=me;try{v(g)}catch(Se){gd(Se)}g.currentTarget=null,v=W}else for(_=0;_<h.length;_++){if(P=h[_],W=P.instance,me=P.currentTarget,P=P.listener,W!==v&&g.isPropagationStopped())break e;v=P,g.currentTarget=me;try{v(g)}catch(Se){gd(Se)}g.currentTarget=null,v=W}}}}function Tt(s,i){var u=i[oh];u===void 0&&(u=i[oh]=new Set);var h=s+"__bubble";u.has(h)||(oy(i,s,2,!1),u.add(h))}function Qf(s,i,u){var h=0;i&&(h|=4),oy(u,s,h,i)}var r0="_reactListening"+Math.random().toString(36).slice(2);function Zf(s){if(!s[r0]){s[r0]=!0,tv.forEach(function(u){u!=="selectionchange"&&(tC.has(u)||Qf(u,!1,s),Qf(u,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[r0]||(i[r0]=!0,Qf("selectionchange",!1,i))}}function oy(s,i,u,h){switch(By(i)){case 2:var g=EC;break;case 8:g=MC;break;default:g=hp}u=g.bind(null,i,u,s),g=void 0,!gh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),h?g!==void 0?s.addEventListener(i,u,{capture:!0,passive:g}):s.addEventListener(i,u,!0):g!==void 0?s.addEventListener(i,u,{passive:g}):s.addEventListener(i,u,!1)}function Jf(s,i,u,h,g){var v=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var _=h.tag;if(_===3||_===4){var P=h.stateNode.containerInfo;if(P===g)break;if(_===4)for(_=h.return;_!==null;){var W=_.tag;if((W===3||W===4)&&_.stateNode.containerInfo===g)return;_=_.return}for(;P!==null;){if(_=Oi(P),_===null)return;if(W=_.tag,W===5||W===6||W===26||W===27){h=v=_;continue e}P=P.parentNode}}h=h.return}hv(function(){var me=v,Se=ph(u),Ce=[];e:{var xe=qv.get(s);if(xe!==void 0){var ye=fd,Ue=s;switch(s){case"keypress":if(md(u)===0)break e;case"keydown":case"keyup":ye=WS;break;case"focusin":Ue="focus",ye=wh;break;case"focusout":Ue="blur",ye=wh;break;case"beforeblur":case"afterblur":ye=wh;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=xv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=LS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=QS;break;case Bv:case Pv:case Fv:ye=FS;break;case Iv:ye=JS;break;case"scroll":case"scrollend":ye=OS;break;case"wheel":ye=tk;break;case"copy":case"cut":case"paste":ye=qS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=vv;break;case"toggle":case"beforetoggle":ye=rk}var rt=(i&4)!==0,on=!rt&&(s==="scroll"||s==="scrollend"),ie=rt?xe!==null?xe+"Capture":null:xe;rt=[];for(var te=me,ue;te!==null;){var ke=te;if(ue=ke.stateNode,ke=ke.tag,ke!==5&&ke!==26&&ke!==27||ue===null||ie===null||(ke=ic(te,ie),ke!=null&&rt.push(Ic(te,ke,ue))),on)break;te=te.return}0<rt.length&&(xe=new ye(xe,Ue,null,u,Se),Ce.push({event:xe,listeners:rt}))}}if((i&7)===0){e:{if(xe=s==="mouseover"||s==="pointerover",ye=s==="mouseout"||s==="pointerout",xe&&u!==fh&&(Ue=u.relatedTarget||u.fromElement)&&(Oi(Ue)||Ue[zi]))break e;if((ye||xe)&&(xe=Se.window===Se?Se:(xe=Se.ownerDocument)?xe.defaultView||xe.parentWindow:window,ye?(Ue=u.relatedTarget||u.toElement,ye=me,Ue=Ue?Oi(Ue):null,Ue!==null&&(on=o(Ue),rt=Ue.tag,Ue!==on||rt!==5&&rt!==27&&rt!==6)&&(Ue=null)):(ye=null,Ue=me),ye!==Ue)){if(rt=xv,ke="onMouseLeave",ie="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(rt=vv,ke="onPointerLeave",ie="onPointerEnter",te="pointer"),on=ye==null?xe:lc(ye),ue=Ue==null?xe:lc(Ue),xe=new rt(ke,te+"leave",ye,u,Se),xe.target=on,xe.relatedTarget=ue,ke=null,Oi(Se)===me&&(rt=new rt(ie,te+"enter",Ue,u,Se),rt.target=ue,rt.relatedTarget=on,ke=rt),on=ke,ye&&Ue)t:{for(rt=nC,ie=ye,te=Ue,ue=0,ke=ie;ke;ke=rt(ke))ue++;ke=0;for(var Qe=te;Qe;Qe=rt(Qe))ke++;for(;0<ue-ke;)ie=rt(ie),ue--;for(;0<ke-ue;)te=rt(te),ke--;for(;ue--;){if(ie===te||te!==null&&ie===te.alternate){rt=ie;break t}ie=rt(ie),te=rt(te)}rt=null}else rt=null;ye!==null&&cy(Ce,xe,ye,rt,!1),Ue!==null&&on!==null&&cy(Ce,on,Ue,rt,!0)}}e:{if(xe=me?lc(me):window,ye=xe.nodeName&&xe.nodeName.toLowerCase(),ye==="select"||ye==="input"&&xe.type==="file")var qt=Cv;else if(Sv(xe))if(Tv)qt=hk;else{qt=dk;var Ye=uk}else ye=xe.nodeName,!ye||ye.toLowerCase()!=="input"||xe.type!=="checkbox"&&xe.type!=="radio"?me&&hh(me.elementType)&&(qt=Cv):qt=mk;if(qt&&(qt=qt(s,me))){kv(Ce,qt,u,Se);break e}Ye&&Ye(s,xe,me),s==="focusout"&&me&&xe.type==="number"&&me.memoizedProps.value!=null&&mh(xe,"number",xe.value)}switch(Ye=me?lc(me):window,s){case"focusin":(Sv(Ye)||Ye.contentEditable==="true")&&(Ui=Ye,Th=me,pc=null);break;case"focusout":pc=Th=Ui=null;break;case"mousedown":_h=!0;break;case"contextmenu":case"mouseup":case"dragend":_h=!1,Rv(Ce,u,Se);break;case"selectionchange":if(pk)break;case"keydown":case"keyup":Rv(Ce,u,Se)}var xt;if(Nh)e:{switch(s){case"compositionstart":var Dt="onCompositionStart";break e;case"compositionend":Dt="onCompositionEnd";break e;case"compositionupdate":Dt="onCompositionUpdate";break e}Dt=void 0}else Hi?jv(s,u)&&(Dt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Dt="onCompositionStart");Dt&&(yv&&u.locale!=="ko"&&(Hi||Dt!=="onCompositionStart"?Dt==="onCompositionEnd"&&Hi&&(xt=fv()):(Ys=Se,vh="value"in Ys?Ys.value:Ys.textContent,Hi=!0)),Ye=a0(me,Dt),0<Ye.length&&(Dt=new gv(Dt,s,null,u,Se),Ce.push({event:Dt,listeners:Ye}),xt?Dt.data=xt:(xt=Nv(u),xt!==null&&(Dt.data=xt)))),(xt=sk?lk(s,u):ik(s,u))&&(Dt=a0(me,"onBeforeInput"),0<Dt.length&&(Ye=new gv("onBeforeInput","beforeinput",null,u,Se),Ce.push({event:Ye,listeners:Dt}),Ye.data=xt)),Zk(Ce,s,me,u,Se)}iy(Ce,i)})}function Ic(s,i,u){return{instance:s,listener:i,currentTarget:u}}function a0(s,i){for(var u=i+"Capture",h=[];s!==null;){var g=s,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=ic(s,u),g!=null&&h.unshift(Ic(s,g,v)),g=ic(s,i),g!=null&&h.push(Ic(s,g,v))),s.tag===3)return h;s=s.return}return[]}function nC(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function cy(s,i,u,h,g){for(var v=i._reactName,_=[];u!==null&&u!==h;){var P=u,W=P.alternate,me=P.stateNode;if(P=P.tag,W!==null&&W===h)break;P!==5&&P!==26&&P!==27||me===null||(W=me,g?(me=ic(u,v),me!=null&&_.unshift(Ic(u,me,W))):g||(me=ic(u,v),me!=null&&_.push(Ic(u,me,W)))),u=u.return}_.length!==0&&s.push({event:i,listeners:_})}var rC=/\r\n?/g,aC=/\u0000|\uFFFD/g;function uy(s){return(typeof s=="string"?s:""+s).replace(rC,`
`).replace(aC,"")}function dy(s,i){return i=uy(i),uy(s)===i}function ln(s,i,u,h,g,v){switch(u){case"children":typeof h=="string"?i==="body"||i==="textarea"&&h===""||Fi(s,h):(typeof h=="number"||typeof h=="bigint")&&i!=="body"&&Fi(s,""+h);break;case"className":od(s,"class",h);break;case"tabIndex":od(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":od(s,u,h);break;case"style":dv(s,h,v);break;case"data":if(i!=="object"){od(s,"data",h);break}case"src":case"href":if(h===""&&(i!=="a"||u!=="href")){s.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=ud(""+h),s.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(u,"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 v=="function"&&(u==="formAction"?(i!=="input"&&ln(s,i,"name",g.name,g,null),ln(s,i,"formEncType",g.formEncType,g,null),ln(s,i,"formMethod",g.formMethod,g,null),ln(s,i,"formTarget",g.formTarget,g,null)):(ln(s,i,"encType",g.encType,g,null),ln(s,i,"method",g.method,g,null),ln(s,i,"target",g.target,g,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(u);break}h=ud(""+h),s.setAttribute(u,h);break;case"onClick":h!=null&&(s.onclick=ms);break;case"onScroll":h!=null&&Tt("scroll",s);break;case"onScrollEnd":h!=null&&Tt("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(a(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(a(60));s.innerHTML=u}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}u=ud(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""+h):s.removeAttribute(u);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":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":h===!0?s.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(u,h):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(u,h):s.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(u):s.setAttribute(u,h);break;case"popover":Tt("beforetoggle",s),Tt("toggle",s),id(s,"popover",h);break;case"xlinkActuate":ds(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":ds(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":ds(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":ds(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":ds(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":ds(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":ds(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":ds(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":ds(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":id(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=DS.get(u)||u,id(s,u,h))}}function ep(s,i,u,h,g,v){switch(u){case"style":dv(s,h,v);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(a(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(a(60));s.innerHTML=u}}break;case"children":typeof h=="string"?Fi(s,h):(typeof h=="number"||typeof h=="bigint")&&Fi(s,""+h);break;case"onScroll":h!=null&&Tt("scroll",s);break;case"onScrollEnd":h!=null&&Tt("scrollend",s);break;case"onClick":h!=null&&(s.onclick=ms);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nv.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),i=u.slice(2,g?u.length-7:void 0),v=s[Or]||null,v=v!=null?v[u]:null,typeof v=="function"&&s.removeEventListener(i,v,g),typeof h=="function")){typeof v!="function"&&v!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(i,h,g);break e}u in s?s[u]=h:h===!0?s.setAttribute(u,""):id(s,u,h)}}}function fr(s,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",s),Tt("load",s);var h=!1,g=!1,v;for(v in u)if(u.hasOwnProperty(v)){var _=u[v];if(_!=null)switch(v){case"src":h=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ln(s,i,v,_,u,null)}}g&&ln(s,i,"srcSet",u.srcSet,u,null),h&&ln(s,i,"src",u.src,u,null);return;case"input":Tt("invalid",s);var P=v=_=g=null,W=null,me=null;for(h in u)if(u.hasOwnProperty(h)){var Se=u[h];if(Se!=null)switch(h){case"name":g=Se;break;case"type":_=Se;break;case"checked":W=Se;break;case"defaultChecked":me=Se;break;case"value":v=Se;break;case"defaultValue":P=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(a(137,i));break;default:ln(s,i,h,Se,u,null)}}iv(s,v,P,W,me,_,g,!1);return;case"select":Tt("invalid",s),h=_=v=null;for(g in u)if(u.hasOwnProperty(g)&&(P=u[g],P!=null))switch(g){case"value":v=P;break;case"defaultValue":_=P;break;case"multiple":h=P;default:ln(s,i,g,P,u,null)}i=v,u=_,s.multiple=!!h,i!=null?Pi(s,!!h,i,!1):u!=null&&Pi(s,!!h,u,!0);return;case"textarea":Tt("invalid",s),v=g=h=null;for(_ in u)if(u.hasOwnProperty(_)&&(P=u[_],P!=null))switch(_){case"value":h=P;break;case"defaultValue":g=P;break;case"children":v=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:ln(s,i,_,P,u,null)}cv(s,h,g,v);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(h=u[W],h!=null))switch(W){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:ln(s,i,W,h,u,null)}return;case"dialog":Tt("beforetoggle",s),Tt("toggle",s),Tt("cancel",s),Tt("close",s);break;case"iframe":case"object":Tt("load",s);break;case"video":case"audio":for(h=0;h<Fc.length;h++)Tt(Fc[h],s);break;case"image":Tt("error",s),Tt("load",s);break;case"details":Tt("toggle",s);break;case"embed":case"source":case"link":Tt("error",s),Tt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(me in u)if(u.hasOwnProperty(me)&&(h=u[me],h!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ln(s,i,me,h,u,null)}return;default:if(hh(i)){for(Se in u)u.hasOwnProperty(Se)&&(h=u[Se],h!==void 0&&ep(s,i,Se,h,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(h=u[P],h!=null&&ln(s,i,P,h,u,null))}function sC(s,i,u,h){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,_=null,P=null,W=null,me=null,Se=null;for(ye in u){var Ce=u[ye];if(u.hasOwnProperty(ye)&&Ce!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":W=Ce;default:h.hasOwnProperty(ye)||ln(s,i,ye,null,h,Ce)}}for(var xe in h){var ye=h[xe];if(Ce=u[xe],h.hasOwnProperty(xe)&&(ye!=null||Ce!=null))switch(xe){case"type":v=ye;break;case"name":g=ye;break;case"checked":me=ye;break;case"defaultChecked":Se=ye;break;case"value":_=ye;break;case"defaultValue":P=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(a(137,i));break;default:ye!==Ce&&ln(s,i,xe,ye,h,Ce)}}dh(s,_,P,W,me,Se,v,g);return;case"select":ye=_=P=xe=null;for(v in u)if(W=u[v],u.hasOwnProperty(v)&&W!=null)switch(v){case"value":break;case"multiple":ye=W;default:h.hasOwnProperty(v)||ln(s,i,v,null,h,W)}for(g in h)if(v=h[g],W=u[g],h.hasOwnProperty(g)&&(v!=null||W!=null))switch(g){case"value":xe=v;break;case"defaultValue":P=v;break;case"multiple":_=v;default:v!==W&&ln(s,i,g,v,h,W)}i=P,u=_,h=ye,xe!=null?Pi(s,!!u,xe,!1):!!h!=!!u&&(i!=null?Pi(s,!!u,i,!0):Pi(s,!!u,u?[]:"",!1));return;case"textarea":ye=xe=null;for(P in u)if(g=u[P],u.hasOwnProperty(P)&&g!=null&&!h.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:ln(s,i,P,null,h,g)}for(_ in h)if(g=h[_],v=u[_],h.hasOwnProperty(_)&&(g!=null||v!=null))switch(_){case"value":xe=g;break;case"defaultValue":ye=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==v&&ln(s,i,_,g,h,v)}ov(s,xe,ye);return;case"option":for(var Ue in u)if(xe=u[Ue],u.hasOwnProperty(Ue)&&xe!=null&&!h.hasOwnProperty(Ue))switch(Ue){case"selected":s.selected=!1;break;default:ln(s,i,Ue,null,h,xe)}for(W in h)if(xe=h[W],ye=u[W],h.hasOwnProperty(W)&&xe!==ye&&(xe!=null||ye!=null))switch(W){case"selected":s.selected=xe&&typeof xe!="function"&&typeof xe!="symbol";break;default:ln(s,i,W,xe,h,ye)}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 rt in u)xe=u[rt],u.hasOwnProperty(rt)&&xe!=null&&!h.hasOwnProperty(rt)&&ln(s,i,rt,null,h,xe);for(me in h)if(xe=h[me],ye=u[me],h.hasOwnProperty(me)&&xe!==ye&&(xe!=null||ye!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(137,i));break;default:ln(s,i,me,xe,h,ye)}return;default:if(hh(i)){for(var on in u)xe=u[on],u.hasOwnProperty(on)&&xe!==void 0&&!h.hasOwnProperty(on)&&ep(s,i,on,void 0,h,xe);for(Se in h)xe=h[Se],ye=u[Se],!h.hasOwnProperty(Se)||xe===ye||xe===void 0&&ye===void 0||ep(s,i,Se,xe,h,ye);return}}for(var ie in u)xe=u[ie],u.hasOwnProperty(ie)&&xe!=null&&!h.hasOwnProperty(ie)&&ln(s,i,ie,null,h,xe);for(Ce in h)xe=h[Ce],ye=u[Ce],!h.hasOwnProperty(Ce)||xe===ye||xe==null&&ye==null||ln(s,i,Ce,xe,h,ye)}function my(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lC(){if(typeof performance.getEntriesByType=="function"){for(var s=0,i=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var g=u[h],v=g.transferSize,_=g.initiatorType,P=g.duration;if(v&&P&&my(_)){for(_=0,P=g.responseEnd,h+=1;h<u.length;h++){var W=u[h],me=W.startTime;if(me>P)break;var Se=W.transferSize,Ce=W.initiatorType;Se&&my(Ce)&&(W=W.responseEnd,_+=Se*(W<P?1:(P-me)/(W-me)))}if(--h,i+=8*(v+_)/(g.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var tp=null,np=null;function s0(s){return s.nodeType===9?s:s.ownerDocument}function hy(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fy(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function rp(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ap=null;function iC(){var s=window.event;return s&&s.type==="popstate"?s===ap?!1:(ap=s,!0):(ap=null,!1)}var py=typeof setTimeout=="function"?setTimeout:void 0,oC=typeof clearTimeout=="function"?clearTimeout:void 0,xy=typeof Promise=="function"?Promise:void 0,cC=typeof queueMicrotask=="function"?queueMicrotask:typeof xy<"u"?function(s){return xy.resolve(null).then(s).catch(uC)}:py;function uC(s){setTimeout(function(){throw s})}function ul(s){return s==="head"}function gy(s,i){var u=i,h=0;do{var g=u.nextSibling;if(s.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"||u==="/&"){if(h===0){s.removeChild(g),go(i);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")qc(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,qc(u);for(var v=u.firstChild;v;){var _=v.nextSibling,P=v.nodeName;v[sc]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=_}}else u==="body"&&qc(s.ownerDocument.body);u=g}while(u);go(i)}function vy(s,i){var u=s;s=0;do{var h=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=h}while(u)}function sp(s){var i=s.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":sp(u),ch(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function dC(s,i,u,h){for(;s.nodeType===1;){var g=u;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[sc])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(v=s.getAttribute("rel"),v==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(v!==g.rel||s.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||s.getAttribute("title")!==(g.title==null?null:g.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(v=s.getAttribute("src"),(v!==(g.src==null?null:g.src)||s.getAttribute("type")!==(g.type==null?null:g.type)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&s.getAttribute("name")===v)return s}else return s;if(s=ja(s.nextSibling),s===null)break}return null}function mC(s,i,u){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=ja(s.nextSibling),s===null))return null;return s}function yy(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=ja(s.nextSibling),s===null))return null;return s}function lp(s){return s.data==="$?"||s.data==="$~"}function ip(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function hC(s,i){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||u.readyState!=="loading")i();else{var h=function(){i(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function ja(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var op=null;function by(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(i===0)return ja(s.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}s=s.nextSibling}return null}function wy(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return s;i--}else u!=="/$"&&u!=="/&"||i++}s=s.previousSibling}return null}function jy(s,i,u){switch(i=s0(u),s){case"html":if(s=i.documentElement,!s)throw Error(a(452));return s;case"head":if(s=i.head,!s)throw Error(a(453));return s;case"body":if(s=i.body,!s)throw Error(a(454));return s;default:throw Error(a(451))}}function qc(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);ch(s)}var Na=new Map,Ny=new Set;function l0(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var _s=le.d;le.d={f:fC,r:pC,D:xC,C:gC,L:vC,m:yC,X:wC,S:bC,M:jC};function fC(){var s=_s.f(),i=Qd();return s||i}function pC(s){var i=Ri(s);i!==null&&i.tag===5&&i.type==="form"?I4(i):_s.r(s)}var fo=typeof document>"u"?null:document;function Sy(s,i,u){var h=fo;if(h&&typeof i=="string"&&i){var g=pa(i);g='link[rel="'+s+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),Ny.has(g)||(Ny.add(g),s={rel:s,crossOrigin:u,href:i},h.querySelector(g)===null&&(i=h.createElement("link"),fr(i,"link",s),sr(i),h.head.appendChild(i)))}}function xC(s){_s.D(s),Sy("dns-prefetch",s,null)}function gC(s,i){_s.C(s,i),Sy("preconnect",s,i)}function vC(s,i,u){_s.L(s,i,u);var h=fo;if(h&&s&&i){var g='link[rel="preload"][as="'+pa(i)+'"]';i==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+pa(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+pa(u.imageSizes)+'"]')):g+='[href="'+pa(s)+'"]';var v=g;switch(i){case"style":v=po(s);break;case"script":v=xo(s)}Na.has(v)||(s=x({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:s,as:i},u),Na.set(v,s),h.querySelector(g)!==null||i==="style"&&h.querySelector(Hc(v))||i==="script"&&h.querySelector(Uc(v))||(i=h.createElement("link"),fr(i,"link",s),sr(i),h.head.appendChild(i)))}}function yC(s,i){_s.m(s,i);var u=fo;if(u&&s){var h=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+pa(h)+'"][href="'+pa(s)+'"]',v=g;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=xo(s)}if(!Na.has(v)&&(s=x({rel:"modulepreload",href:s},i),Na.set(v,s),u.querySelector(g)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Uc(v)))return}h=u.createElement("link"),fr(h,"link",s),sr(h),u.head.appendChild(h)}}}function bC(s,i,u){_s.S(s,i,u);var h=fo;if(h&&s){var g=Li(h).hoistableStyles,v=po(s);i=i||"default";var _=g.get(v);if(!_){var P={loading:0,preload:null};if(_=h.querySelector(Hc(v)))P.loading=5;else{s=x({rel:"stylesheet",href:s,"data-precedence":i},u),(u=Na.get(v))&&cp(s,u);var W=_=h.createElement("link");sr(W),fr(W,"link",s),W._p=new Promise(function(me,Se){W.onload=me,W.onerror=Se}),W.addEventListener("load",function(){P.loading|=1}),W.addEventListener("error",function(){P.loading|=2}),P.loading|=4,i0(_,i,h)}_={type:"stylesheet",instance:_,count:1,state:P},g.set(v,_)}}}function wC(s,i){_s.X(s,i);var u=fo;if(u&&s){var h=Li(u).hoistableScripts,g=xo(s),v=h.get(g);v||(v=u.querySelector(Uc(g)),v||(s=x({src:s,async:!0},i),(i=Na.get(g))&&up(s,i),v=u.createElement("script"),sr(v),fr(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(g,v))}}function jC(s,i){_s.M(s,i);var u=fo;if(u&&s){var h=Li(u).hoistableScripts,g=xo(s),v=h.get(g);v||(v=u.querySelector(Uc(g)),v||(s=x({src:s,async:!0,type:"module"},i),(i=Na.get(g))&&up(s,i),v=u.createElement("script"),sr(v),fr(v,"link",s),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},h.set(g,v))}}function ky(s,i,u,h){var g=(g=ce.current)?l0(g):null;if(!g)throw Error(a(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=po(u.href),u=Li(g).hoistableStyles,h=u.get(i),h||(h={type:"style",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=po(u.href);var v=Li(g).hoistableStyles,_=v.get(s);if(_||(g=g.ownerDocument||g,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(s,_),(v=g.querySelector(Hc(s)))&&!v._p&&(_.instance=v,_.state.loading=5),Na.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Na.set(s,u),v||NC(g,s,u,_.state))),i&&h===null)throw Error(a(528,""));return _}if(i&&h!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=xo(u),u=Li(g).hoistableScripts,h=u.get(i),h||(h={type:"script",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,s))}}function po(s){return'href="'+pa(s)+'"'}function Hc(s){return'link[rel="stylesheet"]['+s+"]"}function Cy(s){return x({},s,{"data-precedence":s.precedence,precedence:null})}function NC(s,i,u,h){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?h.loading=1:(i=s.createElement("link"),h.preload=i,i.addEventListener("load",function(){return h.loading|=1}),i.addEventListener("error",function(){return h.loading|=2}),fr(i,"link",u),sr(i),s.head.appendChild(i))}function xo(s){return'[src="'+pa(s)+'"]'}function Uc(s){return"script[async]"+s}function Ty(s,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var h=s.querySelector('style[data-href~="'+pa(u.href)+'"]');if(h)return i.instance=h,sr(h),h;var g=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),sr(h),fr(h,"style",g),i0(h,u.precedence,s),i.instance=h;case"stylesheet":g=po(u.href);var v=s.querySelector(Hc(g));if(v)return i.state.loading|=4,i.instance=v,sr(v),v;h=Cy(u),(g=Na.get(g))&&cp(h,g),v=(s.ownerDocument||s).createElement("link"),sr(v);var _=v;return _._p=new Promise(function(P,W){_.onload=P,_.onerror=W}),fr(v,"link",h),i.state.loading|=4,i0(v,u.precedence,s),i.instance=v;case"script":return v=xo(u.src),(g=s.querySelector(Uc(v)))?(i.instance=g,sr(g),g):(h=u,(g=Na.get(v))&&(h=x({},u),up(h,g)),s=s.ownerDocument||s,g=s.createElement("script"),sr(g),fr(g,"link",h),s.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(h=i.instance,i.state.loading|=4,i0(h,u.precedence,s));return i.instance}function i0(s,i,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=h.length?h[h.length-1]:null,v=g,_=0;_<h.length;_++){var P=h[_];if(P.dataset.precedence===i)v=P;else if(v!==g)break}v?v.parentNode.insertBefore(s,v.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(s,i.firstChild))}function cp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function up(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var o0=null;function _y(s,i,u){if(o0===null){var h=new Map,g=o0=new Map;g.set(u,h)}else g=o0,h=g.get(u),h||(h=new Map,g.set(u,h));if(h.has(s))return h;for(h.set(s,null),u=u.getElementsByTagName(s),g=0;g<u.length;g++){var v=u[g];if(!(v[sc]||v[ur]||s==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var _=v.getAttribute(i)||"";_=s+_;var P=h.get(_);P?P.push(v):h.set(_,[v])}}return h}function Ey(s,i,u){s=s.ownerDocument||s,s.head.insertBefore(u,i==="title"?s.querySelector("head > title"):null)}function SC(s,i,u){if(u===1||i.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return s=i.disabled,typeof i.precedence=="string"&&s==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function My(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function kC(s,i,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=po(h.href),v=i.querySelector(Hc(g));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=c0.bind(s),i.then(s,s)),u.state.loading|=4,u.instance=v,sr(v);return}v=i.ownerDocument||i,h=Cy(h),(g=Na.get(g))&&cp(h,g),v=v.createElement("link"),sr(v);var _=v;_._p=new Promise(function(P,W){_.onload=P,_.onerror=W}),fr(v,"link",h),u.instance=v}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=c0.bind(s),i.addEventListener("load",u),i.addEventListener("error",u))}}var dp=0;function CC(s,i){return s.stylesheets&&s.count===0&&d0(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var h=setTimeout(function(){if(s.stylesheets&&d0(s,s.stylesheets),s.unsuspend){var v=s.unsuspend;s.unsuspend=null,v()}},6e4+i);0<s.imgBytes&&dp===0&&(dp=62500*lC());var g=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&d0(s,s.stylesheets),s.unsuspend)){var v=s.unsuspend;s.unsuspend=null,v()}},(s.imgBytes>dp?50:800)+i);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(g)}}:null}function c0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)d0(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var u0=null;function d0(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,u0=new Map,i.forEach(TC,s),u0=null,c0.call(s))}function TC(s,i){if(!(i.state.loading&4)){var u=u0.get(s);if(u)var h=u.get(null);else{u=new Map,u0.set(s,u);for(var g=s.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var _=g[v];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(u.set(_.dataset.precedence,_),h=_)}h&&u.set(null,h)}g=i.instance,_=g.getAttribute("data-precedence"),v=u.get(_)||h,v===h&&u.set(null,g),u.set(_,g),this.count++,h=c0.bind(this),g.addEventListener("load",h),g.addEventListener("error",h),v?v.parentNode.insertBefore(g,v.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(g,s.firstChild)),i.state.loading|=4}}var $c={$$typeof:A,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function _C(s,i,u,h,g,v,_,P,W){this.tag=1,this.containerInfo=s,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=Il(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Il(0),this.hiddenUpdates=Il(null),this.identifierPrefix=h,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Ay(s,i,u,h,g,v,_,P,W,me,Se,Ce){return s=new _C(s,i,u,_,W,me,Se,Ce,P),i=1,v===!0&&(i|=24),v=ea(3,null,null,i),s.current=v,v.stateNode=s,i=Uh(),i.refCount++,s.pooledCache=i,i.refCount++,v.memoizedState={element:h,isDehydrated:u,cache:i},Yh(v),s}function Dy(s){return s?(s=Gi,s):Gi}function zy(s,i,u,h,g,v){g=Dy(g),h.context===null?h.context=g:h.pendingContext=g,h=Js(i),h.payload={element:u},v=v===void 0?null:v,v!==null&&(h.callback=v),u=el(s,h,i),u!==null&&(Ir(u,s,i),jc(u,s,i))}function Oy(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<i?u:i}}function mp(s,i){Oy(s,i),(s=s.alternate)&&Oy(s,i)}function Ry(s){if(s.tag===13||s.tag===31){var i=Vl(s,67108864);i!==null&&Ir(i,s,67108864),mp(s,67108864)}}function Ly(s){if(s.tag===13||s.tag===31){var i=sa();i=lh(i);var u=Vl(s,i);u!==null&&Ir(u,s,i),mp(s,i)}}var m0=!0;function EC(s,i,u,h){var g=H.T;H.T=null;var v=le.p;try{le.p=2,hp(s,i,u,h)}finally{le.p=v,H.T=g}}function MC(s,i,u,h){var g=H.T;H.T=null;var v=le.p;try{le.p=8,hp(s,i,u,h)}finally{le.p=v,H.T=g}}function hp(s,i,u,h){if(m0){var g=fp(h);if(g===null)Jf(s,i,h,h0,u),Py(s,h);else if(DC(g,s,i,u,h))h.stopPropagation();else if(Py(s,h),i&4&&-1<AC.indexOf(s)){for(;g!==null;){var v=Ri(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var _=bt(v.pendingLanes);if(_!==0){var P=v;for(P.pendingLanes|=2,P.entangledLanes|=2;_;){var W=1<<31-mt(_);P.entanglements[1]|=W,_&=~W}Wa(v),(Vt&6)===0&&(Xd=$e()+500,Pc(0))}}break;case 31:case 13:P=Vl(v,2),P!==null&&Ir(P,v,2),Qd(),mp(v,2)}if(v=fp(h),v===null&&Jf(s,i,h,h0,u),v===g)break;g=v}g!==null&&h.stopPropagation()}else Jf(s,i,h,null,u)}}function fp(s){return s=ph(s),pp(s)}var h0=null;function pp(s){if(h0=null,s=Oi(s),s!==null){var i=o(s);if(i===null)s=null;else{var u=i.tag;if(u===13){if(s=c(i),s!==null)return s;s=null}else if(u===31){if(s=d(i),s!==null)return s;s=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return h0=s,null}function By(s){switch(s){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(Fn()){case K:return 2;case be:return 8;case Re:case nt:return 32;case kt:return 268435456;default:return 32}default:return 32}}var xp=!1,dl=null,ml=null,hl=null,Vc=new Map,Gc=new Map,fl=[],AC="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 Py(s,i){switch(s){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":ml=null;break;case"mouseover":case"mouseout":hl=null;break;case"pointerover":case"pointerout":Vc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gc.delete(i.pointerId)}}function Yc(s,i,u,h,g,v){return s===null||s.nativeEvent!==v?(s={blockedOn:i,domEventName:u,eventSystemFlags:h,nativeEvent:v,targetContainers:[g]},i!==null&&(i=Ri(i),i!==null&&Ry(i)),s):(s.eventSystemFlags|=h,i=s.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),s)}function DC(s,i,u,h,g){switch(i){case"focusin":return dl=Yc(dl,s,i,u,h,g),!0;case"dragenter":return ml=Yc(ml,s,i,u,h,g),!0;case"mouseover":return hl=Yc(hl,s,i,u,h,g),!0;case"pointerover":var v=g.pointerId;return Vc.set(v,Yc(Vc.get(v)||null,s,i,u,h,g)),!0;case"gotpointercapture":return v=g.pointerId,Gc.set(v,Yc(Gc.get(v)||null,s,i,u,h,g)),!0}return!1}function Fy(s){var i=Oi(s.target);if(i!==null){var u=o(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){s.blockedOn=i,Jg(s.priority,function(){Ly(u)});return}}else if(i===31){if(i=d(u),i!==null){s.blockedOn=i,Jg(s.priority,function(){Ly(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function f0(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var u=fp(s.nativeEvent);if(u===null){u=s.nativeEvent;var h=new u.constructor(u.type,u);fh=h,u.target.dispatchEvent(h),fh=null}else return i=Ri(u),i!==null&&Ry(i),s.blockedOn=u,!1;i.shift()}return!0}function Iy(s,i,u){f0(s)&&u.delete(i)}function zC(){xp=!1,dl!==null&&f0(dl)&&(dl=null),ml!==null&&f0(ml)&&(ml=null),hl!==null&&f0(hl)&&(hl=null),Vc.forEach(Iy),Gc.forEach(Iy)}function p0(s,i){s.blockedOn===i&&(s.blockedOn=null,xp||(xp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,zC)))}var x0=null;function qy(s){x0!==s&&(x0=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){x0===s&&(x0=null);for(var i=0;i<s.length;i+=3){var u=s[i],h=s[i+1],g=s[i+2];if(typeof h!="function"){if(pp(h||u)===null)continue;break}var v=Ri(u);v!==null&&(s.splice(i,3),i-=3,ff(v,{pending:!0,data:g,method:u.method,action:h},h,g))}}))}function go(s){function i(W){return p0(W,s)}dl!==null&&p0(dl,s),ml!==null&&p0(ml,s),hl!==null&&p0(hl,s),Vc.forEach(i),Gc.forEach(i);for(var u=0;u<fl.length;u++){var h=fl[u];h.blockedOn===s&&(h.blockedOn=null)}for(;0<fl.length&&(u=fl[0],u.blockedOn===null);)Fy(u),u.blockedOn===null&&fl.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var g=u[h],v=u[h+1],_=g[Or]||null;if(typeof v=="function")_||qy(u);else if(_){var P=null;if(v&&v.hasAttribute("formAction")){if(g=v,_=v[Or]||null)P=_.formAction;else if(pp(g)!==null)continue}else P=_.action;typeof P=="function"?u[h+1]=P:(u.splice(h,3),h-=3),qy(u)}}}function Hy(){function s(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(_){return g=_})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,g=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function gp(s){this._internalRoot=s}g0.prototype.render=gp.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(a(409));var u=i.current,h=sa();zy(u,h,s,i,null,null)},g0.prototype.unmount=gp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;zy(s.current,2,null,s,null,null),Qd(),i[zi]=null}};function g0(s){this._internalRoot=s}g0.prototype.unstable_scheduleHydration=function(s){if(s){var i=Zg();s={blockedOn:null,target:s,priority:i};for(var u=0;u<fl.length&&i!==0&&i<fl[u].priority;u++);fl.splice(u,0,s),u===0&&Fy(s)}};var Uy=t.version;if(Uy!=="19.2.0")throw Error(a(527,Uy,"19.2.0"));le.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(a(188)):(s=Object.keys(s).join(","),Error(a(268,s)));return s=f(i),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var OC={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var v0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!v0.isDisabled&&v0.supportsFiber)try{pe=v0.inject(OC),Ee=v0}catch{}}return Xc.createRoot=function(s,i){if(!l(s))throw Error(a(299));var u=!1,h="",g=K4,v=Q4,_=Z4;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(_=i.onRecoverableError)),i=Ay(s,1,!1,null,null,u,h,null,g,v,_,Hy),s[zi]=i.current,Zf(s),new gp(i)},Xc.hydrateRoot=function(s,i,u){if(!l(s))throw Error(a(299));var h=!1,g="",v=K4,_=Q4,P=Z4,W=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(_=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),i=Ay(s,1,!0,i,u??null,h,g,W,v,_,P,Hy),i.context=Dy(null),u=i.current,h=sa(),h=lh(h),g=Js(h),g.callback=null,el(u,g,h),u=h,i.current.lanes=u,ac(i,u),Wa(i),s[zi]=i.current,Zf(s),new g0(i)},Xc.version="19.2.0",Xc}var eb;function FT(){if(eb)return bp.exports;eb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),bp.exports=PT(),bp.exports}var IT=FT();function d6(e,t){return function(){return e.apply(t,arguments)}}const{toString:qT}=Object.prototype,{getPrototypeOf:k1}=Object,{iterator:Tm,toStringTag:m6}=Symbol,_m=(e=>t=>{const n=qT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),$a=e=>(e=e.toLowerCase(),t=>_m(t)===e),Em=e=>t=>typeof t===e,{isArray:Go}=Array,Fo=Em("undefined");function Ou(e){return e!==null&&!Fo(e)&&e.constructor!==null&&!Fo(e.constructor)&&Vr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const h6=$a("ArrayBuffer");function HT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&h6(e.buffer),t}const UT=Em("string"),Vr=Em("function"),f6=Em("number"),Ru=e=>e!==null&&typeof e=="object",$T=e=>e===!0||e===!1,$0=e=>{if(_m(e)!=="object")return!1;const t=k1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(m6 in e)&&!(Tm in e)},VT=e=>{if(!Ru(e)||Ou(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},GT=$a("Date"),YT=$a("File"),WT=$a("Blob"),XT=$a("FileList"),KT=e=>Ru(e)&&Vr(e.pipe),QT=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Vr(e.append)&&((t=_m(e))==="formdata"||t==="object"&&Vr(e.toString)&&e.toString()==="[object FormData]"))},ZT=$a("URLSearchParams"),[JT,e_,t_,n_]=["ReadableStream","Request","Response","Headers"].map($a),r_=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lu(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,l;if(typeof e!="object"&&(e=[e]),Go(e))for(a=0,l=e.length;a<l;a++)t.call(null,e[a],a,e);else{if(Ou(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),c=o.length;let d;for(a=0;a<c;a++)d=o[a],t.call(null,e[d],d,e)}}function p6(e,t){if(Ou(e))return null;t=t.toLowerCase();const n=Object.keys(e);let a=n.length,l;for(;a-- >0;)if(l=n[a],t===l.toLowerCase())return l;return null}const ci=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,x6=e=>!Fo(e)&&e!==ci;function kx(){const{caseless:e,skipUndefined:t}=x6(this)&&this||{},n={},a=(l,o)=>{const c=e&&p6(n,o)||o;$0(n[c])&&$0(l)?n[c]=kx(n[c],l):$0(l)?n[c]=kx({},l):Go(l)?n[c]=l.slice():(!t||!Fo(l))&&(n[c]=l)};for(let l=0,o=arguments.length;l<o;l++)arguments[l]&&Lu(arguments[l],a);return n}const a_=(e,t,n,{allOwnKeys:a}={})=>(Lu(t,(l,o)=>{n&&Vr(l)?e[o]=d6(l,n):e[o]=l},{allOwnKeys:a}),e),s_=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),l_=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},i_=(e,t,n,a)=>{let l,o,c;const d={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),o=l.length;o-- >0;)c=l[o],(!a||a(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&k1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},o_=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},c_=e=>{if(!e)return null;if(Go(e))return e;let t=e.length;if(!f6(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},u_=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&k1(Uint8Array)),d_=(e,t)=>{const a=(e&&e[Tm]).call(e);let l;for(;(l=a.next())&&!l.done;){const o=l.value;t.call(e,o[0],o[1])}},m_=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},h_=$a("HTMLFormElement"),f_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,l){return a.toUpperCase()+l}),tb=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),p_=$a("RegExp"),g6=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};Lu(n,(l,o)=>{let c;(c=t(l,o,e))!==!1&&(a[o]=c||l)}),Object.defineProperties(e,a)},x_=e=>{g6(e,(t,n)=>{if(Vr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(Vr(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},g_=(e,t)=>{const n={},a=l=>{l.forEach(o=>{n[o]=!0})};return Go(e)?a(e):a(String(e).split(t)),n},v_=()=>{},y_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function b_(e){return!!(e&&Vr(e.append)&&e[m6]==="FormData"&&e[Tm])}const w_=e=>{const t=new Array(10),n=(a,l)=>{if(Ru(a)){if(t.indexOf(a)>=0)return;if(Ou(a))return a;if(!("toJSON"in a)){t[l]=a;const o=Go(a)?[]:{};return Lu(a,(c,d)=>{const m=n(c,l+1);!Fo(m)&&(o[d]=m)}),t[l]=void 0,o}}return a};return n(e,0)},j_=$a("AsyncFunction"),N_=e=>e&&(Ru(e)||Vr(e))&&Vr(e.then)&&Vr(e.catch),v6=((e,t)=>e?setImmediate:t?((n,a)=>(ci.addEventListener("message",({source:l,data:o})=>{l===ci&&o===n&&a.length&&a.shift()()},!1),l=>{a.push(l),ci.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Vr(ci.postMessage)),S_=typeof queueMicrotask<"u"?queueMicrotask.bind(ci):typeof process<"u"&&process.nextTick||v6,k_=e=>e!=null&&Vr(e[Tm]),ve={isArray:Go,isArrayBuffer:h6,isBuffer:Ou,isFormData:QT,isArrayBufferView:HT,isString:UT,isNumber:f6,isBoolean:$T,isObject:Ru,isPlainObject:$0,isEmptyObject:VT,isReadableStream:JT,isRequest:e_,isResponse:t_,isHeaders:n_,isUndefined:Fo,isDate:GT,isFile:YT,isBlob:WT,isRegExp:p_,isFunction:Vr,isStream:KT,isURLSearchParams:ZT,isTypedArray:u_,isFileList:XT,forEach:Lu,merge:kx,extend:a_,trim:r_,stripBOM:s_,inherits:l_,toFlatObject:i_,kindOf:_m,kindOfTest:$a,endsWith:o_,toArray:c_,forEachEntry:d_,matchAll:m_,isHTMLForm:h_,hasOwnProperty:tb,hasOwnProp:tb,reduceDescriptors:g6,freezeMethods:x_,toObjectSet:g_,toCamelCase:f_,noop:v_,toFiniteNumber:y_,findKey:p6,global:ci,isContextDefined:x6,isSpecCompliantForm:b_,toJSONObject:w_,isAsyncFn:j_,isThenable:N_,setImmediate:v6,asap:S_,isIterable:k_};function ft(e,t,n,a,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),l&&(this.response=l,this.status=l.status?l.status:null)}ve.inherits(ft,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:ve.toJSONObject(this.config),code:this.code,status:this.status}}});const y6=ft.prototype,b6={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{b6[e]={value:e}});Object.defineProperties(ft,b6);Object.defineProperty(y6,"isAxiosError",{value:!0});ft.from=(e,t,n,a,l,o)=>{const c=Object.create(y6);ve.toFlatObject(e,c,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const d=e&&e.message?e.message:"Error",m=t==null&&e?e.code:t;return ft.call(c,d,m,n,a,l),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",o&&Object.assign(c,o),c};const C_=null;function Cx(e){return ve.isPlainObject(e)||ve.isArray(e)}function w6(e){return ve.endsWith(e,"[]")?e.slice(0,-2):e}function nb(e,t,n){return e?e.concat(t).map(function(l,o){return l=w6(l),!n&&o?"["+l+"]":l}).join(n?".":""):t}function T_(e){return ve.isArray(e)&&!e.some(Cx)}const __=ve.toFlatObject(ve,{},null,function(t){return/^is[A-Z]/.test(t)});function Mm(e,t,n){if(!ve.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ve.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,S){return!ve.isUndefined(S[k])});const a=n.metaTokens,l=n.visitor||p,o=n.dots,c=n.indexes,m=(n.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(t);if(!ve.isFunction(l))throw new TypeError("visitor must be a function");function f(N){if(N===null)return"";if(ve.isDate(N))return N.toISOString();if(ve.isBoolean(N))return N.toString();if(!m&&ve.isBlob(N))throw new ft("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(N)||ve.isTypedArray(N)?m&&typeof Blob=="function"?new Blob([N]):Buffer.from(N):N}function p(N,k,S){let T=N;if(N&&!S&&typeof N=="object"){if(ve.endsWith(k,"{}"))k=a?k:k.slice(0,-2),N=JSON.stringify(N);else if(ve.isArray(N)&&T_(N)||(ve.isFileList(N)||ve.endsWith(k,"[]"))&&(T=ve.toArray(N)))return k=w6(k),T.forEach(function(A,R){!(ve.isUndefined(A)||A===null)&&t.append(c===!0?nb([k],R,o):c===null?k:k+"[]",f(A))}),!1}return Cx(N)?!0:(t.append(nb(S,k,o),f(N)),!1)}const x=[],y=Object.assign(__,{defaultVisitor:p,convertValue:f,isVisitable:Cx});function b(N,k){if(!ve.isUndefined(N)){if(x.indexOf(N)!==-1)throw Error("Circular reference detected in "+k.join("."));x.push(N),ve.forEach(N,function(T,M){(!(ve.isUndefined(T)||T===null)&&l.call(t,T,ve.isString(M)?M.trim():M,k,y))===!0&&b(T,k?k.concat(M):[M])}),x.pop()}}if(!ve.isObject(e))throw new TypeError("data must be an object");return b(e),t}function rb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function C1(e,t){this._pairs=[],e&&Mm(e,this,t)}const j6=C1.prototype;j6.append=function(t,n){this._pairs.push([t,n])};j6.toString=function(t){const n=t?function(a){return t.call(this,a,rb)}:rb;return this._pairs.map(function(l){return n(l[0])+"="+n(l[1])},"").join("&")};function E_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function N6(e,t,n){if(!t)return e;const a=n&&n.encode||E_;ve.isFunction(n)&&(n={serialize:n});const l=n&&n.serialize;let o;if(l?o=l(t,n):o=ve.isURLSearchParams(t)?t.toString():new C1(t,n).toString(a),o){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class ab{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ve.forEach(this.handlers,function(a){a!==null&&t(a)})}}const S6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},M_=typeof URLSearchParams<"u"?URLSearchParams:C1,A_=typeof FormData<"u"?FormData:null,D_=typeof Blob<"u"?Blob:null,z_={isBrowser:!0,classes:{URLSearchParams:M_,FormData:A_,Blob:D_},protocols:["http","https","file","blob","url","data"]},T1=typeof window<"u"&&typeof document<"u",Tx=typeof navigator=="object"&&navigator||void 0,O_=T1&&(!Tx||["ReactNative","NativeScript","NS"].indexOf(Tx.product)<0),R_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",L_=T1&&window.location.href||"http://localhost",B_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:T1,hasStandardBrowserEnv:O_,hasStandardBrowserWebWorkerEnv:R_,navigator:Tx,origin:L_},Symbol.toStringTag,{value:"Module"})),br={...B_,...z_};function P_(e,t){return Mm(e,new br.classes.URLSearchParams,{visitor:function(n,a,l,o){return br.isNode&&ve.isBuffer(n)?(this.append(a,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function F_(e){return ve.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function I_(e){const t={},n=Object.keys(e);let a;const l=n.length;let o;for(a=0;a<l;a++)o=n[a],t[o]=e[o];return t}function k6(e){function t(n,a,l,o){let c=n[o++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),m=o>=n.length;return c=!c&&ve.isArray(l)?l.length:c,m?(ve.hasOwnProp(l,c)?l[c]=[l[c],a]:l[c]=a,!d):((!l[c]||!ve.isObject(l[c]))&&(l[c]=[]),t(n,a,l[c],o)&&ve.isArray(l[c])&&(l[c]=I_(l[c])),!d)}if(ve.isFormData(e)&&ve.isFunction(e.entries)){const n={};return ve.forEachEntry(e,(a,l)=>{t(F_(a),l,n,0)}),n}return null}function q_(e,t,n){if(ve.isString(e))try{return(t||JSON.parse)(e),ve.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const Bu={transitional:S6,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",l=a.indexOf("application/json")>-1,o=ve.isObject(t);if(o&&ve.isHTMLForm(t)&&(t=new FormData(t)),ve.isFormData(t))return l?JSON.stringify(k6(t)):t;if(ve.isArrayBuffer(t)||ve.isBuffer(t)||ve.isStream(t)||ve.isFile(t)||ve.isBlob(t)||ve.isReadableStream(t))return t;if(ve.isArrayBufferView(t))return t.buffer;if(ve.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(o){if(a.indexOf("application/x-www-form-urlencoded")>-1)return P_(t,this.formSerializer).toString();if((d=ve.isFileList(t))||a.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return Mm(d?{"files[]":t}:t,m&&new m,this.formSerializer)}}return o||l?(n.setContentType("application/json",!1),q_(t)):t}],transformResponse:[function(t){const n=this.transitional||Bu.transitional,a=n&&n.forcedJSONParsing,l=this.responseType==="json";if(ve.isResponse(t)||ve.isReadableStream(t))return t;if(t&&ve.isString(t)&&(a&&!this.responseType||l)){const c=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?ft.from(d,ft.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:br.classes.FormData,Blob:br.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],e=>{Bu.headers[e]={}});const H_=ve.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"]),U_=e=>{const t={};let n,a,l;return e&&e.split(`
`).forEach(function(c){l=c.indexOf(":"),n=c.substring(0,l).trim().toLowerCase(),a=c.substring(l+1).trim(),!(!n||t[n]&&H_[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},sb=Symbol("internals");function Kc(e){return e&&String(e).trim().toLowerCase()}function V0(e){return e===!1||e==null?e:ve.isArray(e)?e.map(V0):String(e)}function $_(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const V_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Np(e,t,n,a,l){if(ve.isFunction(a))return a.call(this,t,n);if(l&&(t=n),!!ve.isString(t)){if(ve.isString(a))return t.indexOf(a)!==-1;if(ve.isRegExp(a))return a.test(t)}}function G_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function Y_(e,t){const n=ve.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(l,o,c){return this[a].call(this,t,l,o,c)},configurable:!0})})}let Gr=class{constructor(t){t&&this.set(t)}set(t,n,a){const l=this;function o(d,m,f){const p=Kc(m);if(!p)throw new Error("header name must be a non-empty string");const x=ve.findKey(l,p);(!x||l[x]===void 0||f===!0||f===void 0&&l[x]!==!1)&&(l[x||m]=V0(d))}const c=(d,m)=>ve.forEach(d,(f,p)=>o(f,p,m));if(ve.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ve.isString(t)&&(t=t.trim())&&!V_(t))c(U_(t),n);else if(ve.isObject(t)&&ve.isIterable(t)){let d={},m,f;for(const p of t){if(!ve.isArray(p))throw TypeError("Object iterator must return a key-value pair");d[f=p[0]]=(m=d[f])?ve.isArray(m)?[...m,p[1]]:[m,p[1]]:p[1]}c(d,n)}else t!=null&&o(n,t,a);return this}get(t,n){if(t=Kc(t),t){const a=ve.findKey(this,t);if(a){const l=this[a];if(!n)return l;if(n===!0)return $_(l);if(ve.isFunction(n))return n.call(this,l,a);if(ve.isRegExp(n))return n.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Kc(t),t){const a=ve.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||Np(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let l=!1;function o(c){if(c=Kc(c),c){const d=ve.findKey(a,c);d&&(!n||Np(a,a[d],d,n))&&(delete a[d],l=!0)}}return ve.isArray(t)?t.forEach(o):o(t),l}clear(t){const n=Object.keys(this);let a=n.length,l=!1;for(;a--;){const o=n[a];(!t||Np(this,this[o],o,t,!0))&&(delete this[o],l=!0)}return l}normalize(t){const n=this,a={};return ve.forEach(this,(l,o)=>{const c=ve.findKey(a,o);if(c){n[c]=V0(l),delete n[o];return}const d=t?G_(o):String(o).trim();d!==o&&delete n[o],n[d]=V0(l),a[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ve.forEach(this,(a,l)=>{a!=null&&a!==!1&&(n[l]=t&&ve.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(l=>a.set(l)),a}static accessor(t){const a=(this[sb]=this[sb]={accessors:{}}).accessors,l=this.prototype;function o(c){const d=Kc(c);a[d]||(Y_(l,c),a[d]=!0)}return ve.isArray(t)?t.forEach(o):o(t),this}};Gr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ve.reduceDescriptors(Gr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});ve.freezeMethods(Gr);function Sp(e,t){const n=this||Bu,a=t||n,l=Gr.from(a.headers);let o=a.data;return ve.forEach(e,function(d){o=d.call(n,o,l.normalize(),t?t.status:void 0)}),l.normalize(),o}function C6(e){return!!(e&&e.__CANCEL__)}function Yo(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}ve.inherits(Yo,ft,{__CANCEL__:!0});function T6(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function W_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function X_(e,t){e=e||10;const n=new Array(e),a=new Array(e);let l=0,o=0,c;return t=t!==void 0?t:1e3,function(m){const f=Date.now(),p=a[o];c||(c=f),n[l]=m,a[l]=f;let x=o,y=0;for(;x!==l;)y+=n[x++],x=x%e;if(l=(l+1)%e,l===o&&(o=(o+1)%e),f-c<t)return;const b=p&&f-p;return b?Math.round(y*1e3/b):void 0}}function K_(e,t){let n=0,a=1e3/t,l,o;const c=(f,p=Date.now())=>{n=p,l=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const p=Date.now(),x=p-n;x>=a?c(f,p):(l=f,o||(o=setTimeout(()=>{o=null,c(l)},a-x)))},()=>l&&c(l)]}const rm=(e,t,n=3)=>{let a=0;const l=X_(50,250);return K_(o=>{const c=o.loaded,d=o.lengthComputable?o.total:void 0,m=c-a,f=l(m),p=c<=d;a=c;const x={loaded:c,total:d,progress:d?c/d:void 0,bytes:m,rate:f||void 0,estimated:f&&d&&p?(d-c)/f:void 0,event:o,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(x)},n)},lb=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},ib=e=>(...t)=>ve.asap(()=>e(...t)),Q_=br.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,br.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(br.origin),br.navigator&&/(msie|trident)/i.test(br.navigator.userAgent)):()=>!0,Z_=br.hasStandardBrowserEnv?{write(e,t,n,a,l,o,c){if(typeof document>"u")return;const d=[`${e}=${encodeURIComponent(t)}`];ve.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),ve.isString(a)&&d.push(`path=${a}`),ve.isString(l)&&d.push(`domain=${l}`),o===!0&&d.push("secure"),ve.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function J_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eE(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _6(e,t,n){let a=!J_(t);return e&&(a||n==!1)?eE(e,t):t}const ob=e=>e instanceof Gr?{...e}:e;function gi(e,t){t=t||{};const n={};function a(f,p,x,y){return ve.isPlainObject(f)&&ve.isPlainObject(p)?ve.merge.call({caseless:y},f,p):ve.isPlainObject(p)?ve.merge({},p):ve.isArray(p)?p.slice():p}function l(f,p,x,y){if(ve.isUndefined(p)){if(!ve.isUndefined(f))return a(void 0,f,x,y)}else return a(f,p,x,y)}function o(f,p){if(!ve.isUndefined(p))return a(void 0,p)}function c(f,p){if(ve.isUndefined(p)){if(!ve.isUndefined(f))return a(void 0,f)}else return a(void 0,p)}function d(f,p,x){if(x in t)return a(f,p);if(x in e)return a(void 0,f)}const m={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(f,p,x)=>l(ob(f),ob(p),x,!0)};return ve.forEach(Object.keys({...e,...t}),function(p){const x=m[p]||l,y=x(e[p],t[p],p);ve.isUndefined(y)&&x!==d||(n[p]=y)}),n}const E6=e=>{const t=gi({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:l,xsrfCookieName:o,headers:c,auth:d}=t;if(t.headers=c=Gr.from(c),t.url=N6(_6(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),ve.isFormData(n)){if(br.hasStandardBrowserEnv||br.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(ve.isFunction(n.getHeaders)){const m=n.getHeaders(),f=["content-type","content-length"];Object.entries(m).forEach(([p,x])=>{f.includes(p.toLowerCase())&&c.set(p,x)})}}if(br.hasStandardBrowserEnv&&(a&&ve.isFunction(a)&&(a=a(t)),a||a!==!1&&Q_(t.url))){const m=l&&o&&Z_.read(o);m&&c.set(l,m)}return t},tE=typeof XMLHttpRequest<"u",nE=tE&&function(e){return new Promise(function(n,a){const l=E6(e);let o=l.data;const c=Gr.from(l.headers).normalize();let{responseType:d,onUploadProgress:m,onDownloadProgress:f}=l,p,x,y,b,N;function k(){b&&b(),N&&N(),l.cancelToken&&l.cancelToken.unsubscribe(p),l.signal&&l.signal.removeEventListener("abort",p)}let S=new XMLHttpRequest;S.open(l.method.toUpperCase(),l.url,!0),S.timeout=l.timeout;function T(){if(!S)return;const A=Gr.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),B={data:!d||d==="text"||d==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:A,config:e,request:S};T6(function(L){n(L),k()},function(L){a(L),k()},B),S=null}"onloadend"in S?S.onloadend=T:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(T)},S.onabort=function(){S&&(a(new ft("Request aborted",ft.ECONNABORTED,e,S)),S=null)},S.onerror=function(R){const B=R&&R.message?R.message:"Network Error",O=new ft(B,ft.ERR_NETWORK,e,S);O.event=R||null,a(O),S=null},S.ontimeout=function(){let R=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const B=l.transitional||S6;l.timeoutErrorMessage&&(R=l.timeoutErrorMessage),a(new ft(R,B.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,S)),S=null},o===void 0&&c.setContentType(null),"setRequestHeader"in S&&ve.forEach(c.toJSON(),function(R,B){S.setRequestHeader(B,R)}),ve.isUndefined(l.withCredentials)||(S.withCredentials=!!l.withCredentials),d&&d!=="json"&&(S.responseType=l.responseType),f&&([y,N]=rm(f,!0),S.addEventListener("progress",y)),m&&S.upload&&([x,b]=rm(m),S.upload.addEventListener("progress",x),S.upload.addEventListener("loadend",b)),(l.cancelToken||l.signal)&&(p=A=>{S&&(a(!A||A.type?new Yo(null,e,S):A),S.abort(),S=null)},l.cancelToken&&l.cancelToken.subscribe(p),l.signal&&(l.signal.aborted?p():l.signal.addEventListener("abort",p)));const M=W_(l.url);if(M&&br.protocols.indexOf(M)===-1){a(new ft("Unsupported protocol "+M+":",ft.ERR_BAD_REQUEST,e));return}S.send(o||null)})},rE=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,l;const o=function(f){if(!l){l=!0,d();const p=f instanceof Error?f:this.reason;a.abort(p instanceof ft?p:new Yo(p instanceof Error?p.message:p))}};let c=t&&setTimeout(()=>{c=null,o(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:m}=a;return m.unsubscribe=()=>ve.asap(d),m}},aE=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let a=0,l;for(;a<n;)l=a+t,yield e.slice(a,l),a=l},sE=async function*(e,t){for await(const n of lE(e))yield*aE(n,t)},lE=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},cb=(e,t,n,a)=>{const l=sE(e,t);let o=0,c,d=m=>{c||(c=!0,a&&a(m))};return new ReadableStream({async pull(m){try{const{done:f,value:p}=await l.next();if(f){d(),m.close();return}let x=p.byteLength;if(n){let y=o+=x;n(y)}m.enqueue(new Uint8Array(p))}catch(f){throw d(f),f}},cancel(m){return d(m),l.return()}},{highWaterMark:2})},ub=64*1024,{isFunction:j0}=ve,iE=(({Request:e,Response:t})=>({Request:e,Response:t}))(ve.global),{ReadableStream:db,TextEncoder:mb}=ve.global,hb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},oE=e=>{e=ve.merge.call({skipUndefined:!0},iE,e);const{fetch:t,Request:n,Response:a}=e,l=t?j0(t):typeof fetch=="function",o=j0(n),c=j0(a);if(!l)return!1;const d=l&&j0(db),m=l&&(typeof mb=="function"?(N=>k=>N.encode(k))(new mb):async N=>new Uint8Array(await new n(N).arrayBuffer())),f=o&&d&&hb(()=>{let N=!1;const k=new n(br.origin,{body:new db,method:"POST",get duplex(){return N=!0,"half"}}).headers.has("Content-Type");return N&&!k}),p=c&&d&&hb(()=>ve.isReadableStream(new a("").body)),x={stream:p&&(N=>N.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(N=>{!x[N]&&(x[N]=(k,S)=>{let T=k&&k[N];if(T)return T.call(k);throw new ft(`Response type '${N}' is not supported`,ft.ERR_NOT_SUPPORT,S)})});const y=async N=>{if(N==null)return 0;if(ve.isBlob(N))return N.size;if(ve.isSpecCompliantForm(N))return(await new n(br.origin,{method:"POST",body:N}).arrayBuffer()).byteLength;if(ve.isArrayBufferView(N)||ve.isArrayBuffer(N))return N.byteLength;if(ve.isURLSearchParams(N)&&(N=N+""),ve.isString(N))return(await m(N)).byteLength},b=async(N,k)=>{const S=ve.toFiniteNumber(N.getContentLength());return S??y(k)};return async N=>{let{url:k,method:S,data:T,signal:M,cancelToken:A,timeout:R,onDownloadProgress:B,onUploadProgress:O,responseType:L,headers:$,withCredentials:U="same-origin",fetchOptions:I}=E6(N),G=t||fetch;L=L?(L+"").toLowerCase():"text";let ee=rE([M,A&&A.toAbortSignal()],R),Ne=null;const J=ee&&ee.unsubscribe&&(()=>{ee.unsubscribe()});let se;try{if(O&&f&&S!=="get"&&S!=="head"&&(se=await b($,T))!==0){let we=new n(k,{method:"POST",body:T,duplex:"half"}),Z;if(ve.isFormData(T)&&(Z=we.headers.get("content-type"))&&$.setContentType(Z),we.body){const[z,X]=lb(se,rm(ib(O)));T=cb(we.body,ub,z,X)}}ve.isString(U)||(U=U?"include":"omit");const H=o&&"credentials"in n.prototype,le={...I,signal:ee,method:S.toUpperCase(),headers:$.normalize().toJSON(),body:T,duplex:"half",credentials:H?U:void 0};Ne=o&&new n(k,le);let re=await(o?G(Ne,I):G(k,le));const ge=p&&(L==="stream"||L==="response");if(p&&(B||ge&&J)){const we={};["status","statusText","headers"].forEach(q=>{we[q]=re[q]});const Z=ve.toFiniteNumber(re.headers.get("content-length")),[z,X]=B&&lb(Z,rm(ib(B),!0))||[];re=new a(cb(re.body,ub,z,()=>{X&&X(),J&&J()}),we)}L=L||"text";let E=await x[ve.findKey(x,L)||"text"](re,N);return!ge&&J&&J(),await new Promise((we,Z)=>{T6(we,Z,{data:E,headers:Gr.from(re.headers),status:re.status,statusText:re.statusText,config:N,request:Ne})})}catch(H){throw J&&J(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,N,Ne),{cause:H.cause||H}):ft.from(H,H&&H.code,N,Ne)}}},cE=new Map,M6=e=>{let t=e&&e.env||{};const{fetch:n,Request:a,Response:l}=t,o=[a,l,n];let c=o.length,d=c,m,f,p=cE;for(;d--;)m=o[d],f=p.get(m),f===void 0&&p.set(m,f=d?new Map:oE(t)),p=f;return f};M6();const _1={http:C_,xhr:nE,fetch:{get:M6}};ve.forEach(_1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const fb=e=>`- ${e}`,uE=e=>ve.isFunction(e)||e===null||e===!1;function dE(e,t){e=ve.isArray(e)?e:[e];const{length:n}=e;let a,l;const o={};for(let c=0;c<n;c++){a=e[c];let d;if(l=a,!uE(a)&&(l=_1[(d=String(a)).toLowerCase()],l===void 0))throw new ft(`Unknown adapter '${d}'`);if(l&&(ve.isFunction(l)||(l=l.get(t))))break;o[d||"#"+c]=l}if(!l){const c=Object.entries(o).map(([m,f])=>`adapter ${m} `+(f===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
`+c.map(fb).join(`
`):" "+fb(c[0]):"as no adapter specified";throw new ft("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return l}const A6={getAdapter:dE,adapters:_1};function kp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yo(null,e)}function pb(e){return kp(e),e.headers=Gr.from(e.headers),e.data=Sp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),A6.getAdapter(e.adapter||Bu.adapter,e)(e).then(function(a){return kp(e),a.data=Sp.call(e,e.transformResponse,a),a.headers=Gr.from(a.headers),a},function(a){return C6(a)||(kp(e),a&&a.response&&(a.response.data=Sp.call(e,e.transformResponse,a.response),a.response.headers=Gr.from(a.response.headers))),Promise.reject(a)})}const D6="1.13.2",Am={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Am[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const xb={};Am.transitional=function(t,n,a){function l(o,c){return"[Axios v"+D6+"] Transitional option '"+o+"'"+c+(a?". "+a:"")}return(o,c,d)=>{if(t===!1)throw new ft(l(c," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!xb[c]&&(xb[c]=!0,console.warn(l(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,c,d):!0}};Am.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function mE(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let l=a.length;for(;l-- >0;){const o=a[l],c=t[o];if(c){const d=e[o],m=d===void 0||c(d,o,e);if(m!==!0)throw new ft("option "+o+" must be "+m,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+o,ft.ERR_BAD_OPTION)}}const G0={assertOptions:mE,validators:Am},Xa=G0.validators;let fi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ab,response:new ab}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const o=l.stack?l.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
`+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=gi(this.defaults,n);const{transitional:a,paramsSerializer:l,headers:o}=n;a!==void 0&&G0.assertOptions(a,{silentJSONParsing:Xa.transitional(Xa.boolean),forcedJSONParsing:Xa.transitional(Xa.boolean),clarifyTimeoutError:Xa.transitional(Xa.boolean)},!1),l!=null&&(ve.isFunction(l)?n.paramsSerializer={serialize:l}:G0.assertOptions(l,{encode:Xa.function,serialize:Xa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),G0.assertOptions(n,{baseUrl:Xa.spelling("baseURL"),withXsrfToken:Xa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&ve.merge(o.common,o[n.method]);o&&ve.forEach(["delete","get","head","post","put","patch","common"],N=>{delete o[N]}),n.headers=Gr.concat(c,o);const d=[];let m=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(m=m&&k.synchronous,d.unshift(k.fulfilled,k.rejected))});const f=[];this.interceptors.response.forEach(function(k){f.push(k.fulfilled,k.rejected)});let p,x=0,y;if(!m){const N=[pb.bind(this),void 0];for(N.unshift(...d),N.push(...f),y=N.length,p=Promise.resolve(n);x<y;)p=p.then(N[x++],N[x++]);return p}y=d.length;let b=n;for(;x<y;){const N=d[x++],k=d[x++];try{b=N(b)}catch(S){k.call(this,S);break}}try{p=pb.call(this,b)}catch(N){return Promise.reject(N)}for(x=0,y=f.length;x<y;)p=p.then(f[x++],f[x++]);return p}getUri(t){t=gi(this.defaults,t);const n=_6(t.baseURL,t.url,t.allowAbsoluteUrls);return N6(n,t.params,t.paramsSerializer)}};ve.forEach(["delete","get","head","options"],function(t){fi.prototype[t]=function(n,a){return this.request(gi(a||{},{method:t,url:n,data:(a||{}).data}))}});ve.forEach(["post","put","patch"],function(t){function n(a){return function(o,c,d){return this.request(gi(d||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}fi.prototype[t]=n(),fi.prototype[t+"Form"]=n(!0)});let hE=class z6{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(l=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](l);a._listeners=null}),this.promise.then=l=>{let o;const c=new Promise(d=>{a.subscribe(d),o=d}).then(l);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,d){a.reason||(a.reason=new Yo(o,c,d),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new z6(function(l){t=l}),cancel:t}}};function fE(e){return function(n){return e.apply(null,n)}}function pE(e){return ve.isObject(e)&&e.isAxiosError===!0}const _x={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(_x).forEach(([e,t])=>{_x[t]=e});function O6(e){const t=new fi(e),n=d6(fi.prototype.request,t);return ve.extend(n,fi.prototype,t,{allOwnKeys:!0}),ve.extend(n,t,null,{allOwnKeys:!0}),n.create=function(l){return O6(gi(e,l))},n}const An=O6(Bu);An.Axios=fi;An.CanceledError=Yo;An.CancelToken=hE;An.isCancel=C6;An.VERSION=D6;An.toFormData=Mm;An.AxiosError=ft;An.Cancel=An.CanceledError;An.all=function(t){return Promise.all(t)};An.spread=fE;An.isAxiosError=pE;An.mergeConfig=gi;An.AxiosHeaders=Gr;An.formToJSON=e=>k6(ve.isHTMLForm(e)?new FormData(e):e);An.getAdapter=A6.getAdapter;An.HttpStatusCode=_x;An.default=An;const{Axios:wK,AxiosError:jK,CanceledError:NK,isCancel:SK,CancelToken:kK,VERSION:CK,all:TK,Cancel:_K,isAxiosError:EK,spread:MK,toFormData:AK,AxiosHeaders:DK,HttpStatusCode:zK,formToJSON:OK,getAdapter:RK,mergeConfig:LK}=An,xE=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},gE=(e,t)=>({classGroupId:e,validator:t}),R6=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),am="-",gb=[],vE="arbitrary..",yE=e=>{const t=wE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return bE(c);const d=c.split(am),m=d[0]===""&&d.length>1?1:0;return L6(d,m,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const m=a[c],f=n[c];return m?f?xE(f,m):m:f||gb}return n[c]||gb}}},L6=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const f=L6(e,t+1,o);if(f)return f}const c=n.validators;if(c===null)return;const d=t===0?e.join(am):e.slice(t).join(am),m=c.length;for(let f=0;f<m;f++){const p=c[f];if(p.validator(d))return p.classGroupId}},bE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?vE+a:void 0})(),wE=e=>{const{theme:t,classGroups:n}=e;return jE(n,t)},jE=(e,t)=>{const n=R6();for(const a in e){const l=e[a];E1(l,n,a,t)}return n},E1=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];NE(c,t,n,a)}},NE=(e,t,n,a)=>{if(typeof e=="string"){SE(e,t,n);return}if(typeof e=="function"){kE(e,t,n,a);return}CE(e,t,n,a)},SE=(e,t,n)=>{const a=e===""?t:B6(t,e);a.classGroupId=n},kE=(e,t,n,a)=>{if(TE(e)){E1(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(gE(n,e))},CE=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[d,m]=l[c];E1(m,B6(t,d),n,a)}},B6=(e,t)=>{let n=e;const a=t.split(am),l=a.length;for(let o=0;o<l;o++){const c=a[o];let d=n.nextPart.get(c);d||(d=R6(),n.nextPart.set(c,d)),n=d}return n},TE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_E=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},Ex="!",vb=":",EE=[],yb=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),ME=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,d=0,m=0,f;const p=l.length;for(let k=0;k<p;k++){const S=l[k];if(c===0&&d===0){if(S===vb){o.push(l.slice(m,k)),m=k+1;continue}if(S==="/"){f=k;continue}}S==="["?c++:S==="]"?c--:S==="("?d++:S===")"&&d--}const x=o.length===0?l:l.slice(m);let y=x,b=!1;x.endsWith(Ex)?(y=x.slice(0,-1),b=!0):x.startsWith(Ex)&&(y=x.slice(1),b=!0);const N=f&&f>m?f-m:void 0;return yb(o,b,y,N)};if(t){const l=t+vb,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):yb(EE,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},AE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],d=c[0]==="[",m=t.has(c);d||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},DE=e=>({cache:_E(e.cacheSize),parseClassName:ME(e),sortModifiers:AE(e),...yE(e)}),zE=/\s+/,OE=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],d=e.trim().split(zE);let m="";for(let f=d.length-1;f>=0;f-=1){const p=d[f],{isExternal:x,modifiers:y,hasImportantModifier:b,baseClassName:N,maybePostfixModifierPosition:k}=n(p);if(x){m=p+(m.length>0?" "+m:m);continue}let S=!!k,T=a(S?N.substring(0,k):N);if(!T){if(!S){m=p+(m.length>0?" "+m:m);continue}if(T=a(N),!T){m=p+(m.length>0?" "+m:m);continue}S=!1}const M=y.length===0?"":y.length===1?y[0]:o(y).join(":"),A=b?M+Ex:M,R=A+T;if(c.indexOf(R)>-1)continue;c.push(R);const B=l(T,S);for(let O=0;O<B.length;++O){const L=B[O];c.push(A+L)}m=p+(m.length>0?" "+m:m)}return m},RE=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=P6(n))&&(l&&(l+=" "),l+=a);return l},P6=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=P6(e[a]))&&(n&&(n+=" "),n+=t);return n},LE=(e,...t)=>{let n,a,l,o;const c=m=>{const f=t.reduce((p,x)=>x(p),e());return n=DE(f),a=n.cache.get,l=n.cache.set,o=d,d(m)},d=m=>{const f=a(m);if(f)return f;const p=OE(m,n);return l(m,p),p};return o=c,(...m)=>o(RE(...m))},BE=[],Kn=e=>{const t=n=>n[e]||BE;return t.isThemeGetter=!0,t},F6=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I6=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PE=/^\d+\/\d+$/,FE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IE=/\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$/,qE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vo=e=>PE.test(e),wt=e=>!!e&&!Number.isNaN(Number(e)),xl=e=>!!e&&Number.isInteger(Number(e)),Cp=e=>e.endsWith("%")&&wt(e.slice(0,-1)),Es=e=>FE.test(e),$E=()=>!0,VE=e=>IE.test(e)&&!qE.test(e),q6=()=>!1,GE=e=>HE.test(e),YE=e=>UE.test(e),WE=e=>!Ve(e)&&!Ge(e),XE=e=>Wo(e,$6,q6),Ve=e=>F6.test(e),ai=e=>Wo(e,V6,VE),Tp=e=>Wo(e,eM,wt),bb=e=>Wo(e,H6,q6),KE=e=>Wo(e,U6,YE),N0=e=>Wo(e,G6,GE),Ge=e=>I6.test(e),Qc=e=>Xo(e,V6),QE=e=>Xo(e,tM),wb=e=>Xo(e,H6),ZE=e=>Xo(e,$6),JE=e=>Xo(e,U6),S0=e=>Xo(e,G6,!0),Wo=(e,t,n)=>{const a=F6.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Xo=(e,t,n=!1)=>{const a=I6.exec(e);return a?a[1]?t(a[1]):n:!1},H6=e=>e==="position"||e==="percentage",U6=e=>e==="image"||e==="url",$6=e=>e==="length"||e==="size"||e==="bg-size",V6=e=>e==="length",eM=e=>e==="number",tM=e=>e==="family-name",G6=e=>e==="shadow",nM=()=>{const e=Kn("color"),t=Kn("font"),n=Kn("text"),a=Kn("font-weight"),l=Kn("tracking"),o=Kn("leading"),c=Kn("breakpoint"),d=Kn("container"),m=Kn("spacing"),f=Kn("radius"),p=Kn("shadow"),x=Kn("inset-shadow"),y=Kn("text-shadow"),b=Kn("drop-shadow"),N=Kn("blur"),k=Kn("perspective"),S=Kn("aspect"),T=Kn("ease"),M=Kn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...R(),Ge,Ve],O=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],$=()=>[Ge,Ve,m],U=()=>[vo,"full","auto",...$()],I=()=>[xl,"none","subgrid",Ge,Ve],G=()=>["auto",{span:["full",xl,Ge,Ve]},xl,Ge,Ve],ee=()=>[xl,"auto",Ge,Ve],Ne=()=>["auto","min","max","fr",Ge,Ve],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...$()],le=()=>[vo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],re=()=>[e,Ge,Ve],ge=()=>[...R(),wb,bb,{position:[Ge,Ve]}],E=()=>["no-repeat",{repeat:["","x","y","space","round"]}],we=()=>["auto","cover","contain",ZE,XE,{size:[Ge,Ve]}],Z=()=>[Cp,Qc,ai],z=()=>["","none","full",f,Ge,Ve],X=()=>["",wt,Qc,ai],q=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[wt,Cp,wb,bb],De=()=>["","none",N,Ge,Ve],oe=()=>["none",wt,Ge,Ve],He=()=>["none",wt,Ge,Ve],at=()=>[wt,Ge,Ve],je=()=>[vo,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Es],breakpoint:[Es],color:[$E],container:[Es],"drop-shadow":[Es],ease:["in","out","in-out"],font:[WE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Es],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Es],shadow:[Es],spacing:["px",wt],text:[Es],"text-shadow":[Es],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vo,Ve,Ge,S]}],container:["container"],columns:[{columns:[wt,Ve,Ge,d]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:B()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[xl,"auto",Ge,Ve]}],basis:[{basis:[vo,"full","auto",d,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[wt,vo,"auto","initial","none",Ve]}],grow:[{grow:["",wt,Ge,Ve]}],shrink:[{shrink:["",wt,Ge,Ve]}],order:[{order:[xl,"first","last","none",Ge,Ve]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ne()}],"auto-rows":[{"auto-rows":Ne()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],w:[{w:[d,"screen",...le()]}],"min-w":[{"min-w":[d,"screen","none",...le()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...le()]}],h:[{h:["screen","lh",...le()]}],"min-h":[{"min-h":["screen","lh","none",...le()]}],"max-h":[{"max-h":["screen","lh",...le()]}],"font-size":[{text:["base",n,Qc,ai]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ge,Tp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cp,Ve]}],"font-family":[{font:[QE,Ve,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ge,Ve]}],"line-clamp":[{"line-clamp":[wt,"none",Ge,Tp]}],leading:[{leading:[o,...$()]}],"list-image":[{"list-image":["none",Ge,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:re()}],"text-color":[{text:re()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[wt,"from-font","auto",Ge,ai]}],"text-decoration-color":[{decoration:re()}],"underline-offset":[{"underline-offset":[wt,"auto",Ge,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,Ve]}],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",Ge,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ge()}],"bg-repeat":[{bg:E()}],"bg-size":[{bg:we()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xl,Ge,Ve],radial:["",Ge,Ve],conic:[xl,Ge,Ve]},JE,KE]}],"bg-color":[{bg:re()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:re()}],"gradient-via":[{via:re()}],"gradient-to":[{to:re()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:re()}],"border-color-x":[{"border-x":re()}],"border-color-y":[{"border-y":re()}],"border-color-s":[{"border-s":re()}],"border-color-e":[{"border-e":re()}],"border-color-t":[{"border-t":re()}],"border-color-r":[{"border-r":re()}],"border-color-b":[{"border-b":re()}],"border-color-l":[{"border-l":re()}],"divide-color":[{divide:re()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[wt,Ge,Ve]}],"outline-w":[{outline:["",wt,Qc,ai]}],"outline-color":[{outline:re()}],shadow:[{shadow:["","none",p,S0,N0]}],"shadow-color":[{shadow:re()}],"inset-shadow":[{"inset-shadow":["none",x,S0,N0]}],"inset-shadow-color":[{"inset-shadow":re()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:re()}],"ring-offset-w":[{"ring-offset":[wt,ai]}],"ring-offset-color":[{"ring-offset":re()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":re()}],"text-shadow":[{"text-shadow":["none",y,S0,N0]}],"text-shadow-color":[{"text-shadow":re()}],opacity:[{opacity:[wt,Ge,Ve]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"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":[wt]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":re()}],"mask-image-linear-to-color":[{"mask-linear-to":re()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":re()}],"mask-image-t-to-color":[{"mask-t-to":re()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":re()}],"mask-image-r-to-color":[{"mask-r-to":re()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":re()}],"mask-image-b-to-color":[{"mask-b-to":re()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":re()}],"mask-image-l-to-color":[{"mask-l-to":re()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":re()}],"mask-image-x-to-color":[{"mask-x-to":re()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":re()}],"mask-image-y-to-color":[{"mask-y-to":re()}],"mask-image-radial":[{"mask-radial":[Ge,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":re()}],"mask-image-radial-to-color":[{"mask-radial-to":re()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[wt]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":re()}],"mask-image-conic-to-color":[{"mask-conic-to":re()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ge()}],"mask-repeat":[{mask:E()}],"mask-size":[{mask:we()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Ve]}],filter:[{filter:["","none",Ge,Ve]}],blur:[{blur:De()}],brightness:[{brightness:[wt,Ge,Ve]}],contrast:[{contrast:[wt,Ge,Ve]}],"drop-shadow":[{"drop-shadow":["","none",b,S0,N0]}],"drop-shadow-color":[{"drop-shadow":re()}],grayscale:[{grayscale:["",wt,Ge,Ve]}],"hue-rotate":[{"hue-rotate":[wt,Ge,Ve]}],invert:[{invert:["",wt,Ge,Ve]}],saturate:[{saturate:[wt,Ge,Ve]}],sepia:[{sepia:["",wt,Ge,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Ve]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[wt,Ge,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[wt,Ge,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",wt,Ge,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[wt,Ge,Ve]}],"backdrop-invert":[{"backdrop-invert":["",wt,Ge,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[wt,Ge,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[wt,Ge,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",wt,Ge,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[wt,"initial",Ge,Ve]}],ease:[{ease:["linear","initial",T,Ge,Ve]}],delay:[{delay:[wt,Ge,Ve]}],animate:[{animate:["none",M,Ge,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ge,Ve]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:He()}],"scale-x":[{"scale-x":He()}],"scale-y":[{"scale-y":He()}],"scale-z":[{"scale-z":He()}],"scale-3d":["scale-3d"],skew:[{skew:at()}],"skew-x":[{"skew-x":at()}],"skew-y":[{"skew-y":at()}],transform:[{transform:[Ge,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:re()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:re()}],"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",Ge,Ve]}],"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":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",Ge,Ve]}],fill:[{fill:["none",...re()]}],"stroke-w":[{stroke:[wt,Qc,ai,Tp]}],stroke:[{stroke:["none",...re()]}],"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"]}},rM=LE(nM);function he(...e){return rM(P5(e))}const ct=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ct.displayName="Card";const Lt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("flex flex-col space-y-1.5 p-6",e),...t}));Lt.displayName="CardHeader";const Bt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("font-semibold leading-none tracking-tight",e),...t}));Bt.displayName="CardTitle";const Qn=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("text-sm text-muted-foreground",e),...t}));Qn.displayName="CardDescription";const Gt=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("p-6 pt-0",e),...t}));Gt.displayName="CardContent";const Y6=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("flex items-center p-6 pt-0",e),...t}));Y6.displayName="CardFooter";var _p="rovingFocusGroup.onEntryFocus",aM={bubbles:!1,cancelable:!0},Pu="RovingFocusGroup",[Mx,W6,sM]=bm(Pu),[lM,Dm]=Ua(Pu,[sM]),[iM,oM]=lM(Pu),X6=w.forwardRef((e,t)=>r.jsx(Mx.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(Mx.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(cM,{...e,ref:t})})}));X6.displayName=Pu;var cM=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:l=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...x}=e,y=w.useRef(null),b=mn(t,y),N=Eu(o),[k,S]=zl({prop:c,defaultProp:d??null,onChange:m,caller:Pu}),[T,M]=w.useState(!1),A=yr(f),R=W6(n),B=w.useRef(!1),[O,L]=w.useState(0);return w.useEffect(()=>{const $=y.current;if($)return $.addEventListener(_p,A),()=>$.removeEventListener(_p,A)},[A]),r.jsx(iM,{scope:n,orientation:a,dir:N,loop:l,currentTabStopId:k,onItemFocus:w.useCallback($=>S($),[S]),onItemShiftTab:w.useCallback(()=>M(!0),[]),onFocusableItemAdd:w.useCallback(()=>L($=>$+1),[]),onFocusableItemRemove:w.useCallback(()=>L($=>$-1),[]),children:r.jsx(It.div,{tabIndex:T||O===0?-1:0,"data-orientation":a,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{B.current=!0}),onFocus:Pe(e.onFocus,$=>{const U=!B.current;if($.target===$.currentTarget&&U&&!T){const I=new CustomEvent(_p,aM);if($.currentTarget.dispatchEvent(I),!I.defaultPrevented){const G=R().filter(H=>H.focusable),ee=G.find(H=>H.active),Ne=G.find(H=>H.id===k),se=[ee,Ne,...G].filter(Boolean).map(H=>H.ref.current);Z6(se,p)}}B.current=!1}),onBlur:Pe(e.onBlur,()=>M(!1))})})}),K6="RovingFocusGroupItem",Q6=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:o,children:c,...d}=e,m=Ta(),f=o||m,p=oM(K6,n),x=p.currentTabStopId===f,y=W6(n),{onFocusableItemAdd:b,onFocusableItemRemove:N,currentTabStopId:k}=p;return w.useEffect(()=>{if(a)return b(),()=>N()},[a,b,N]),r.jsx(Mx.ItemSlot,{scope:n,id:f,focusable:a,active:l,children:r.jsx(It.span,{tabIndex:x?0:-1,"data-orientation":p.orientation,...d,ref:t,onMouseDown:Pe(e.onMouseDown,S=>{a?p.onItemFocus(f):S.preventDefault()}),onFocus:Pe(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:Pe(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){p.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const T=mM(S,p.orientation,p.dir);if(T!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let A=y().filter(R=>R.focusable).map(R=>R.ref.current);if(T==="last")A.reverse();else if(T==="prev"||T==="next"){T==="prev"&&A.reverse();const R=A.indexOf(S.currentTarget);A=p.loop?hM(A,R+1):A.slice(R+1)}setTimeout(()=>Z6(A))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});Q6.displayName=K6;var uM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mM(e,t,n){const a=dM(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return uM[a]}function Z6(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function hM(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var J6=X6,ew=Q6,zm="Tabs",[fM]=Ua(zm,[Dm]),tw=Dm(),[pM,M1]=fM(zm),nw=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:l,defaultValue:o,orientation:c="horizontal",dir:d,activationMode:m="automatic",...f}=e,p=Eu(d),[x,y]=zl({prop:a,onChange:l,defaultProp:o??"",caller:zm});return r.jsx(pM,{scope:n,baseId:Ta(),value:x,onValueChange:y,orientation:c,dir:p,activationMode:m,children:r.jsx(It.div,{dir:p,"data-orientation":c,...f,ref:t})})});nw.displayName=zm;var rw="TabsList",aw=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...l}=e,o=M1(rw,n),c=tw(n);return r.jsx(J6,{asChild:!0,...c,orientation:o.orientation,dir:o.dir,loop:a,children:r.jsx(It.div,{role:"tablist","aria-orientation":o.orientation,...l,ref:t})})});aw.displayName=rw;var sw="TabsTrigger",lw=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:l=!1,...o}=e,c=M1(sw,n),d=tw(n),m=cw(c.baseId,a),f=uw(c.baseId,a),p=a===c.value;return r.jsx(ew,{asChild:!0,...d,focusable:!l,active:p,children:r.jsx(It.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:m,...o,ref:t,onMouseDown:Pe(e.onMouseDown,x=>{!l&&x.button===0&&x.ctrlKey===!1?c.onValueChange(a):x.preventDefault()}),onKeyDown:Pe(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(a)}),onFocus:Pe(e.onFocus,()=>{const x=c.activationMode!=="manual";!p&&!l&&x&&c.onValueChange(a)})})})});lw.displayName=sw;var iw="TabsContent",ow=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:l,children:o,...c}=e,d=M1(iw,n),m=cw(d.baseId,a),f=uw(d.baseId,a),p=a===d.value,x=w.useRef(p);return w.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Wr,{present:l||p,children:({present:y})=>r.jsx(It.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":m,hidden:!y,id:f,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&o})})});ow.displayName=iw;function cw(e,t){return`${e}-trigger-${t}`}function uw(e,t){return`${e}-content-${t}`}var xM=nw,dw=aw,mw=lw,hw=ow;const kl=xM,Bs=w.forwardRef(({className:e,...t},n)=>r.jsx(dw,{ref:n,className:he("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Bs.displayName=dw.displayName;const Pt=w.forwardRef(({className:e,...t},n)=>r.jsx(mw,{ref:n,className:he("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Pt.displayName=mw.displayName;const cn=w.forwardRef(({className:e,...t},n)=>r.jsx(hw,{ref:n,className:he("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));cn.displayName=hw.displayName;function gM(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var A1="ScrollArea",[fw]=Ua(A1),[vM,Aa]=fw(A1),pw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:l,scrollHideDelay:o=600,...c}=e,[d,m]=w.useState(null),[f,p]=w.useState(null),[x,y]=w.useState(null),[b,N]=w.useState(null),[k,S]=w.useState(null),[T,M]=w.useState(0),[A,R]=w.useState(0),[B,O]=w.useState(!1),[L,$]=w.useState(!1),U=mn(t,G=>m(G)),I=Eu(l);return r.jsx(vM,{scope:n,type:a,dir:I,scrollHideDelay:o,scrollArea:d,viewport:f,onViewportChange:p,content:x,onContentChange:y,scrollbarX:b,onScrollbarXChange:N,scrollbarXEnabled:B,onScrollbarXEnabledChange:O,scrollbarY:k,onScrollbarYChange:S,scrollbarYEnabled:L,onScrollbarYEnabledChange:$,onCornerWidthChange:M,onCornerHeightChange:R,children:r.jsx(It.div,{dir:I,...c,ref:U,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});pw.displayName=A1;var xw="ScrollAreaViewport",gw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:l,...o}=e,c=Aa(xw,n),d=w.useRef(null),m=mn(t,d,c.onViewportChange);return r.jsxs(r.Fragment,{children:[r.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:l}),r.jsx(It.div,{"data-radix-scroll-area-viewport":"",...o,ref:m,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:r.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});gw.displayName=xw;var ss="ScrollAreaScrollbar",D1=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(ss,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=l,d=e.orientation==="horizontal";return w.useEffect(()=>(d?o(!0):c(!0),()=>{d?o(!1):c(!1)}),[d,o,c]),l.type==="hover"?r.jsx(yM,{...a,ref:t,forceMount:n}):l.type==="scroll"?r.jsx(bM,{...a,ref:t,forceMount:n}):l.type==="auto"?r.jsx(vw,{...a,ref:t,forceMount:n}):l.type==="always"?r.jsx(z1,{...a,ref:t}):null});D1.displayName=ss;var yM=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(ss,e.__scopeScrollArea),[o,c]=w.useState(!1);return w.useEffect(()=>{const d=l.scrollArea;let m=0;if(d){const f=()=>{window.clearTimeout(m),c(!0)},p=()=>{m=window.setTimeout(()=>c(!1),l.scrollHideDelay)};return d.addEventListener("pointerenter",f),d.addEventListener("pointerleave",p),()=>{window.clearTimeout(m),d.removeEventListener("pointerenter",f),d.removeEventListener("pointerleave",p)}}},[l.scrollArea,l.scrollHideDelay]),r.jsx(Wr,{present:n||o,children:r.jsx(vw,{"data-state":o?"visible":"hidden",...a,ref:t})})}),bM=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=Aa(ss,e.__scopeScrollArea),o=e.orientation==="horizontal",c=Rm(()=>m("SCROLL_END"),100),[d,m]=gM("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 w.useEffect(()=>{if(d==="idle"){const f=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(f)}},[d,l.scrollHideDelay,m]),w.useEffect(()=>{const f=l.viewport,p=o?"scrollLeft":"scrollTop";if(f){let x=f[p];const y=()=>{const b=f[p];x!==b&&(m("SCROLL"),c()),x=b};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[l.viewport,o,m,c]),r.jsx(Wr,{present:n||d!=="hidden",children:r.jsx(z1,{"data-state":d==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),vw=w.forwardRef((e,t)=>{const n=Aa(ss,e.__scopeScrollArea),{forceMount:a,...l}=e,[o,c]=w.useState(!1),d=e.orientation==="horizontal",m=Rm(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?f:p)}},10);return Io(n.viewport,m),Io(n.content,m),r.jsx(Wr,{present:a||o,children:r.jsx(z1,{"data-state":o?"visible":"hidden",...l,ref:t})})}),z1=w.forwardRef((e,t)=>{const{orientation:n="vertical",...a}=e,l=Aa(ss,e.__scopeScrollArea),o=w.useRef(null),c=w.useRef(0),[d,m]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Nw(d.viewport,d.content),p={...a,sizes:d,onSizesChange:m,hasThumb:f>0&&f<1,onThumbChange:y=>o.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function x(y,b){return CM(y,c.current,d,b)}return n==="horizontal"?r.jsx(wM,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&o.current){const y=l.viewport.scrollLeft,b=jb(y,d,l.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=x(y,l.dir))}}):n==="vertical"?r.jsx(jM,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&o.current){const y=l.viewport.scrollTop,b=jb(y,d);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=x(y))}}):null}),wM=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...l}=e,o=Aa(ss,e.__scopeScrollArea),[c,d]=w.useState(),m=w.useRef(null),f=mn(t,m,o.onScrollbarXChange);return w.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),r.jsx(bw,{"data-orientation":"horizontal",...l,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Om(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,x)=>{if(o.viewport){const y=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(y),kw(y,x)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&c&&a({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:lm(c.paddingLeft),paddingEnd:lm(c.paddingRight)}})}})}),jM=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...l}=e,o=Aa(ss,e.__scopeScrollArea),[c,d]=w.useState(),m=w.useRef(null),f=mn(t,m,o.onScrollbarYChange);return w.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),r.jsx(bw,{"data-orientation":"vertical",...l,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Om(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,x)=>{if(o.viewport){const y=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(y),kw(y,x)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&c&&a({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:lm(c.paddingTop),paddingEnd:lm(c.paddingBottom)}})}})}),[NM,yw]=fw(ss),bw=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:l,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:d,onThumbPositionChange:m,onDragScroll:f,onWheelScroll:p,onResize:x,...y}=e,b=Aa(ss,n),[N,k]=w.useState(null),S=mn(t,U=>k(U)),T=w.useRef(null),M=w.useRef(""),A=b.viewport,R=a.content-a.viewport,B=yr(p),O=yr(m),L=Rm(x,10);function $(U){if(T.current){const I=U.clientX-T.current.left,G=U.clientY-T.current.top;f({x:I,y:G})}}return w.useEffect(()=>{const U=I=>{const G=I.target;N?.contains(G)&&B(I,R)};return document.addEventListener("wheel",U,{passive:!1}),()=>document.removeEventListener("wheel",U,{passive:!1})},[A,N,R,B]),w.useEffect(O,[a,O]),Io(N,L),Io(b.content,L),r.jsx(NM,{scope:n,scrollbar:N,hasThumb:l,onThumbChange:yr(o),onThumbPointerUp:yr(c),onThumbPositionChange:O,onThumbPointerDown:yr(d),children:r.jsx(It.div,{...y,ref:S,style:{position:"absolute",...y.style},onPointerDown:Pe(e.onPointerDown,U=>{U.button===0&&(U.target.setPointerCapture(U.pointerId),T.current=N.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),$(U))}),onPointerMove:Pe(e.onPointerMove,$),onPointerUp:Pe(e.onPointerUp,U=>{const I=U.target;I.hasPointerCapture(U.pointerId)&&I.releasePointerCapture(U.pointerId),document.body.style.webkitUserSelect=M.current,b.viewport&&(b.viewport.style.scrollBehavior=""),T.current=null})})})}),sm="ScrollAreaThumb",ww=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,l=yw(sm,e.__scopeScrollArea);return r.jsx(Wr,{present:n||l.hasThumb,children:r.jsx(SM,{ref:t,...a})})}),SM=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...l}=e,o=Aa(sm,n),c=yw(sm,n),{onThumbPositionChange:d}=c,m=mn(t,x=>c.onThumbChange(x)),f=w.useRef(void 0),p=Rm(()=>{f.current&&(f.current(),f.current=void 0)},100);return w.useEffect(()=>{const x=o.viewport;if(x){const y=()=>{if(p(),!f.current){const b=TM(x,d);f.current=b,d()}};return d(),x.addEventListener("scroll",y),()=>x.removeEventListener("scroll",y)}},[o.viewport,p,d]),r.jsx(It.div,{"data-state":c.hasThumb?"visible":"hidden",...l,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Pe(e.onPointerDownCapture,x=>{const b=x.target.getBoundingClientRect(),N=x.clientX-b.left,k=x.clientY-b.top;c.onThumbPointerDown({x:N,y:k})}),onPointerUp:Pe(e.onPointerUp,c.onThumbPointerUp)})});ww.displayName=sm;var O1="ScrollAreaCorner",jw=w.forwardRef((e,t)=>{const n=Aa(O1,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?r.jsx(kM,{...e,ref:t}):null});jw.displayName=O1;var kM=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,l=Aa(O1,n),[o,c]=w.useState(0),[d,m]=w.useState(0),f=!!(o&&d);return Io(l.scrollbarX,()=>{const p=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(p),m(p)}),Io(l.scrollbarY,()=>{const p=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(p),c(p)}),f?r.jsx(It.div,{...a,ref:t,style:{width:o,height:d,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function lm(e){return e?parseInt(e,10):0}function Nw(e,t){const n=e/t;return isNaN(n)?0:n}function Om(e){const t=Nw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function CM(e,t,n,a="ltr"){const l=Om(n),o=l/2,c=t||o,d=l-c,m=n.scrollbar.paddingStart+c,f=n.scrollbar.size-n.scrollbar.paddingEnd-d,p=n.content-n.viewport,x=a==="ltr"?[0,p]:[p*-1,0];return Sw([m,f],x)(e)}function jb(e,t,n="ltr"){const a=Om(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-l,c=t.content-t.viewport,d=o-a,m=n==="ltr"?[0,c]:[c*-1,0],f=h1(e,m);return Sw([0,c],[0,d])(f)}function Sw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function kw(e,t){return e>0&&e<t}var TM=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return(function l(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,d=n.top!==o.top;(c||d)&&t(),n=o,a=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(a)};function Rm(e,t){const n=yr(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Io(e,t){const n=yr(t);F5(()=>{let a=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return l.observe(e),()=>{window.cancelAnimationFrame(a),l.unobserve(e)}}},[e,n])}var Cw=pw,_M=gw,EM=jw;const an=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(Cw,{ref:a,className:he("relative overflow-hidden",e),...n,children:[r.jsx(_M,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsx(Tw,{}),r.jsx(EM,{})]}));an.displayName=Cw.displayName;const Tw=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>r.jsx(D1,{ref:a,orientation:t,className:he("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:r.jsx(ww,{className:"relative flex-1 rounded-full bg-border"})}));Tw.displayName=D1.displayName;function Nb({className:e,...t}){return r.jsx("div",{className:he("animate-pulse rounded-md bg-primary/10",e),...t})}function MM(e,t=[]){let n=[];function a(o,c){const d=w.createContext(c);d.displayName=o+"Context";const m=n.length;n=[...n,c];const f=x=>{const{scope:y,children:b,...N}=x,k=y?.[e]?.[m]||d,S=w.useMemo(()=>N,Object.values(N));return r.jsx(k.Provider,{value:S,children:b})};f.displayName=o+"Provider";function p(x,y){const b=y?.[e]?.[m]||d,N=w.useContext(b);if(N)return N;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${o}\``)}return[f,p]}const l=()=>{const o=n.map(c=>w.createContext(c));return function(d){const m=d?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return l.scopeName=e,[a,AM(l,...t)]}function AM(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((d,{useScope:m,scopeName:f})=>{const x=m(o)[`__scope${f}`];return{...d,...x}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var DM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_w=DM.reduce((e,t)=>{const n=f1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),R1="Progress",L1=100,[zM]=MM(R1),[OM,RM]=zM(R1),Ew=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:l,getValueLabel:o=LM,...c}=e;(l||l===0)&&!Sb(l)&&console.error(BM(`${l}`,"Progress"));const d=Sb(l)?l:L1;a!==null&&!kb(a,d)&&console.error(PM(`${a}`,"Progress"));const m=kb(a,d)?a:null,f=im(m)?o(m,d):void 0;return r.jsx(OM,{scope:n,value:m,max:d,children:r.jsx(_w.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":im(m)?m:void 0,"aria-valuetext":f,role:"progressbar","data-state":Dw(m,d),"data-value":m??void 0,"data-max":d,...c,ref:t})})});Ew.displayName=R1;var Mw="ProgressIndicator",Aw=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,l=RM(Mw,n);return r.jsx(_w.div,{"data-state":Dw(l.value,l.max),"data-value":l.value??void 0,"data-max":l.max,...a,ref:t})});Aw.displayName=Mw;function LM(e,t){return`${Math.round(e/t*100)}%`}function Dw(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function im(e){return typeof e=="number"}function Sb(e){return im(e)&&!isNaN(e)&&e>0}function kb(e,t){return im(e)&&!isNaN(e)&&e<=t&&e>=0}function BM(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${L1}\`.`}function PM(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${L1} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var zw=Ew,FM=Aw;const Fu=w.forwardRef(({className:e,value:t,...n},a)=>r.jsx(zw,{ref:a,className:he("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:r.jsx(FM,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Fu.displayName=zw.displayName;const IM={light:"",dark:".dark"},Ow=w.createContext(null);function Rw(){const e=w.useContext(Ow);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const So=w.forwardRef(({id:e,className:t,children:n,config:a,...l},o)=>{const c=w.useId(),d=`chart-${e||c.replace(/:/g,"")}`;return r.jsx(Ow.Provider,{value:{config:a},children:r.jsxs("div",{"data-chart":d,ref:o,className:he("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...l,children:[r.jsx(qM,{id:d,config:a}),r.jsx(VC,{children:n})]})})});So.displayName="Chart";const qM=({id:e,config:t})=>{const n=Object.entries(t).filter(([,a])=>a.theme||a.color);return n.length?r.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(IM).map(([a,l])=>`
${l} [data-chart=${e}] {
${n.map(([o,c])=>{const d=c.theme?.[a]||c.color;return d?` --color-${o}: ${d};`:null}).join(`
`)}
}
`).join(`
`)}}):null},Zc=GC,ko=w.forwardRef(({active:e,payload:t,className:n,indicator:a="dot",hideLabel:l=!1,hideIndicator:o=!1,label:c,labelFormatter:d,labelClassName:m,formatter:f,color:p,nameKey:x,labelKey:y},b)=>{const{config:N}=Rw(),k=w.useMemo(()=>{if(l||!t?.length)return null;const[T]=t,M=`${y||T?.dataKey||T?.name||"value"}`,A=Ax(N,T,M),R=!y&&typeof c=="string"?N[c]?.label||c:A?.label;return d?r.jsx("div",{className:he("font-medium",m),children:d(R,t)}):R?r.jsx("div",{className:he("font-medium",m),children:R}):null},[c,d,t,l,m,N,y]);if(!e||!t?.length)return null;const S=t.length===1&&a!=="dot";return r.jsxs("div",{ref:b,className:he("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[S?null:k,r.jsx("div",{className:"grid gap-1.5",children:t.filter(T=>T.type!=="none").map((T,M)=>{const A=`${x||T.name||T.dataKey||"value"}`,R=Ax(N,T,A),B=p||T.payload.fill||T.color;return r.jsx("div",{className:he("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",a==="dot"&&"items-center"),children:f&&T?.value!==void 0&&T.name?f(T.value,T.name,T,M,T.payload):r.jsxs(r.Fragment,{children:[R?.icon?r.jsx(R.icon,{}):!o&&r.jsx("div",{className:he("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":S&&a==="dashed"}),style:{"--color-bg":B,"--color-border":B}}),r.jsxs("div",{className:he("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[r.jsxs("div",{className:"grid gap-1.5",children:[S?k:null,r.jsx("span",{className:"text-muted-foreground",children:R?.label||T.name})]}),T.value&&r.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:T.value.toLocaleString()})]})]})},T.dataKey)})})]})});ko.displayName="ChartTooltip";const HM=YC,Lw=w.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:a="bottom",nameKey:l},o)=>{const{config:c}=Rw();return n?.length?r.jsx("div",{ref:o,className:he("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:n.filter(d=>d.type!=="none").map(d=>{const m=`${l||d.dataKey||"value"}`,f=Ax(c,d,m);return r.jsxs("div",{className:he("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[f?.icon&&!t?r.jsx(f.icon,{}):r.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:d.color}}),f?.label]},d.value)})}):null});Lw.displayName="ChartLegend";function Ax(e,t,n){if(typeof t!="object"||t===null)return;const a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let l=n;return n in t&&typeof t[n]=="string"?l=t[n]:a&&n in a&&typeof a[n]=="string"&&(l=a[n]),l in e?e[l]:e[n]}const Cb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Tb=P5,Ko=(e,t)=>n=>{var a;if(t?.variants==null)return Tb(e,n?.class,n?.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(f=>{const p=n?.[f],x=o?.[f];if(p===null)return null;const y=Cb(p)||Cb(x);return l[f][y]}),d=n&&Object.entries(n).reduce((f,p)=>{let[x,y]=p;return y===void 0||(f[x]=y),f},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,p)=>{let{class:x,className:y,...b}=p;return Object.entries(b).every(N=>{let[k,S]=N;return Array.isArray(S)?S.includes({...o,...d}[k]):{...o,...d}[k]===S})?[...f,x,y]:f},[]);return Tb(e,c,m,n?.class,n?.className)},gu=Ko("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"}}),ne=w.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?JC:"button";return r.jsx(c,{className:he(gu({variant:t,size:n,className:e})),ref:o,...l})});ne.displayName="Button";function UM(){const[e,t]=w.useState(null),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(24),[m,f]=w.useState(!0),[p,x]=w.useState(null),[y,b]=w.useState(!0),N=w.useCallback(async()=>{try{b(!0);const U=await An.get("https://v1.hitokoto.cn/?c=a&c=b&c=c&c=d&c=h&c=i&c=k");x({hitokoto:U.data.hitokoto,from:U.data.from||U.data.from_who||"未知"})}catch(U){console.error("获取一言失败:",U),x({hitokoto:"人生就像一盒巧克力,你永远不知道下一颗是什么味道。",from:"阿甘正传"})}finally{b(!1)}},[]),k=w.useCallback(async()=>{try{const U=localStorage.getItem("access-token"),I=await An.get(`/api/webui/statistics/dashboard?hours=${c}`,{headers:{Authorization:`Bearer ${U}`}});t(I.data),a(!1),o(100)}catch(U){console.error("Failed to fetch dashboard data:",U),a(!1),o(100)}},[c]);if(w.useEffect(()=>{if(!n)return;o(0);const U=setTimeout(()=>o(15),200),I=setTimeout(()=>o(30),800),G=setTimeout(()=>o(45),2e3),ee=setTimeout(()=>o(60),4e3),Ne=setTimeout(()=>o(75),6500),J=setTimeout(()=>o(85),9e3),se=setTimeout(()=>o(92),11e3);return()=>{clearTimeout(U),clearTimeout(I),clearTimeout(G),clearTimeout(ee),clearTimeout(Ne),clearTimeout(J),clearTimeout(se)}},[n]),w.useEffect(()=>{k(),N()},[k,N]),w.useEffect(()=>{if(!m)return;const U=setInterval(()=>{k()},3e4);return()=>clearInterval(U)},[m,k]),n||!e)return r.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:r.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[r.jsx(Ia,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Fu,{value:l,className:"h-2"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[l,"%"]})]})]})});const{summary:S,model_stats:T,hourly_data:M,daily_data:A,recent_activity:R}=e,B=U=>{const I=Math.floor(U/3600),G=Math.floor(U%3600/60);return`${I}小时${G}分钟`},O=U=>new Date(U).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),L=T.slice(0,6).map(U=>({name:U.model_name,value:U.request_count,fill:`hsl(var(--chart-${T.indexOf(U)%5+1}))`})),$={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(kl,{value:c.toString(),onValueChange:U=>d(Number(U)),children:r.jsxs(Bs,{className:"grid grid-cols-3 w-full sm:w-auto",children:[r.jsx(Pt,{value:"24",children:"24小时"}),r.jsx(Pt,{value:"168",children:"7天"}),r.jsx(Pt,{value:"720",children:"30天"})]})}),r.jsxs(ne,{variant:m?"default":"outline",size:"sm",onClick:()=>f(!m),className:"gap-2",children:[r.jsx(Ia,{className:`h-4 w-4 ${m?"animate-spin":""}`}),r.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:k,children:r.jsx(Ia,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"总请求数"}),r.jsx(mT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:S.total_requests.toLocaleString()}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",c<48?c+"小时":Math.floor(c/24)+"天"]})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"总花费"}),r.jsx(hT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:["¥",S.total_cost.toFixed(2)]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.cost_per_hour>0?`¥${S.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"Token消耗"}),r.jsx(fT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:[(S.total_tokens/1e3).toFixed(1),"K"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.tokens_per_hour>0?`${(S.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"平均响应"}),r.jsx(fu,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsxs("div",{className:"text-2xl font-bold",children:[S.avg_response_time.toFixed(2),"s"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"在线时长"}),r.jsx(di,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsx(Gt,{children:r.jsx("div",{className:"text-xl font-bold",children:B(S.online_time)})})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"消息处理"}),r.jsx(Mu,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-xl font-bold",children:S.total_messages.toLocaleString()}),r.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",S.total_replies.toLocaleString()," 条"]})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"成本效率"}),r.jsx(pT,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-xl font-bold",children:S.total_messages>0?`¥${(S.total_cost/S.total_messages*100).toFixed(2)}`:"¥0.00"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),r.jsxs(kl,{defaultValue:"trends",className:"space-y-4",children:[r.jsxs(Bs,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[r.jsx(Pt,{value:"trends",children:"趋势"}),r.jsx(Pt,{value:"models",children:"模型"}),r.jsx(Pt,{value:"activity",children:"活动"}),r.jsx(Pt,{value:"daily",children:"日统计"})]}),r.jsxs(cn,{value:"trends",className:"space-y-4",children:[r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"请求趋势"}),r.jsxs(Qn,{children:["最近",c,"小时的请求量变化"]})]}),r.jsx(Gt,{children:r.jsx(So,{config:$,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:r.jsxs(WC,{data:M,children:[r.jsx(y0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(b0,{dataKey:"timestamp",tickFormatter:U=>O(U),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Wc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Zc,{content:r.jsx(ko,{labelFormatter:U=>O(U)})}),r.jsx(XC,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"花费趋势"}),r.jsx(Qn,{children:"API调用成本变化"})]}),r.jsx(Gt,{children:r.jsx(So,{config:$,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:r.jsxs(vp,{data:M,children:[r.jsx(y0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(b0,{dataKey:"timestamp",tickFormatter:U=>O(U),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Wc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Zc,{content:r.jsx(ko,{labelFormatter:U=>O(U)})}),r.jsx(w0,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"Token消耗"}),r.jsx(Qn,{children:"Token使用量变化"})]}),r.jsx(Gt,{children:r.jsx(So,{config:$,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:r.jsxs(vp,{data:M,children:[r.jsx(y0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(b0,{dataKey:"timestamp",tickFormatter:U=>O(U),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Wc,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Zc,{content:r.jsx(ko,{labelFormatter:U=>O(U)})}),r.jsx(w0,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),r.jsx(cn,{value:"models",className:"space-y-4",children:r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"模型请求分布"}),r.jsx(Qn,{children:"各模型使用占比"})]}),r.jsx(Gt,{children:r.jsx(So,{config:Object.fromEntries(T.slice(0,6).map((U,I)=>[U.model_name,{label:U.model_name,color:`hsl(var(--chart-${I%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:r.jsxs(KC,{children:[r.jsx(Zc,{content:r.jsx(ko,{})}),r.jsx(QC,{data:L,cx:"50%",cy:"50%",labelLine:!1,label:({name:U,percent:I})=>`${U} ${I?(I*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:L.map((U,I)=>r.jsx(ZC,{fill:U.fill},`cell-${I}`))})]})})})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"模型详细统计"}),r.jsx(Qn,{children:"请求数、花费和性能"})]}),r.jsx(Gt,{children:r.jsx(an,{className:"h-[300px] sm:h-[400px]",children:r.jsx("div",{className:"space-y-3",children:T.map((U,I)=>r.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:U.model_name}),r.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${I%5+1}))`}})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),r.jsx("span",{className:"ml-1 font-medium",children:U.request_count.toLocaleString()})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"花费:"}),r.jsxs("span",{className:"ml-1 font-medium",children:["¥",U.total_cost.toFixed(2)]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),r.jsxs("span",{className:"ml-1 font-medium",children:[(U.total_tokens/1e3).toFixed(1),"K"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),r.jsxs("span",{className:"ml-1 font-medium",children:[U.avg_response_time.toFixed(2),"s"]})]})]})]},I))})})})]})]})}),r.jsx(cn,{value:"activity",children:r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"最近活动"}),r.jsx(Qn,{children:"最新的API调用记录"})]}),r.jsx(Gt,{children:r.jsx(an,{className:"h-[400px] sm:h-[500px]",children:r.jsx("div",{className:"space-y-2",children:R.map((U,I)=>r.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-sm truncate",children:U.model}),r.jsx("div",{className:"text-xs text-muted-foreground",children:U.request_type})]}),r.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:O(U.timestamp)})]}),r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),r.jsx("span",{className:"ml-1",children:U.tokens})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"花费:"}),r.jsxs("span",{className:"ml-1",children:["¥",U.cost.toFixed(4)]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),r.jsxs("span",{className:"ml-1",children:[U.time_cost.toFixed(2),"s"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"状态:"}),r.jsx("span",{className:`ml-1 ${U.status==="success"?"text-green-600":"text-red-600"}`,children:U.status})]})]})]},I))})})})]})}),r.jsx(cn,{value:"daily",children:r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"每日统计"}),r.jsx(Qn,{children:"最近7天的数据汇总"})]}),r.jsx(Gt,{children:r.jsx(So,{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:r.jsxs(vp,{data:A,children:[r.jsx(y0,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),r.jsx(b0,{dataKey:"timestamp",tickFormatter:U=>{const I=new Date(U);return`${I.getMonth()+1}/${I.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Wc,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Wc,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),r.jsx(Zc,{content:r.jsx(ko,{labelFormatter:U=>new Date(U).toLocaleDateString("zh-CN")})}),r.jsx(HM,{content:r.jsx(Lw,{})}),r.jsx(w0,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),r.jsx(w0,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),r.jsxs(ct,{className:"border-2 border-primary/20",children:[r.jsx(Lt,{className:"pb-3",children:r.jsx(Bt,{className:"text-lg",children:"每日一言"})}),r.jsx(Gt,{children:y?r.jsxs("div",{className:"space-y-2",children:[r.jsx(Nb,{className:"h-6 w-3/4"}),r.jsx(Nb,{className:"h-4 w-1/4"})]}):p?r.jsxs("div",{className:"space-y-2",children:[r.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',p.hitokoto,'"']}),r.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",p.from]})]}):null})]})]})})}const $M={theme:"system",setTheme:()=>null},Bw=w.createContext($M),B1=()=>{const e=w.useContext(Bw);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},VM=(e,t,n)=>{const a=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||a){t(e);return}const l=n.clientX,o=n.clientY,c=Math.hypot(Math.max(l,innerWidth-l),Math.max(o,innerHeight-o));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${l}px ${o}px)`,`circle(${c}px at ${l}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},Pw=w.createContext(void 0),Fw=()=>{const e=w.useContext(Pw);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};var Lm="Switch",[GM]=Ua(Lm),[YM,WM]=GM(Lm),Iw=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:l,defaultChecked:o,required:c,disabled:d,value:m="on",onCheckedChange:f,form:p,...x}=e,[y,b]=w.useState(null),N=mn(t,A=>b(A)),k=w.useRef(!1),S=y?p||!!y.closest("form"):!0,[T,M]=zl({prop:l,defaultProp:o??!1,onChange:f,caller:Lm});return r.jsxs(YM,{scope:n,checked:T,disabled:d,children:[r.jsx(It.button,{type:"button",role:"switch","aria-checked":T,"aria-required":c,"data-state":$w(T),"data-disabled":d?"":void 0,disabled:d,value:m,...x,ref:N,onClick:Pe(e.onClick,A=>{M(R=>!R),S&&(k.current=A.isPropagationStopped(),k.current||A.stopPropagation())})}),S&&r.jsx(Uw,{control:y,bubbles:!k.current,name:a,value:m,checked:T,required:c,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});Iw.displayName=Lm;var qw="SwitchThumb",Hw=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,l=WM(qw,n);return r.jsx(It.span,{"data-state":$w(l.checked),"data-disabled":l.disabled?"":void 0,...a,ref:t})});Hw.displayName=qw;var XM="SwitchBubbleInput",Uw=w.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...l},o)=>{const c=w.useRef(null),d=mn(c,o),m=I5(n),f=q5(t);return w.useEffect(()=>{const p=c.current;if(!p)return;const x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set;if(m!==n&&b){const N=new Event("click",{bubbles:a});b.call(p,n),p.dispatchEvent(N)}},[m,n,a]),r.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:d,style:{...l.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Uw.displayName=XM;function $w(e){return e?"checked":"unchecked"}var Vw=Iw,KM=Hw;const vt=w.forwardRef(({className:e,...t},n)=>r.jsx(Vw,{className:he("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:r.jsx(KM,{className:he("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")})}));vt.displayName=Vw.displayName;const QM=Ko("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=w.forwardRef(({className:e,...t},n)=>r.jsx(H5,{ref:n,className:he(QM(),e),...t}));Q.displayName=H5.displayName;const Te=w.forwardRef(({className:e,type:t,...n},a)=>r.jsx("input",{type:t,className:he("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...n}));Te.displayName="Input";const ZM=1,JM=1e6;let Ep=0;function eA(){return Ep=(Ep+1)%Number.MAX_SAFE_INTEGER,Ep.toString()}const Mp=new Map,_b=e=>{if(Mp.has(e))return;const t=setTimeout(()=>{Mp.delete(e),cu({type:"REMOVE_TOAST",toastId:e})},JM);Mp.set(e,t)},tA=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ZM)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?_b(n):e.toasts.forEach(a=>{_b(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===n||n===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Y0=[];let W0={toasts:[]};function cu(e){W0=tA(W0,e),Y0.forEach(t=>{t(W0)})}function nA({...e}){const t=eA(),n=l=>cu({type:"UPDATE_TOAST",toast:{...l,id:t}}),a=()=>cu({type:"DISMISS_TOAST",toastId:t});return cu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:l=>{l||a()}}}),{id:t,dismiss:a,update:n}}function or(){const[e,t]=w.useState(W0);return w.useEffect(()=>(Y0.push(t),()=>{const n=Y0.indexOf(t);n>-1&&Y0.splice(n,1)}),[e]),{...e,toast:nA,dismiss:n=>cu({type:"DISMISS_TOAST",toastId:n})}}const rA=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function aA(e){const t=rA.map(a=>({id:a.id,label:a.label,description:a.description,passed:a.validate(e)}));return{isValid:t.every(a=>a.passed),rules:t}}const P1="0.11.5 Beta",F1="MaiBot Dashboard",sA=`${F1} v${P1}`,lA=(e="v")=>`${e}${P1}`,ir=y1,I1=U5,iA=p1,Gw=w.forwardRef(({className:e,...t},n)=>r.jsx(wm,{ref:n,className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Gw.displayName=wm.displayName;const Jn=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(iA,{children:[r.jsx(Gw,{}),r.jsxs(jm,{ref:a,className:he("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,r.jsxs(x1,{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:[r.jsx(Au,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jn.displayName=jm.displayName;const er=({className:e,...t})=>r.jsx("div",{className:he("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});er.displayName="DialogHeader";const Er=({className:e,...t})=>r.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Er.displayName="DialogFooter";const tr=w.forwardRef(({className:e,...t},n)=>r.jsx(g1,{ref:n,className:he("text-lg font-semibold leading-none tracking-tight",e),...t}));tr.displayName=g1.displayName;const xr=w.forwardRef(({className:e,...t},n)=>r.jsx(v1,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));xr.displayName=v1.displayName;var oA=Symbol("radix.slottable");function cA(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=oA,t}var Yw="AlertDialog",[uA]=Ua(Yw,[$5]),Hs=$5(),Ww=e=>{const{__scopeAlertDialog:t,...n}=e,a=Hs(t);return r.jsx(y1,{...a,...n,modal:!0})};Ww.displayName=Yw;var dA="AlertDialogTrigger",Xw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(U5,{...l,...a,ref:t})});Xw.displayName=dA;var mA="AlertDialogPortal",Kw=e=>{const{__scopeAlertDialog:t,...n}=e,a=Hs(t);return r.jsx(p1,{...a,...n})};Kw.displayName=mA;var hA="AlertDialogOverlay",Qw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(wm,{...l,...a,ref:t})});Qw.displayName=hA;var Do="AlertDialogContent",[fA,pA]=uA(Do),xA=cA("AlertDialogContent"),Zw=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...l}=e,o=Hs(n),c=w.useRef(null),d=mn(t,c),m=w.useRef(null);return r.jsx(eT,{contentName:Do,titleName:Jw,docsSlug:"alert-dialog",children:r.jsx(fA,{scope:n,cancelRef:m,children:r.jsxs(jm,{role:"alertdialog",...o,...l,ref:d,onOpenAutoFocus:Pe(l.onOpenAutoFocus,f=>{f.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(xA,{children:a}),r.jsx(vA,{contentRef:c})]})})})});Zw.displayName=Do;var Jw="AlertDialogTitle",ej=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(g1,{...l,...a,ref:t})});ej.displayName=Jw;var tj="AlertDialogDescription",nj=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(v1,{...l,...a,ref:t})});nj.displayName=tj;var gA="AlertDialogAction",rj=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,l=Hs(n);return r.jsx(x1,{...l,...a,ref:t})});rj.displayName=gA;var aj="AlertDialogCancel",sj=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:l}=pA(aj,n),o=Hs(n),c=mn(t,l);return r.jsx(x1,{...o,...a,ref:c})});sj.displayName=aj;var vA=({contentRef:e})=>{const t=`\`${Do}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${Do}\` by passing a \`${tj}\` 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 \`${Do}\`. 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 w.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},yA=Ww,bA=Xw,wA=Kw,lj=Qw,ij=Zw,oj=rj,cj=sj,uj=ej,dj=nj;const en=yA,Zn=bA,jA=wA,mj=w.forwardRef(({className:e,...t},n)=>r.jsx(lj,{className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));mj.displayName=lj.displayName;const Yt=w.forwardRef(({className:e,...t},n)=>r.jsxs(jA,{children:[r.jsx(mj,{}),r.jsx(ij,{ref:n,className:he("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Yt.displayName=ij.displayName;const Wt=({className:e,...t})=>r.jsx("div",{className:he("flex flex-col space-y-2 text-center sm:text-left",e),...t});Wt.displayName="AlertDialogHeader";const Xt=({className:e,...t})=>r.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xt.displayName="AlertDialogFooter";const Kt=w.forwardRef(({className:e,...t},n)=>r.jsx(uj,{ref:n,className:he("text-lg font-semibold",e),...t}));Kt.displayName=uj.displayName;const Qt=w.forwardRef(({className:e,...t},n)=>r.jsx(dj,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));Qt.displayName=dj.displayName;const Zt=w.forwardRef(({className:e,...t},n)=>r.jsx(oj,{ref:n,className:he(gu(),e),...t}));Zt.displayName=oj.displayName;const Jt=w.forwardRef(({className:e,...t},n)=>r.jsx(cj,{ref:n,className:he(gu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Jt.displayName=cj.displayName;function NA(){return r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),r.jsxs(kl,{defaultValue:"appearance",className:"w-full",children:[r.jsxs(Bs,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[r.jsxs(Pt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(s6,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"外观"})]}),r.jsxs(Pt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(xT,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"安全"})]}),r.jsxs(Pt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(Pa,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"其他"})]}),r.jsxs(Pt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[r.jsx(pi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),r.jsx("span",{children:"关于"})]})]}),r.jsxs(an,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[r.jsx(cn,{value:"appearance",className:"mt-0",children:r.jsx(SA,{})}),r.jsx(cn,{value:"security",className:"mt-0",children:r.jsx(kA,{})}),r.jsx(cn,{value:"other",className:"mt-0",children:r.jsx(CA,{})}),r.jsx(cn,{value:"about",className:"mt-0",children:r.jsx(TA,{})})]})]})]})}function Eb(e){const t=document.documentElement,a={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%",gradient:null},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%",gradient:null},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%",gradient:null},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%",gradient:null},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%",gradient:null},red:{hsl:"0 84% 60%",darkHsl:"0 90% 70%",gradient:null},"gradient-sunset":{hsl:"15 95% 60%",darkHsl:"15 95% 65%",gradient:"linear-gradient(135deg, hsl(25 95% 53%) 0%, hsl(330 81% 60%) 100%)"},"gradient-ocean":{hsl:"200 90% 55%",darkHsl:"200 90% 60%",gradient:"linear-gradient(135deg, hsl(221.2 83.2% 53.3%) 0%, hsl(189 94% 43%) 100%)"},"gradient-forest":{hsl:"150 70% 45%",darkHsl:"150 75% 40%",gradient:"linear-gradient(135deg, hsl(142 71% 45%) 0%, hsl(158 64% 52%) 100%)"},"gradient-aurora":{hsl:"310 85% 65%",darkHsl:"310 90% 70%",gradient:"linear-gradient(135deg, hsl(271 91% 65%) 0%, hsl(330 81% 60%) 100%)"},"gradient-fire":{hsl:"15 95% 55%",darkHsl:"15 95% 60%",gradient:"linear-gradient(135deg, hsl(0 84% 60%) 0%, hsl(25 95% 53%) 100%)"},"gradient-twilight":{hsl:"250 90% 60%",darkHsl:"250 95% 65%",gradient:"linear-gradient(135deg, hsl(239 84% 67%) 0%, hsl(271 91% 65%) 100%)"}}[e];if(a)t.style.setProperty("--primary",a.hsl),a.gradient?(t.style.setProperty("--primary-gradient",a.gradient),t.classList.add("has-gradient")):(t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient"));else if(e.startsWith("#")){const l=o=>{o=o.replace("#","");const c=parseInt(o.substring(0,2),16)/255,d=parseInt(o.substring(2,4),16)/255,m=parseInt(o.substring(4,6),16)/255,f=Math.max(c,d,m),p=Math.min(c,d,m);let x=0,y=0;const b=(f+p)/2;if(f!==p){const N=f-p;switch(y=b>.5?N/(2-f-p):N/(f+p),f){case c:x=((d-m)/N+(d<m?6:0))/6;break;case d:x=((m-c)/N+2)/6;break;case m:x=((c-d)/N+4)/6;break}}return`${Math.round(x*360)} ${Math.round(y*100)}% ${Math.round(b*100)}%`};t.style.setProperty("--primary",l(e)),t.style.removeProperty("--primary-gradient"),t.classList.remove("has-gradient")}}function SA(){const{theme:e,setTheme:t}=B1(),{enableAnimations:n,setEnableAnimations:a,enableWavesBackground:l,setEnableWavesBackground:o}=Fw(),[c,d]=w.useState(()=>localStorage.getItem("accent-color")||"blue");w.useEffect(()=>{const f=localStorage.getItem("accent-color")||"blue";Eb(f)},[]);const m=f=>{d(f),localStorage.setItem("accent-color",f),Eb(f)};return r.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[r.jsx(Ap,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),r.jsx(Ap,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),r.jsx(Ap,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),r.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[r.jsx(Sa,{value:"blue",current:c,onChange:m,label:"蓝色",colorClass:"bg-blue-500"}),r.jsx(Sa,{value:"purple",current:c,onChange:m,label:"紫色",colorClass:"bg-purple-500"}),r.jsx(Sa,{value:"green",current:c,onChange:m,label:"绿色",colorClass:"bg-green-500"}),r.jsx(Sa,{value:"orange",current:c,onChange:m,label:"橙色",colorClass:"bg-orange-500"}),r.jsx(Sa,{value:"pink",current:c,onChange:m,label:"粉色",colorClass:"bg-pink-500"}),r.jsx(Sa,{value:"red",current:c,onChange:m,label:"红色",colorClass:"bg-red-500"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),r.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[r.jsx(Sa,{value:"gradient-sunset",current:c,onChange:m,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),r.jsx(Sa,{value:"gradient-ocean",current:c,onChange:m,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),r.jsx(Sa,{value:"gradient-forest",current:c,onChange:m,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),r.jsx(Sa,{value:"gradient-aurora",current:c,onChange:m,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),r.jsx(Sa,{value:"gradient-fire",current:c,onChange:m,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),r.jsx(Sa,{value:"gradient-twilight",current:c,onChange:m,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[r.jsx("div",{className:"flex-1",children:r.jsx("input",{type:"color",value:c.startsWith("#")?c:"#3b82f6",onChange:f=>m(f.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),r.jsx("div",{className:"flex-1",children:r.jsx(Te,{type:"text",value:c,onChange:f=>m(f.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),r.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[r.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5 flex-1",children:[r.jsx(Q,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),r.jsx(vt,{id:"animations",checked:n,onCheckedChange:a})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5 flex-1",children:[r.jsx(Q,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),r.jsx(vt,{id:"waves-background",checked:l,onCheckedChange:o})]})})]})]})]})}function kA(){const e=as(),[t,n]=w.useState(""),[a,l]=w.useState(""),[o,c]=w.useState(!1),[d,m]=w.useState(!1),[f,p]=w.useState(!1),[x,y]=w.useState(!1),[b,N]=w.useState(!1),[k,S]=w.useState(!1),[T,M]=w.useState(""),[A,R]=w.useState(!1),{toast:B}=or(),O=w.useMemo(()=>aA(a),[a]),L=()=>localStorage.getItem("access-token")||"",$=async J=>{try{await navigator.clipboard.writeText(J),N(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>N(!1),2e3)}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=async()=>{if(!a.trim()){B({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!O.isValid){const J=O.rules.filter(se=>!se.passed).map(se=>se.label).join(", ");B({title:"格式错误",description:`Token 不符合要求: ${J}`,variant:"destructive"});return}p(!0);try{const J=L(),se=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`},body:JSON.stringify({new_token:a.trim()})}),H=await se.json();se.ok&&H.success?(localStorage.setItem("access-token",a.trim()),l(""),t&&n(a.trim()),B({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},1500)):B({title:"更新失败",description:H.message||"无法更新 Token",variant:"destructive"})}catch(J){console.error("更新 Token 错误:",J),B({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{p(!1)}},I=async()=>{y(!0);try{const J=L(),se=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${J}`}}),H=await se.json();se.ok&&H.success?(localStorage.setItem("access-token",H.token),n(H.token),M(H.token),S(!0),R(!1),B({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):B({title:"生成失败",description:H.message||"无法生成新 Token",variant:"destructive"})}catch(J){console.error("生成 Token 错误:",J),B({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{y(!1)}},G=async()=>{try{await navigator.clipboard.writeText(T),R(!0),B({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{B({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},ee=()=>{S(!1),setTimeout(()=>{M(""),R(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),e({to:"/auth"})},500)},Ne=J=>{J||ee()};return r.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[r.jsx(ir,{open:k,onOpenChange:Ne,children:r.jsxs(Jn,{className:"sm:max-w-md",children:[r.jsxs(er,{children:[r.jsxs(tr,{className:"flex items-center gap-2",children:[r.jsx(Ao,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),r.jsx(xr,{children:"这是您的新 Token请立即保存。关闭此窗口后将跳转到登录页面。"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[r.jsx(Q,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),r.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:T})]}),r.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Ao,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[r.jsx("p",{className:"font-semibold",children:"重要提示"}),r.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[r.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),r.jsx("li",{children:"请立即复制并保存到安全的位置"}),r.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),r.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),r.jsxs(Er,{className:"gap-2 sm:gap-0",children:[r.jsx(ne,{variant:"outline",onClick:G,className:"gap-2",children:A?r.jsxs(r.Fragment,{children:[r.jsx(mi,{className:"h-4 w-4 text-green-500"}),"已复制"]}):r.jsxs(r.Fragment,{children:[r.jsx(vx,{className:"h-4 w-4"}),"复制 Token"]})}),r.jsx(ne,{onClick:ee,children:"我已保存,关闭"})]})]})}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),r.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Te,{id:"current-token",type:o?"text":"password",value:t||L(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),r.jsx("button",{onClick:()=>{t||n(L()),c(!o)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:o?"隐藏":"显示",children:o?r.jsx(yx,{className:"h-4 w-4 text-muted-foreground"}):r.jsx(Ha,{className:"h-4 w-4 text-muted-foreground"})})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsx(ne,{variant:"outline",size:"icon",onClick:()=>$(L()),title:"复制到剪贴板",className:"flex-shrink-0",children:b?r.jsx(mi,{className:"h-4 w-4 text-green-500"}):r.jsx(vx,{className:"h-4 w-4"})}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsxs(ne,{variant:"outline",disabled:x,className:"gap-2 flex-1 sm:flex-none",children:[r.jsx(Ia,{className:he("h-4 w-4",x&&"animate-spin")}),r.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),r.jsx("span",{className:"sm:hidden",children:"生成"})]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认重新生成 Token"}),r.jsx(Qt,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:I,children:"确认生成"})]})]})]})]})]}),r.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token不要泄露给他人"})]})})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),r.jsxs("div",{className:"relative",children:[r.jsx(Te,{id:"new-token",type:d?"text":"password",value:a,onChange:J=>l(J.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),r.jsx("button",{onClick:()=>m(!d),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:d?"隐藏":"显示",children:d?r.jsx(yx,{className:"h-4 w-4 text-muted-foreground"}):r.jsx(Ha,{className:"h-4 w-4 text-muted-foreground"})})]}),a&&r.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),r.jsx("div",{className:"space-y-1.5",children:O.rules.map(J=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[J.passed?r.jsx($r,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):r.jsx(bx,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),r.jsx("span",{className:he(J.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:J.label})]},J.id))}),O.isValid&&r.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:r.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[r.jsx(mi,{className:"h-4 w-4"}),r.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),r.jsx(ne,{onClick:U,disabled:f||!O.isValid||!a,className:"w-full sm:w-auto",children:f?"更新中...":"更新自定义 Token"})]})]}),r.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:[r.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),r.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),r.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),r.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),r.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),r.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),r.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function CA(){const e=as(),{toast:t}=or(),[n,a]=w.useState(!1),l=async()=>{a(!0);try{const o=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${o}`}}),d=await c.json();c.ok&&d.success?(t({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{e({to:"/setup"})},1e3)):t({title:"重置失败",description:d.message||"无法重置配置状态",variant:"destructive"})}catch(o){console.error("重置配置状态错误:",o),t({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{a(!1)}};return r.jsx("div",{className:"space-y-4 sm:space-y-6",children:r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),r.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[r.jsx("div",{className:"space-y-2",children:r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsxs(ne,{variant:"outline",disabled:n,className:"gap-2",children:[r.jsx(gT,{className:he("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认重新配置"}),r.jsx(Qt,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:l,children:"确认重置"})]})]})]})]})]})})}function TA(){return r.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",F1]}),r.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("p",{children:["版本: ",P1]}),r.jsx("p",{children:"麦麦MaiBot的现代化 Web 管理界面"})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),r.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",r.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"React 19.2.0"}),r.jsx("li",{children:"TypeScript 5.7.2"}),r.jsx("li",{children:"Vite 6.0.7"}),r.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"shadcn/ui"}),r.jsx("li",{children:"Radix UI"}),r.jsx("li",{children:"Tailwind CSS 3.4.17"}),r.jsx("li",{children:"Lucide Icons"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"后端"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"Python 3.12+"}),r.jsx("li",{children:"FastAPI"}),r.jsx("li",{children:"Uvicorn"}),r.jsx("li",{children:"WebSocket"})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),r.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[r.jsx("li",{children:"Bun / npm"}),r.jsx("li",{children:"ESLint 9.17.0"}),r.jsx("li",{children:"PostCSS"})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),r.jsx(an,{className:"h-[300px] sm:h-[400px]",children:r.jsxs("div",{className:"space-y-4 pr-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"React",description:"用户界面构建库",license:"MIT"}),r.jsx(Tn,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),r.jsx(Tn,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),r.jsx(Tn,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),r.jsx(Tn,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),r.jsx(Tn,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),r.jsx(Tn,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),r.jsx(Tn,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),r.jsx(Tn,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),r.jsx(Tn,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),r.jsx(Tn,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),r.jsx(Tn,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),r.jsx(Tn,{name:"Pydantic",description:"数据验证库",license:"MIT"}),r.jsx(Tn,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),r.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[r.jsx(Tn,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),r.jsx(Tn,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),r.jsx(Tn,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),r.jsx(Tn,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[r.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:r.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[r.jsx("div",{className:"flex-shrink-0 mt-0.5",children:r.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:r.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function Tn({name:e,description:t,license:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-medium text-foreground truncate",children:e}),r.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:t})]}),r.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary flex-shrink-0",children:n})]})}function Ap({value:e,current:t,onChange:n,label:a,description:l}){const o=t===e;return r.jsxs("button",{onClick:()=>n(e),className:he("relative rounded-lg border-2 p-3 sm:p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&r.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"text-sm sm:text-base font-medium",children:a}),r.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:l})]}),r.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[e==="light"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),r.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function Sa({value:e,current:t,onChange:n,label:a,colorClass:l}){const o=t===e;return r.jsxs("button",{onClick:()=>n(e),className:he("relative rounded-lg border-2 p-2 sm:p-3 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&r.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"}),r.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[r.jsx("div",{className:he("h-8 w-8 sm:h-10 sm:w-10 rounded-full",l)}),r.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:a})]})]})}class _A{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,a){return t[0]*n+t[1]*a}mix(t,n,a){return(1-a)*t+a*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const a=Math.floor(t)&255,l=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const o=this.fade(t),c=this.fade(n),d=this.perm[a]+l,m=this.perm[d],f=this.perm[d+1],p=this.perm[a+1]+l,x=this.perm[p],y=this.perm[p+1];return this.mix(this.mix(this.dot(this.grad3[m%12],t,n),this.dot(this.grad3[x%12],t-1,n),o),this.mix(this.dot(this.grad3[f%12],t,n-1),this.dot(this.grad3[y%12],t-1,n-1),o),c)}}function EA(){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(void 0),a=w.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 _A(Math.random()),bounding:null});return w.useEffect(()=>{const l=t.current,o=e.current;if(!l||!o)return;const c=a.current,d=()=>{const k=l.getBoundingClientRect();c.bounding=k,o.style.width=`${k.width}px`,o.style.height=`${k.height}px`},m=()=>{if(!c.bounding)return;const{width:k,height:S}=c.bounding;c.lines=[],c.paths.forEach(U=>U.remove()),c.paths=[];const T=10,M=32,A=k+200,R=S+30,B=Math.ceil(A/T),O=Math.ceil(R/M),L=(k-T*B)/2,$=(S-M*O)/2;for(let U=0;U<=B;U++){const I=[];for(let ee=0;ee<=O;ee++){const Ne={x:L+T*U,y:$+M*ee,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};I.push(Ne)}const G=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild(G),c.paths.push(G),c.lines.push(I)}},f=k=>{const{lines:S,mouse:T,noise:M}=c;S.forEach(A=>{A.forEach(R=>{const B=M.perlin2((R.x+k*.0125)*.002,(R.y+k*.005)*.0015)*12;R.wave.x=Math.cos(B)*32,R.wave.y=Math.sin(B)*16;const O=R.x-T.sx,L=R.y-T.sy,$=Math.hypot(O,L),U=Math.max(175,T.vs);if($<U){const I=1-$/U,G=Math.cos($*.001)*I;R.cursor.vx+=Math.cos(T.a)*G*U*T.vs*65e-5,R.cursor.vy+=Math.sin(T.a)*G*U*T.vs*65e-5}R.cursor.vx+=(0-R.cursor.x)*.005,R.cursor.vy+=(0-R.cursor.y)*.005,R.cursor.vx*=.925,R.cursor.vy*=.925,R.cursor.x+=R.cursor.vx*2,R.cursor.y+=R.cursor.vy*2,R.cursor.x=Math.min(100,Math.max(-100,R.cursor.x)),R.cursor.y=Math.min(100,Math.max(-100,R.cursor.y))})})},p=(k,S=!0)=>{const T={x:k.x+k.wave.x+(S?k.cursor.x:0),y:k.y+k.wave.y+(S?k.cursor.y:0)};return T.x=Math.round(T.x*10)/10,T.y=Math.round(T.y*10)/10,T},x=()=>{const{lines:k,paths:S}=c;k.forEach((T,M)=>{let A=p(T[0],!1),R=`M ${A.x} ${A.y}`;T.forEach((B,O)=>{const L=O===T.length-1;A=p(B,!L),R+=`L ${A.x} ${A.y}`}),S[M].setAttribute("d",R)})},y=k=>{const{mouse:S}=c;S.sx+=(S.x-S.sx)*.1,S.sy+=(S.y-S.sy)*.1;const T=S.x-S.lx,M=S.y-S.ly,A=Math.hypot(T,M);S.v=A,S.vs+=(A-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(M,T),l&&(l.style.setProperty("--x",`${S.sx}px`),l.style.setProperty("--y",`${S.sy}px`)),f(k),x(),n.current=requestAnimationFrame(y)},b=k=>{if(!c.bounding)return;const{mouse:S}=c;S.x=k.pageX-c.bounding.left,S.y=k.pageY-c.bounding.top+window.scrollY,S.set||(S.sx=S.x,S.sy=S.y,S.lx=S.x,S.ly=S.y,S.set=!0)},N=()=>{d(),m()};return d(),m(),window.addEventListener("resize",N),window.addEventListener("mousemove",b),n.current=requestAnimationFrame(y),()=>{window.removeEventListener("resize",N),window.removeEventListener("mousemove",b),n.current&&cancelAnimationFrame(n.current)}},[]),r.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[r.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"}}),r.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:r.jsx("style",{children:`
path {
fill: none;
stroke: hsl(var(--primary) / 0.20);
stroke-width: 1px;
}
`})})]})}function MA(){const e=as();w.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function hj(){return!!localStorage.getItem("access-token")}function AA(){const[e,t]=w.useState(""),[n,a]=w.useState(!1),[l,o]=w.useState(""),c=as(),{enableWavesBackground:d,setEnableWavesBackground:m}=Fw(),{theme:f,setTheme:p}=B1();w.useEffect(()=>{hj()&&c({to:"/"})},[c]);const y=f==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":f,b=()=>{p(y==="dark"?"light":"dark")},N=async k=>{if(k.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}a(!0);try{const S=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),T=await S.json();if(S.ok&&T.valid){localStorage.setItem("access-token",e.trim());const M=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${e.trim()}`}}),A=await M.json();M.ok&&A.is_first_setup?c({to:"/setup"}):c({to:"/"})}else o(T.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),o("连接服务器失败,请检查网络连接")}finally{a(!1)}};return r.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[d&&r.jsx(EA,{}),r.jsxs(ct,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[r.jsx("button",{onClick:b,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:y==="dark"?"切换到浅色模式":"切换到深色模式",children:y==="dark"?r.jsx(wx,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):r.jsx(jx,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),r.jsxs(Lt,{className:"space-y-4 text-center",children:[r.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:r.jsx($y,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Bt,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),r.jsx(Qn,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),r.jsx(Gt,{children:r.jsxs("form",{onSubmit:N,className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),r.jsxs("div",{className:"relative",children:[r.jsx(vT,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),r.jsx(Te,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:k=>t(k.target.value),className:he("pl-10",l&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),l&&r.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:[r.jsx(xi,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),r.jsx("span",{children:l})]}),r.jsx(ne,{type:"submit",className:"w-full",disabled:n,children:n?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),r.jsxs(ir,{children:[r.jsx(I1,{asChild:!0,children:r.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:[r.jsx(yT,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token我该去哪里获得 Token"]})}),r.jsxs(Jn,{className:"sm:max-w-md",children:[r.jsxs(er,{children:[r.jsxs(tr,{className:"flex items-center gap-2",children:[r.jsx($y,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),r.jsx(xr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(bT,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),r.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[r.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),r.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(Nl,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),r.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:r.jsx("code",{className:"text-primary",children:"data/webui.json"})}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",r.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),r.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx(xi,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),r.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[r.jsx("p",{className:"font-semibold",children:"安全提示"}),r.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[r.jsx("li",{children:"请妥善保管您的 Token不要泄露给他人"}),r.jsx("li",{children:"如需重置 Token请在登录后前往系统设置"})]})]})]})})]})]})]}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.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:[r.jsx(fu,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsxs(Kt,{className:"flex items-center gap-2",children:[r.jsx(fu,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),r.jsx(Qt,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),r.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>m(!1),children:"关闭动画"})]})]})]})]})})]}),r.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:r.jsx("p",{children:sA})})]})}const fn=w.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{className:he("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));fn.displayName="Textarea";var DA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zA=DA.reduce((e,t)=>{const n=f1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),OA="Separator",Mb="horizontal",RA=["horizontal","vertical"],fj=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=Mb,...l}=e,o=LA(a)?a:Mb,d=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return r.jsx(zA.div,{"data-orientation":o,...d,...l,ref:t})});fj.displayName=OA;function LA(e){return RA.includes(e)}var pj=fj;const vu=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},l)=>r.jsx(pj,{ref:l,decorative:n,orientation:t,className:he("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));vu.displayName=pj.displayName;const BA=Ko("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 un({className:e,variant:t,...n}){return r.jsx("div",{className:he(BA({variant:t}),e),...n})}function PA({config:e,onChange:t}){const n=l=>{l.trim()&&!e.alias_names.includes(l.trim())&&t({...e,alias_names:[...e.alias_names,l.trim()]})},a=l=>{t({...e,alias_names:e.alias_names.filter((o,c)=>c!==l)})};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"qq_account",children:"QQ账号 *"}),r.jsx(Te,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:e.qq_account||"",onChange:l=>t({...e,qq_account:Number(l.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称 *"}),r.jsx(Te,{id:"nickname",placeholder:"请输入机器人的昵称",value:e.nickname,onChange:l=>t({...e,nickname:l.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{children:"别名"}),r.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:e.alias_names.map((l,o)=>r.jsxs(un,{variant:"secondary",className:"gap-1",children:[l,r.jsx("button",{type:"button",onClick:()=>a(o),className:"ml-1 hover:text-destructive",children:r.jsx(Au,{className:"h-3 w-3"})})]},o))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:l=>{l.key==="Enter"&&(n(l.target.value),l.target.value="")}}),r.jsx(ne,{type:"button",variant:"outline",onClick:()=>{const l=document.getElementById("alias_input");l&&(n(l.value),l.value="")},children:"添加"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function FA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"personality",children:"人格特征 *"}),r.jsx(fn,{id:"personality",placeholder:"描述机器人的人格特质和身份特征建议120字以内",value:e.personality,onChange:n=>t({...e,personality:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"reply_style",children:"表达风格 *"}),r.jsx(fn,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:e.reply_style,onChange:n=>t({...e,reply_style:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"interest",children:"兴趣 *"}),r.jsx(fn,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:e.interest,onChange:n=>t({...e,interest:n.target.value}),rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),r.jsx(vu,{}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"plan_style",children:"群聊说话规则 *"}),r.jsx(fn,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:e.plan_style,onChange:n=>t({...e,plan_style:n.target.value}),rows:4}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),r.jsx(fn,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:e.private_plan_style,onChange:n=>t({...e,private_plan_style:n.target.value}),rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function IA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:"emoji_chance",children:"表情包激活概率"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[(e.emoji_chance*100).toFixed(0),"%"]})]}),r.jsx(Te,{id:"emoji_chance",type:"range",min:"0",max:"1",step:"0.1",value:e.emoji_chance,onChange:n=>t({...e,emoji_chance:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"max_reg_num",children:"最大表情包数量"}),r.jsx(Te,{id:"max_reg_num",type:"number",min:"1",max:"200",value:e.max_reg_num,onChange:n=>t({...e,max_reg_num:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"do_replace",children:"达到最大数量时替换"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),r.jsx(vt,{id:"do_replace",checked:e.do_replace,onCheckedChange:n=>t({...e,do_replace:n})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),r.jsx(Te,{id:"check_interval",type:"number",min:"1",max:"120",value:e.check_interval,onChange:n=>t({...e,check_interval:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),r.jsx(vu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"steal_emoji",children:"偷取表情包"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),r.jsx(vt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:n=>t({...e,steal_emoji:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"content_filtration",children:"启用表情包过滤"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),r.jsx(vt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:n=>t({...e,content_filtration:n})})]}),e.content_filtration&&r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"filtration_prompt",children:"过滤要求"}),r.jsx(Te,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:e.filtration_prompt,onChange:n=>t({...e,filtration_prompt:n.target.value})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function qA({config:e,onChange:t}){return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"enable_tool",children:"启用工具系统"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),r.jsx(vt,{id:"enable_tool",checked:e.enable_tool,onCheckedChange:n=>t({...e,enable_tool:n})})]}),r.jsx(vu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"enable_mood",children:"启用情绪系统"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),r.jsx(vt,{id:"enable_mood",checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})})]}),e.enable_mood&&r.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),r.jsx(Te,{id:"mood_update_threshold",type:"number",min:"0.1",max:"10",step:"0.1",value:e.mood_update_threshold||1,onChange:n=>t({...e,mood_update_threshold:Number(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(Q,{htmlFor:"emotion_style",children:"情感特征"}),r.jsx(fn,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:e.emotion_style||"",onChange:n=>t({...e,emotion_style:n.target.value}),rows:2}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),r.jsx(vu,{}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Q,{htmlFor:"all_global",children:"启用全局黑话模式"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),r.jsx(vt,{id:"all_global",checked:e.all_global,onCheckedChange:n=>t({...e,all_global:n})})]})]})}async function lt(e,t){const n=await fetch(e,t);if(n.status===401)throw localStorage.removeItem("access-token"),window.location.href="/auth",new Error("认证失败,请重新登录");return n}function pt(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function HA(){const e=await lt("/api/webui/config/bot",{method:"GET",headers:pt()});if(!e.ok)throw new Error("读取Bot配置失败");const n=(await e.json()).config.bot||{};return{qq_account:n.qq_account||0,nickname:n.nickname||"",alias_names:n.alias_names||[]}}async function UA(){const e=await lt("/api/webui/config/bot",{method:"GET",headers:pt()});if(!e.ok)throw new Error("读取人格配置失败");const n=(await e.json()).config.personality||{};return{personality:n.personality||"",reply_style:n.reply_style||"",interest:n.interest||"",plan_style:n.plan_style||"",private_plan_style:n.private_plan_style||""}}async function $A(){const e=await lt("/api/webui/config/bot",{method:"GET",headers:pt()});if(!e.ok)throw new Error("读取表情包配置失败");const n=(await e.json()).config.emoji||{};return{emoji_chance:n.emoji_chance??.4,max_reg_num:n.max_reg_num??40,do_replace:n.do_replace??!0,check_interval:n.check_interval??10,steal_emoji:n.steal_emoji??!0,content_filtration:n.content_filtration??!1,filtration_prompt:n.filtration_prompt||""}}async function VA(){const e=await lt("/api/webui/config/bot",{method:"GET",headers:pt()});if(!e.ok)throw new Error("读取其他配置失败");const n=(await e.json()).config,a=n.tool||{},l=n.mood||{},o=n.jargon||{};return{enable_tool:a.enable_tool??!0,enable_mood:l.enable_mood??!1,mood_update_threshold:l.mood_update_threshold,emotion_style:l.emotion_style,all_global:o.all_global??!0}}async function GA(e){const t=await lt("/api/webui/config/bot/section/bot",{method:"POST",headers:pt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await t.json()}async function YA(e){const t=await lt("/api/webui/config/bot/section/personality",{method:"POST",headers:pt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存人格配置失败")}return await t.json()}async function WA(e){const t=await lt("/api/webui/config/bot/section/emoji",{method:"POST",headers:pt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"保存表情包配置失败")}return await t.json()}async function XA(e){const t=[];t.push(lt("/api/webui/config/bot/section/tool",{method:"POST",headers:pt(),body:JSON.stringify({enable_tool:e.enable_tool})})),t.push(lt("/api/webui/config/bot/section/jargon",{method:"POST",headers:pt(),body:JSON.stringify({all_global:e.all_global})}));const n={enable_mood:e.enable_mood};e.enable_mood&&(n.mood_update_threshold=e.mood_update_threshold||1,n.emotion_style=e.emotion_style||""),t.push(lt("/api/webui/config/bot/section/mood",{method:"POST",headers:pt(),body:JSON.stringify(n)}));const a=await Promise.all(t);for(const l of a)if(!l.ok){const o=await l.json();throw new Error(o.detail||"保存其他配置失败")}return{success:!0}}async function Ab(){const e=localStorage.getItem("access-token"),t=await lt("/api/webui/setup/complete",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){const n=await t.json();throw new Error(n.message||"标记配置完成失败")}return await t.json()}function KA(){const e=as(),{toast:t}=or(),[n,a]=w.useState(0),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!0),[p,x]=w.useState({qq_account:0,nickname:"",alias_names:[]}),[y,b]=w.useState({personality:"是一个女大学生,现在在读大二,会刷贴吧。",reply_style:"请回复的平淡一些,简短一些,说中文,不要刻意突出自身学科背景。可以参考贴吧,知乎和微博的回复风格。",interest:"对技术相关话题,游戏和动漫相关话题感兴趣,也对日常话题感兴趣,不喜欢太过沉重严肃的话题",plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
2.如果相同的内容已经被执行,请不要重复执行
3.请控制你的发言频率,不要太过频繁的发言
4.如果有人对你感到厌烦,请减少回复
5.如果有人对你进行攻击,或者情绪激动,请你以合适的方法应对`,private_plan_style:`1.思考**所有**的可用的action中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用
2.如果相同的内容已经被执行,请不要重复执行
3.某句话如果已经被回复过,不要重复回复`}),[N,k]=w.useState({emoji_chance:.4,max_reg_num:40,do_replace:!0,check_interval:10,steal_emoji:!0,content_filtration:!1,filtration_prompt:"符合公序良俗"}),[S,T]=w.useState({enable_tool:!0,enable_mood:!1,mood_update_threshold:1,emotion_style:"情绪较为稳定,但遭遇特定事件的时候起伏较大",all_global:!0}),M=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:jT},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:l6},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:N1},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:Pa},{id:"complete",title:"完成设置",description:"后续配置提示",icon:fu}],A=(n+1)/M.length*100;w.useEffect(()=>{(async()=>{try{f(!0);const[G,ee,Ne,J]=await Promise.all([HA(),UA(),$A(),VA()]);x(G),b(ee),k(Ne),T(J)}catch(G){t({title:"加载配置失败",description:G instanceof Error?G.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{f(!1)}})()},[t]);const R=async()=>{d(!0);try{switch(n){case 0:await GA(p);break;case 1:await YA(y);break;case 2:await WA(N);break;case 3:await XA(S);break}return t({title:"保存成功",description:`${M[n].title}配置已保存`}),!0}catch(I){return t({title:"保存失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"}),!1}finally{d(!1)}},B=async()=>{await R()&&n<M.length-1&&a(n+1)},O=()=>{n>0&&a(n-1)},L=async()=>{o(!0);try{if(!await R()){o(!1);return}await Ab(),t({title:"配置完成",description:"所有配置已保存,正在跳转..."}),setTimeout(()=>{e({to:"/"})},500)}catch(I){t({title:"完成失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}finally{o(!1)}},$=async()=>{try{await Ab(),e({to:"/"})}catch(I){t({title:"跳过失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}},U=()=>{switch(n){case 0:return r.jsx(PA,{config:p,onChange:x});case 1:return r.jsx(FA,{config:y,onChange:b});case 2:return r.jsx(IA,{config:N,onChange:k});case 3:return r.jsx(qA,{config:S,onChange:T});case 4:return r.jsxs("div",{className:"space-y-6 text-center py-8",children:[r.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:r.jsx(fu,{className:"h-8 w-8 text-primary",strokeWidth:2})}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("h3",{className:"text-xl font-semibold",children:"模型配置"}),r.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"为了让机器人正常工作,您需要配置 AI 模型提供商和模型。"})]}),r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-6 max-w-md mx-auto text-left space-y-4",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.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"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"配置 API 提供商"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → API 提供商"中添加您的 API 提供商信息'})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.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"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"添加模型"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型列表"中添加需要使用的模型'})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"mt-0.5",children:r.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"})}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:"配置模型任务"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'在"系统设置 → 模型配置 → 模型任务配置"中为不同任务分配模型'})]})]})]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"💡 提示:完成向导后,您可以在系统设置中进行详细的模型配置"})]});default:return null}};return r.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:[r.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[r.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"}),r.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"})]}),m?r.jsxs("div",{className:"relative z-10 text-center",children:[r.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:r.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),r.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[r.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[r.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:r.jsx(wT,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),r.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),r.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",F1," 的初始配置"]})]}),r.jsxs("div",{className:"mb-6 md:mb-8",children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",M.length]}),r.jsxs("span",{className:"font-medium text-primary",children:[Math.round(A),"%"]})]}),r.jsx(Fu,{value:A,className:"h-2"})]}),r.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:M.map((I,G)=>{const ee=I.icon;return r.jsxs("div",{className:he("flex flex-1 flex-col items-center gap-1 md:gap-2",G<M.length-1&&"relative"),children:[G<M.length-1&&r.jsx("div",{className:he("absolute left-1/2 top-3 md:top-4 h-0.5 w-full",G<n?"bg-primary":"bg-border")}),r.jsx("div",{className:he("relative z-10 flex h-6 w-6 md:h-8 md:w-8 items-center justify-center rounded-full border-2 transition-all",G===n||G<n?"border-primary bg-primary text-primary-foreground":"border-border bg-background text-muted-foreground"),children:G<n?r.jsx($r,{className:"h-3 w-3 md:h-4 md:w-4",strokeWidth:2.5,fill:"none"}):r.jsx(ee,{className:"h-3 w-3 md:h-4 md:w-4"})}),r.jsx("span",{className:he("text-[10px] md:text-xs text-center max-w-[60px] md:max-w-none truncate md:whitespace-normal",G===n?"font-medium text-foreground":"text-muted-foreground"),title:I.title,children:I.title})]},I.id)})}),r.jsx(ct,{className:"mb-6 md:mb-8 shadow-lg",children:r.jsx(Gt,{className:"p-4 md:p-8",children:r.jsxs("div",{className:"min-h-[300px] md:min-h-[400px]",children:[r.jsxs("div",{className:"mb-4 md:mb-6",children:[r.jsx("h2",{className:"mb-2 text-xl md:text-2xl font-semibold",children:M[n].title}),r.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:M[n].description})]}),r.jsx(an,{className:"h-[400px] md:h-[500px]",children:r.jsx("div",{className:"pr-2",children:U()})})]})})}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-3 sm:gap-0",children:[r.jsx(ne,{variant:"outline",onClick:O,disabled:n===0||c,className:"w-full sm:w-auto order-2 sm:order-1",children:"上一步"}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto order-1 sm:order-2",children:[r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsxs(ne,{variant:"ghost",className:"flex-1 sm:flex-none gap-2",disabled:c||l,children:[r.jsx(NT,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"跳过向导"]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认跳过配置向导"}),r.jsx(Qt,{children:"您可以随时在系统设置中重新进入配置向导。确定要跳过吗?"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:$,children:"确认跳过"})]})]})]}),n===M.length-1?r.jsx(ne,{onClick:L,disabled:l||c,className:"flex-1 sm:flex-none",children:l||c?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),c?"保存中...":"完成中..."]}):r.jsxs(r.Fragment,{children:["完成配置",r.jsx($r,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})}):r.jsx(ne,{onClick:B,disabled:c,className:"flex-1 sm:flex-none",children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"保存中..."]}):r.jsxs(r.Fragment,{children:["下一步",r.jsx(ST,{className:"ml-2 h-4 w-4",strokeWidth:2,fill:"none"})]})})]})]})]}),r.jsx("div",{className:"relative z-10 mt-6 md:mt-8 text-center text-xs text-muted-foreground",children:r.jsx("p",{children:"您可以随时在设置中修改这些配置"})})]})]})}function xj(){const e=as();return r.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:r.jsxs("div",{className:"w-full max-w-2xl text-center",children:[r.jsxs("div",{className:"relative mb-8",children:[r.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(Yr,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),r.jsxs("div",{className:"space-y-4 mb-8",children:[r.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),r.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[r.jsxs(ne,{size:"lg",onClick:()=>e({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[r.jsx(J0,{className:"h-4 w-4"}),"返回首页"]}),r.jsxs(ne,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[r.jsx(i6,{className:"h-4 w-4"}),"返回上一页"]})]}),r.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var gj=["PageUp","PageDown"],vj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yj={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Qo="Slider",[Dx,QA,ZA]=bm(Qo),[bj]=Ua(Qo,[ZA]),[JA,Bm]=bj(Qo),wj=w.forwardRef((e,t)=>{const{name:n,min:a=0,max:l=100,step:o=1,orientation:c="horizontal",disabled:d=!1,minStepsBetweenThumbs:m=0,defaultValue:f=[a],value:p,onValueChange:x=()=>{},onValueCommit:y=()=>{},inverted:b=!1,form:N,...k}=e,S=w.useRef(new Set),T=w.useRef(0),A=c==="horizontal"?eD:tD,[R=[],B]=zl({prop:p,defaultProp:f,onChange:G=>{[...S.current][T.current]?.focus(),x(G)}}),O=w.useRef(R);function L(G){const ee=lD(R,G);I(G,ee)}function $(G){I(G,T.current)}function U(){const G=O.current[T.current];R[T.current]!==G&&y(R)}function I(G,ee,{commit:Ne}={commit:!1}){const J=uD(o),se=dD(Math.round((G-a)/o)*o+a,J),H=h1(se,[a,l]);B((le=[])=>{const re=aD(le,H,ee);if(cD(re,m*o)){T.current=re.indexOf(H);const ge=String(re)!==String(le);return ge&&Ne&&y(re),ge?re:le}else return le})}return r.jsx(JA,{scope:e.__scopeSlider,name:n,disabled:d,min:a,max:l,valueIndexToChangeRef:T,thumbs:S.current,values:R,orientation:c,form:N,children:r.jsx(Dx.Provider,{scope:e.__scopeSlider,children:r.jsx(Dx.Slot,{scope:e.__scopeSlider,children:r.jsx(A,{"aria-disabled":d,"data-disabled":d?"":void 0,...k,ref:t,onPointerDown:Pe(k.onPointerDown,()=>{d||(O.current=R)}),min:a,max:l,inverted:b,onSlideStart:d?void 0:L,onSlideMove:d?void 0:$,onSlideEnd:d?void 0:U,onHomeKeyDown:()=>!d&&I(a,0,{commit:!0}),onEndKeyDown:()=>!d&&I(l,R.length-1,{commit:!0}),onStepKeyDown:({event:G,direction:ee})=>{if(!d){const se=gj.includes(G.key)||G.shiftKey&&vj.includes(G.key)?10:1,H=T.current,le=R[H],re=o*se*ee;I(le+re,H,{commit:!0})}}})})})})});wj.displayName=Qo;var[jj,Nj]=bj(Qo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),eD=w.forwardRef((e,t)=>{const{min:n,max:a,dir:l,inverted:o,onSlideStart:c,onSlideMove:d,onSlideEnd:m,onStepKeyDown:f,...p}=e,[x,y]=w.useState(null),b=mn(t,A=>y(A)),N=w.useRef(void 0),k=Eu(l),S=k==="ltr",T=S&&!o||!S&&o;function M(A){const R=N.current||x.getBoundingClientRect(),B=[0,R.width],L=q1(B,T?[n,a]:[a,n]);return N.current=R,L(A-R.left)}return r.jsx(jj,{scope:e.__scopeSlider,startEdge:T?"left":"right",endEdge:T?"right":"left",direction:T?1:-1,size:"width",children:r.jsx(Sj,{dir:k,"data-orientation":"horizontal",...p,ref:b,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const R=M(A.clientX);c?.(R)},onSlideMove:A=>{const R=M(A.clientX);d?.(R)},onSlideEnd:()=>{N.current=void 0,m?.()},onStepKeyDown:A=>{const B=yj[T?"from-left":"from-right"].includes(A.key);f?.({event:A,direction:B?-1:1})}})})}),tD=w.forwardRef((e,t)=>{const{min:n,max:a,inverted:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:m,...f}=e,p=w.useRef(null),x=mn(t,p),y=w.useRef(void 0),b=!l;function N(k){const S=y.current||p.current.getBoundingClientRect(),T=[0,S.height],A=q1(T,b?[a,n]:[n,a]);return y.current=S,A(k-S.top)}return r.jsx(jj,{scope:e.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:r.jsx(Sj,{"data-orientation":"vertical",...f,ref:x,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:k=>{const S=N(k.clientY);o?.(S)},onSlideMove:k=>{const S=N(k.clientY);c?.(S)},onSlideEnd:()=>{y.current=void 0,d?.()},onStepKeyDown:k=>{const T=yj[b?"from-bottom":"from-top"].includes(k.key);m?.({event:k,direction:T?-1:1})}})})}),Sj=w.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:l,onSlideEnd:o,onHomeKeyDown:c,onEndKeyDown:d,onStepKeyDown:m,...f}=e,p=Bm(Qo,n);return r.jsx(It.span,{...f,ref:t,onKeyDown:Pe(e.onKeyDown,x=>{x.key==="Home"?(c(x),x.preventDefault()):x.key==="End"?(d(x),x.preventDefault()):gj.concat(vj).includes(x.key)&&(m(x),x.preventDefault())}),onPointerDown:Pe(e.onPointerDown,x=>{const y=x.target;y.setPointerCapture(x.pointerId),x.preventDefault(),p.thumbs.has(y)?y.focus():a(x)}),onPointerMove:Pe(e.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&l(x)}),onPointerUp:Pe(e.onPointerUp,x=>{const y=x.target;y.hasPointerCapture(x.pointerId)&&(y.releasePointerCapture(x.pointerId),o(x))})})}),kj="SliderTrack",Cj=w.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,l=Bm(kj,n);return r.jsx(It.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...a,ref:t})});Cj.displayName=kj;var zx="SliderRange",Tj=w.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,l=Bm(zx,n),o=Nj(zx,n),c=w.useRef(null),d=mn(t,c),m=l.values.length,f=l.values.map(y=>Mj(y,l.min,l.max)),p=m>1?Math.min(...f):0,x=100-Math.max(...f);return r.jsx(It.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...a,ref:d,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:x+"%"}})});Tj.displayName=zx;var Ox="SliderThumb",_j=w.forwardRef((e,t)=>{const n=QA(e.__scopeSlider),[a,l]=w.useState(null),o=mn(t,d=>l(d)),c=w.useMemo(()=>a?n().findIndex(d=>d.ref.current===a):-1,[n,a]);return r.jsx(nD,{...e,ref:o,index:c})}),nD=w.forwardRef((e,t)=>{const{__scopeSlider:n,index:a,name:l,...o}=e,c=Bm(Ox,n),d=Nj(Ox,n),[m,f]=w.useState(null),p=mn(t,M=>f(M)),x=m?c.form||!!m.closest("form"):!0,y=q5(m),b=c.values[a],N=b===void 0?0:Mj(b,c.min,c.max),k=sD(a,c.values.length),S=y?.[d.size],T=S?iD(S,N,d.direction):0;return w.useEffect(()=>{if(m)return c.thumbs.add(m),()=>{c.thumbs.delete(m)}},[m,c.thumbs]),r.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[d.startEdge]:`calc(${N}% + ${T}px)`},children:[r.jsx(Dx.ItemSlot,{scope:e.__scopeSlider,children:r.jsx(It.span,{role:"slider","aria-label":e["aria-label"]||k,"aria-valuemin":c.min,"aria-valuenow":b,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...o,ref:p,style:b===void 0?{display:"none"}:e.style,onFocus:Pe(e.onFocus,()=>{c.valueIndexToChangeRef.current=a})})}),x&&r.jsx(Ej,{name:l??(c.name?c.name+(c.values.length>1?"[]":""):void 0),form:c.form,value:b},a)]})});_j.displayName=Ox;var rD="RadioBubbleInput",Ej=w.forwardRef(({__scopeSlider:e,value:t,...n},a)=>{const l=w.useRef(null),o=mn(l,a),c=I5(t);return w.useEffect(()=>{const d=l.current;if(!d)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"value").set;if(c!==t&&p){const x=new Event("input",{bubbles:!0});p.call(d,t),d.dispatchEvent(x)}},[c,t]),r.jsx(It.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Ej.displayName=rD;function aD(e=[],t,n){const a=[...e];return a[n]=t,a.sort((l,o)=>l-o)}function Mj(e,t,n){const o=100/(n-t)*(e-t);return h1(o,[0,100])}function sD(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function lD(e,t){if(e.length===1)return 0;const n=e.map(l=>Math.abs(l-t)),a=Math.min(...n);return n.indexOf(a)}function iD(e,t,n){const a=e/2,o=q1([0,50],[0,a]);return(a-o(t)*n)*n}function oD(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function cD(e,t){if(t>0){const n=oD(e);return Math.min(...n)>=t}return!0}function q1(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function uD(e){return(String(e).split(".")[1]||"").length}function dD(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Aj=wj,mD=Cj,hD=Tj,fD=_j;const Pm=w.forwardRef(({className:e,...t},n)=>r.jsxs(Aj,{ref:n,className:he("relative flex w-full touch-none select-none items-center",e),...t,children:[r.jsx(mD,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:r.jsx(hD,{className:"absolute h-full bg-primary"})}),r.jsx(fD,{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"})]}));Pm.displayName=Aj.displayName;const _t=lT,Et=iT,jt=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(V5,{ref:a,className:he("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,r.jsx(tT,{asChild:!0,children:r.jsx(pu,{className:"h-4 w-4 opacity-50"})})]}));jt.displayName=V5.displayName;const Dj=w.forwardRef(({className:e,...t},n)=>r.jsx(G5,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Nx,{className:"h-4 w-4"})}));Dj.displayName=G5.displayName;const zj=w.forwardRef(({className:e,...t},n)=>r.jsx(Y5,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(pu,{className:"h-4 w-4"})}));zj.displayName=Y5.displayName;const Nt=w.forwardRef(({className:e,children:t,position:n="popper",...a},l)=>r.jsx(nT,{children:r.jsxs(W5,{ref:l,className:he("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[r.jsx(Dj,{}),r.jsx(rT,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),r.jsx(zj,{})]})}));Nt.displayName=W5.displayName;const pD=w.forwardRef(({className:e,...t},n)=>r.jsx(X5,{ref:n,className:he("px-2 py-1.5 text-sm font-semibold",e),...t}));pD.displayName=X5.displayName;const Oe=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(K5,{ref:a,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(aT,{children:r.jsx(mi,{className:"h-4 w-4"})})}),r.jsx(sT,{children:t})]}));Oe.displayName=K5.displayName;const xD=w.forwardRef(({className:e,...t},n)=>r.jsx(Q5,{ref:n,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));xD.displayName=Q5.displayName;function gD(e){const t=vD(e),n=w.forwardRef((a,l)=>{const{children:o,...c}=a,d=w.Children.toArray(o),m=d.find(bD);if(m){const f=m.props.children,p=d.map(x=>x===m?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return r.jsx(t,{...c,ref:l,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return r.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function vD(e){const t=w.forwardRef((n,a)=>{const{children:l,...o}=n;if(w.isValidElement(l)){const c=jD(l),d=wD(o,l.props);return l.type!==w.Fragment&&(d.ref=a?Sl(a,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yD=Symbol("radix.slottable");function bD(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yD}function wD(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...d)=>{const m=o(...d);return l(...d),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function jD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fm="Popover",[Oj]=Ua(Fm,[Vo]),Iu=Vo(),[ND,Ol]=Oj(Fm),Rj=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!1}=e,d=Iu(t),m=w.useRef(null),[f,p]=w.useState(!1),[x,y]=zl({prop:a,defaultProp:l??!1,onChange:o,caller:Fm});return r.jsx(Sm,{...d,children:r.jsx(ND,{scope:t,contentId:Ta(),triggerRef:m,open:x,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:f,onCustomAnchorAdd:w.useCallback(()=>p(!0),[]),onCustomAnchorRemove:w.useCallback(()=>p(!1),[]),modal:c,children:n})})};Rj.displayName=Fm;var Lj="PopoverAnchor",SD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=Ol(Lj,n),o=Iu(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=l;return w.useEffect(()=>(c(),()=>d()),[c,d]),r.jsx(km,{...o,...a,ref:t})});SD.displayName=Lj;var Bj="PopoverTrigger",Pj=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=Ol(Bj,n),o=Iu(n),c=mn(t,l.triggerRef),d=r.jsx(It.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Uj(l.open),...a,ref:c,onClick:Pe(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?d:r.jsx(km,{asChild:!0,...o,children:d})});Pj.displayName=Bj;var H1="PopoverPortal",[kD,CD]=Oj(H1,{forceMount:void 0}),Fj=e=>{const{__scopePopover:t,forceMount:n,children:a,container:l}=e,o=Ol(H1,t);return r.jsx(kD,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(Nm,{asChild:!0,container:l,children:a})})})};Fj.displayName=H1;var qo="PopoverContent",Ij=w.forwardRef((e,t)=>{const n=CD(qo,e.__scopePopover),{forceMount:a=n.forceMount,...l}=e,o=Ol(qo,e.__scopePopover);return r.jsx(Wr,{present:a||o.open,children:o.modal?r.jsx(_D,{...l,ref:t}):r.jsx(ED,{...l,ref:t})})});Ij.displayName=qo;var TD=gD("PopoverContent.RemoveScroll"),_D=w.forwardRef((e,t)=>{const n=Ol(qo,e.__scopePopover),a=w.useRef(null),l=mn(t,a),o=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return Z5(c)},[]),r.jsx(J5,{as:TD,allowPinchZoom:!0,children:r.jsx(qj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,c=>{c.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0,f=d.button===2||m;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),ED=w.forwardRef((e,t)=>{const n=Ol(qo,e.__scopePopover),a=w.useRef(!1),l=w.useRef(!1);return r.jsx(qj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(a.current||n.triggerRef.current?.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;n.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),qj=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:p,...x}=e,y=Ol(qo,n),b=Iu(n);return e6(),r.jsx(t6,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:r.jsx(b1,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:r.jsx(w1,{"data-state":Uj(y.open),role:"dialog",id:y.contentId,...b,...x,ref:t,style:{...x.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)"}})})})}),Hj="PopoverClose",MD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=Ol(Hj,n);return r.jsx(It.button,{type:"button",...a,ref:t,onClick:Pe(e.onClick,()=>l.onOpenChange(!1))})});MD.displayName=Hj;var AD="PopoverArrow",DD=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,l=Iu(n);return r.jsx(j1,{...l,...a,ref:t})});DD.displayName=AD;function Uj(e){return e?"open":"closed"}var zD=Rj,OD=Pj,RD=Fj,$j=Ij;const Cl=zD,Tl=OD,Ps=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},l)=>r.jsx(RD,{children:r.jsx($j,{ref:l,align:t,sideOffset:n,className:he("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...a})}));Ps.displayName=$j.displayName;const Zo="/api/webui/config";async function LD(){const t=await(await lt(`${Zo}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function zo(){const t=await(await lt(`${Zo}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function Db(e){const n=await(await lt(`${Zo}/bot`,{method:"POST",headers:pt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function om(e){const n=await(await lt(`${Zo}/model`,{method:"POST",headers:pt(),body:JSON.stringify(e)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function BD(e,t){const a=await(await lt(`${Zo}/bot/section/${e}`,{method:"POST",headers:pt(),body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}async function Rx(e,t){const a=await(await lt(`${Zo}/model/section/${e}`,{method:"POST",headers:pt(),body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}const PD=An.create({baseURL:"",timeout:1e4});async function U1(){try{return(await PD.post("/api/webui/system/restart")).data}catch(e){throw console.error("重启麦麦失败:",e),e}}const FD=Ko("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"}}),qu=w.forwardRef(({className:e,variant:t,...n},a)=>r.jsx("div",{ref:a,role:"alert",className:he(FD({variant:t}),e),...n}));qu.displayName="Alert";const ID=w.forwardRef(({className:e,...t},n)=>r.jsx("h5",{ref:n,className:he("mb-1 font-medium leading-none tracking-tight",e),...t}));ID.displayName="AlertTitle";const Hu=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:he("text-sm [&_p]:leading-relaxed",e),...t}));Hu.displayName="AlertDescription";function $1({onRestartComplete:e,onRestartFailed:t}){const[n,a]=w.useState(0),[l,o]=w.useState("restarting"),[c,d]=w.useState(0),[m,f]=w.useState(0);w.useEffect(()=>{const y=setInterval(()=>{a(k=>k>=90?k:k+1)},200),b=setInterval(()=>{d(k=>k+1)},1e3),N=setTimeout(()=>{o("checking"),p()},3e3);return()=>{clearInterval(y),clearInterval(b),clearTimeout(N)}},[]);const p=()=>{const b=async()=>{try{if(f(k=>k+1),(await fetch("/api/webui/system/status",{method:"GET",headers:{"Content-Type":"application/json"},signal:AbortSignal.timeout(3e3)})).ok)a(100),o("success"),setTimeout(()=>{e?.()},1500);else throw new Error("Status check failed")}catch{m<60?setTimeout(b,2e3):(o("failed"),t?.())}};b()},x=y=>{const b=Math.floor(y/60),N=y%60;return`${b}:${N.toString().padStart(2,"0")}`};return r.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:r.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[r.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[l==="restarting"&&r.jsxs(r.Fragment,{children:[r.jsx(xu,{className:"h-16 w-16 text-primary animate-spin"}),r.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),l==="checking"&&r.jsxs(r.Fragment,{children:[r.jsx(xu,{className:"h-16 w-16 text-primary animate-spin"}),r.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),r.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",m,"/60)"]})]}),l==="success"&&r.jsxs(r.Fragment,{children:[r.jsx($r,{className:"h-16 w-16 text-green-500"}),r.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),l==="failed"&&r.jsxs(r.Fragment,{children:[r.jsx(xi,{className:"h-16 w-16 text-destructive"}),r.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),r.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),l!=="failed"&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Fu,{value:n,className:"h-2"}),r.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[r.jsxs("span",{children:[n,"%"]}),r.jsxs("span",{children:["已用时: ",x(c)]})]})]}),r.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:[l==="restarting"&&"🔄 配置已保存,正在重启主程序...",l==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",l==="success"&&"✅ 配置已生效,服务运行正常",l==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),l==="failed"&&r.jsxs("div",{className:"flex gap-2",children:[r.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:"刷新页面"}),r.jsx("button",{onClick:()=>{o("checking"),f(0),p()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}function qD(){const[e,t]=w.useState(!0),[n,a]=w.useState(!1),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!1),[p,x]=w.useState(!1),{toast:y}=or(),[b,N]=w.useState(null),[k,S]=w.useState(null),[T,M]=w.useState(null),[A,R]=w.useState(null),[B,O]=w.useState(null),[L,$]=w.useState(null),[U,I]=w.useState(null),[G,ee]=w.useState(null),[Ne,J]=w.useState(null),[se,H]=w.useState(null),[le,re]=w.useState(null),[ge,E]=w.useState(null),[we,Z]=w.useState(null),[z,X]=w.useState(null),[q,ce]=w.useState(null),[fe,De]=w.useState(null),[oe,He]=w.useState(null),[at,je]=w.useState(null),Ze=w.useRef(null),qe=w.useRef(!0),Ot=w.useRef({}),bn=w.useCallback(async()=>{try{t(!0);const $e=await LD();Ot.current=$e,N($e.bot),S($e.personality);const Fn=$e.chat;Fn.talk_value_rules||(Fn.talk_value_rules=[]),M(Fn),R($e.expression),O($e.emoji),$($e.memory),I($e.tool),ee($e.mood),J($e.voice),H($e.lpmm_knowledge),re($e.keyword_reaction),E($e.response_post_process),Z($e.chinese_typo),X($e.response_splitter),ce($e.log),De($e.debug),He($e.maim_message),je($e.telemetry),d(!1),qe.current=!1}catch($e){console.error("加载配置失败:",$e),y({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[y]);w.useEffect(()=>{bn()},[bn]);const Dn=w.useCallback(async($e,Fn)=>{if(!qe.current)try{o(!0),await BD($e,Fn),d(!1)}catch(K){console.error(`自动保存 ${$e} 失败:`,K),d(!0)}finally{o(!1)}},[]),Xe=w.useCallback(($e,Fn)=>{qe.current||(d(!0),Ze.current&&clearTimeout(Ze.current),Ze.current=setTimeout(()=>{Dn($e,Fn)},2e3))},[Dn]);w.useEffect(()=>{b&&!qe.current&&Xe("bot",b)},[b,Xe]),w.useEffect(()=>{k&&!qe.current&&Xe("personality",k)},[k,Xe]),w.useEffect(()=>{T&&!qe.current&&Xe("chat",T)},[T,Xe]),w.useEffect(()=>{A&&!qe.current&&Xe("expression",A)},[A,Xe]),w.useEffect(()=>{B&&!qe.current&&Xe("emoji",B)},[B,Xe]),w.useEffect(()=>{L&&!qe.current&&Xe("memory",L)},[L,Xe]),w.useEffect(()=>{U&&!qe.current&&Xe("tool",U)},[U,Xe]),w.useEffect(()=>{G&&!qe.current&&Xe("mood",G)},[G,Xe]),w.useEffect(()=>{Ne&&!qe.current&&Xe("voice",Ne)},[Ne,Xe]),w.useEffect(()=>{se&&!qe.current&&Xe("lpmm_knowledge",se)},[se,Xe]),w.useEffect(()=>{le&&!qe.current&&Xe("keyword_reaction",le)},[le,Xe]),w.useEffect(()=>{ge&&!qe.current&&Xe("response_post_process",ge)},[ge,Xe]),w.useEffect(()=>{we&&!qe.current&&Xe("chinese_typo",we)},[we,Xe]),w.useEffect(()=>{z&&!qe.current&&Xe("response_splitter",z)},[z,Xe]),w.useEffect(()=>{q&&!qe.current&&Xe("log",q)},[q,Xe]),w.useEffect(()=>{fe&&!qe.current&&Xe("debug",fe)},[fe,Xe]),w.useEffect(()=>{oe&&!qe.current&&Xe("maim_message",oe)},[oe,Xe]),w.useEffect(()=>{at&&!qe.current&&Xe("telemetry",at)},[at,Xe]);const wn=async()=>{try{a(!0),Ze.current&&clearTimeout(Ze.current);const $e={...Ot.current,bot:b,personality:k,chat:T,expression:A,emoji:B,memory:L,tool:U,mood:G,voice:Ne,lpmm_knowledge:se,keyword_reaction:le,response_post_process:ge,chinese_typo:we,response_splitter:z,log:q,debug:fe,maim_message:oe,telemetry:at};await Db($e),d(!1),y({title:"保存成功",description:"麦麦主程序配置已保存"})}catch($e){console.error("保存配置失败:",$e),y({title:"保存失败",description:$e.message,variant:"destructive"})}finally{a(!1)}},Wn=async()=>{try{f(!0),U1().catch(()=>{}),x(!0)}catch($e){console.error("重启失败:",$e),x(!1),y({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),f(!1)}},Ar=async()=>{try{a(!0),Ze.current&&clearTimeout(Ze.current);const $e={...Ot.current,bot:b,personality:k,chat:T,expression:A,emoji:B,memory:L,tool:U,mood:G,voice:Ne,lpmm_knowledge:se,keyword_reaction:le,response_post_process:ge,chinese_typo:we,response_splitter:z,log:q,debug:fe,maim_message:oe,telemetry:at};await Db($e),d(!1),y({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(Fn=>setTimeout(Fn,500)),await Wn()}catch($e){console.error("保存失败:",$e),y({title:"保存失败",description:$e.message,variant:"destructive"})}finally{a(!1)}},Cn=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},cr=()=>{x(!1),f(!1),y({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return e?r.jsx(an,{className:"h-full",children:r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsxs(ne,{onClick:wn,disabled:n||l||!c||m,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(Cm,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":l?"自动保存中...":c?"保存配置":"已保存"]}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsxs(ne,{disabled:n||l||m,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(S1,{className:"mr-2 h-4 w-4"}),m?"重启中...":c?"保存并重启":"重启麦麦"]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认重启麦麦?"}),r.jsx(Qt,{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:c?Ar:Wn,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(qu,{children:[r.jsx(pi,{className:"h-4 w-4"}),r.jsxs(Hu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(kl,{defaultValue:"bot",className:"w-full",children:[r.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:r.jsxs(Bs,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[r.jsx(Pt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),r.jsx(Pt,{value:"personality",className:"flex-shrink-0",children:"人格"}),r.jsx(Pt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),r.jsx(Pt,{value:"expression",className:"flex-shrink-0",children:"表达"}),r.jsx(Pt,{value:"features",className:"flex-shrink-0",children:"功能"}),r.jsx(Pt,{value:"processing",className:"flex-shrink-0",children:"处理"}),r.jsx(Pt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),r.jsx(Pt,{value:"voice",className:"flex-shrink-0",children:"语音"}),r.jsx(Pt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),r.jsx(Pt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),r.jsx(cn,{value:"bot",className:"space-y-4",children:b&&r.jsx(HD,{config:b,onChange:N})}),r.jsx(cn,{value:"personality",className:"space-y-4",children:k&&r.jsx(UD,{config:k,onChange:S})}),r.jsx(cn,{value:"chat",className:"space-y-4",children:T&&r.jsx($D,{config:T,onChange:M})}),r.jsx(cn,{value:"expression",className:"space-y-4",children:A&&r.jsx(VD,{config:A,onChange:R})}),r.jsx(cn,{value:"features",className:"space-y-4",children:B&&L&&U&&r.jsx(GD,{emojiConfig:B,memoryConfig:L,toolConfig:U,onEmojiChange:O,onMemoryChange:$,onToolChange:I})}),r.jsx(cn,{value:"processing",className:"space-y-4",children:le&&ge&&we&&z&&r.jsx(YD,{keywordReactionConfig:le,responsePostProcessConfig:ge,chineseTypoConfig:we,responseSplitterConfig:z,onKeywordReactionChange:re,onResponsePostProcessChange:E,onChineseTypoChange:Z,onResponseSplitterChange:X})}),r.jsx(cn,{value:"mood",className:"space-y-4",children:G&&r.jsx(WD,{config:G,onChange:ee})}),r.jsx(cn,{value:"voice",className:"space-y-4",children:Ne&&r.jsx(XD,{config:Ne,onChange:J})}),r.jsx(cn,{value:"lpmm",className:"space-y-4",children:se&&r.jsx(KD,{config:se,onChange:H})}),r.jsxs(cn,{value:"other",className:"space-y-4",children:[q&&r.jsx(QD,{config:q,onChange:ce}),fe&&r.jsx(ZD,{config:fe,onChange:De}),oe&&r.jsx(JD,{config:oe,onChange:He}),at&&r.jsx(ez,{config:at,onChange:je})]})]}),p&&r.jsx($1,{onRestartComplete:Cn,onRestartFailed:cr})]})})}function HD({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},a=m=>{t({...e,platforms:e.platforms.filter((f,p)=>p!==m)})},l=(m,f)=>{const p=[...e.platforms];p[m]=f,t({...e,platforms:p})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},c=m=>{t({...e,alias_names:e.alias_names.filter((f,p)=>p!==m)})},d=(m,f)=>{const p=[...e.alias_names];p[m]=f,t({...e,alias_names:p})};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"platform",children:"平台"}),r.jsx(Te,{id:"platform",value:e.platform,onChange:m=>t({...e,platform:m.target.value}),placeholder:"qq"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"qq_account",children:"QQ账号"}),r.jsx(Te,{id:"qq_account",value:e.qq_account,onChange:m=>t({...e,qq_account:m.target.value}),placeholder:"123456789"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称"}),r.jsx(Te,{id:"nickname",value:e.nickname,onChange:m=>t({...e,nickname:m.target.value}),placeholder:"麦麦"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"其他平台账号"}),r.jsxs(ne,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),r.jsxs("div",{className:"space-y-2",children:[e.platforms.map((m,f)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{value:m,onChange:p=>l(f,p.target.value),placeholder:"wx:114514"}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除平台账号 "',m||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a(f),children:"删除"})]})]})]})]},f)),e.platforms.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"别名"}),r.jsxs(ne,{onClick:o,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加"]})]}),r.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((m,f)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{value:m,onChange:p=>d(f,p.target.value),placeholder:"小麦"}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除别名 "',m||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>c(f),children:"删除"})]})]})]})]},f)),e.alias_names.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function UD({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},a=o=>{t({...e,states:e.states.filter((c,d)=>d!==o)})},l=(o,c)=>{const d=[...e.states];d[o]=c,t({...e,states:d})};return r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"personality",children:"人格特质"}),r.jsx(fn,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征建议120字以内",rows:3}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内描述人格特质和身份特征"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"reply_style",children:"表达风格"}),r.jsx(fn,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"interest",children:"兴趣"}),r.jsx(fn,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"plan_style",children:"说话规则与行为风格"}),r.jsx(fn,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"visual_style",children:"识图规则"}),r.jsx(fn,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"private_plan_style",children:"私聊规则"}),r.jsx(fn,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"状态列表(人格多样性)"}),r.jsxs(ne,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),r.jsx("div",{className:"space-y-2",children:e.states.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(fn,{value:o,onChange:d=>l(c,d.target.value),placeholder:"描述一个人格状态",rows:2}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsx(Qt,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a(c),children:"删除"})]})]})]})]},c))})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"state_probability",children:"状态替换概率"}),r.jsx(Te,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:o=>t({...e,state_probability:parseFloat(o.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率0.0-1.0"})]})]})]})})}function $D({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},a=d=>{t({...e,talk_value_rules:e.talk_value_rules.filter((m,f)=>f!==d)})},l=(d,m,f)=>{const p=[...e.talk_value_rules];p[d]={...p[d],[m]:f},t({...e,talk_value_rules:p})},o=({value:d,onChange:m})=>{const[f,p]=w.useState("00"),[x,y]=w.useState("00"),[b,N]=w.useState("23"),[k,S]=w.useState("59");w.useEffect(()=>{const M=d.split("-");if(M.length===2){const[A,R]=M,[B,O]=A.split(":"),[L,$]=R.split(":");B&&p(B.padStart(2,"0")),O&&y(O.padStart(2,"0")),L&&N(L.padStart(2,"0")),$&&S($.padStart(2,"0"))}},[d]);const T=(M,A,R,B)=>{const O=`${M}:${A}-${R}:${B}`;m(O)};return r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[r.jsx(di,{className:"h-4 w-4 mr-2"}),d||"选择时间段"]})}),r.jsx(Ps,{className:"w-80",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"小时"}),r.jsxs(_t,{value:f,onValueChange:M=>{p(M),T(M,x,b,k)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:Array.from({length:24},(M,A)=>A).map(M=>r.jsx(Oe,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"分钟"}),r.jsxs(_t,{value:x,onValueChange:M=>{y(M),T(f,M,b,k)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:Array.from({length:60},(M,A)=>A).map(M=>r.jsx(Oe,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]})]})]}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"小时"}),r.jsxs(_t,{value:b,onValueChange:M=>{N(M),T(f,x,M,k)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:Array.from({length:24},(M,A)=>A).map(M=>r.jsx(Oe,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs",children:"分钟"}),r.jsxs(_t,{value:k,onValueChange:M=>{S(M),T(f,x,b,M)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:Array.from({length:60},(M,A)=>A).map(M=>r.jsx(Oe,{value:M.toString().padStart(2,"0"),children:M.toString().padStart(2,"0")},M))})]})]})]})]})]})})]})},c=({rule:d})=>{const m=`{ target = "${d.target}", time = "${d.time}", value = ${d.value.toFixed(1)} }`;return r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",children:[r.jsx(Ha,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-96",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:m}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),r.jsx(Te,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:d=>t({...e,talk_value:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),r.jsx(Te,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:d=>t({...e,mentioned_bot_reply:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅1 为 100% 回复"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_context_size",children:"上下文长度"}),r.jsx(Te,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:d=>t({...e,max_context_size:parseInt(d.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"planner_smooth",children:"规划器平滑"}),r.jsx(Te,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:d=>t({...e,planner_smooth:parseFloat(d.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-50 为关闭"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:d=>t({...e,enable_talk_value_rules:d})}),r.jsx(Q,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:d=>t({...e,include_planner_reasoning:d})}),r.jsx(Q,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&r.jsxs("div",{className:"border-t pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率优先匹配具体聊天再匹配全局规则"})]}),r.jsxs(ne,{onClick:n,size:"sm",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?r.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((d,m)=>r.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",m+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(c,{rule:d}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{variant:"ghost",size:"sm",children:r.jsx(zt,{className:"h-4 w-4 text-destructive"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除规则 #",m+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a(m),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"配置类型"}),r.jsxs(_t,{value:d.target===""?"global":"specific",onValueChange:f=>{f==="global"?l(m,"target",""):l(m,"target","qq::group")},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"global",children:"全局配置"}),r.jsx(Oe,{value:"specific",children:"详细配置"})]})]})]}),d.target!==""&&(()=>{const f=d.target.split(":"),p=f[0]||"qq",x=f[1]||"",y=f[2]||"group";return r.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"平台"}),r.jsxs(_t,{value:p,onValueChange:b=>{l(m,"target",`${b}:${x}:${y}`)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"qq",children:"QQ"}),r.jsx(Oe,{value:"wx",children:"微信"})]})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"群 ID"}),r.jsx(Te,{value:x,onChange:b=>{l(m,"target",`${p}:${b.target.value}:${y}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"类型"}),r.jsxs(_t,{value:y,onValueChange:b=>{l(m,"target",`${p}:${x}:${b}`)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"group",children:"群组group"}),r.jsx(Oe,{value:"private",children:"私聊private"})]})]})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID",d.target||"(未设置)"]})]})})(),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"时间段 (Time)"}),r.jsx(o,{value:d.time,onChange:f=>l(m,"time",f)}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{htmlFor:`rule-value-${m}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),r.jsx(Te,{id:`rule-value-${m}`,type:"number",step:"0.01",min:"0",max:"1",value:d.value,onChange:f=>{const p=parseFloat(f.target.value);isNaN(p)||l(m,"value",Math.max(0,Math.min(1,p)))},className:"w-20 h-8 text-xs"})]}),r.jsx(Pm,{value:[d.value],onValueChange:f=>l(m,"value",f[0]),min:0,max:1,step:.01,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0 (完全沉默)"}),r.jsx("span",{children:"0.5"}),r.jsx("span",{children:"1.0 (正常)"})]})]})]})]},m))}):r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:r.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),r.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:[r.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),r.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[r.jsxs("li",{children:["• ",r.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"Target 指定"}),"仅对特定聊天流生效格式platform:id:type"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),r.jsxs("li",{children:["• ",r.jsx("strong",{children:"数值范围"}),":建议 0-10 表示完全沉默1 表示正常发言"]})]})]})]})]})}function VD({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},a=y=>{t({...e,learning_list:e.learning_list.filter((b,N)=>N!==y)})},l=(y,b,N)=>{const k=[...e.learning_list];k[y][b]=N,t({...e,learning_list:k})},o=({rule:y})=>{const b=`["${y[0]}", "${y[1]}", "${y[2]}", "${y[3]}"]`;return r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",children:[r.jsx(Ha,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-96",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:b}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},c=({member:y,groupIndex:b,memberIndex:N,availableChatIds:k})=>{const S=k.includes(y)||y==="*",[T,M]=w.useState(!S);return r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"flex-1 flex gap-2",children:T?r.jsxs(r.Fragment,{children:[r.jsx(Te,{value:y,onChange:A=>x(b,N,A.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),k.length>0&&r.jsx(ne,{size:"sm",variant:"outline",onClick:()=>M(!1),title:"切换到下拉选择",children:"下拉"})]}):r.jsxs(r.Fragment,{children:[r.jsxs(_t,{value:y,onValueChange:A=>x(b,N,A),children:[r.jsx(jt,{className:"flex-1",children:r.jsx(Et,{placeholder:"选择聊天流"})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"*",children:"* (全局共享)"}),k.map((A,R)=>r.jsx(Oe,{value:A,children:A},R))]})]}),r.jsx(ne,{size:"sm",variant:"outline",onClick:()=>M(!0),title:"切换到手动输入",children:"输入"})]})}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除组成员 "',y||"(空)",'" 吗?此操作无法撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>p(b,N),children:"删除"})]})]})]})]})},d=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},m=y=>{t({...e,expression_groups:e.expression_groups.filter((b,N)=>N!==y)})},f=y=>{const b=[...e.expression_groups];b[y]=[...b[y],""],t({...e,expression_groups:b})},p=(y,b)=>{const N=[...e.expression_groups];N[y]=N[y].filter((k,S)=>S!==b),t({...e,expression_groups:N})},x=(y,b,N)=>{const k=[...e.expression_groups];k[y][b]=N,t({...e,expression_groups:k})};return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),r.jsxs(ne,{onClick:n,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),r.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((y,b)=>{const N=e.learning_list.some((R,B)=>B!==b&&R[0]===""),k=y[0]==="",S=y[0].split(":"),T=S[0]||"qq",M=S[1]||"",A=S[2]||"group";return r.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["规则 ",b+1," ",k&&"(全局配置)"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(o,{rule:y}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"sm",variant:"ghost",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除学习规则 ",b+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a(b),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"配置类型"}),r.jsxs(_t,{value:k?"global":"specific",onValueChange:R=>{R==="global"?l(b,0,""):l(b,0,"qq::group")},disabled:N&&!k,children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"global",children:"全局配置"}),r.jsx(Oe,{value:"specific",disabled:N&&!k,children:"详细配置"})]})]}),N&&!k&&r.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!k&&r.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"平台"}),r.jsxs(_t,{value:T,onValueChange:R=>{l(b,0,`${R}:${M}:${A}`)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"qq",children:"QQ"}),r.jsx(Oe,{value:"wx",children:"微信"})]})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"群 ID"}),r.jsx(Te,{value:M,onChange:R=>{l(b,0,`${T}:${R.target.value}:${A}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"类型"}),r.jsxs(_t,{value:A,onValueChange:R=>{l(b,0,`${T}:${M}:${R}`)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"group",children:"群组group"}),r.jsx(Oe,{value:"private",children:"私聊private"})]})]})]})]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID",y[0]||"(未设置)"]})]}),r.jsx("div",{className:"grid gap-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs font-medium",children:"使用学到的表达"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),r.jsx(vt,{checked:y[1]==="enable",onCheckedChange:R=>l(b,1,R?"enable":"disable")})]})}),r.jsx("div",{className:"grid gap-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-xs font-medium",children:"学习表达"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),r.jsx(vt,{checked:y[2]==="enable",onCheckedChange:R=>l(b,2,R?"enable":"disable")})]})}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{className:"text-xs font-medium",children:"学习强度"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"5",value:y[3],onChange:R=>{const B=parseFloat(R.target.value);isNaN(B)||l(b,3,Math.max(0,Math.min(5,B)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),r.jsx(Pm,{value:[parseFloat(y[3])||1],onValueChange:R=>l(b,3,R[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),r.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[r.jsx("span",{children:"0 (不学习)"}),r.jsx("span",{children:"2.5"}),r.jsx("span",{children:"5.0 (快速学习)"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},b)}),e.learning_list.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),r.jsxs(ne,{onClick:d,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),r.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((y,b)=>{const N=e.learning_list.map(k=>k[0]).filter(k=>k!=="");return r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",b+1,y.length===1&&y[0]==="*"&&"(全局共享)"]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ne,{onClick:()=>f(b),size:"sm",variant:"outline",children:r.jsx(pr,{className:"h-4 w-4"})}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"sm",variant:"ghost",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除共享组 ",b+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>m(b),children:"删除"})]})]})]})]})]}),r.jsx("div",{className:"space-y-2",children:y.map((k,S)=>r.jsx(c,{member:k,groupIndex:b,memberIndex:S,availableChatIds:N},S))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},b)}),e.expression_groups.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function GD({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:a,onMemoryChange:l,onToolChange:o}){return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:c=>o({...n,enable_tool:c})}),r.jsx(Q,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),r.jsx(Te,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:c=>l({...t,max_agent_iterations:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1不深入思考"})]})]})}),r.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"emoji_chance",children:"表情包激活概率"}),r.jsx(Te,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:c=>a({...e,emoji_chance:parseFloat(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1越大越容易发送表情包"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_reg_num",children:"最大注册数量"}),r.jsx(Te,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:c=>a({...e,max_reg_num:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),r.jsx(Te,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:c=>a({...e,check_interval:parseInt(c.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"do_replace",checked:e.do_replace,onCheckedChange:c=>a({...e,do_replace:c})}),r.jsx(Q,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:c=>a({...e,steal_emoji:c})}),r.jsx(Q,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:c=>a({...e,content_filtration:c})}),r.jsx(Q,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&r.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[r.jsx(Q,{htmlFor:"filtration_prompt",children:"过滤要求"}),r.jsx(Te,{id:"filtration_prompt",value:e.filtration_prompt,onChange:c=>a({...e,filtration_prompt:c.target.value}),placeholder:"符合公序良俗"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function YD({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:a,onKeywordReactionChange:l,onResponsePostProcessChange:o,onChineseTypoChange:c,onResponseSplitterChange:d}){const m=()=>{l({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},f=R=>{l({...e,regex_rules:e.regex_rules.filter((B,O)=>O!==R)})},p=(R,B,O)=>{const L=[...e.regex_rules];B==="regex"&&typeof O=="string"?L[R]={...L[R],regex:[O]}:B==="reaction"&&typeof O=="string"&&(L[R]={...L[R],reaction:O}),l({...e,regex_rules:L})},x=({regex:R,reaction:B,onRegexChange:O,onReactionChange:L})=>{const[$,U]=w.useState(!1),[I,G]=w.useState(""),[ee,Ne]=w.useState(null),[J,se]=w.useState(""),[H,le]=w.useState({}),[re,ge]=w.useState(""),E=w.useRef(null),[we,Z]=w.useState("build"),z=fe=>fe.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),X=(fe,De=0)=>{const oe=E.current;if(!oe)return;const He=oe.selectionStart||0,at=oe.selectionEnd||0,je=R.substring(0,He)+fe+R.substring(at);O(je),setTimeout(()=>{const Ze=He+fe.length+De;oe.setSelectionRange(Ze,Ze),oe.focus()},0)};w.useEffect(()=>{if(!R||!I){Ne(null),le({}),ge(B),se("");return}try{const fe=z(R),De=new RegExp(fe,"g"),oe=I.match(De);Ne(oe),se("");const at=new RegExp(fe).exec(I);if(at&&at.groups){le(at.groups);let je=B;Object.entries(at.groups).forEach(([Ze,qe])=>{je=je.replace(new RegExp(`\\[${Ze}\\]`,"g"),qe||"")}),ge(je)}else le({}),ge(B)}catch(fe){se(fe.message),Ne(null),le({}),ge(B)}},[R,I,B]);const q=()=>{if(!I||!ee||ee.length===0)return r.jsx("span",{className:"text-muted-foreground",children:I||"请输入测试文本"});try{const fe=z(R),De=new RegExp(fe,"g");let oe=0;const He=[];let at;for(;(at=De.exec(I))!==null;)at.index>oe&&He.push(r.jsx("span",{children:I.substring(oe,at.index)},`text-${oe}`)),He.push(r.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:at[0]},`match-${at.index}`)),oe=at.index+at[0].length;return oe<I.length&&He.push(r.jsx("span",{children:I.substring(oe)},`text-${oe}`)),r.jsx(r.Fragment,{children:He})}catch{return r.jsx("span",{children:I})}},ce=[{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 r.jsxs(ir,{open:$,onOpenChange:U,children:[r.jsx(I1,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",children:[r.jsx(em,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),r.jsxs(Jn,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"正则表达式编辑器"}),r.jsx(xr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),r.jsx(an,{className:"max-h-[calc(90vh-120px)]",children:r.jsxs(kl,{value:we,onValueChange:fe=>Z(fe),className:"w-full",children:[r.jsxs(Bs,{className:"grid w-full grid-cols-2",children:[r.jsx(Pt,{value:"build",children:"🔧 构建器"}),r.jsx(Pt,{value:"test",children:"🧪 测试器"})]}),r.jsxs(cn,{value:"build",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"正则表达式"}),r.jsx(Te,{ref:E,value:R,onChange:fe=>O(fe.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"Reaction 内容"}),r.jsx(fn,{value:B,onChange:fe=>L(fe.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),r.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ce.map(fe=>r.jsxs("div",{className:"space-y-2",children:[r.jsx("h5",{className:"text-xs font-semibold text-primary",children:fe.category}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:fe.items.map(De=>r.jsx(ne,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>X(De.pattern,De.moveCursor||0),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r.jsx("span",{className:"text-xs font-medium",children:De.label}),r.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:De.pattern})]}),r.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:De.desc})]})},De.label))})]},fe.category)),r.jsxs("div",{className:"space-y-2 border-t pt-4",children:[r.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(ne,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>O("^(?P<n>\\S{1,20})是这样的$"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.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}",")是这样的$"]}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),r.jsx(ne,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>O("(?:[^,。.\\s]+\\s*)?我(?:也)?[没沒]要求你\\s*(?P<action>.+?)[.。,]?$"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.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>.+?)[.。,]?$"}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),r.jsx(ne,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>O("(?P<subject>.+?)(?:是|为什么|怎么)"),children:r.jsxs("div",{className:"flex flex-col items-start w-full",children:[r.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P<subject>.+?)(?:是|为什么|怎么)"}),r.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),r.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:[r.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),r.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),r.jsxs("li",{children:["命名捕获组格式:",r.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),r.jsxs("li",{children:["在 reaction 中使用 ",r.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),r.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),r.jsxs(cn,{value:"test",className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"当前正则表达式"}),r.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:R||"(未设置)"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),r.jsx(fn,{id:"test-text",value:I,onChange:fe=>G(fe.target.value),placeholder:`在此输入要测试的文本...
例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),J&&r.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[r.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),r.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:J})]}),!J&&I&&r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center gap-2",children:ee&&ee.length>0?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),r.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",ee.length," 处)"]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),r.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"匹配高亮"}),r.jsx(an,{className:"h-40 rounded-md bg-muted p-3",children:r.jsx("div",{className:"text-sm break-words",children:q()})})]}),Object.keys(H).length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"命名捕获组"}),r.jsx(an,{className:"h-32 rounded-md border p-3",children:r.jsx("div",{className:"space-y-2",children:Object.entries(H).map(([fe,De])=>r.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[r.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",fe,"]"]}),r.jsx("span",{className:"text-muted-foreground",children:"="}),r.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:De})]},fe))})})]}),Object.keys(H).length>0&&B&&r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{className:"text-sm font-medium",children:"Reaction 替换预览"}),r.jsx(an,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:r.jsx("div",{className:"text-sm break-words",children:re})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),r.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:[r.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),r.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[r.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),r.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),r.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),r.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},y=()=>{l({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},b=R=>{l({...e,keyword_rules:e.keyword_rules.filter((B,O)=>O!==R)})},N=(R,B,O)=>{const L=[...e.keyword_rules];typeof O=="string"&&(L[R]={...L[R],reaction:O}),l({...e,keyword_rules:L})},k=R=>{const B=[...e.keyword_rules];B[R]={...B[R],keywords:[...B[R].keywords||[],""]},l({...e,keyword_rules:B})},S=(R,B)=>{const O=[...e.keyword_rules];O[R]={...O[R],keywords:(O[R].keywords||[]).filter((L,$)=>$!==B)},l({...e,keyword_rules:O})},T=(R,B,O)=>{const L=[...e.keyword_rules],$=[...L[R].keywords||[]];$[B]=O,L[R]={...L[R],keywords:$},l({...e,keyword_rules:L})},M=({rule:R})=>{const B=`{ regex = [${(R.regex||[]).map(O=>`"${O}"`).join(", ")}], reaction = "${R.reaction}" }`;return r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",children:[r.jsx(Ha,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-[95vw] sm:w-[500px]",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx(an,{className:"h-60 rounded-md bg-muted p-3",children:r.jsx("pre",{className:"font-mono text-xs break-all",children:B})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},A=({rule:R})=>{const B=`[[keyword_reaction.keyword_rules]]
keywords = [${(R.keywords||[]).map(O=>`"${O}"`).join(", ")}]
reaction = "${R.reaction}"`;return r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",children:[r.jsx(Ha,{className:"h-4 w-4 mr-1"}),"预览"]})}),r.jsx(Ps,{className:"w-[95vw] sm:w-[500px]",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),r.jsx(an,{className:"h-60 rounded-md bg-muted p-3",children:r.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:B})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),r.jsxs(ne,{onClick:m,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),r.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((R,B)=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",B+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(x,{regex:R.regex&&R.regex[0]||"",reaction:R.reaction,onRegexChange:O=>p(B,"regex",O),onReactionChange:O=>p(B,"reaction",O)}),r.jsx(M,{rule:R}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"sm",variant:"ghost",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除正则规则 ",B+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>f(B),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"正则表达式Python 语法)"}),r.jsx(Te,{value:R.regex&&R.regex[0]||"",onChange:O=>p(B,"regex",O.target.value),placeholder:"例如:^(?P<n>\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?P<name>pattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"反应内容"}),r.jsx(fn,{value:R.reaction,onChange:O=>p(B,"reaction",O.target.value),placeholder:`触发后麦麦的反应...
可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},B)),e.regex_rules.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),r.jsxs("div",{className:"space-y-4 border-t pt-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),r.jsxs(ne,{onClick:y,size:"sm",variant:"outline",children:[r.jsx(pr,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),r.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((R,B)=>r.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",B+1]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(A,{rule:R}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"sm",variant:"ghost",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除关键词规则 ",B+1," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>b(B),children:"删除"})]})]})]})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{className:"text-xs font-medium",children:"关键词列表"}),r.jsxs(ne,{onClick:()=>k(B),size:"sm",variant:"ghost",children:[r.jsx(pr,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),r.jsxs("div",{className:"space-y-2",children:[(R.keywords||[]).map((O,L)=>r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{value:O,onChange:$=>T(B,L,$.target.value),placeholder:"关键词",className:"flex-1"}),r.jsx(ne,{onClick:()=>S(B,L),size:"sm",variant:"ghost",children:r.jsx(zt,{className:"h-4 w-4"})})]},L)),(!R.keywords||R.keywords.length===0)&&r.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-xs font-medium",children:"反应内容"}),r.jsx(fn,{value:R.reaction,onChange:O=>N(B,"reaction",O.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},B)),e.keyword_rules.length===0&&r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:R=>o({...t,enable_response_post_process:R})}),r.jsx(Q,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"border-t pt-6 space-y-4",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[r.jsx(vt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:R=>c({...n,enable:R})}),r.jsx(Q,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&r.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),r.jsx(Te,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:R=>c({...n,error_rate:parseFloat(R.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),r.jsx(Te,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:R=>c({...n,min_freq:parseInt(R.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),r.jsx(Te,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:R=>c({...n,tone_error_rate:parseFloat(R.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),r.jsx(Te,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:R=>c({...n,word_replace_rate:parseFloat(R.target.value)})})]})]})]})}),r.jsx("div",{className:"border-t pt-6 space-y-4",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[r.jsx(vt,{id:"enable_response_splitter",checked:a.enable,onCheckedChange:R=>d({...a,enable:R})}),r.jsx(Q,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),r.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),a.enable&&r.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),r.jsx(Te,{id:"max_length",type:"number",min:"1",value:a.max_length,onChange:R=>d({...a,max_length:parseInt(R.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),r.jsx(Te,{id:"max_sentence_num",type:"number",min:"1",value:a.max_sentence_num,onChange:R=>d({...a,max_sentence_num:parseInt(R.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"enable_kaomoji_protection",checked:a.enable_kaomoji_protection,onCheckedChange:R=>d({...a,enable_kaomoji_protection:R})}),r.jsx(Q,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"enable_overflow_return_all",checked:a.enable_overflow_return_all,onCheckedChange:R=>d({...a,enable_overflow_return_all:R})}),r.jsx(Q,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),r.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function WD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"情绪更新阈值"}),r.jsx(Te,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"情感特征"}),r.jsx(fn,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function XD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用语音识别"})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function KD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),r.jsx(Q,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"LPMM 模式"}),r.jsxs(_t,{value:e.lpmm_mode,onValueChange:n=>t({...e,lpmm_mode:n}),children:[r.jsx(jt,{children:r.jsx(Et,{placeholder:"选择 LPMM 模式"})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"classic",children:"经典模式"}),r.jsx(Oe,{value:"agent",children:"Agent 模式"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"同义词搜索 TopK"}),r.jsx(Te,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"同义词阈值"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"实体提取线程数"}),r.jsx(Te,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"嵌入向量维度"}),r.jsx(Te,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function QD({config:e,onChange:t}){const[n,a]=w.useState(""),[l,o]=w.useState("WARNING"),c=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),a(""))},d=b=>{t({...e,suppress_libraries:e.suppress_libraries.filter(N=>N!==b)})},m=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:l}}),a(""),o("WARNING"))},f=b=>{const N={...e.library_log_levels};delete N[b],t({...e,library_log_levels:N})},p=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],x=["FULL","compact","lite"],y=["none","title","full"];return r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日期格式"}),r.jsx(Te,{value:e.date_style,onChange:b=>t({...e,date_style:b.target.value}),placeholder:"例如: m-d H:i:s"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志级别样式"}),r.jsxs(_t,{value:e.log_level_style,onValueChange:b=>t({...e,log_level_style:b}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:x.map(b=>r.jsx(Oe,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"日志文本颜色"}),r.jsxs(_t,{value:e.color_text,onValueChange:b=>t({...e,color_text:b}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:y.map(b=>r.jsx(Oe,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"全局日志级别"}),r.jsxs(_t,{value:e.log_level,onValueChange:b=>t({...e,log_level:b}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(Oe,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"控制台日志级别"}),r.jsxs(_t,{value:e.console_log_level,onValueChange:b=>t({...e,console_log_level:b}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(Oe,{value:b,children:b},b))})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"文件日志级别"}),r.jsxs(_t,{value:e.file_log_level,onValueChange:b=>t({...e,file_log_level:b}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(Oe,{value:b,children:b},b))})]})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"完全屏蔽的库"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:b=>a(b.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),c())}}),r.jsx(ne,{onClick:c,size:"sm",className:"flex-shrink-0",children:r.jsx(pr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(b=>r.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[r.jsx("span",{className:"text-sm",children:b}),r.jsx(ne,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>d(b),children:r.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},b))})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"特定库的日志级别"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:b=>a(b.target.value),placeholder:"输入库名",className:"flex-1"}),r.jsxs(_t,{value:l,onValueChange:o,children:[r.jsx(jt,{className:"w-32",children:r.jsx(Et,{})}),r.jsx(Nt,{children:p.map(b=>r.jsx(Oe,{value:b,children:b},b))})]}),r.jsx(ne,{onClick:m,size:"sm",children:r.jsx(pr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([b,N])=>r.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[r.jsx("span",{className:"text-sm font-medium",children:b}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:N}),r.jsx(ne,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>f(b),children:r.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},b))})]})]})}function ZD({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示 Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),r.jsx(vt,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示回复器 Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),r.jsx(vt,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示回复器推理"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),r.jsx(vt,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"显示 Jargon Prompt"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),r.jsx(vt,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function JD({config:e,onChange:t}){const[n,a]=w.useState(""),l=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),a(""))},o=c=>{t({...e,auth_token:e.auth_token.filter((d,m)=>m!==c)})};return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"启用自定义服务器"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),r.jsx(vt,{checked:e.use_custom,onCheckedChange:c=>t({...e,use_custom:c})})]}),e.use_custom&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"主机地址"}),r.jsx(Te,{value:e.host,onChange:c=>t({...e,host:c.target.value}),placeholder:"127.0.0.1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"端口号"}),r.jsx(Te,{type:"number",value:e.port,onChange:c=>t({...e,port:parseInt(c.target.value)}),placeholder:"8090"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"连接模式"}),r.jsxs(_t,{value:e.mode,onValueChange:c=>t({...e,mode:c}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"ws",children:"WebSocket (ws)"}),r.jsx(Oe,{value:"tcp",children:"TCP"})]})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{checked:e.use_wss,onCheckedChange:c=>t({...e,use_wss:c}),disabled:e.mode!=="ws"}),r.jsx(Q,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"SSL 证书文件路径"}),r.jsx(Te,{value:e.cert_file,onChange:c=>t({...e,cert_file:c.target.value}),placeholder:"cert.pem"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"SSL 密钥文件路径"}),r.jsx(Te,{value:e.key_file,onChange:c=>t({...e,key_file:c.target.value}),placeholder:"key.pem"})]})]})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"mb-2 block",children:"认证令牌"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),r.jsxs("div",{className:"flex gap-2 mb-2",children:[r.jsx(Te,{value:n,onChange:c=>a(c.target.value),placeholder:"输入认证令牌",onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())}}),r.jsx(ne,{onClick:l,size:"sm",children:r.jsx(pr,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),r.jsx("div",{className:"space-y-2",children:e.auth_token.map((c,d)=>r.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[r.jsx("span",{className:"text-sm font-mono",children:c}),r.jsx(ne,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(d),children:r.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},d))})]})]})}function ez({config:e,onChange:t}){return r.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-0.5",children:[r.jsx(Q,{children:"启用统计信息发送"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),r.jsx(vt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const ji=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{className:"relative w-full overflow-auto",children:r.jsx("table",{ref:n,className:he("w-full caption-bottom text-sm",e),...t})}));ji.displayName="Table";const Ni=w.forwardRef(({className:e,...t},n)=>r.jsx("thead",{ref:n,className:he("[&_tr]:border-b",e),...t}));Ni.displayName="TableHeader";const Si=w.forwardRef(({className:e,...t},n)=>r.jsx("tbody",{ref:n,className:he("[&_tr:last-child]:border-0",e),...t}));Si.displayName="TableBody";const tz=w.forwardRef(({className:e,...t},n)=>r.jsx("tfoot",{ref:n,className:he("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));tz.displayName="TableFooter";const Vn=w.forwardRef(({className:e,...t},n)=>r.jsx("tr",{ref:n,className:he("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Vn.displayName="TableRow";const ut=w.forwardRef(({className:e,...t},n)=>r.jsx("th",{ref:n,className:he("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ut.displayName="TableHead";const et=w.forwardRef(({className:e,...t},n)=>r.jsx("td",{ref:n,className:he("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));et.displayName="TableCell";const nz=w.forwardRef(({className:e,...t},n)=>r.jsx("caption",{ref:n,className:he("mt-4 text-sm text-muted-foreground",e),...t}));nz.displayName="TableCaption";const jr=w.forwardRef(({className:e,...t},n)=>r.jsx(n6,{ref:n,className:he("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:r.jsx(oT,{className:he("grid place-content-center text-current"),children:r.jsx(mi,{className:"h-4 w-4"})})}));jr.displayName=n6.displayName;function rz(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(!1),[c,d]=w.useState(!1),[m,f]=w.useState(!1),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[N,k]=w.useState(!1),[S,T]=w.useState(null),[M,A]=w.useState(null),[R,B]=w.useState(!1),[O,L]=w.useState(null),[$,U]=w.useState(!1),[I,G]=w.useState(""),[ee,Ne]=w.useState(new Set),[J,se]=w.useState(!1),[H,le]=w.useState(1),[re,ge]=w.useState(20),[E,we]=w.useState(""),{toast:Z}=or(),z=w.useRef(null),X=w.useRef(!0);w.useEffect(()=>{q()},[]);const q=async()=>{try{a(!0);const K=await zo();t(K.api_providers||[]),f(!1),X.current=!1}catch(K){console.error("加载配置失败:",K)}finally{a(!1)}},ce=async()=>{try{x(!0),U1().catch(()=>{}),b(!0)}catch(K){console.error("重启失败:",K),b(!1),Z({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),x(!1)}},fe=async()=>{try{o(!0),z.current&&clearTimeout(z.current);const K=await zo();K.api_providers=e,await om(K),f(!1),Z({title:"保存成功",description:"正在重启麦麦..."}),await ce()}catch(K){console.error("保存配置失败:",K),Z({title:"保存失败",description:K.message,variant:"destructive"}),o(!1)}},De=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},oe=()=>{b(!1),x(!1),Z({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},He=w.useCallback(async K=>{if(!X.current)try{d(!0),await Rx("api_providers",K),f(!1)}catch(be){console.error("自动保存失败:",be),f(!0)}finally{d(!1)}},[]);w.useEffect(()=>{if(!X.current)return f(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{He(e)},2e3),()=>{z.current&&clearTimeout(z.current)}},[e,He]);const at=async()=>{try{o(!0),z.current&&clearTimeout(z.current);const K=await zo();K.api_providers=e,await om(K),f(!1),Z({title:"保存成功",description:"模型提供商配置已保存"})}catch(K){console.error("保存配置失败:",K),Z({title:"保存失败",description:K.message,variant:"destructive"})}finally{o(!1)}},je=(K,be)=>{T(K||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),A(be),U(!1),k(!0)},Ze=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),Z({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{Z({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},qe=()=>{if(!S)return;const K={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(M!==null){const be=[...e];be[M]=K,t(be)}else t([...e,K]);k(!1),T(null),A(null)},Ot=K=>{if(!K&&S){const be={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};T(be)}k(K)},bn=K=>{L(K),B(!0)},Dn=()=>{if(O!==null){const K=e.filter((be,Re)=>Re!==O);t(K),Z({title:"删除成功",description:"提供商已从列表中移除"})}B(!1),L(null)},Xe=K=>{const be=new Set(ee);be.has(K)?be.delete(K):be.add(K),Ne(be)},wn=()=>{if(ee.size===Cn.length)Ne(new Set);else{const K=Cn.map((be,Re)=>e.findIndex(nt=>nt===Cn[Re]));Ne(new Set(K))}},Wn=()=>{if(ee.size===0){Z({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}se(!0)},Ar=()=>{const K=e.filter((be,Re)=>!ee.has(Re));t(K),Ne(new Set),se(!1),Z({title:"批量删除成功",description:`已删除 ${ee.size} 个提供商`})},Cn=e.filter(K=>{if(!I)return!0;const be=I.toLowerCase();return K.name.toLowerCase().includes(be)||K.base_url.toLowerCase().includes(be)||K.client_type.toLowerCase().includes(be)}),cr=Math.ceil(Cn.length/re),$e=Cn.slice((H-1)*re,H*re),Fn=()=>{const K=parseInt(E);K>=1&&K<=cr&&(le(K),we(""))};return n?r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[ee.size>0&&r.jsxs(ne,{onClick:Wn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(zt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",ee.size,")"]}),r.jsxs(ne,{onClick:()=>je(null,null),size:"sm",className:"w-full sm:w-auto",children:[r.jsx(pr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),r.jsxs(ne,{onClick:at,disabled:l||c||!m||p,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(Cm,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),l?"保存中...":c?"自动保存中...":m?"保存配置":"已保存"]}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsxs(ne,{disabled:l||c||p,size:"sm",className:"w-full sm:w-auto",children:[r.jsx(S1,{className:"mr-2 h-4 w-4"}),p?"重启中...":m?"保存并重启":"重启麦麦"]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认重启麦麦?"}),r.jsx(Qt,{children:m?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:m?fe:ce,children:m?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(qu,{children:[r.jsx(pi,{className:"h-4 w-4"}),r.jsxs(Hu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(an,{className:"h-[calc(100vh-260px)]",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[r.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[r.jsx(Yr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索提供商名称、URL 或类型...",value:I,onChange:K=>G(K.target.value),className:"pl-9"})]}),I&&r.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Cn.length," 个结果"]})]}),r.jsx("div",{className:"md:hidden space-y-3",children:Cn.length===0?r.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):$e.map((K,be)=>{const Re=e.findIndex(nt=>nt===K);return r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"font-semibold text-base truncate",children:K.name}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:K.base_url})]}),r.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>je(K,Re),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(ne,{size:"sm",onClick:()=>bn(Re),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),r.jsx("p",{className:"font-medium",children:K.client_type})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),r.jsx("p",{className:"font-medium",children:K.max_retry})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),r.jsx("p",{className:"font-medium",children:K.timeout})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),r.jsx("p",{className:"font-medium",children:K.retry_interval})]})]})]},be)})}),r.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:r.jsxs(ji,{children:[r.jsx(Ni,{children:r.jsxs(Vn,{children:[r.jsx(ut,{className:"w-12",children:r.jsx(jr,{checked:ee.size===Cn.length&&Cn.length>0,onCheckedChange:wn})}),r.jsx(ut,{children:"名称"}),r.jsx(ut,{children:"基础URL"}),r.jsx(ut,{children:"客户端类型"}),r.jsx(ut,{className:"text-right",children:"最大重试"}),r.jsx(ut,{className:"text-right",children:"超时(秒)"}),r.jsx(ut,{className:"text-right",children:"重试间隔(秒)"}),r.jsx(ut,{className:"text-right",children:"操作"})]})}),r.jsx(Si,{children:$e.length===0?r.jsx(Vn,{children:r.jsx(et,{colSpan:8,className:"text-center text-muted-foreground py-8",children:I?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):$e.map((K,be)=>{const Re=e.findIndex(nt=>nt===K);return r.jsxs(Vn,{children:[r.jsx(et,{children:r.jsx(jr,{checked:ee.has(Re),onCheckedChange:()=>Xe(Re)})}),r.jsx(et,{className:"font-medium",children:K.name}),r.jsx(et,{className:"max-w-xs truncate",title:K.base_url,children:K.base_url}),r.jsx(et,{children:K.client_type}),r.jsx(et,{className:"text-right",children:K.max_retry}),r.jsx(et,{className:"text-right",children:K.timeout}),r.jsx(et,{className:"text-right",children:K.retry_interval}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>je(K,Re),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(ne,{size:"sm",onClick:()=>bn(Re),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},be)})})]})}),Cn.length>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:re.toString(),onValueChange:K=>{ge(parseInt(K)),le(1),Ne(new Set)},children:[r.jsx(jt,{id:"page-size-provider",className:"w-20",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"10",children:"10"}),r.jsx(Oe,{value:"20",children:"20"}),r.jsx(Oe,{value:"50",children:"50"}),r.jsx(Oe,{value:"100",children:"100"})]})]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(H-1)*re+1," 到"," ",Math.min(H*re,Cn.length)," 条,共 ",Cn.length," 条"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>le(1),disabled:H===1,className:"hidden sm:flex",children:r.jsx(Du,{className:"h-4 w-4"})}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>le(K=>Math.max(1,K-1)),disabled:H===1,children:[r.jsx(bi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:E,onChange:K=>we(K.target.value),onKeyDown:K=>K.key==="Enter"&&Fn(),placeholder:H.toString(),className:"w-16 h-8 text-center",min:1,max:cr}),r.jsx(ne,{variant:"outline",size:"sm",onClick:Fn,disabled:!E,className:"h-8",children:"跳转"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>le(K=>K+1),disabled:H>=cr,children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(wi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>le(cr),disabled:H>=cr,className:"hidden sm:flex",children:r.jsx(zu,{className:"h-4 w-4"})})]})]})]}),r.jsx(ir,{open:N,onOpenChange:Ot,children:r.jsxs(Jn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:M!==null?"编辑提供商":"添加提供商"}),r.jsx(xr,{children:"配置 API 提供商的连接信息和参数"})]}),r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"name",children:"名称 *"}),r.jsx(Te,{id:"name",value:S?.name||"",onChange:K=>T(be=>be?{...be,name:K.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"base_url",children:"基础 URL *"}),r.jsx(Te,{id:"base_url",value:S?.base_url||"",onChange:K=>T(be=>be?{...be,base_url:K.target.value}:null),placeholder:"https://api.example.com/v1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"api_key",children:"API Key *"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{id:"api_key",type:$?"text":"password",value:S?.api_key||"",onChange:K=>T(be=>be?{...be,api_key:K.target.value}:null),placeholder:"sk-...",className:"flex-1"}),r.jsx(ne,{type:"button",variant:"outline",size:"icon",onClick:()=>U(!$),title:$?"隐藏密钥":"显示密钥",children:$?r.jsx(yx,{className:"h-4 w-4"}):r.jsx(Ha,{className:"h-4 w-4"})}),r.jsx(ne,{type:"button",variant:"outline",size:"icon",onClick:Ze,title:"复制密钥",children:r.jsx(vx,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"client_type",children:"客户端类型"}),r.jsxs(_t,{value:S?.client_type||"openai",onValueChange:K=>T(be=>be?{...be,client_type:K}:null),children:[r.jsx(jt,{id:"client_type",children:r.jsx(Et,{placeholder:"选择客户端类型"})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"openai",children:"OpenAI"}),r.jsx(Oe,{value:"gemini",children:"Gemini"})]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"max_retry",children:"最大重试"}),r.jsx(Te,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:K=>{const be=K.target.value===""?null:parseInt(K.target.value);T(Re=>Re?{...Re,max_retry:be}:null)},placeholder:"默认: 2"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"timeout",children:"超时(秒)"}),r.jsx(Te,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:K=>{const be=K.target.value===""?null:parseInt(K.target.value);T(Re=>Re?{...Re,timeout:be}:null)},placeholder:"默认: 30"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),r.jsx(Te,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:K=>{const be=K.target.value===""?null:parseInt(K.target.value);T(Re=>Re?{...Re,retry_interval:be}:null)},placeholder:"默认: 10"})]})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>k(!1),children:"取消"}),r.jsx(ne,{onClick:qe,children:"保存"})]})]})}),r.jsx(en,{open:R,onOpenChange:B,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除提供商 "',O!==null?e[O]?.name:"",'" 吗? 此操作无法撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:Dn,children:"删除"})]})]})}),r.jsx(en,{open:J,onOpenChange:se,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认批量删除"}),r.jsxs(Qt,{children:["确定要删除选中的 ",ee.size," 个提供商吗? 此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:Ar,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),y&&r.jsx($1,{onRestartComplete:De,onRestartFailed:oe})]})}var zb=1,az=.9,sz=.8,lz=.17,Dp=.1,zp=.999,iz=.9999,oz=.99,cz=/[\\\/_+.#"@\[\(\{&]/,uz=/[\\\/_+.#"@\[\(\{&]/g,dz=/[\s-]/,Vj=/[\s-]/g;function Lx(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?zb:oz;var d=`${l},${o}`;if(c[d]!==void 0)return c[d];for(var m=a.charAt(o),f=n.indexOf(m,l),p=0,x,y,b,N;f>=0;)x=Lx(e,t,n,a,f+1,o+1,c),x>p&&(f===l?x*=zb:cz.test(e.charAt(f-1))?(x*=sz,b=e.slice(l,f-1).match(uz),b&&l>0&&(x*=Math.pow(zp,b.length))):dz.test(e.charAt(f-1))?(x*=az,N=e.slice(l,f-1).match(Vj),N&&l>0&&(x*=Math.pow(zp,N.length))):(x*=lz,l>0&&(x*=Math.pow(zp,f-l))),e.charAt(f)!==t.charAt(o)&&(x*=iz)),(x<Dp&&n.charAt(f-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(f-1)!==a.charAt(o))&&(y=Lx(e,t,n,a,f+1,o+2,c),y*Dp>x&&(x=y*Dp)),x>p&&(p=x),f=n.indexOf(m,f+1);return c[d]=p,p}function Ob(e){return e.toLowerCase().replace(Vj," ")}function mz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Lx(e,t,Ob(e),Ob(t),0,0,{})}var hz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rl=hz.reduce((e,t)=>{const n=f1(`Primitive.${t}`),a=w.forwardRef((l,o)=>{const{asChild:c,...d}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...d,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),Jc='[cmdk-group=""]',Op='[cmdk-group-items=""]',fz='[cmdk-group-heading=""]',Gj='[cmdk-item=""]',Rb=`${Gj}:not([aria-disabled="true"])`,Bx="cmdk-item-select",Co="data-value",pz=(e,t,n)=>mz(e,t,n),Yj=w.createContext(void 0),Uu=()=>w.useContext(Yj),Wj=w.createContext(void 0),V1=()=>w.useContext(Wj),Xj=w.createContext(void 0),Kj=w.forwardRef((e,t)=>{let n=To(()=>{var Z,z;return{search:"",value:(z=(Z=e.value)!=null?Z:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=To(()=>new Set),l=To(()=>new Map),o=To(()=>new Map),c=To(()=>new Set),d=Qj(e),{label:m,children:f,value:p,onValueChange:x,filter:y,shouldFilter:b,loop:N,disablePointerSelection:k=!1,vimBindings:S=!0,...T}=e,M=Ta(),A=Ta(),R=Ta(),B=w.useRef(null),O=Cz();vi(()=>{if(p!==void 0){let Z=p.trim();n.current.value=Z,L.emit()}},[p]),vi(()=>{O(6,Ne)},[]);let L=w.useMemo(()=>({subscribe:Z=>(c.current.add(Z),()=>c.current.delete(Z)),snapshot:()=>n.current,setState:(Z,z,X)=>{var q,ce,fe,De;if(!Object.is(n.current[Z],z)){if(n.current[Z]=z,Z==="search")ee(),I(),O(1,G);else if(Z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(R);oe?oe.focus():(q=document.getElementById(M))==null||q.focus()}if(O(7,()=>{var oe;n.current.selectedItemId=(oe=J())==null?void 0:oe.id,L.emit()}),X||O(5,Ne),((ce=d.current)==null?void 0:ce.value)!==void 0){let oe=z??"";(De=(fe=d.current).onValueChange)==null||De.call(fe,oe);return}}L.emit()}},emit:()=>{c.current.forEach(Z=>Z())}}),[]),$=w.useMemo(()=>({value:(Z,z,X)=>{var q;z!==((q=o.current.get(Z))==null?void 0:q.value)&&(o.current.set(Z,{value:z,keywords:X}),n.current.filtered.items.set(Z,U(z,X)),O(2,()=>{I(),L.emit()}))},item:(Z,z)=>(a.current.add(Z),z&&(l.current.has(z)?l.current.get(z).add(Z):l.current.set(z,new Set([Z]))),O(3,()=>{ee(),I(),n.current.value||G(),L.emit()}),()=>{o.current.delete(Z),a.current.delete(Z),n.current.filtered.items.delete(Z);let X=J();O(4,()=>{ee(),X?.getAttribute("id")===Z&&G(),L.emit()})}),group:Z=>(l.current.has(Z)||l.current.set(Z,new Set),()=>{o.current.delete(Z),l.current.delete(Z)}),filter:()=>d.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:M,inputId:R,labelId:A,listInnerRef:B}),[]);function U(Z,z){var X,q;let ce=(q=(X=d.current)==null?void 0:X.filter)!=null?q:pz;return Z?ce(Z,n.current.search,z):0}function I(){if(!n.current.search||d.current.shouldFilter===!1)return;let Z=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(q=>{let ce=l.current.get(q),fe=0;ce.forEach(De=>{let oe=Z.get(De);fe=Math.max(oe,fe)}),z.push([q,fe])});let X=B.current;se().sort((q,ce)=>{var fe,De;let oe=q.getAttribute("id"),He=ce.getAttribute("id");return((fe=Z.get(He))!=null?fe:0)-((De=Z.get(oe))!=null?De:0)}).forEach(q=>{let ce=q.closest(Op);ce?ce.appendChild(q.parentElement===ce?q:q.closest(`${Op} > *`)):X.appendChild(q.parentElement===X?q:q.closest(`${Op} > *`))}),z.sort((q,ce)=>ce[1]-q[1]).forEach(q=>{var ce;let fe=(ce=B.current)==null?void 0:ce.querySelector(`${Jc}[${Co}="${encodeURIComponent(q[0])}"]`);fe?.parentElement.appendChild(fe)})}function G(){let Z=se().find(X=>X.getAttribute("aria-disabled")!=="true"),z=Z?.getAttribute(Co);L.setState("value",z||void 0)}function ee(){var Z,z,X,q;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let fe of a.current){let De=(z=(Z=o.current.get(fe))==null?void 0:Z.value)!=null?z:"",oe=(q=(X=o.current.get(fe))==null?void 0:X.keywords)!=null?q:[],He=U(De,oe);n.current.filtered.items.set(fe,He),He>0&&ce++}for(let[fe,De]of l.current)for(let oe of De)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(fe);break}n.current.filtered.count=ce}function Ne(){var Z,z,X;let q=J();q&&(((Z=q.parentElement)==null?void 0:Z.firstChild)===q&&((X=(z=q.closest(Jc))==null?void 0:z.querySelector(fz))==null||X.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function J(){var Z;return(Z=B.current)==null?void 0:Z.querySelector(`${Gj}[aria-selected="true"]`)}function se(){var Z;return Array.from(((Z=B.current)==null?void 0:Z.querySelectorAll(Rb))||[])}function H(Z){let z=se()[Z];z&&L.setState("value",z.getAttribute(Co))}function le(Z){var z;let X=J(),q=se(),ce=q.findIndex(De=>De===X),fe=q[ce+Z];(z=d.current)!=null&&z.loop&&(fe=ce+Z<0?q[q.length-1]:ce+Z===q.length?q[0]:q[ce+Z]),fe&&L.setState("value",fe.getAttribute(Co))}function re(Z){let z=J(),X=z?.closest(Jc),q;for(;X&&!q;)X=Z>0?Sz(X,Jc):kz(X,Jc),q=X?.querySelector(Rb);q?L.setState("value",q.getAttribute(Co)):le(Z)}let ge=()=>H(se().length-1),E=Z=>{Z.preventDefault(),Z.metaKey?ge():Z.altKey?re(1):le(1)},we=Z=>{Z.preventDefault(),Z.metaKey?H(0):Z.altKey?re(-1):le(-1)};return w.createElement(Rl.div,{ref:t,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:Z=>{var z;(z=T.onKeyDown)==null||z.call(T,Z);let X=Z.nativeEvent.isComposing||Z.keyCode===229;if(!(Z.defaultPrevented||X))switch(Z.key){case"n":case"j":{S&&Z.ctrlKey&&E(Z);break}case"ArrowDown":{E(Z);break}case"p":case"k":{S&&Z.ctrlKey&&we(Z);break}case"ArrowUp":{we(Z);break}case"Home":{Z.preventDefault(),H(0);break}case"End":{Z.preventDefault(),ge();break}case"Enter":{Z.preventDefault();let q=J();if(q){let ce=new Event(Bx);q.dispatchEvent(ce)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:_z},m),Im(e,Z=>w.createElement(Wj.Provider,{value:L},w.createElement(Yj.Provider,{value:$},Z))))}),xz=w.forwardRef((e,t)=>{var n,a;let l=Ta(),o=w.useRef(null),c=w.useContext(Xj),d=Uu(),m=Qj(e),f=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c?.forceMount;vi(()=>{if(!f)return d.item(l,c?.id)},[f]);let p=Zj(l,o,[e.value,e.children,o],e.keywords),x=V1(),y=_l(O=>O.value&&O.value===p.current),b=_l(O=>f||d.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);w.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(Bx,N),()=>O.removeEventListener(Bx,N)},[b,e.onSelect,e.disabled]);function N(){var O,L;k(),(L=(O=m.current).onSelect)==null||L.call(O,p.current)}function k(){x.setState("value",p.current,!0)}if(!b)return null;let{disabled:S,value:T,onSelect:M,forceMount:A,keywords:R,...B}=e;return w.createElement(Rl.div,{ref:Sl(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!y,"data-disabled":!!S,"data-selected":!!y,onPointerMove:S||d.getDisablePointerSelection()?void 0:k,onClick:S?void 0:N},e.children)}),gz=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Ta(),d=w.useRef(null),m=w.useRef(null),f=Ta(),p=Uu(),x=_l(b=>l||p.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);vi(()=>p.group(c),[]),Zj(c,d,[e.value,e.heading,m]);let y=w.useMemo(()=>({id:c,forceMount:l}),[l]);return w.createElement(Rl.div,{ref:Sl(d,t),...o,"cmdk-group":"",role:"presentation",hidden:x?void 0:!0},n&&w.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Im(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},w.createElement(Xj.Provider,{value:y},b))))}),vz=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=w.useRef(null),o=_l(c=>!c.search);return!n&&!o?null:w.createElement(Rl.div,{ref:Sl(l,t),...a,"cmdk-separator":"",role:"separator"})}),yz=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=V1(),c=_l(f=>f.search),d=_l(f=>f.selectedItemId),m=Uu();return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Rl.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:l?e.value:c,onChange:f=>{l||o.setState("search",f.target.value),n?.(f.target.value)}})}),bz=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=w.useRef(null),c=w.useRef(null),d=_l(f=>f.selectedItemId),m=Uu();return w.useEffect(()=>{if(c.current&&o.current){let f=c.current,p=o.current,x,y=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let b=f.offsetHeight;p.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(x),y.unobserve(f)}}},[]),w.createElement(Rl.div,{ref:Sl(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":a,id:m.listId},Im(e,f=>w.createElement("div",{ref:Sl(c,m.listInnerRef),"cmdk-list-sizer":""},f)))}),wz=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...d}=e;return w.createElement(y1,{open:n,onOpenChange:a},w.createElement(p1,{container:c},w.createElement(wm,{"cmdk-overlay":"",className:l}),w.createElement(jm,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(Kj,{ref:t,...d}))))}),jz=w.forwardRef((e,t)=>_l(n=>n.filtered.count===0)?w.createElement(Rl.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Nz=w.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return w.createElement(Rl.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Im(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),Xr=Object.assign(Kj,{List:bz,Item:xz,Input:yz,Group:gz,Separator:vz,Dialog:wz,Empty:jz,Loading:Nz});function Sz(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function kz(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Qj(e){let t=w.useRef(e);return vi(()=>{t.current=e}),t}var vi=typeof window>"u"?w.useEffect:w.useLayoutEffect;function To(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function _l(e){let t=V1(),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function Zj(e,t,n,a=[]){let l=w.useRef(),o=Uu();return vi(()=>{var c;let d=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():l.current}})(),m=a.map(f=>f.trim());o.value(e,d,m),(c=t.current)==null||c.setAttribute(Co,d),l.current=d}),l}var Cz=()=>{let[e,t]=w.useState(),n=To(()=>new Map);return vi(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function Tz(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Im({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(Tz(t),{ref:t.ref},n(t.props.children)):n(t)}var _z={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Jj=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr,{ref:n,className:he("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Jj.displayName=Xr.displayName;const e7=w.forwardRef(({className:e,...t},n)=>r.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[r.jsx(Yr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),r.jsx(Xr.Input,{ref:n,className:he("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));e7.displayName=Xr.Input.displayName;const t7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.List,{ref:n,className:he("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));t7.displayName=Xr.List.displayName;const n7=w.forwardRef((e,t)=>r.jsx(Xr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));n7.displayName=Xr.Empty.displayName;const r7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Group,{ref:n,className:he("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));r7.displayName=Xr.Group.displayName;const Ez=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Separator,{ref:n,className:he("-mx-1 h-px bg-border",e),...t}));Ez.displayName=Xr.Separator.displayName;const a7=w.forwardRef(({className:e,...t},n)=>r.jsx(Xr.Item,{ref:n,className:he("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));a7.displayName=Xr.Item.displayName;function Mz({options:e,selected:t,onChange:n,placeholder:a="选择选项...",emptyText:l="未找到选项",className:o}){const[c,d]=w.useState(!1),m=p=>{t.includes(p)?n(t.filter(x=>x!==p)):n([...t,p])},f=p=>{n(t.filter(x=>x!==p))};return r.jsxs(Cl,{open:c,onOpenChange:d,children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",role:"combobox","aria-expanded":c,className:he("w-full justify-between min-h-10 h-auto",o),children:[r.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?r.jsx("span",{className:"text-muted-foreground",children:a}):t.map(p=>{const x=e.find(y=>y.value===p);return r.jsxs(un,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:y=>{y.stopPropagation(),f(p)},children:[x?.label||p,r.jsx(Au,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},p)})}),r.jsx(kT,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),r.jsx(Ps,{className:"w-full p-0",align:"start",children:r.jsxs(Jj,{children:[r.jsx(e7,{placeholder:"搜索...",className:"h-9"}),r.jsxs(t7,{children:[r.jsx(n7,{children:l}),r.jsx(r7,{children:e.map(p=>{const x=t.includes(p.value);return r.jsxs(a7,{value:p.value,onSelect:()=>m(p.value),children:[r.jsx("div",{className:he("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",x?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:r.jsx(mi,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),r.jsx("span",{children:p.label})]},p.value)})})]})]})})]})}function Az(){const[e,t]=w.useState([]),[n,a]=w.useState([]),[l,o]=w.useState([]),[c,d]=w.useState(null),[m,f]=w.useState(!0),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[N,k]=w.useState(!1),[S,T]=w.useState(!1),[M,A]=w.useState(!1),[R,B]=w.useState(!1),[O,L]=w.useState(null),[$,U]=w.useState(null),[I,G]=w.useState(!1),[ee,Ne]=w.useState(null),[J,se]=w.useState(""),[H,le]=w.useState(new Set),[re,ge]=w.useState(!1),[E,we]=w.useState(1),[Z,z]=w.useState(20),[X,q]=w.useState(""),{toast:ce}=or(),fe=w.useRef(null),De=w.useRef(null),oe=w.useRef(!0);w.useEffect(()=>{He()},[]);const He=async()=>{try{f(!0);const pe=await zo(),Ee=pe.models||[];t(Ee),o(Ee.map(mt=>mt.name));const dt=pe.api_providers||[];a(dt.map(mt=>mt.name)),d(pe.model_task_config||null),k(!1),oe.current=!1}catch(pe){console.error("加载配置失败:",pe)}finally{f(!1)}},at=async()=>{try{T(!0),U1().catch(()=>{}),A(!0)}catch(pe){console.error("重启失败:",pe),A(!1),ce({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),T(!1)}},je=async()=>{try{x(!0),fe.current&&clearTimeout(fe.current),De.current&&clearTimeout(De.current);const pe=await zo();pe.models=e,pe.model_task_config=c,await om(pe),k(!1),ce({title:"保存成功",description:"正在重启麦麦..."}),await at()}catch(pe){console.error("保存配置失败:",pe),ce({title:"保存失败",description:pe.message,variant:"destructive"}),x(!1)}},Ze=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},qe=()=>{A(!1),T(!1),ce({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ot=w.useCallback(async pe=>{if(!oe.current)try{b(!0),await Rx("models",pe),k(!1)}catch(Ee){console.error("自动保存模型列表失败:",Ee),k(!0)}finally{b(!1)}},[]),bn=w.useCallback(async pe=>{if(!oe.current)try{b(!0),await Rx("model_task_config",pe),k(!1)}catch(Ee){console.error("自动保存任务配置失败:",Ee),k(!0)}finally{b(!1)}},[]);w.useEffect(()=>{if(!oe.current)return k(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>{Ot(e)},2e3),()=>{fe.current&&clearTimeout(fe.current)}},[e,Ot]),w.useEffect(()=>{if(!(oe.current||!c))return k(!0),De.current&&clearTimeout(De.current),De.current=setTimeout(()=>{bn(c)},2e3),()=>{De.current&&clearTimeout(De.current)}},[c,bn]);const Dn=async()=>{try{x(!0),fe.current&&clearTimeout(fe.current),De.current&&clearTimeout(De.current);const pe=await zo();pe.models=e,pe.model_task_config=c,await om(pe),k(!1),ce({title:"保存成功",description:"模型配置已保存"}),await He()}catch(pe){console.error("保存配置失败:",pe),ce({title:"保存失败",description:pe.message,variant:"destructive"})}finally{x(!1)}},Xe=(pe,Ee)=>{L(pe||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),U(Ee),B(!0)},wn=()=>{if(!O)return;const pe={...O,price_in:O.price_in??0,price_out:O.price_out??0};let Ee;$!==null?(Ee=[...e],Ee[$]=pe):Ee=[...e,pe],t(Ee),o(Ee.map(dt=>dt.name)),B(!1),L(null),U(null)},Wn=pe=>{if(!pe&&O){const Ee={...O,price_in:O.price_in??0,price_out:O.price_out??0};L(Ee)}B(pe)},Ar=pe=>{Ne(pe),G(!0)},Cn=()=>{if(ee!==null){const pe=e.filter((Ee,dt)=>dt!==ee);t(pe),o(pe.map(Ee=>Ee.name)),ce({title:"删除成功",description:"模型已从列表中移除"})}G(!1),Ne(null)},cr=pe=>{const Ee=new Set(H);Ee.has(pe)?Ee.delete(pe):Ee.add(pe),le(Ee)},$e=()=>{if(H.size===Re.length)le(new Set);else{const pe=Re.map((Ee,dt)=>e.findIndex(mt=>mt===Re[dt]));le(new Set(pe))}},Fn=()=>{if(H.size===0){ce({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}ge(!0)},K=()=>{const pe=e.filter((Ee,dt)=>!H.has(dt));t(pe),o(pe.map(Ee=>Ee.name)),le(new Set),ge(!1),ce({title:"批量删除成功",description:`已删除 ${H.size} 个模型`})},be=(pe,Ee,dt)=>{c&&d({...c,[pe]:{...c[pe],[Ee]:dt}})},Re=e.filter(pe=>{if(!J)return!0;const Ee=J.toLowerCase();return pe.name.toLowerCase().includes(Ee)||pe.model_identifier.toLowerCase().includes(Ee)||pe.api_provider.toLowerCase().includes(Ee)}),nt=Math.ceil(Re.length/Z),kt=Re.slice((E-1)*Z,E*Z),rr=()=>{const pe=parseInt(X);pe>=1&&pe<=nt&&(we(pe),q(""))},Dr=pe=>c?[c.utils?.model_list||[],c.utils_small?.model_list||[],c.tool_use?.model_list||[],c.replyer?.model_list||[],c.planner?.model_list||[],c.vlm?.model_list||[],c.voice?.model_list||[],c.embedding?.model_list||[],c.lpmm_entity_extract?.model_list||[],c.lpmm_rdf_build?.model_list||[],c.lpmm_qa?.model_list||[]].some(dt=>dt.includes(pe)):!1;return m?r.jsx(an,{className:"h-full",children:r.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:r.jsx("div",{className:"flex items-center justify-center h-64",children:r.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[r.jsxs(ne,{onClick:Dn,disabled:p||y||!N||S,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[r.jsx(Cm,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),p?"保存中...":y?"自动保存中...":N?"保存配置":"已保存"]}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsxs(ne,{disabled:p||y||S,size:"sm",className:"flex-1 sm:flex-none",children:[r.jsx(S1,{className:"mr-2 h-4 w-4"}),S?"重启中...":N?"保存并重启":"重启麦麦"]})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认重启麦麦?"}),r.jsx(Qt,{children:N?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:N?je:at,children:N?"保存并重启":"确认重启"})]})]})]})]})]}),r.jsxs(qu,{children:[r.jsx(pi,{className:"h-4 w-4"}),r.jsxs(Hu,{children:["配置更新后需要",r.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),r.jsxs(kl,{defaultValue:"models",className:"w-full",children:[r.jsxs(Bs,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[r.jsx(Pt,{value:"models",children:"模型配置"}),r.jsx(Pt,{value:"tasks",children:"模型任务配置"})]}),r.jsxs(cn,{value:"models",className:"space-y-4 mt-0",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),r.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[H.size>0&&r.jsxs(ne,{onClick:Fn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(zt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",H.size,")"]}),r.jsxs(ne,{onClick:()=>Xe(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(pr,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[r.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[r.jsx(Yr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索模型名称、标识符或提供商...",value:J,onChange:pe=>se(pe.target.value),className:"pl-9"})]}),J&&r.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Re.length," 个结果"]})]}),r.jsx("div",{className:"md:hidden space-y-3",children:kt.length===0?r.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:J?"未找到匹配的模型":"暂无模型配置"}):kt.map((pe,Ee)=>{const dt=e.findIndex(zr=>zr===pe),mt=Dr(pe.name);return r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("h3",{className:"font-semibold text-base",children:pe.name}),r.jsx(un,{variant:mt?"default":"secondary",className:mt?"bg-green-600 hover:bg-green-700":"",children:mt?"已使用":"未使用"})]}),r.jsx("p",{className:"text-xs text-muted-foreground break-all",title:pe.model_identifier,children:pe.model_identifier})]}),r.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>Xe(pe,dt),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(ne,{size:"sm",onClick:()=>Ar(dt),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),r.jsx("p",{className:"font-medium",children:pe.api_provider})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),r.jsx("p",{className:"font-medium",children:pe.force_stream_mode?"是":"否"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),r.jsxs("p",{className:"font-medium",children:["¥",pe.price_in,"/M"]})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),r.jsxs("p",{className:"font-medium",children:["¥",pe.price_out,"/M"]})]})]})]},Ee)})}),r.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:r.jsxs(ji,{children:[r.jsx(Ni,{children:r.jsxs(Vn,{children:[r.jsx(ut,{className:"w-12",children:r.jsx(jr,{checked:H.size===Re.length&&Re.length>0,onCheckedChange:$e})}),r.jsx(ut,{className:"w-24",children:"使用状态"}),r.jsx(ut,{children:"模型名称"}),r.jsx(ut,{children:"模型标识符"}),r.jsx(ut,{children:"提供商"}),r.jsx(ut,{className:"text-right",children:"输入价格"}),r.jsx(ut,{className:"text-right",children:"输出价格"}),r.jsx(ut,{className:"text-center",children:"强制流式"}),r.jsx(ut,{className:"text-right",children:"操作"})]})}),r.jsx(Si,{children:kt.length===0?r.jsx(Vn,{children:r.jsx(et,{colSpan:9,className:"text-center text-muted-foreground py-8",children:J?"未找到匹配的模型":"暂无模型配置"})}):kt.map((pe,Ee)=>{const dt=e.findIndex(zr=>zr===pe),mt=Dr(pe.name);return r.jsxs(Vn,{children:[r.jsx(et,{children:r.jsx(jr,{checked:H.has(dt),onCheckedChange:()=>cr(dt)})}),r.jsx(et,{children:r.jsx(un,{variant:mt?"default":"secondary",className:mt?"bg-green-600 hover:bg-green-700":"",children:mt?"已使用":"未使用"})}),r.jsx(et,{className:"font-medium",children:pe.name}),r.jsx(et,{className:"max-w-xs truncate",title:pe.model_identifier,children:pe.model_identifier}),r.jsx(et,{children:pe.api_provider}),r.jsxs(et,{className:"text-right",children:["¥",pe.price_in,"/M"]}),r.jsxs(et,{className:"text-right",children:["¥",pe.price_out,"/M"]}),r.jsx(et,{className:"text-center",children:pe.force_stream_mode?"是":"否"}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>Xe(pe,dt),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),r.jsxs(ne,{size:"sm",onClick:()=>Ar(dt),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Ee)})})]})}),Re.length>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:Z.toString(),onValueChange:pe=>{z(parseInt(pe)),we(1),le(new Set)},children:[r.jsx(jt,{id:"page-size-model",className:"w-20",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"10",children:"10"}),r.jsx(Oe,{value:"20",children:"20"}),r.jsx(Oe,{value:"50",children:"50"}),r.jsx(Oe,{value:"100",children:"100"})]})]}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(E-1)*Z+1," 到"," ",Math.min(E*Z,Re.length)," 条,共 ",Re.length," 条"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>we(1),disabled:E===1,className:"hidden sm:flex",children:r.jsx(Du,{className:"h-4 w-4"})}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>we(pe=>Math.max(1,pe-1)),disabled:E===1,children:[r.jsx(bi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:X,onChange:pe=>q(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&rr(),placeholder:E.toString(),className:"w-16 h-8 text-center",min:1,max:nt}),r.jsx(ne,{variant:"outline",size:"sm",onClick:rr,disabled:!X,className:"h-8",children:"跳转"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>we(pe=>pe+1),disabled:E>=nt,children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(wi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>we(nt),disabled:E>=nt,className:"hidden sm:flex",children:r.jsx(zu,{className:"h-4 w-4"})})]})]})]}),r.jsxs(cn,{value:"tasks",className:"space-y-6 mt-0",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&r.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[r.jsx(Ra,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:l,onChange:(pe,Ee)=>be("utils",pe,Ee)}),r.jsx(Ra,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:l,onChange:(pe,Ee)=>be("utils_small",pe,Ee)}),r.jsx(Ra,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:l,onChange:(pe,Ee)=>be("tool_use",pe,Ee)}),r.jsx(Ra,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:l,onChange:(pe,Ee)=>be("replyer",pe,Ee)}),r.jsx(Ra,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:l,onChange:(pe,Ee)=>be("planner",pe,Ee)}),r.jsx(Ra,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:l,onChange:(pe,Ee)=>be("vlm",pe,Ee),hideTemperature:!0}),r.jsx(Ra,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:l,onChange:(pe,Ee)=>be("voice",pe,Ee),hideTemperature:!0,hideMaxTokens:!0}),r.jsx(Ra,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:l,onChange:(pe,Ee)=>be("embedding",pe,Ee),hideTemperature:!0,hideMaxTokens:!0}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),r.jsx(Ra,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:l,onChange:(pe,Ee)=>be("lpmm_entity_extract",pe,Ee)}),r.jsx(Ra,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:l,onChange:(pe,Ee)=>be("lpmm_rdf_build",pe,Ee)}),r.jsx(Ra,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:l,onChange:(pe,Ee)=>be("lpmm_qa",pe,Ee)})]})]})]})]}),r.jsx(ir,{open:R,onOpenChange:Wn,children:r.jsxs(Jn,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:$!==null?"编辑模型":"添加模型"}),r.jsx(xr,{children:"配置模型的基本信息和参数"})]}),r.jsxs("div",{className:"grid gap-4 py-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"model_name",children:"模型名称 *"}),r.jsx(Te,{id:"model_name",value:O?.name||"",onChange:pe=>L(Ee=>Ee?{...Ee,name:pe.target.value}:null),placeholder:"例如: qwen3-30b"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"model_identifier",children:"模型标识符 *"}),r.jsx(Te,{id:"model_identifier",value:O?.model_identifier||"",onChange:pe=>L(Ee=>Ee?{...Ee,model_identifier:pe.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"api_provider",children:"API 提供商 *"}),r.jsxs(_t,{value:O?.api_provider||"",onValueChange:pe=>L(Ee=>Ee?{...Ee,api_provider:pe}:null),children:[r.jsx(jt,{id:"api_provider",children:r.jsx(Et,{placeholder:"选择提供商"})}),r.jsx(Nt,{children:n.map(pe=>r.jsx(Oe,{value:pe,children:pe},pe))})]})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),r.jsx(Te,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in??"",onChange:pe=>{const Ee=pe.target.value===""?null:parseFloat(pe.target.value);L(dt=>dt?{...dt,price_in:Ee}:null)},placeholder:"默认: 0"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),r.jsx(Te,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out??"",onChange:pe=>{const Ee=pe.target.value===""?null:parseFloat(pe.target.value);L(dt=>dt?{...dt,price_out:Ee}:null)},placeholder:"默认: 0"})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:pe=>L(Ee=>Ee?{...Ee,force_stream_mode:pe}:null)}),r.jsx(Q,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>B(!1),children:"取消"}),r.jsx(ne,{onClick:wn,children:"保存"})]})]})}),r.jsx(en,{open:I,onOpenChange:G,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除模型 "',ee!==null?e[ee]?.name:"",'" 吗? 此操作无法撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:Cn,children:"删除"})]})]})}),r.jsx(en,{open:re,onOpenChange:ge,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认批量删除"}),r.jsxs(Qt,{children:["确定要删除选中的 ",H.size," 个模型吗? 此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:K,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),M&&r.jsx($1,{onRestartComplete:Ze,onRestartFailed:qe})]})})}function Ra({title:e,description:t,taskConfig:n,modelNames:a,onChange:l,hideTemperature:o=!1,hideMaxTokens:c=!1}){const d=m=>{l("model_list",m)};return r.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"模型列表"}),r.jsx(Mz,{options:a.map(m=>({label:m,value:m})),selected:n.model_list||[],onChange:d,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Q,{children:"温度"}),r.jsx(Te,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:m=>{const f=parseFloat(m.target.value);!isNaN(f)&&f>=0&&f<=1&&l("temperature",f)},className:"w-20 h-8 text-sm"})]}),r.jsx(Pm,{value:[n.temperature??.3],onValueChange:m=>l("temperature",m[0]),min:0,max:1,step:.1,className:"w-full"})]}),!c&&r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{children:"最大 Token"}),r.jsx(Te,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:m=>l("max_tokens",parseInt(m.target.value))})]})]})]})]})}const qm="/api/webui/config";async function Dz(){const t=await(await lt(`${qm}/adapter-config/path`)).json();return!t.success||!t.path?null:{path:t.path,lastModified:t.lastModified}}async function zz(e){const n=await(await lt(`${qm}/adapter-config/path`,{method:"POST",headers:pt(),body:JSON.stringify({path:e})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function Oz(e){const n=await(await lt(`${qm}/adapter-config?path=${encodeURIComponent(e)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function Lb(e,t){const a=await(await lt(`${qm}/adapter-config`,{method:"POST",headers:pt(),body:JSON.stringify({path:e,content:t})})).json();if(!a.success)throw new Error(a.message||"保存配置失败")}const la={inner:{version:"0.1.2"},nickname:{nickname:""},napcat_server:{host:"localhost",port:8095,token:"",heartbeat_interval:30},maibot_server:{host:"localhost",port:8e3},chat:{group_list_type:"whitelist",group_list:[],private_list_type:"whitelist",private_list:[],ban_user_id:[],ban_qq_bot:!1,enable_poke:!0},voice:{use_tts:!1},debug:{level:"INFO"}};function Rz(){const[e,t]=w.useState("upload"),[n,a]=w.useState(null),[l,o]=w.useState(""),[c,d]=w.useState(""),[m,f]=w.useState(""),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[N,k]=w.useState(!1),[S,T]=w.useState(!1),[M,A]=w.useState(null),R=w.useRef(null),{toast:B}=or(),O=w.useRef(null),L=X=>{if(!X.trim())return{valid:!1,error:"路径不能为空"};const q=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,ce=/^(\/|~\/).+\.toml$/i,fe=q.test(X),De=ce.test(X);return!fe&&!De?{valid:!1,error:"路径格式错误。Windows: C:\\path\\file.tomlLinux: /path/file.toml"}:X.toLowerCase().endsWith(".toml")?/[<>"|?*\x00-\x1F]/.test(X)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}:{valid:!1,error:"文件必须是 .toml 格式"}},$=X=>{if(d(X),X.trim()){const q=L(X);f(q.error)}else f("")};w.useEffect(()=>{(async()=>{try{const q=await Dz();q&&q.path&&(d(q.path),t("path"),await U(q.path))}catch(q){console.error("加载保存的路径失败:",q)}})()},[]);const U=async X=>{const q=L(X);if(!q.valid){f(q.error),B({title:"路径无效",description:q.error,variant:"destructive"});return}f(""),b(!0);try{const ce=await Oz(X),fe=ge(ce);a(fe),d(X),await zz(X),B({title:"加载成功",description:"已从配置文件加载"})}catch(ce){console.error("加载配置失败:",ce),B({title:"加载失败",description:ce instanceof Error?ce.message:"无法读取配置文件",variant:"destructive"})}finally{b(!1)}},I=w.useCallback(X=>{e!=="path"||!c||(O.current&&clearTimeout(O.current),O.current=setTimeout(async()=>{x(!0);try{const q=E(X);await Lb(c,q),B({title:"自动保存成功",description:"配置已保存到文件"})}catch(q){console.error("自动保存失败:",q),B({title:"自动保存失败",description:q instanceof Error?q.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},1e3))},[e,c,B]),G=async()=>{if(!n||!c)return;const X=L(c);if(!X.valid){B({title:"保存失败",description:X.error,variant:"destructive"});return}x(!0);try{const q=E(n);await Lb(c,q),B({title:"保存成功",description:"配置已保存到文件"})}catch(q){console.error("保存失败:",q),B({title:"保存失败",description:q instanceof Error?q.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},ee=async()=>{c&&await U(c)},Ne=X=>{if(X!==e){if(n){A(X),k(!0);return}J(X)}},J=X=>{a(null),o(""),f(""),t(X),B({title:"已切换模式",description:X==="upload"?"现在可以上传配置文件":"现在可以指定配置文件路径"})},se=()=>{M&&(J(M),A(null)),k(!1)},H=()=>{if(n){T(!0);return}le()},le=()=>{d(""),a(null),f(""),B({title:"已清空",description:"路径和配置已清空"})},re=()=>{le(),T(!1)},ge=X=>{const q=JSON.parse(JSON.stringify(la)),ce=X.split(`
`);let fe="";for(const De of ce){const oe=De.trim();if(!oe||oe.startsWith("#"))continue;const He=oe.match(/^\[(\w+)\]$/);if(He){fe=He[1];continue}const at=oe.match(/^(\w+)\s*=\s*(.+)$/);if(at&&fe){const[,je,Ze]=at,qe=Ze.trim();let Ot;if(qe==="true")Ot=!0;else if(qe==="false")Ot=!1;else if(qe.startsWith("[")&&qe.endsWith("]")){const bn=qe.slice(1,-1).trim();if(bn){const Dn=bn.split(",").map(wn=>{const Wn=wn.trim();return isNaN(Number(Wn))?Wn.replace(/"/g,""):Number(Wn)}),Xe=typeof Dn[0];Ot=Dn.every(wn=>typeof wn===Xe)?Dn:Dn.filter(wn=>typeof wn=="number")}else Ot=[]}else qe.startsWith('"')&&qe.endsWith('"')?Ot=qe.slice(1,-1):isNaN(Number(qe))?Ot=qe.replace(/"/g,""):Ot=Number(qe);if(fe in q){const bn=q[fe];bn[je]=Ot}}}return q},E=X=>{const q=[],ce=(fe,De)=>fe===""||fe===null||fe===void 0?De:fe;return q.push("[inner]"),q.push(`version = "${ce(X.inner.version,la.inner.version)}" # 版本号`),q.push("# 请勿修改版本号,除非你知道自己在做什么"),q.push(""),q.push("[nickname] # 现在没用"),q.push(`nickname = "${ce(X.nickname.nickname,la.nickname.nickname)}"`),q.push(""),q.push("[napcat_server] # Napcat连接的ws服务设置"),q.push(`host = "${ce(X.napcat_server.host,la.napcat_server.host)}" # Napcat设定的主机地址`),q.push(`port = ${ce(X.napcat_server.port||0,la.napcat_server.port)} # Napcat设定的端口`),q.push(`token = "${ce(X.napcat_server.token,la.napcat_server.token)}" # Napcat设定的访问令牌若无则留空`),q.push(`heartbeat_interval = ${ce(X.napcat_server.heartbeat_interval||0,la.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同按秒计`),q.push(""),q.push("[maibot_server] # 连接麦麦的ws服务设置"),q.push(`host = "${ce(X.maibot_server.host,la.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址即HOST字段`),q.push(`port = ${ce(X.maibot_server.port||0,la.maibot_server.port)} # 麦麦在.env文件中设置的端口即PORT字段`),q.push(""),q.push("[chat] # 黑白名单功能"),q.push(`group_list_type = "${ce(X.chat.group_list_type,la.chat.group_list_type)}" # 群组名单类型可选为whitelist, blacklist`),q.push(`group_list = [${X.chat.group_list.join(", ")}] # 群组名单`),q.push("# 当group_list_type为whitelist时只有群组名单中的群组可以聊天"),q.push("# 当group_list_type为blacklist时群组名单中的任何群组无法聊天"),q.push(`private_list_type = "${ce(X.chat.private_list_type,la.chat.private_list_type)}" # 私聊名单类型可选为whitelist, blacklist`),q.push(`private_list = [${X.chat.private_list.join(", ")}] # 私聊名单`),q.push("# 当private_list_type为whitelist时只有私聊名单中的用户可以聊天"),q.push("# 当private_list_type为blacklist时私聊名单中的任何用户无法聊天"),q.push(`ban_user_id = [${X.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),q.push(`ban_qq_bot = ${X.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),q.push(`enable_poke = ${X.chat.enable_poke} # 是否启用戳一戳功能`),q.push(""),q.push("[voice] # 发送语音设置"),q.push(`use_tts = ${X.voice.use_tts} # 是否使用tts语音请确保你配置了tts并有对应的adapter`),q.push(""),q.push("[debug]"),q.push(`level = "${ce(X.debug.level,la.debug.level)}" # 日志等级DEBUG, INFO, WARNING, ERROR, CRITICAL`),q.join(`
`)},we=X=>{const q=X.target.files?.[0];if(!q)return;const ce=new FileReader;ce.onload=fe=>{try{const De=fe.target?.result,oe=ge(De);a(oe),o(q.name),B({title:"上传成功",description:`已加载配置文件:${q.name}`})}catch(De){console.error("解析配置文件失败:",De),B({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},ce.readAsText(q)},Z=()=>{if(!n)return;const X=E(n),q=new Blob([X],{type:"text/plain;charset=utf-8"}),ce=URL.createObjectURL(q),fe=document.createElement("a");fe.href=ce,fe.download=l||"config.toml",document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(ce),B({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},z=()=>{a(JSON.parse(JSON.stringify(la))),o("config.toml"),B({title:"已加载默认配置",description:"可以开始编辑配置"})};return r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"工作模式"}),r.jsx(Qn,{children:"选择配置文件的管理方式"})]}),r.jsxs(Gt,{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 md:gap-4",children:[r.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${e==="upload"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Ne("upload"),children:r.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[r.jsx(Vy,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),r.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),r.jsx("div",{className:`border-2 rounded-lg p-3 md:p-4 cursor-pointer transition-all ${e==="path"?"border-primary bg-primary/5":"border-muted hover:border-primary/50 active:border-primary/70"}`,onClick:()=>Ne("path"),children:r.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[r.jsx(CT,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),r.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),e==="path"&&r.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsxs("div",{className:"flex-1 space-y-1",children:[r.jsx(Te,{id:"config-path",value:c,onChange:X=>$(X.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${m?"border-destructive":""}`}),m&&r.jsx("p",{className:"text-xs text-destructive",children:m})]}),r.jsx(ne,{onClick:()=>U(c),disabled:y||!c||!!m,className:"w-full sm:w-auto",children:y?r.jsxs(r.Fragment,{children:[r.jsx(Ia,{className:"h-4 w-4 animate-spin mr-2"}),r.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"sm:hidden",children:"加载配置"}),r.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),r.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[r.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[r.jsx("span",{children:"路径格式说明"}),r.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),r.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[r.jsx("div",{children:"C:\\Adapter\\config.toml"}),r.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),r.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),r.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[r.jsx("div",{children:"/opt/adapter/config.toml"}),r.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),r.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),r.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),r.jsxs(qu,{children:[r.jsx(pi,{className:"h-4 w-4"}),r.jsx(Hu,{children:e==="upload"?r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",p&&" (正在保存...)"]})})]}),e==="upload"&&!n&&r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[r.jsx("input",{ref:R,type:"file",accept:".toml",className:"hidden",onChange:we}),r.jsxs(ne,{onClick:()=>R.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(Vy,{className:"mr-2 h-4 w-4"}),"上传配置"]}),r.jsxs(ne,{onClick:z,size:"sm",className:"w-full sm:w-auto",children:[r.jsx(Nl,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),e==="upload"&&n&&r.jsx("div",{className:"flex gap-2",children:r.jsxs(ne,{onClick:Z,size:"sm",className:"w-full sm:w-auto",children:[r.jsx(hi,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),e==="path"&&n&&r.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[r.jsxs(ne,{onClick:G,size:"sm",disabled:p||!!m,className:"w-full sm:w-auto",children:[r.jsx(Cm,{className:"mr-2 h-4 w-4"}),p?"保存中...":"立即保存"]}),r.jsxs(ne,{onClick:ee,size:"sm",variant:"outline",disabled:y,className:"w-full sm:w-auto",children:[r.jsx(Ia,{className:`mr-2 h-4 w-4 ${y?"animate-spin":""}`}),"刷新"]}),r.jsxs(ne,{onClick:H,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[r.jsx(zt,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?r.jsxs(kl,{defaultValue:"napcat",className:"w-full",children:[r.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:r.jsxs(Bs,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[r.jsxs(Pt,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[r.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),r.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),r.jsxs(Pt,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[r.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),r.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),r.jsxs(Pt,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[r.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),r.jsx("span",{className:"sm:hidden",children:"聊天"})]}),r.jsxs(Pt,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[r.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),r.jsx("span",{className:"sm:hidden",children:"语音"})]}),r.jsx(Pt,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),r.jsx(cn,{value:"napcat",className:"space-y-4",children:r.jsx(Lz,{config:n,onChange:X=>{a(X),I(X)}})}),r.jsx(cn,{value:"maibot",className:"space-y-4",children:r.jsx(Bz,{config:n,onChange:X=>{a(X),I(X)}})}),r.jsx(cn,{value:"chat",className:"space-y-4",children:r.jsx(Pz,{config:n,onChange:X=>{a(X),I(X)}})}),r.jsx(cn,{value:"voice",className:"space-y-4",children:r.jsx(Fz,{config:n,onChange:X=>{a(X),I(X)}})}),r.jsx(cn,{value:"debug",className:"space-y-4",children:r.jsx(Iz,{config:n,onChange:X=>{a(X),I(X)}})})]}):r.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:r.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[r.jsx(Nl,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),r.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:e==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),r.jsx(en,{open:N,onOpenChange:k,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认切换模式"}),r.jsxs(Qt,{children:["切换模式将清空当前配置,确定要继续吗?",r.jsx("br",{}),r.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{onClick:()=>{k(!1),A(null)},children:"取消"}),r.jsx(Zt,{onClick:se,children:"确认切换"})]})]})}),r.jsx(en,{open:S,onOpenChange:T,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认清空路径"}),r.jsxs(Qt,{children:["清空路径将清除当前配置,确定要继续吗?",r.jsx("br",{}),r.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{onClick:()=>T(!1),children:"取消"}),r.jsx(Zt,{onClick:re,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function Lz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),r.jsxs("div",{className:"grid gap-3 md:gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),r.jsx(Te,{id:"napcat-host",value:e.napcat_server.host,onChange:n=>t({...e,napcat_server:{...e.napcat_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),r.jsx(Te,{id:"napcat-port",type:"number",value:e.napcat_server.port||"",onChange:n=>t({...e,napcat_server:{...e.napcat_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8095",className:"text-sm md:text-base"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌Token"}),r.jsx(Te,{id:"napcat-token",type:"password",value:e.napcat_server.token,onChange:n=>t({...e,napcat_server:{...e.napcat_server,token:n.target.value}}),placeholder:"留空表示无需令牌",className:"text-sm md:text-base"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),r.jsx(Te,{id:"napcat-heartbeat",type:"number",value:e.napcat_server.heartbeat_interval||"",onChange:n=>t({...e,napcat_server:{...e.napcat_server,heartbeat_interval:n.target.value?parseInt(n.target.value):0}}),placeholder:"30",className:"text-sm md:text-base"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30"})]})]})]})})}function Bz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),r.jsxs("div",{className:"grid gap-3 md:gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),r.jsx(Te,{id:"maibot-host",value:e.maibot_server.host,onChange:n=>t({...e,maibot_server:{...e.maibot_server,host:n.target.value}}),placeholder:"localhost",className:"text-sm md:text-base"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),r.jsx(Te,{id:"maibot-port",type:"number",value:e.maibot_server.port||"",onChange:n=>t({...e,maibot_server:{...e.maibot_server,port:n.target.value?parseInt(n.target.value):0}}),placeholder:"8000",className:"text-sm md:text-base"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000"})]})]})]})})}function Pz({config:e,onChange:t}){const n=o=>{const c={...e};o==="group"?c.chat.group_list=[...c.chat.group_list,0]:o==="private"?c.chat.private_list=[...c.chat.private_list,0]:c.chat.ban_user_id=[...c.chat.ban_user_id,0],t(c)},a=(o,c)=>{const d={...e};o==="group"?d.chat.group_list=d.chat.group_list.filter((m,f)=>f!==c):o==="private"?d.chat.private_list=d.chat.private_list.filter((m,f)=>f!==c):d.chat.ban_user_id=d.chat.ban_user_id.filter((m,f)=>f!==c),t(d)},l=(o,c,d)=>{const m={...e};o==="group"?m.chat.group_list[c]=d:o==="private"?m.chat.private_list[c]=d:m.chat.ban_user_id[c]=d,t(m)};return r.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),r.jsxs("div",{className:"grid gap-4 md:gap-6",children:[r.jsxs("div",{className:"space-y-3 md:space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-sm md:text-base",children:"群组名单类型"}),r.jsxs(_t,{value:e.chat.group_list_type,onValueChange:o=>t({...e,chat:{...e.chat,group_list_type:o}}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),r.jsx(Oe,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[r.jsx(Q,{className:"text-sm md:text-base",children:"群组列表"}),r.jsxs(ne,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(Nl,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),e.chat.group_list.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("group",c,parseInt(d.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除群号 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a("group",c),children:"删除"})]})]})]})]},c)),e.chat.group_list.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),r.jsxs("div",{className:"space-y-3 md:space-y-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-sm md:text-base",children:"私聊名单类型"}),r.jsxs(_t,{value:e.chat.private_list_type,onValueChange:o=>t({...e,chat:{...e.chat,private_list_type:o}}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),r.jsx(Oe,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[r.jsx(Q,{className:"text-sm md:text-base",children:"私聊列表"}),r.jsxs(ne,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(Nl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),e.chat.private_list.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("private",c,parseInt(d.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要删除用户 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a("private",c),children:"删除"})]})]})]})]},c)),e.chat.private_list.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-sm md:text-base",children:"全局禁止名单"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),r.jsxs(ne,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[r.jsx(Nl,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),e.chat.ban_user_id.map((o,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Te,{type:"number",value:o,onChange:d=>l("ban",c,parseInt(d.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),r.jsxs(en,{children:[r.jsx(Zn,{asChild:!0,children:r.jsx(ne,{size:"icon",variant:"outline",children:r.jsx(zt,{className:"h-4 w-4"})})}),r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:["确定要从全局禁止名单中删除用户 ",o," 吗?此操作无法撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>a("ban",c),children:"删除"})]})]})]})]},c)),e.chat.ban_user_id.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),r.jsx(vt,{checked:e.chat.ban_qq_bot,onCheckedChange:o=>t({...e,chat:{...e.chat,ban_qq_bot:o}})})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),r.jsx(vt,{checked:e.chat.enable_poke,onCheckedChange:o=>t({...e,chat:{...e.chat,enable_poke:o}})})]})]})]})})}function Fz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),r.jsx(vt,{checked:e.voice.use_tts,onCheckedChange:n=>t({...e,voice:{use_tts:n}})})]})]})})}function Iz({config:e,onChange:t}){return r.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:r.jsxs("div",{children:[r.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),r.jsx("div",{className:"grid gap-3 md:gap-4",children:r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Q,{className:"text-sm md:text-base",children:"日志等级"}),r.jsxs(_t,{value:e.debug.level,onValueChange:n=>t({...e,debug:{level:n}}),children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"DEBUG",children:"DEBUG调试"}),r.jsx(Oe,{value:"INFO",children:"INFO信息"}),r.jsx(Oe,{value:"WARNING",children:"WARNING警告"}),r.jsx(Oe,{value:"ERROR",children:"ERROR错误"}),r.jsx(Oe,{value:"CRITICAL",children:"CRITICAL严重"})]})]}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function Bb(e){const t=[],n=String(e||"");let a=n.indexOf(","),l=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(l,a).trim();(c||!o)&&t.push(c),l=a+1,a=n.indexOf(",",l)}return t}function qz(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Hz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$z={};function Pb(e,t){return($z.jsx?Uz:Hz).test(e)}const Vz=/[ \t\n\f\r]/g;function Gz(e){return typeof e=="object"?e.type==="text"?Fb(e.value):!1:Fb(e)}function Fb(e){return e.replace(Vz,"")===""}class $u{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}$u.prototype.normal={};$u.prototype.property={};$u.prototype.space=void 0;function s7(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new $u(n,a,t)}function yu(e){return e.toLowerCase()}class Kr{constructor(t,n){this.attribute=n,this.property=t}}Kr.prototype.attribute="";Kr.prototype.booleanish=!1;Kr.prototype.boolean=!1;Kr.prototype.commaOrSpaceSeparated=!1;Kr.prototype.commaSeparated=!1;Kr.prototype.defined=!1;Kr.prototype.mustUseProperty=!1;Kr.prototype.number=!1;Kr.prototype.overloadedBoolean=!1;Kr.prototype.property="";Kr.prototype.spaceSeparated=!1;Kr.prototype.space=void 0;let Yz=0;const gt=ki(),$n=ki(),Px=ki(),ze=ki(),vn=ki(),Oo=ki(),ia=ki();function ki(){return 2**++Yz}const Fx=Object.freeze(Object.defineProperty({__proto__:null,boolean:gt,booleanish:$n,commaOrSpaceSeparated:ia,commaSeparated:Oo,number:ze,overloadedBoolean:Px,spaceSeparated:vn},Symbol.toStringTag,{value:"Module"})),Rp=Object.keys(Fx);class G1 extends Kr{constructor(t,n,a,l){let o=-1;if(super(t,n),Ib(this,"space",l),typeof a=="number")for(;++o<Rp.length;){const c=Rp[o];Ib(this,Rp[o],(a&Fx[c])===Fx[c])}}}G1.prototype.defined=!0;function Ib(e,t,n){n&&(e[t]=n)}function Jo(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new G1(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[yu(a)]=a,n[yu(o.attribute)]=a}return new $u(t,n,e.space)}const l7=Jo({properties:{ariaActiveDescendant:null,ariaAtomic:$n,ariaAutoComplete:null,ariaBusy:$n,ariaChecked:$n,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:vn,ariaCurrent:null,ariaDescribedBy:vn,ariaDetails:null,ariaDisabled:$n,ariaDropEffect:vn,ariaErrorMessage:null,ariaExpanded:$n,ariaFlowTo:vn,ariaGrabbed:$n,ariaHasPopup:null,ariaHidden:$n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vn,ariaLevel:ze,ariaLive:null,ariaModal:$n,ariaMultiLine:$n,ariaMultiSelectable:$n,ariaOrientation:null,ariaOwns:vn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:$n,ariaReadOnly:$n,ariaRelevant:null,ariaRequired:$n,ariaRoleDescription:vn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:$n,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function i7(e,t){return t in e?e[t]:t}function o7(e,t){return i7(e,t.toLowerCase())}const Wz=Jo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oo,acceptCharset:vn,accessKey:vn,action:null,allow:null,allowFullScreen:gt,allowPaymentRequest:gt,allowUserMedia:gt,alt:null,as:null,async:gt,autoCapitalize:null,autoComplete:vn,autoFocus:gt,autoPlay:gt,blocking:vn,capture:null,charSet:null,checked:gt,cite:null,className:vn,cols:ze,colSpan:null,content:null,contentEditable:$n,controls:gt,controlsList:vn,coords:ze|Oo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:gt,defer:gt,dir:null,dirName:null,disabled:gt,download:Px,draggable:$n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:gt,formTarget:null,headers:vn,height:ze,hidden:Px,high:ze,href:null,hrefLang:null,htmlFor:vn,httpEquiv:vn,id:null,imageSizes:null,imageSrcSet:null,inert:gt,inputMode:null,integrity:null,is:null,isMap:gt,itemId:null,itemProp:vn,itemRef:vn,itemScope:gt,itemType:vn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:gt,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:gt,muted:gt,name:null,nonce:null,noModule:gt,noValidate:gt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:gt,optimum:ze,pattern:null,ping:vn,placeholder:null,playsInline:gt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:gt,referrerPolicy:null,rel:vn,required:gt,reversed:gt,rows:ze,rowSpan:ze,sandbox:vn,scope:null,scoped:gt,seamless:gt,selected:gt,shadowRootClonable:gt,shadowRootDelegatesFocus:gt,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:$n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:gt,useMap:null,value:$n,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vn,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:gt,declare:gt,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:gt,noHref:gt,noShade:gt,noWrap:gt,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:$n,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:gt,disableRemotePlayback:gt,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:o7}),Xz=Jo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ia,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:vn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:gt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Oo,g2:Oo,glyphName:Oo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:ia,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ze,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ia,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ia,rev:ia,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ia,requiredFeatures:ia,requiredFonts:ia,requiredFormats:ia,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:ia,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ia,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ia,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:i7}),c7=Jo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),u7=Jo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:o7}),d7=Jo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Kz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Qz=/[A-Z]/g,qb=/-[a-z]/g,Zz=/^data[-\w.:]+$/i;function m7(e,t){const n=yu(t);let a=t,l=Kr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Zz.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(qb,eO);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!qb.test(o)){let c=o.replace(Qz,Jz);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=G1}return new l(a,t)}function Jz(e){return"-"+e.toLowerCase()}function eO(e){return e.charAt(1).toUpperCase()}const h7=s7([l7,Wz,c7,u7,d7],"html"),Hm=s7([l7,Xz,c7,u7,d7],"svg");function Hb(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function tO(e){return e.join(" ").trim()}var yo={},Lp,Ub;function nO(){if(Ub)return Lp;Ub=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=`
`,f="/",p="*",x="",y="comment",b="declaration";function N(S,T){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];T=T||{};var M=1,A=1;function R(J){var se=J.match(t);se&&(M+=se.length);var H=J.lastIndexOf(m);A=~H?J.length-H:A+J.length}function B(){var J={line:M,column:A};return function(se){return se.position=new O(J),U(),se}}function O(J){this.start=J,this.end={line:M,column:A},this.source=T.source}O.prototype.content=S;function L(J){var se=new Error(T.source+":"+M+":"+A+": "+J);if(se.reason=J,se.filename=T.source,se.line=M,se.column=A,se.source=S,!T.silent)throw se}function $(J){var se=J.exec(S);if(se){var H=se[0];return R(H),S=S.slice(H.length),se}}function U(){$(n)}function I(J){var se;for(J=J||[];se=G();)se!==!1&&J.push(se);return J}function G(){var J=B();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var se=2;x!=S.charAt(se)&&(p!=S.charAt(se)||f!=S.charAt(se+1));)++se;if(se+=2,x===S.charAt(se-1))return L("End of comment missing");var H=S.slice(2,se-2);return A+=2,R(H),S=S.slice(se),A+=2,J({type:y,comment:H})}}function ee(){var J=B(),se=$(a);if(se){if(G(),!$(l))return L("property missing ':'");var H=$(o),le=J({type:b,property:k(se[0].replace(e,x)),value:H?k(H[0].replace(e,x)):x});return $(c),le}}function Ne(){var J=[];I(J);for(var se;se=ee();)se!==!1&&(J.push(se),I(J));return J}return U(),Ne()}function k(S){return S?S.replace(d,x):x}return Lp=N,Lp}var $b;function rO(){if($b)return yo;$b=1;var e=yo&&yo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(yo,"__esModule",{value:!0}),yo.default=n;const t=e(nO());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:f,value:p}=m;d?l(f,p,m):p&&(o=o||{},o[f]=p)}),o}return yo}var eu={},Vb;function aO(){if(Vb)return eu;Vb=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},c=function(f,p){return p.toUpperCase()},d=function(f,p){return"".concat(p,"-")},m=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(l,d):f=f.replace(a,d),f.replace(t,c))};return eu.camelCase=m,eu}var tu,Gb;function sO(){if(Gb)return tu;Gb=1;var e=tu&&tu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(rO()),n=aO();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(d,m){d&&m&&(c[(0,n.camelCase)(d,o)]=m)}),c}return a.default=a,tu=a,tu}var lO=sO();const iO=B5(lO),f7=p7("end"),Y1=p7("start");function p7(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function oO(e){const t=Y1(e),n=f7(e);if(t&&n)return{start:t,end:n}}function uu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yb(e.position):"start"in e||"end"in e?Yb(e):"line"in e||"column"in e?Ix(e):""}function Ix(e){return Wb(e&&e.line)+":"+Wb(e&&e.column)}function Yb(e){return Ix(e&&e.start)+"-"+Ix(e&&e.end)}function Wb(e){return e&&typeof e=="number"?e:1}class Nr extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=d?d.line:void 0,this.name=uu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nr.prototype.file="";Nr.prototype.name="";Nr.prototype.reason="";Nr.prototype.message="";Nr.prototype.stack="";Nr.prototype.column=void 0;Nr.prototype.line=void 0;Nr.prototype.ancestors=void 0;Nr.prototype.cause=void 0;Nr.prototype.fatal=void 0;Nr.prototype.place=void 0;Nr.prototype.ruleId=void 0;Nr.prototype.source=void 0;const W1={}.hasOwnProperty,cO=new Map,uO=/[A-Z]/g,dO=new Set(["table","tbody","thead","tfoot","tr"]),mO=new Set(["td","th"]),x7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hO(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=wO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=bO(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hm:h7,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=g7(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function g7(e,t,n){if(t.type==="element")return fO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return gO(e,t,n);if(t.type==="mdxjsEsm")return xO(e,t);if(t.type==="root")return vO(e,t,n);if(t.type==="text")return yO(e,t)}function fO(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Hm,e.schema=l),e.ancestors.push(t);const o=y7(e,t.tagName,!1),c=jO(e,t);let d=K1(e,t);return dO.has(t.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!Gz(m):!0})),v7(e,c,o,t),X1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function pO(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}bu(e,t.position)}function xO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bu(e,t.position)}function gO(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Hm,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:y7(e,t.name,!0),c=NO(e,t),d=K1(e,t);return v7(e,c,o,t),X1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function vO(e,t,n){const a={};return X1(a,K1(e,t)),e.create(t,e.Fragment,a,n)}function yO(e,t){return t.value}function v7(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function X1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function bO(e,t,n){return a;function a(l,o,c,d){const f=Array.isArray(c.children)?n:t;return d?f(o,c,d):f(o,c)}}function wO(e,t){return n;function n(a,l,o,c){const d=Array.isArray(o.children),m=Y1(a);return t(l,o,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function jO(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&W1.call(t.properties,l)){const o=SO(e,l,t.properties[l]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&mO.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function NO(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else bu(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else bu(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function K1(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:cO;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const f=l.get(m)||0;c=m+"-"+f,l.set(m,f+1)}}const d=g7(e,o,c);d!==void 0&&n.push(d)}return n}function SO(e,t,n){const a=m7(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?qz(n):tO(n)),a.property==="style"){let l=typeof n=="object"?n:kO(e,String(n));return e.stylePropertyNameCase==="css"&&(l=CO(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?Kz[a.property]||a.property:a.attribute,n]}}function kO(e,t){try{return iO(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new Nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=x7+"#cannot-parse-style-attribute",l}}function y7(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const d=Pb(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=c}else a=Pb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return W1.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);bu(e)}function bu(e,t){const n=new Nr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=x7+"#cannot-handle-mdx-estrees-without-createevaluater",n}function CO(e){const t={};let n;for(n in e)W1.call(e,n)&&(t[TO(n)]=e[n]);return t}function TO(e){let t=e.replace(uO,_O);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _O(e){return"-"+e.toLowerCase()}const Bp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},EO={};function Q1(e,t){const n=EO,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return b7(e,a,l)}function b7(e,t,n){if(MO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Xb(e.children,t,n)}return Array.isArray(e)?Xb(e,t,n):""}function Xb(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=b7(e[l],t,n);return a.join("")}function MO(e){return!!(e&&typeof e=="object")}const Kb=document.createElement("i");function Z1(e){const t="&"+e+";";Kb.innerHTML=t;const n=Kb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ua(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function ka(e,t){return e.length>0?(ua(e,e.length,0,t),e):t}const Qb={}.hasOwnProperty;function w7(e){const t={};let n=-1;for(;++n<e.length;)AO(t,e[n]);return t}function AO(e,t){let n;for(n in t){const l=(Qb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Qb.call(l,c)||(l[c]=[]);const d=o[c];DO(l[c],Array.isArray(d)?d:d?[d]:[])}}}function DO(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ua(e,0,0,a)}function j7(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"<22>":String.fromCodePoint(n)}function qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tr=Ll(/[A-Za-z]/),wr=Ll(/[\dA-Za-z]/),zO=Ll(/[#-'*+\--9=?A-Z^-~]/);function cm(e){return e!==null&&(e<32||e===127)}const qx=Ll(/\d/),OO=Ll(/[\dA-Fa-f]/),RO=Ll(/[!-/:-@[-`{-~]/);function We(e){return e!==null&&e<-2}function pn(e){return e!==null&&(e<0||e===32)}function Mt(e){return e===-2||e===-1||e===32}const Um=Ll(new RegExp("\\p{P}|\\p{S}","u")),yi=Ll(/\s/);function Ll(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ec(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&wr(e.charCodeAt(n+1))&&wr(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),l=1):c="<22>"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function St(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return Mt(m)?(e.enter(n),d(m)):t(m)}function d(m){return Mt(m)&&o++<l?(e.consume(m),d):(e.exit(n),t(m))}}const LO={tokenize:BO};function BO(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),St(e,t,"linePrefix")}function l(d){return e.enter("paragraph"),o(d)}function o(d){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return We(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const PO={tokenize:FO},Zb={tokenize:IO};function FO(e){const t=this,n=[];let a=0,l,o,c;return d;function d(A){if(a<n.length){const R=n[a];return t.containerState=R[1],e.attempt(R[0].continuation,m,f)(A)}return f(A)}function m(A){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&M();const R=t.events.length;let B=R,O;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){O=t.events[B][1].end;break}T(a);let L=R;for(;L<t.events.length;)t.events[L][1].end={...O},L++;return ua(t.events,B+1,0,t.events.slice(R)),t.events.length=L,f(A)}return d(A)}function f(A){if(a===n.length){if(!l)return y(A);if(l.currentConstruct&&l.currentConstruct.concrete)return N(A);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zb,p,x)(A)}function p(A){return l&&M(),T(a),y(A)}function x(A){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,N(A)}function y(A){return t.containerState={},e.attempt(Zb,b,N)(A)}function b(A){return a++,n.push([t.currentConstruct,t.containerState]),y(A)}function N(A){if(A===null){l&&M(),T(0),e.consume(A);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),k(A)}function k(A){if(A===null){S(e.exit("chunkFlow"),!0),T(0),e.consume(A);return}return We(A)?(e.consume(A),S(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(A),k)}function S(A,R){const B=t.sliceStream(A);if(R&&B.push(null),A.previous=o,o&&(o.next=A),o=A,l.defineSkip(A.start),l.write(B),t.parser.lazy[A.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<c&&(!l.events[O][1].end||l.events[O][1].end.offset>c))return;const L=t.events.length;let $=L,U,I;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(U){I=t.events[$][1].end;break}U=!0}for(T(a),O=L;O<t.events.length;)t.events[O][1].end={...I},O++;ua(t.events,$+1,0,t.events.slice(L)),t.events.length=O}}function T(A){let R=n.length;for(;R-- >A;){const B=n[R];t.containerState=B[1],B[0].exit.call(t,e)}n.length=A}function M(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function IO(e,t,n){return St(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ho(e){if(e===null||pn(e)||yi(e))return 1;if(Um(e))return 2}function $m(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Hx={name:"attention",resolveAll:qO,tokenize:HO};function qO(e,t){let n=-1,a,l,o,c,d,m,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[a][1].end},y={...e[n][1].start};Jb(x,-m),Jb(y,m),c={type:m>1?"strongSequence":"emphasisSequence",start:x,end:{...e[a][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},f=[],e[a][1].end.offset-e[a][1].start.offset&&(f=ka(f,[["enter",e[a][1],t],["exit",e[a][1],t]])),f=ka(f,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),f=ka(f,$m(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),f=ka(f,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=ka(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ua(e,a-1,n-a+3,f),n=a+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function HO(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Ho(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),d(m)}function d(m){if(m===o)return e.consume(m),d;const f=e.exit("attentionSequence"),p=Ho(m),x=!p||p===2&&l||n.includes(m),y=!l||l===2&&p||n.includes(a);return f._open=!!(o===42?x:x&&(l||!y)),f._close=!!(o===42?y:y&&(p||!x)),t(m)}}function Jb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const UO={name:"autolink",tokenize:$O};function $O(e,t,n){let a=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Tr(b)?(e.consume(b),c):b===64?n(b):f(b)}function c(b){return b===43||b===45||b===46||wr(b)?(a=1,d(b)):f(b)}function d(b){return b===58?(e.consume(b),a=0,m):(b===43||b===45||b===46||wr(b))&&a++<32?(e.consume(b),d):(a=0,f(b))}function m(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||cm(b)?n(b):(e.consume(b),m)}function f(b){return b===64?(e.consume(b),p):zO(b)?(e.consume(b),f):n(b)}function p(b){return wr(b)?x(b):n(b)}function x(b){return b===46?(e.consume(b),a=0,p):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||wr(b))&&a++<63){const N=b===45?y:x;return e.consume(b),N}return n(b)}}const Vu={partial:!0,tokenize:VO};function VO(e,t,n){return a;function a(o){return Mt(o)?St(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||We(o)?t(o):n(o)}}const N7={continuation:{tokenize:YO},exit:WO,name:"blockQuote",tokenize:GO};function GO(e,t,n){const a=this;return l;function l(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Mt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function YO(e,t,n){const a=this;return l;function l(c){return Mt(c)?St(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(N7,t,n)(c)}}function WO(e){e.exit("blockQuote")}const S7={name:"characterEscape",tokenize:XO};function XO(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return RO(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const k7={name:"characterReference",tokenize:KO};function KO(e,t,n){const a=this;let l=0,o,c;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),m}function m(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,c=wr,p(x))}function f(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=OO,p):(e.enter("characterReferenceValue"),o=7,c=qx,p(x))}function p(x){if(x===59&&l){const y=e.exit("characterReferenceValue");return c===wr&&!Z1(a.sliceSerialize(y))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&l++<o?(e.consume(x),p):n(x)}}const e3={partial:!0,tokenize:ZO},t3={concrete:!0,name:"codeFenced",tokenize:QO};function QO(e,t,n){const a=this,l={partial:!0,tokenize:B};let o=0,c=0,d;return m;function m(O){return f(O)}function f(O){const L=a.events[a.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,d=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===d?(c++,e.consume(O),p):c<3?n(O):(e.exit("codeFencedFenceSequence"),Mt(O)?St(e,x,"whitespace")(O):x(O))}function x(O){return O===null||We(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check(e3,k,R)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||We(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(O)):Mt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),St(e,b,"whitespace")(O)):O===96&&O===d?n(O):(e.consume(O),y)}function b(O){return O===null||We(O)?x(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),N(O))}function N(O){return O===null||We(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(O)):O===96&&O===d?n(O):(e.consume(O),N)}function k(O){return e.attempt(l,R,S)(O)}function S(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),T}function T(O){return o>0&&Mt(O)?St(e,M,"linePrefix",o+1)(O):M(O)}function M(O){return O===null||We(O)?e.check(e3,k,R)(O):(e.enter("codeFlowValue"),A(O))}function A(O){return O===null||We(O)?(e.exit("codeFlowValue"),M(O)):(e.consume(O),A)}function R(O){return e.exit("codeFenced"),t(O)}function B(O,L,$){let U=0;return I;function I(se){return O.enter("lineEnding"),O.consume(se),O.exit("lineEnding"),G}function G(se){return O.enter("codeFencedFence"),Mt(se)?St(O,ee,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):ee(se)}function ee(se){return se===d?(O.enter("codeFencedFenceSequence"),Ne(se)):$(se)}function Ne(se){return se===d?(U++,O.consume(se),Ne):U>=c?(O.exit("codeFencedFenceSequence"),Mt(se)?St(O,J,"whitespace")(se):J(se)):$(se)}function J(se){return se===null||We(se)?(O.exit("codeFencedFence"),L(se)):$(se)}}}function ZO(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Pp={name:"codeIndented",tokenize:eR},JO={partial:!0,tokenize:tR};function eR(e,t,n){const a=this;return l;function l(f){return e.enter("codeIndented"),St(e,o,"linePrefix",5)(f)}function o(f){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(f):n(f)}function c(f){return f===null?m(f):We(f)?e.attempt(JO,c,m)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||We(f)?(e.exit("codeFlowValue"),c(f)):(e.consume(f),d)}function m(f){return e.exit("codeIndented"),t(f)}}function tR(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):We(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):St(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):We(c)?l(c):n(c)}}const nR={name:"codeText",previous:aR,resolve:rR,tokenize:sR};function rR(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function aR(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function sR(e,t,n){let a=0,l,o;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),a++,d):(e.exit("codeTextSequence"),m(x))}function m(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),m):x===96?(o=e.enter("codeTextSequence"),l=0,p(x)):We(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("codeTextData"),f(x))}function f(x){return x===null||x===32||x===96||We(x)?(e.exit("codeTextData"),m(x)):(e.consume(x),f)}function p(x){return x===96?(e.consume(x),l++,p):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(o.type="codeTextData",f(x))}}class lR{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&nu(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),nu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);nu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);nu(this.left,n.reverse())}}}function nu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function C7(e){const t={};let n=-1,a,l,o,c,d,m,f;const p=new lR(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,iR(p,n)),n=t[n],f=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=p.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(p.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...p.get(l)[1].start},d=p.slice(l,n),d.unshift(a),p.splice(l,n-l+1,d))}}return ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function iR(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,m=[],f={};let p,x,y=-1,b=n,N=0,k=0;const S=[k];for(;b;){for(;e.get(++l)[1]!==b;);o.push(l),b._tokenizer||(p=a.sliceStream(b),b.next||p.push(null),x&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=b,b=b.next}for(b=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(k=y+1,S.push(k),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):S.pop(),y=S.length;y--;){const T=d.slice(S[y],S[y+1]),M=o.pop();m.push([M,M+T.length-1]),e.splice(M,2,T)}for(m.reverse(),y=-1;++y<m.length;)f[N+m[y][0]]=N+m[y][1],N+=m[y][1]-m[y][0]-1;return f}const oR={resolve:uR,tokenize:dR},cR={partial:!0,tokenize:mR};function uR(e){return C7(e),e}function dR(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(d)}function l(d){return d===null?o(d):We(d)?e.check(cR,c,o)(d):(e.consume(d),l)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function mR(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),St(e,o,"linePrefix")}function o(c){if(c===null||We(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function T7(e,t,n,a,l,o,c,d,m){const f=m||Number.POSITIVE_INFINITY;let p=0;return x;function x(T){return T===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(T),e.exit(o),y):T===null||T===32||T===41||cm(T)?n(T):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(T))}function y(T){return T===62?(e.enter(o),e.consume(T),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===62?(e.exit("chunkString"),e.exit(d),y(T)):T===null||T===60||We(T)?n(T):(e.consume(T),T===92?N:b)}function N(T){return T===60||T===62||T===92?(e.consume(T),b):b(T)}function k(T){return!p&&(T===null||T===41||pn(T))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(T)):p<f&&T===40?(e.consume(T),p++,k):T===41?(e.consume(T),p--,k):T===null||T===32||T===40||cm(T)?n(T):(e.consume(T),T===92?S:k)}function S(T){return T===40||T===41||T===92?(e.consume(T),k):k(T)}}function _7(e,t,n,a,l,o){const c=this;let d=0,m;return f;function f(b){return e.enter(a),e.enter(l),e.consume(b),e.exit(l),e.enter(o),p}function p(b){return d>999||b===null||b===91||b===93&&!m||b===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):We(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||b===91||b===93||We(b)||d++>999?(e.exit("chunkString"),p(b)):(e.consume(b),m||(m=!Mt(b)),b===92?y:x)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,x):x(b)}}function E7(e,t,n,a,l,o){let c;return d;function d(y){return y===34||y===39||y===40?(e.enter(a),e.enter(l),e.consume(y),e.exit(l),c=y===40?41:y,m):n(y)}function m(y){return y===c?(e.enter(l),e.consume(y),e.exit(l),e.exit(a),t):(e.enter(o),f(y))}function f(y){return y===c?(e.exit(o),m(c)):y===null?n(y):We(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),St(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===c||y===null||We(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?x:p)}function x(y){return y===c||y===92?(e.consume(y),p):p(y)}}function du(e,t){let n;return a;function a(l){return We(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Mt(l)?St(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const hR={name:"definition",tokenize:pR},fR={partial:!0,tokenize:xR};function pR(e,t,n){const a=this;let l;return o;function o(b){return e.enter("definition"),c(b)}function c(b){return _7.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return l=qa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),m):n(b)}function m(b){return pn(b)?du(e,f)(b):f(b)}function f(b){return T7(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(fR,x,x)(b)}function x(b){return Mt(b)?St(e,y,"whitespace")(b):y(b)}function y(b){return b===null||We(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):n(b)}}function xR(e,t,n){return a;function a(d){return pn(d)?du(e,l)(d):n(d)}function l(d){return E7(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return Mt(d)?St(e,c,"whitespace")(d):c(d)}function c(d){return d===null||We(d)?t(d):n(d)}}const gR={name:"hardBreakEscape",tokenize:vR};function vR(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return We(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const yR={name:"headingAtx",resolve:bR,tokenize:wR};function bR(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ua(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function wR(e,t,n){let a=0;return l;function l(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||pn(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||We(p)?(e.exit("atxHeading"),t(p)):Mt(p)?St(e,d,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),d(p))}function f(p){return p===null||p===35||pn(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),f)}}const jR=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],n3=["pre","script","style","textarea"],NR={concrete:!0,name:"htmlFlow",resolveTo:CR,tokenize:TR},SR={partial:!0,tokenize:ER},kR={partial:!0,tokenize:_R};function CR(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function TR(e,t,n){const a=this;let l,o,c,d,m;return f;function f(z){return p(z)}function p(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),x}function x(z){return z===33?(e.consume(z),y):z===47?(e.consume(z),o=!0,k):z===63?(e.consume(z),l=3,a.interrupt?t:E):Tr(z)?(e.consume(z),c=String.fromCharCode(z),S):n(z)}function y(z){return z===45?(e.consume(z),l=2,b):z===91?(e.consume(z),l=5,d=0,N):Tr(z)?(e.consume(z),l=4,a.interrupt?t:E):n(z)}function b(z){return z===45?(e.consume(z),a.interrupt?t:E):n(z)}function N(z){const X="CDATA[";return z===X.charCodeAt(d++)?(e.consume(z),d===X.length?a.interrupt?t:ee:N):n(z)}function k(z){return Tr(z)?(e.consume(z),c=String.fromCharCode(z),S):n(z)}function S(z){if(z===null||z===47||z===62||pn(z)){const X=z===47,q=c.toLowerCase();return!X&&!o&&n3.includes(q)?(l=1,a.interrupt?t(z):ee(z)):jR.includes(c.toLowerCase())?(l=6,X?(e.consume(z),T):a.interrupt?t(z):ee(z)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(z):o?M(z):A(z))}return z===45||wr(z)?(e.consume(z),c+=String.fromCharCode(z),S):n(z)}function T(z){return z===62?(e.consume(z),a.interrupt?t:ee):n(z)}function M(z){return Mt(z)?(e.consume(z),M):I(z)}function A(z){return z===47?(e.consume(z),I):z===58||z===95||Tr(z)?(e.consume(z),R):Mt(z)?(e.consume(z),A):I(z)}function R(z){return z===45||z===46||z===58||z===95||wr(z)?(e.consume(z),R):B(z)}function B(z){return z===61?(e.consume(z),O):Mt(z)?(e.consume(z),B):A(z)}function O(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),m=z,L):Mt(z)?(e.consume(z),O):$(z)}function L(z){return z===m?(e.consume(z),m=null,U):z===null||We(z)?n(z):(e.consume(z),L)}function $(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||pn(z)?B(z):(e.consume(z),$)}function U(z){return z===47||z===62||Mt(z)?A(z):n(z)}function I(z){return z===62?(e.consume(z),G):n(z)}function G(z){return z===null||We(z)?ee(z):Mt(z)?(e.consume(z),G):n(z)}function ee(z){return z===45&&l===2?(e.consume(z),H):z===60&&l===1?(e.consume(z),le):z===62&&l===4?(e.consume(z),we):z===63&&l===3?(e.consume(z),E):z===93&&l===5?(e.consume(z),ge):We(z)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(SR,Z,Ne)(z)):z===null||We(z)?(e.exit("htmlFlowData"),Ne(z)):(e.consume(z),ee)}function Ne(z){return e.check(kR,J,Z)(z)}function J(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),se}function se(z){return z===null||We(z)?Ne(z):(e.enter("htmlFlowData"),ee(z))}function H(z){return z===45?(e.consume(z),E):ee(z)}function le(z){return z===47?(e.consume(z),c="",re):ee(z)}function re(z){if(z===62){const X=c.toLowerCase();return n3.includes(X)?(e.consume(z),we):ee(z)}return Tr(z)&&c.length<8?(e.consume(z),c+=String.fromCharCode(z),re):ee(z)}function ge(z){return z===93?(e.consume(z),E):ee(z)}function E(z){return z===62?(e.consume(z),we):z===45&&l===2?(e.consume(z),E):ee(z)}function we(z){return z===null||We(z)?(e.exit("htmlFlowData"),Z(z)):(e.consume(z),we)}function Z(z){return e.exit("htmlFlow"),t(z)}}function _R(e,t,n){const a=this;return l;function l(c){return We(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function ER(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Vu,t,n)}}const MR={name:"htmlText",tokenize:AR};function AR(e,t,n){const a=this;let l,o,c;return d;function d(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),m}function m(E){return E===33?(e.consume(E),f):E===47?(e.consume(E),B):E===63?(e.consume(E),A):Tr(E)?(e.consume(E),$):n(E)}function f(E){return E===45?(e.consume(E),p):E===91?(e.consume(E),o=0,N):Tr(E)?(e.consume(E),M):n(E)}function p(E){return E===45?(e.consume(E),b):n(E)}function x(E){return E===null?n(E):E===45?(e.consume(E),y):We(E)?(c=x,le(E)):(e.consume(E),x)}function y(E){return E===45?(e.consume(E),b):x(E)}function b(E){return E===62?H(E):E===45?y(E):x(E)}function N(E){const we="CDATA[";return E===we.charCodeAt(o++)?(e.consume(E),o===we.length?k:N):n(E)}function k(E){return E===null?n(E):E===93?(e.consume(E),S):We(E)?(c=k,le(E)):(e.consume(E),k)}function S(E){return E===93?(e.consume(E),T):k(E)}function T(E){return E===62?H(E):E===93?(e.consume(E),T):k(E)}function M(E){return E===null||E===62?H(E):We(E)?(c=M,le(E)):(e.consume(E),M)}function A(E){return E===null?n(E):E===63?(e.consume(E),R):We(E)?(c=A,le(E)):(e.consume(E),A)}function R(E){return E===62?H(E):A(E)}function B(E){return Tr(E)?(e.consume(E),O):n(E)}function O(E){return E===45||wr(E)?(e.consume(E),O):L(E)}function L(E){return We(E)?(c=L,le(E)):Mt(E)?(e.consume(E),L):H(E)}function $(E){return E===45||wr(E)?(e.consume(E),$):E===47||E===62||pn(E)?U(E):n(E)}function U(E){return E===47?(e.consume(E),H):E===58||E===95||Tr(E)?(e.consume(E),I):We(E)?(c=U,le(E)):Mt(E)?(e.consume(E),U):H(E)}function I(E){return E===45||E===46||E===58||E===95||wr(E)?(e.consume(E),I):G(E)}function G(E){return E===61?(e.consume(E),ee):We(E)?(c=G,le(E)):Mt(E)?(e.consume(E),G):U(E)}function ee(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,Ne):We(E)?(c=ee,le(E)):Mt(E)?(e.consume(E),ee):(e.consume(E),J)}function Ne(E){return E===l?(e.consume(E),l=void 0,se):E===null?n(E):We(E)?(c=Ne,le(E)):(e.consume(E),Ne)}function J(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||pn(E)?U(E):(e.consume(E),J)}function se(E){return E===47||E===62||pn(E)?U(E):n(E)}function H(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function le(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),re}function re(E){return Mt(E)?St(e,ge,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):ge(E)}function ge(E){return e.enter("htmlTextData"),c(E)}}const J1={name:"labelEnd",resolveAll:RR,resolveTo:LR,tokenize:BR},DR={tokenize:PR},zR={tokenize:FR},OR={tokenize:IR};function RR(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&ua(e,0,e.length,n),e}function LR(e,t){let n=e.length,a=0,l,o,c,d;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},p={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",m,t],["enter",f,t]],d=ka(d,e.slice(o+1,o+a+3)),d=ka(d,[["enter",p,t]]),d=ka(d,$m(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),d=ka(d,[["exit",p,t],e[c-2],e[c-1],["exit",f,t]]),d=ka(d,e.slice(c+1)),d=ka(d,[["exit",m,t]]),ua(e,o,e.length,d),e}function BR(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return d;function d(y){return o?o._inactive?x(y):(c=a.parser.defined.includes(qa(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):n(y)}function m(y){return y===40?e.attempt(DR,p,c?p:x)(y):y===91?e.attempt(zR,p,c?f:x)(y):c?p(y):x(y)}function f(y){return e.attempt(OR,p,x)(y)}function p(y){return t(y)}function x(y){return o._balanced=!0,n(y)}}function PR(e,t,n){return a;function a(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),l}function l(x){return pn(x)?du(e,o)(x):o(x)}function o(x){return x===41?p(x):T7(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return pn(x)?du(e,m)(x):p(x)}function d(x){return n(x)}function m(x){return x===34||x===39||x===40?E7(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):p(x)}function f(x){return pn(x)?du(e,p)(x):p(x)}function p(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function FR(e,t,n){const a=this;return l;function l(d){return _7.call(a,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(qa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function IR(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const qR={name:"labelStartImage",resolveAll:J1.resolveAll,tokenize:HR};function HR(e,t,n){const a=this;return l;function l(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const UR={name:"labelStartLink",resolveAll:J1.resolveAll,tokenize:$R};function $R(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Fp={name:"lineEnding",tokenize:VR};function VR(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),St(e,t,"linePrefix")}}const X0={name:"thematicBreak",tokenize:GR};function GR(e,t,n){let a=0,l;return o;function o(f){return e.enter("thematicBreak"),c(f)}function c(f){return l=f,d(f)}function d(f){return f===l?(e.enter("thematicBreakSequence"),m(f)):a>=3&&(f===null||We(f))?(e.exit("thematicBreak"),t(f)):n(f)}function m(f){return f===l?(e.consume(f),a++,m):(e.exit("thematicBreakSequence"),Mt(f)?St(e,d,"whitespace")(f):d(f))}}const qr={continuation:{tokenize:KR},exit:ZR,name:"list",tokenize:XR},YR={partial:!0,tokenize:JR},WR={partial:!0,tokenize:QR};function XR(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return d;function d(b){const N=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:qx(b)){if(a.containerState.type||(a.containerState.type=N,e.enter(N,{_container:!0})),N==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(X0,n,f)(b):f(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(b)}return n(b)}function m(b){return qx(b)&&++c<10?(e.consume(b),m):(!a.interrupt||c<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):n(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(Vu,a.interrupt?n:p,e.attempt(YR,y,x))}function p(b){return a.containerState.initialBlankLine=!0,o++,y(b)}function x(b){return Mt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function KR(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Vu,l,o);function l(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,St(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!Mt(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(WR,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,St(e,e.attempt(qr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function QR(e,t,n){const a=this;return St(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function ZR(e){e.exit(this.containerState.type)}function JR(e,t,n){const a=this;return St(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!Mt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const r3={name:"setextUnderline",resolveTo:eL,tokenize:tL};function eL(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function tL(e,t,n){const a=this;let l;return o;function o(f){let p=a.events.length,x;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){x=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||x)?(e.enter("setextHeadingLine"),l=f,c(f)):n(f)}function c(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===l?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),Mt(f)?St(e,m,"lineSuffix")(f):m(f))}function m(f){return f===null||We(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const nL={tokenize:rL};function rL(e){const t=this,n=e.attempt(Vu,a,e.attempt(this.parser.constructs.flowInitial,l,St(e,e.attempt(this.parser.constructs.flow,l,e.attempt(oR,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const aL={resolveAll:A7()},sL=M7("string"),lL=M7("text");function M7(e){return{resolveAll:A7(e==="text"?iL:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,d);return c;function c(p){return f(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),m}function m(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),m)}function f(p){if(p===null)return!0;const x=l[p];let y=-1;if(x)for(;++y<x.length;){const b=x[y];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function A7(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function iL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,d=0,m;for(;o--;){const f=l[o];if(typeof f=="string"){for(c=f.length;f.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(f===-2)m=!0,d++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const f={type:n===e.length||m||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...f.start},a.start.offset===a.end.offset?Object.assign(a,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const oL={42:qr,43:qr,45:qr,48:qr,49:qr,50:qr,51:qr,52:qr,53:qr,54:qr,55:qr,56:qr,57:qr,62:N7},cL={91:hR},uL={[-2]:Pp,[-1]:Pp,32:Pp},dL={35:yR,42:X0,45:[r3,X0],60:NR,61:r3,95:X0,96:t3,126:t3},mL={38:k7,92:S7},hL={[-5]:Fp,[-4]:Fp,[-3]:Fp,33:qR,38:k7,42:Hx,60:[UO,MR],91:UR,92:[gR,S7],93:J1,95:Hx,96:nR},fL={null:[Hx,aL]},pL={null:[42,95]},xL={null:[]},gL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pL,contentInitial:cL,disable:xL,document:oL,flow:dL,flowInitial:uL,insideSpan:fL,string:mL,text:hL},Symbol.toStringTag,{value:"Module"}));function vL(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],d=[];const m={attempt:L(B),check:L(O),consume:M,enter:A,exit:R,interrupt:L(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:k,events:[],now:N,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:x};let p=t.tokenize.call(f,m);return t.resolveAll&&o.push(t),f;function x(G){return c=ka(c,G),S(),c[c.length-1]!==null?[]:($(t,0),f.events=$m(o,f.events,f),f.events)}function y(G,ee){return bL(b(G),ee)}function b(G){return yL(c,G)}function N(){const{_bufferIndex:G,_index:ee,line:Ne,column:J,offset:se}=a;return{_bufferIndex:G,_index:ee,line:Ne,column:J,offset:se}}function k(G){l[G.line]=G.column,I()}function S(){let G;for(;a._index<c.length;){const ee=c[a._index];if(typeof ee=="string")for(G=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===G&&a._bufferIndex<ee.length;)T(ee.charCodeAt(a._bufferIndex));else T(ee)}}function T(G){p=p(G)}function M(G){We(G)?(a.line++,a.column=1,a.offset+=G===-3?2:1,I()):G!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),f.previous=G}function A(G,ee){const Ne=ee||{};return Ne.type=G,Ne.start=N(),f.events.push(["enter",Ne,f]),d.push(Ne),Ne}function R(G){const ee=d.pop();return ee.end=N(),f.events.push(["exit",ee,f]),ee}function B(G,ee){$(G,ee.from)}function O(G,ee){ee.restore()}function L(G,ee){return Ne;function Ne(J,se,H){let le,re,ge,E;return Array.isArray(J)?Z(J):"tokenize"in J?Z([J]):we(J);function we(ce){return fe;function fe(De){const oe=De!==null&&ce[De],He=De!==null&&ce.null,at=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(He)?He:He?[He]:[]];return Z(at)(De)}}function Z(ce){return le=ce,re=0,ce.length===0?H:z(ce[re])}function z(ce){return fe;function fe(De){return E=U(),ge=ce,ce.partial||(f.currentConstruct=ce),ce.name&&f.parser.constructs.disable.null.includes(ce.name)?q():ce.tokenize.call(ee?Object.assign(Object.create(f),ee):f,m,X,q)(De)}}function X(ce){return G(ge,E),se}function q(ce){return E.restore(),++re<le.length?z(le[re]):H}}}function $(G,ee){G.resolveAll&&!o.includes(G)&&o.push(G),G.resolve&&ua(f.events,ee,f.events.length-ee,G.resolve(f.events.slice(ee),f)),G.resolveTo&&(f.events=G.resolveTo(f.events,f))}function U(){const G=N(),ee=f.previous,Ne=f.currentConstruct,J=f.events.length,se=Array.from(d);return{from:J,restore:H};function H(){a=G,f.previous=ee,f.currentConstruct=Ne,f.events.length=J,d=se,I()}}function I(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function yL(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function bL(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
`;break}case-3:{c=`\r
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function wL(e){const a={constructs:w7([gL,...(e||{}).extensions||[]]),content:l(LO),defined:[],document:l(PO),flow:l(nL),lazy:{},string:l(sL),text:l(lL)};return a;function l(o){return c;function c(d){return vL(a,o,d)}}}function jL(e){for(;!C7(e););return e}const a3=/[\0\t\n\r]/g;function NL(){let e=1,t="",n=!0,a;return l;function l(o,c,d){const m=[];let f,p,x,y,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),x=0,t="",n&&(o.charCodeAt(0)===65279&&x++,n=void 0);x<o.length;){if(a3.lastIndex=x,f=a3.exec(o),y=f&&f.index!==void 0?f.index:o.length,b=o.charCodeAt(y),!f){t=o.slice(x);break}if(b===10&&x===y&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),x<y&&(m.push(o.slice(x,y)),e+=y-x),b){case 0:{m.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,m.push(-2);e++<p;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}x=y+1}return d&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const SL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kL(e){return e.replace(SL,CL)}function CL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return j7(n.slice(o?2:1),o?16:10)}return Z1(n)||e}const D7={}.hasOwnProperty;function TL(e,t,n){return typeof t!="string"&&(n=t,t=void 0),_L(n)(jL(wL(n).document().write(NL()(e,t,!0))))}function _L(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(wn),autolinkProtocol:U,autolinkEmail:U,atxHeading:o(Ot),blockQuote:o(He),characterEscape:U,characterReference:U,codeFenced:o(at),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(at,c),codeText:o(je,c),codeTextData:U,data:U,codeFlowValue:U,definition:o(Ze),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(qe),hardBreakEscape:o(bn),hardBreakTrailing:o(bn),htmlFlow:o(Dn,c),htmlFlowData:U,htmlText:o(Dn,c),htmlTextData:U,image:o(Xe),label:c,link:o(wn),listItem:o(Ar),listItemValue:y,listOrdered:o(Wn,x),listUnordered:o(Wn),paragraph:o(Cn),reference:z,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Ot),strong:o(cr),thematicBreak:o(Fn)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:oe,autolinkProtocol:De,blockQuote:m(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:ce,characterReference:fe,codeFenced:m(S),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:N,codeFlowValue:I,codeIndented:m(T),codeText:m(se),codeTextData:I,data:I,definition:m(),definitionDestinationString:R,definitionLabelString:M,definitionTitleString:A,emphasis:m(),hardBreakEscape:m(ee),hardBreakTrailing:m(ee),htmlFlow:m(Ne),htmlFlowData:I,htmlText:m(J),htmlTextData:I,image:m(le),label:ge,labelText:re,lineEnding:G,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:X,resourceDestinationString:E,resourceTitleString:we,resource:Z,setextHeading:m($),setextHeadingLineSequence:L,setextHeadingText:O,strong:m(),thematicBreak:m()}};z7(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(K){let be={type:"root",children:[]};const Re={stack:[be],tokenStack:[],config:t,enter:d,exit:f,buffer:c,resume:p,data:n},nt=[];let kt=-1;for(;++kt<K.length;)if(K[kt][1].type==="listOrdered"||K[kt][1].type==="listUnordered")if(K[kt][0]==="enter")nt.push(kt);else{const rr=nt.pop();kt=l(K,rr,kt)}for(kt=-1;++kt<K.length;){const rr=t[K[kt][0]];D7.call(rr,K[kt][1].type)&&rr[K[kt][1].type].call(Object.assign({sliceSerialize:K[kt][2].sliceSerialize},Re),K[kt][1])}if(Re.tokenStack.length>0){const rr=Re.tokenStack[Re.tokenStack.length-1];(rr[1]||s3).call(Re,void 0,rr[0])}for(be.position={start:gl(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:gl(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt<t.transforms.length;)be=t.transforms[kt](be)||be;return be}function l(K,be,Re){let nt=be-1,kt=-1,rr=!1,Dr,pe,Ee,dt;for(;++nt<=Re;){const mt=K[nt];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?kt++:kt--,dt=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(Dr&&!dt&&!kt&&!Ee&&(Ee=nt),dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dt=void 0}if(!kt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||kt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(Dr){let zr=nt;for(pe=void 0;zr--;){const st=K[zr];if(st[1].type==="lineEnding"||st[1].type==="lineEndingBlank"){if(st[0]==="exit")continue;pe&&(K[pe][1].type="lineEndingBlank",rr=!0),st[1].type="lineEnding",pe=zr}else if(!(st[1].type==="linePrefix"||st[1].type==="blockQuotePrefix"||st[1].type==="blockQuotePrefixWhitespace"||st[1].type==="blockQuoteMarker"||st[1].type==="listItemIndent"))break}Ee&&(!pe||Ee<pe)&&(Dr._spread=!0),Dr.end=Object.assign({},pe?K[pe][1].start:mt[1].end),K.splice(pe||nt,0,["exit",Dr,mt[2]]),nt++,Re++}if(mt[1].type==="listItemPrefix"){const zr={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};Dr=zr,K.splice(nt,0,["enter",zr,mt[2]]),nt++,Re++,Ee=void 0,dt=!0}}}return K[be][1]._spread=rr,Re}function o(K,be){return Re;function Re(nt){d.call(this,K(nt),nt),be&&be.call(this,nt)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(K,be,Re){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([be,Re||void 0]),K.position={start:gl(be.start),end:void 0}}function m(K){return be;function be(Re){K&&K.call(this,Re),f.call(this,Re)}}function f(K,be){const Re=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==K.type&&(be?be.call(this,K,nt[0]):(nt[1]||s3).call(this,K,nt[0]));else throw new Error("Cannot close `"+K.type+"` ("+uu({start:K.start,end:K.end})+"): its not open");Re.position.end=gl(K.end)}function p(){return Q1(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(K){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function b(){const K=this.resume(),be=this.stack[this.stack.length-1];be.lang=K}function N(){const K=this.resume(),be=this.stack[this.stack.length-1];be.meta=K}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const K=this.resume(),be=this.stack[this.stack.length-1];be.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const K=this.resume(),be=this.stack[this.stack.length-1];be.value=K.replace(/(\r?\n|\r)$/g,"")}function M(K){const be=this.resume(),Re=this.stack[this.stack.length-1];Re.label=be,Re.identifier=qa(this.sliceSerialize(K)).toLowerCase()}function A(){const K=this.resume(),be=this.stack[this.stack.length-1];be.title=K}function R(){const K=this.resume(),be=this.stack[this.stack.length-1];be.url=K}function B(K){const be=this.stack[this.stack.length-1];if(!be.depth){const Re=this.sliceSerialize(K).length;be.depth=Re}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function L(K){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function U(K){const Re=this.stack[this.stack.length-1].children;let nt=Re[Re.length-1];(!nt||nt.type!=="text")&&(nt=$e(),nt.position={start:gl(K.start),end:void 0},Re.push(nt)),this.stack.push(nt)}function I(K){const be=this.stack.pop();be.value+=this.sliceSerialize(K),be.position.end=gl(K.end)}function G(K){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=be.children[be.children.length-1];Re.position.end=gl(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(U.call(this,K),I.call(this,K))}function ee(){this.data.atHardBreak=!0}function Ne(){const K=this.resume(),be=this.stack[this.stack.length-1];be.value=K}function J(){const K=this.resume(),be=this.stack[this.stack.length-1];be.value=K}function se(){const K=this.resume(),be=this.stack[this.stack.length-1];be.value=K}function H(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=be,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function le(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=be,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function re(K){const be=this.sliceSerialize(K),Re=this.stack[this.stack.length-2];Re.label=kL(be),Re.identifier=qa(be).toLowerCase()}function ge(){const K=this.stack[this.stack.length-1],be=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const nt=K.children;Re.children=nt}else Re.alt=be}function E(){const K=this.resume(),be=this.stack[this.stack.length-1];be.url=K}function we(){const K=this.resume(),be=this.stack[this.stack.length-1];be.title=K}function Z(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function X(K){const be=this.resume(),Re=this.stack[this.stack.length-1];Re.label=be,Re.identifier=qa(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function q(K){this.data.characterReferenceType=K.type}function ce(K){const be=this.sliceSerialize(K),Re=this.data.characterReferenceType;let nt;Re?(nt=j7(be,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=Z1(be);const kt=this.stack[this.stack.length-1];kt.value+=nt}function fe(K){const be=this.stack.pop();be.position.end=gl(K.end)}function De(K){I.call(this,K);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(K)}function oe(K){I.call(this,K);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(K)}function He(){return{type:"blockquote",children:[]}}function at(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function Ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function Ot(){return{type:"heading",depth:0,children:[]}}function bn(){return{type:"break"}}function Dn(){return{type:"html",value:""}}function Xe(){return{type:"image",title:null,url:"",alt:null}}function wn(){return{type:"link",title:null,url:"",children:[]}}function Wn(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Ar(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Cn(){return{type:"paragraph",children:[]}}function cr(){return{type:"strong",children:[]}}function $e(){return{type:"text",value:""}}function Fn(){return{type:"thematicBreak"}}}function gl(e){return{line:e.line,column:e.column,offset:e.offset}}function z7(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?z7(e,a):EL(e,a)}}function EL(e,t){let n;for(n in t)if(D7.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function s3(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+uu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+uu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+uu({start:t.start,end:t.end})+") is still open")}function ML(e){const t=this;t.parser=n;function n(a){return TL(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function AL(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function DL(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function zL(e,t){const n=t.value?t.value+`
`:"",a={};t.lang&&(a.className=["language-"+t.lang]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function OL(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RL(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LL(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=ec(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(a,d);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const f={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,f),e.applyData(t,f)}function BL(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function O7(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function FL(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return O7(e,t);const l={src:ec(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function IL(e,t){const n={src:ec(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function qL(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function HL(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return O7(e,t);const l={href:ec(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function UL(e,t){const n={href:ec(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function $L(e,t,n){const a=e.all(t),l=n?VL(n):R7(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let x;p&&p.type==="element"&&p.tagName==="p"?x=p:(x={type:"element",tagName:"p",properties:{},children:[]},a.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const p=a[d];(l||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
`}),p.type==="element"&&p.tagName==="p"&&!l?c.push(...p.children):c.push(p)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
`});const f={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,f),e.applyData(t,f)}function VL(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=R7(n[a])}return t}function R7(e){const t=e.spread;return t??e.children.length>1}function GL(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function YL(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WL(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function XL(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KL(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Y1(t.children[1]),m=f7(t.children[t.children.length-1]);d&&m&&(c.position={start:d,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function QL(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let m=-1;const f=[];for(;++m<d;){const x=t.children[m],y={},b=c?c[m]:void 0;b&&(y.align=b);let N={type:"element",tagName:o,properties:y,children:[]};x&&(N.children=e.all(x),e.patch(x,N),N=e.applyData(x,N)),f.push(N)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function ZL(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const l3=9,i3=32;function JL(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(o3(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(o3(t.slice(l),l>0,!1)),o.join("")}function o3(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===l3||o===i3;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===l3||o===i3;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function eB(e,t){const n={type:"text",value:JL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const nB={blockquote:AL,break:DL,code:zL,delete:OL,emphasis:RL,footnoteReference:LL,heading:BL,html:PL,imageReference:FL,image:IL,inlineCode:qL,linkReference:HL,link:UL,listItem:$L,list:GL,paragraph:YL,root:WL,strong:XL,table:KL,tableCell:ZL,tableRow:QL,text:eB,thematicBreak:tB,toml:k0,yaml:k0,definition:k0,footnoteDefinition:k0};function k0(){}const L7=-1,Vm=0,mu=1,um=2,eg=3,tg=4,ng=5,rg=6,B7=7,P7=8,c3=typeof self=="object"?self:globalThis,rB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case Vm:case L7:return n(c,l);case mu:{const d=n([],l);for(const m of c)d.push(a(m));return d}case um:{const d=n({},l);for(const[m,f]of c)d[a(m)]=a(f);return d}case eg:return n(new Date(c),l);case tg:{const{source:d,flags:m}=c;return n(new RegExp(d,m),l)}case ng:{const d=n(new Map,l);for(const[m,f]of c)d.set(a(m),a(f));return d}case rg:{const d=n(new Set,l);for(const m of c)d.add(a(m));return d}case B7:{const{name:d,message:m}=c;return n(new c3[d](m),l)}case P7:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new c3[o](c),l)};return a},u3=e=>rB(new Map,e)(0),bo="",{toString:aB}={},{keys:sB}=Object,ru=e=>{const t=typeof e;if(t!=="object"||!e)return[Vm,t];const n=aB.call(e).slice(8,-1);switch(n){case"Array":return[mu,bo];case"Object":return[um,bo];case"Date":return[eg,bo];case"RegExp":return[tg,bo];case"Map":return[ng,bo];case"Set":return[rg,bo];case"DataView":return[mu,n]}return n.includes("Array")?[mu,n]:n.includes("Error")?[B7,n]:[um,n]},C0=([e,t])=>e===Vm&&(t==="function"||t==="symbol"),lB=(e,t,n,a)=>{const l=(c,d)=>{const m=a.push(c)-1;return n.set(d,m),m},o=c=>{if(n.has(c))return n.get(c);let[d,m]=ru(c);switch(d){case Vm:{let p=c;switch(m){case"bigint":d=P7,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return l([L7],c)}return l([d,p],c)}case mu:{if(m){let y=c;return m==="DataView"?y=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(c)),l([m,[...y]],c)}const p=[],x=l([d,p],c);for(const y of c)p.push(o(y));return x}case um:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],x=l([d,p],c);for(const y of sB(c))(e||!C0(ru(c[y])))&&p.push([o(y),o(c[y])]);return x}case eg:return l([d,c.toISOString()],c);case tg:{const{source:p,flags:x}=c;return l([d,{source:p,flags:x}],c)}case ng:{const p=[],x=l([d,p],c);for(const[y,b]of c)(e||!(C0(ru(y))||C0(ru(b))))&&p.push([o(y),o(b)]);return x}case rg:{const p=[],x=l([d,p],c);for(const y of c)(e||!C0(ru(y)))&&p.push(o(y));return x}}const{message:f}=c;return l([d,{name:m,message:f}],c)};return o},d3=(e,{json:t,lossy:n}={})=>{const a=[];return lB(!(t||n),!!t,new Map,a)(e),a},dm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u3(d3(e,t)):structuredClone(e):(e,t)=>u3(d3(e,t));function iB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function cB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||iB,a=e.options.footnoteBackLabel||oB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[m]);if(!f)continue;const p=e.all(f),x=String(f.identifier).toUpperCase(),y=ec(x.toLowerCase());let b=0;const N=[],k=e.footnoteCounts.get(x);for(;k!==void 0&&++b<=k;){N.length>0&&N.push({type:"text",value:" "});let M=typeof n=="string"?n:n(m,b);typeof M=="string"&&(M={type:"text",value:M}),N.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,b),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const M=S.children[S.children.length-1];M&&M.type==="text"?M.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...N)}else p.push(...N);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,T),d.push(T)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...dm(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
`}]}}const Gu=(function(e){if(e==null)return hB;if(typeof e=="function")return Gm(e);if(typeof e=="object")return Array.isArray(e)?uB(e):dB(e);if(typeof e=="string")return mB(e);throw new Error("Expected function, string, or object as test")});function uB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Gu(e[n]);return Gm(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function dB(e){const t=e;return Gm(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function mB(e){return Gm(t);function t(n){return n&&n.type===e}}function Gm(e){return t;function t(n,a,l){return!!(fB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function hB(){return!0}function fB(e){return e!==null&&typeof e=="object"&&"type"in e}const F7=[],pB=!0,Ux=!1,I7="skip";function ag(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Gu(l),c=a?-1:1;d(e,void 0,[])();function d(m,f,p){const x=m&&typeof m=="object"?m:{};if(typeof x.type=="string"){const b=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=F7,N,k,S;if((!t||o(m,f,p[p.length-1]||void 0))&&(b=xB(n(m,p)),b[0]===Ux))return b;if("children"in m&&m.children){const T=m;if(T.children&&b[0]!==I7)for(k=(a?T.children.length:-1)+c,S=p.concat(T);k>-1&&k<T.children.length;){const M=T.children[k];if(N=d(M,k,S)(),N[0]===Ux)return N;k=typeof N[1]=="number"?N[1]:k+c}}return b}}}function xB(e){return Array.isArray(e)?e:typeof e=="number"?[pB,e]:e==null?F7:[e]}function sg(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),ag(e,o,d,l);function d(m,f){const p=f[f.length-1],x=p?p.children.indexOf(m):void 0;return c(m,x,p)}}const $x={}.hasOwnProperty,gB={};function vB(e,t){const n=t||gB,a=new Map,l=new Map,o=new Map,c={...nB,...n.handlers},d={all:f,applyData:bB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:yB,wrap:jB};return sg(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const x=p.type==="definition"?a:l,y=String(p.identifier).toUpperCase();x.has(y)||x.set(y,p)}}),d;function m(p,x){const y=p.type,b=d.handlers[y];if($x.call(d.handlers,y)&&b)return b(d,p,x);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in p){const{children:k,...S}=p,T=dm(S);return T.children=d.all(p),T}return dm(p)}return(d.options.unknownHandler||wB)(d,p,x)}function f(p){const x=[];if("children"in p){const y=p.children;let b=-1;for(;++b<y.length;){const N=d.one(y[b],p);if(N){if(b&&y[b-1].type==="break"&&(!Array.isArray(N)&&N.type==="text"&&(N.value=m3(N.value)),!Array.isArray(N)&&N.type==="element")){const k=N.children[0];k&&k.type==="text"&&(k.value=m3(k.value))}Array.isArray(N)?x.push(...N):x.push(N)}}}return x}}function yB(e,t){e.position&&(t.position=oO(e))}function bB(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,dm(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function wB(e,t){const n=t.data||{},a="value"in t&&!($x.call(n,"hProperties")||$x.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function jB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
`});++a<e.length;)a&&n.push({type:"text",value:`
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function m3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function h3(e,t){const n=vB(e,t),a=n.one(e,void 0),l=cB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
`},l),o}function NB(e,t){return e&&"run"in e?async function(n,a){const l=h3(n,{file:a,...t});await e.run(l,a)}:function(n,a){return h3(n,{file:a,...e||t})}}function f3(e){if(e)throw e}var Ip,p3;function SB(){if(p3)return Ip;p3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),x=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!x)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},c=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},d=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(a)return a(f,p).value}else return;return f[p]};return Ip=function m(){var f,p,x,y,b,N,k=arguments[0],S=1,T=arguments.length,M=!1;for(typeof k=="boolean"&&(M=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<T;++S)if(f=arguments[S],f!=null)for(p in f)x=d(k,p),y=d(f,p),k!==y&&(M&&y&&(o(y)||(b=l(y)))?(b?(b=!1,N=x&&l(x)?x:[]):N=x&&o(x)?x:{},c(k,{name:p,newValue:m(M,N,y)})):typeof y<"u"&&c(k,{name:p,newValue:y}));return k},Ip}var kB=SB();const qp=B5(kB);function Vx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function CB(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...l);function d(m,...f){const p=e[++o];let x=-1;if(m){c(m);return}for(;++x<l.length;)(f[x]===null||f[x]===void 0)&&(f[x]=l[x]);l=f,p?TB(p,d)(...f):c(null,...f)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function TB(e,t){let n;return a;function a(...c){const d=e.length>c.length;let m;d&&c.push(l);try{m=e.apply(this,c)}catch(f){const p=f;if(d&&n)throw p;return l(p)}d||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...d){n||(n=!0,t(c,...d))}function o(c){l(null,c)}}const Ka={basename:_B,dirname:EB,extname:MB,join:AB,sep:"/"};function _B(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Yu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),d>-1&&(e.codePointAt(l)===t.codePointAt(d--)?d<0&&(a=l):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function EB(e){if(Yu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function MB(e){Yu(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function AB(...e){let t=-1,n;for(;++t<e.length;)Yu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":DB(n)}function DB(e){Yu(e);const t=e.codePointAt(0)===47;let n=zB(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zB(e,t){let n="",a=0,l=-1,o=0,c=-1,d,m;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function Yu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OB={cwd:RB};function RB(){return"/"}function Gx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LB(e){if(typeof e=="string")e=new URL(e);else if(!Gx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return BB(e)}function BB(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Hp=["history","path","basename","stem","extname","dirname"];class q7{constructor(t){let n;t?Gx(t)?n={path:t}:typeof t=="string"||PB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":OB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Hp.length;){const o=Hp[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Hp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Ka.basename(this.path):void 0}set basename(t){$p(t,"basename"),Up(t,"basename"),this.path=Ka.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ka.dirname(this.path):void 0}set dirname(t){x3(this.basename,"dirname"),this.path=Ka.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ka.extname(this.path):void 0}set extname(t){if(Up(t,"extname"),x3(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ka.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Gx(t)&&(t=LB(t)),$p(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ka.basename(this.path,this.extname):void 0}set stem(t){$p(t,"stem"),Up(t,"stem"),this.path=Ka.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new Nr(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Up(e,t){if(e&&e.includes(Ka.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ka.sep+"`")}function $p(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function x3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FB=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),IB={}.hasOwnProperty;class lg extends FB{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CB()}copy(){const t=new lg;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(qp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Yp("data",this.frozen),this.namespace[t]=n,this):IB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Yp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=T0(t),a=this.parser||this.Parser;return Vp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Vp("process",this.parser||this.Parser),Gp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const d=T0(t),m=a.parse(d);a.run(m,d,function(p,x,y){if(p||!x||!y)return f(p);const b=x,N=a.stringify(b,y);UB(N)?y.value=N:y.result=N,f(p,y)});function f(p,x){p||!x?c(p):o?o(x):n(void 0,x)}}}processSync(t){let n=!1,a;return this.freeze(),Vp("processSync",this.parser||this.Parser),Gp("processSync",this.compiler||this.Compiler),this.process(t,l),v3("processSync","process",n),a;function l(o,c){n=!0,f3(o),a=c}}run(t,n,a){g3(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,d){const m=T0(n);l.run(t,m,f);function f(p,x,y){const b=x||t;p?d(p):c?c(b):a(void 0,b,y)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),v3("runSync","run",a),l;function o(c,d){f3(c),l=d,a=!0}}stringify(t,n){this.freeze();const a=T0(n),l=this.compiler||this.Compiler;return Gp("stringify",l),g3(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Yp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")m(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...x]=f;m(p,x)}else c(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function c(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(f.plugins),f.settings&&(l.settings=qp(!0,l.settings,f.settings))}function d(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const x=f[p];o(x)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function m(f,p){let x=-1,y=-1;for(;++x<a.length;)if(a[x][0]===f){y=x;break}if(y===-1)a.push([f,...p]);else if(p.length>0){let[b,...N]=p;const k=a[y][1];Vx(k)&&Vx(b)&&(b=qp(!0,k,b)),a[y]=[f,b,...N]}}}}const qB=new lg().freeze();function Vp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Yp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g3(e){if(!Vx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function T0(e){return HB(e)?e:new q7(e)}function HB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UB(e){return typeof e=="string"||$B(e)}function $B(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y3=[],b3={allowDangerousHtml:!0},GB=/^(https?|ircs?|mailto|xmpp)$/i,YB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WB(e){const t=XB(e),n=KB(e);return QB(t.runSync(t.parse(n),n),e)}function XB(e){const t=e.rehypePlugins||y3,n=e.remarkPlugins||y3,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b3}:b3;return qB().use(ML).use(n).use(NB,a).use(t)}function KB(e){const t=e.children||"",n=new q7;return typeof t=="string"&&(n.value=t),n}function QB(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,m=t.urlTransform||ZB;for(const p of YB)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+VB+p.id,void 0);return sg(e,f),hO(e,{Fragment:r.Fragment,components:l,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function f(p,x,y){if(p.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let b;for(b in Bp)if(Object.hasOwn(Bp,b)&&Object.hasOwn(p.properties,b)){const N=p.properties[b],k=Bp[b];(k===null||k.includes(p.tagName))&&(p.properties[b]=m(String(N||""),b,p))}}if(p.type==="element"){let b=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!b&&a&&typeof x=="number"&&(b=!a(p,x,y)),b&&y&&typeof x=="number")return d&&p.children?y.children.splice(x,1,...p.children):y.children.splice(x,1),x}}}function ZB(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||GB.test(e.slice(0,t))?e:""}function w3(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}function JB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eP(e,t,n){const l=Gu((n||{}).ignore||[]),o=tP(t);let c=-1;for(;++c<o.length;)ag(e,"text",d);function d(f,p){let x=-1,y;for(;++x<p.length;){const b=p[x],N=y?y.children:void 0;if(l(b,N?N.indexOf(b):void 0,y))return;y=b}if(y)return m(f,p)}function m(f,p){const x=p[p.length-1],y=o[c][0],b=o[c][1];let N=0;const S=x.children.indexOf(f);let T=!1,M=[];y.lastIndex=0;let A=y.exec(f.value);for(;A;){const R=A.index,B={index:A.index,input:A.input,stack:[...p,f]};let O=b(...A,B);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?y.lastIndex=R+1:(N!==R&&M.push({type:"text",value:f.value.slice(N,R)}),Array.isArray(O)?M.push(...O):O&&M.push(O),N=R+A[0].length,T=!0),!y.global)break;A=y.exec(f.value)}return T?(N<f.value.length&&M.push({type:"text",value:f.value.slice(N)}),x.children.splice(S,1,...M)):M=[f],S+M.length}}function tP(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([nP(l[0]),rP(l[1])])}return t}function nP(e){return typeof e=="string"?new RegExp(JB(e),"g"):e}function rP(e){return typeof e=="function"?e:function(){return e}}const Wp="phrasing",Xp=["autolink","link","image","label"];function aP(){return{transforms:[dP],enter:{literalAutolink:lP,literalAutolinkEmail:Kp,literalAutolinkHttp:Kp,literalAutolinkWww:Kp},exit:{literalAutolink:uP,literalAutolinkEmail:cP,literalAutolinkHttp:iP,literalAutolinkWww:oP}}}function sP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Wp,notInConstruct:Xp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Wp,notInConstruct:Xp},{character:":",before:"[ps]",after:"\\/",inConstruct:Wp,notInConstruct:Xp}]}}function lP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kp(e){this.config.enter.autolinkProtocol.call(this,e)}function iP(e){this.config.exit.autolinkProtocol.call(this,e)}function oP(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function cP(e){this.config.exit.autolinkEmail.call(this,e)}function uP(e){this.exit(e)}function dP(e){eP(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,mP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hP]],{ignore:["link","linkReference"]})}function mP(e,t,n,a,l){let o="";if(!H7(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!fP(n)))return!1;const c=pP(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function hP(e,t,n,a){return!H7(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function fP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function pP(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=w3(e,"(");let o=w3(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function H7(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||yi(n)||Um(n))&&(!t||n!==47)}U7.peek=SP;function xP(){this.buffer()}function gP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vP(){this.buffer()}function yP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function bP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wP(e){this.exit(e)}function jP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NP(e){this.exit(e)}function SP(){return"["}function U7(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=l.move("]"),o}function kP(){return{enter:{gfmFootnoteCallString:xP,gfmFootnoteCall:gP,gfmFootnoteDefinitionLabelString:vP,gfmFootnoteDefinition:yP},exit:{gfmFootnoteCallString:bP,gfmFootnoteCall:wP,gfmFootnoteDefinitionLabelString:jP,gfmFootnoteDefinition:NP}}}function CP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:U7},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const d=o.createTracker(c);let m=d.move("[^");const f=o.enter("footnoteDefinition"),p=o.enter("label");return m+=d.move(o.safe(o.associationId(a),{before:m,after:"]"})),p(),m+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),m+=d.move((t?`
`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?$7:TP))),f(),m}}function TP(e,t,n){return t===0?e:$7(e,t,n)}function $7(e,t,n){return(n?"":" ")+e}const _P=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];V7.peek=zP;function EP(){return{canContainEols:["delete"],enter:{strikethrough:AP},exit:{strikethrough:DP}}}function MP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_P}],handlers:{delete:V7}}}function AP(e){this.enter({type:"delete",children:[]},e)}function DP(e){this.exit(e)}function V7(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function zP(){return"~"}function OP(e){return e.length}function RP(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||OP,o=[],c=[],d=[],m=[];let f=0,p=-1;for(;++p<e.length;){const k=[],S=[];let T=-1;for(e[p].length>f&&(f=e[p].length);++T<e[p].length;){const M=LP(e[p][T]);if(n.alignDelimiters!==!1){const A=l(M);S[T]=A,(m[T]===void 0||A>m[T])&&(m[T]=A)}k.push(M)}c[p]=k,d[p]=S}let x=-1;if(typeof a=="object"&&"length"in a)for(;++x<f;)o[x]=j3(a[x]);else{const k=j3(a);for(;++x<f;)o[x]=k}x=-1;const y=[],b=[];for(;++x<f;){const k=o[x];let S="",T="";k===99?(S=":",T=":"):k===108?S=":":k===114&&(T=":");let M=n.alignDelimiters===!1?1:Math.max(1,m[x]-S.length-T.length);const A=S+"-".repeat(M)+T;n.alignDelimiters!==!1&&(M=S.length+M+T.length,M>m[x]&&(m[x]=M),b[x]=M),y[x]=A}c.splice(1,0,y),d.splice(1,0,b),p=-1;const N=[];for(;++p<c.length;){const k=c[p],S=d[p];x=-1;const T=[];for(;++x<f;){const M=k[x]||"";let A="",R="";if(n.alignDelimiters!==!1){const B=m[x]-(S[x]||0),O=o[x];O===114?A=" ".repeat(B):O===99?B%2?(A=" ".repeat(B/2+.5),R=" ".repeat(B/2-.5)):(A=" ".repeat(B/2),R=A):R=" ".repeat(B)}n.delimiterStart!==!1&&!x&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||x)&&T.push(" "),n.alignDelimiters!==!1&&T.push(A),T.push(M),n.alignDelimiters!==!1&&T.push(R),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||x!==f-1)&&T.push("|")}N.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return N.join(`
`)}function LP(e){return e==null?"":String(e)}function j3(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function BP(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),PP);return l(),c}function PP(e,t,n){return">"+(n?"":" ")+e}function FP(e,t){return N3(e,t.inConstruct,!0)&&!N3(e,t.notInConstruct,!1)}function N3(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function S3(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
`&&FP(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
`}function G7(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function IP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function qP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function HP(e,t,n,a){const l=qP(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(IP(e,n)){const x=n.enter("codeIndented"),y=n.indentLines(o,UP);return x(),y}const d=n.createTracker(a),m=l.repeat(Math.max(G7(o,l)+1,3)),f=n.enter("codeFenced");let p=d.move(m);if(e.lang){const x=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),x()}if(e.lang&&e.meta){const x=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
`,encode:["`"],...d.current()})),x()}return p+=d.move(`
`),o&&(p+=d.move(o+`
`)),p+=d.move(m),f(),p}function UP(e,t,n){return(n?"":" ")+e}function ig(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $P(e,t,n,a){const l=ig(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const m=n.createTracker(a);let f=m.move("[");return f+=m.move(n.safe(n.associationId(e),{before:f,after:"]",...m.current()})),f+=m.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=m.move("<"),f+=m.move(n.safe(e.url,{before:f,after:">",...m.current()})),f+=m.move(">")):(d=n.enter("destinationRaw"),f+=m.move(n.safe(e.url,{before:f,after:e.title?" ":`
`,...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=m.move(" "+l),f+=m.move(n.safe(e.title,{before:f,after:l,...m.current()})),f+=m.move(l),d()),c(),f}function VP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function wu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mm(e,t,n){const a=Ho(e),l=Ho(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Y7.peek=GP;function Y7(e,t,n,a){const l=VP(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:d,...c.current()}));const f=m.charCodeAt(0),p=mm(a.before.charCodeAt(a.before.length-1),f,l);p.inside&&(m=wu(f)+m.slice(1));const x=m.charCodeAt(m.length-1),y=mm(a.after.charCodeAt(0),x,l);y.inside&&(m=m.slice(0,-1)+wu(x));const b=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+b}function GP(e,t,n){return n.options.emphasis||"*"}function YP(e,t){let n=!1;return sg(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Ux}),!!((!e.depth||e.depth<3)&&Q1(e)&&(t.options.setext||n))}function WP(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(YP(e,n)){const p=n.enter("headingSetext"),x=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
`,after:`
`});return x(),p(),y+`
`+(l===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
`))+1))}const c="#".repeat(l),d=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
`,...o.current()});return/^[\t ]/.test(f)&&(f=wu(f.charCodeAt(0))+f.slice(1)),f=f?c+" "+f:c,n.options.closeAtx&&(f+=" "+c),m(),d(),f}W7.peek=XP;function W7(e){return e.value||""}function XP(){return"<"}X7.peek=KP;function X7(e,t,n,a){const l=ig(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const m=n.createTracker(a);let f=m.move("![");return f+=m.move(n.safe(e.alt,{before:f,after:"]",...m.current()})),f+=m.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=m.move("<"),f+=m.move(n.safe(e.url,{before:f,after:">",...m.current()})),f+=m.move(">")):(d=n.enter("destinationRaw"),f+=m.move(n.safe(e.url,{before:f,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=m.move(" "+l),f+=m.move(n.safe(e.title,{before:f,after:l,...m.current()})),f+=m.move(l),d()),f+=m.move(")"),c(),f}function KP(){return"!"}K7.peek=QP;function K7(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("![");const f=n.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const x=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),l==="full"||!f||f!==x?m+=d.move(x+"]"):l==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function QP(){return"!"}Q7.peek=ZP;function Q7(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],d=n.compilePattern(c);let m;if(c.atBreak)for(;m=d.exec(a);){let f=m.index;a.charCodeAt(f)===10&&a.charCodeAt(f-1)===13&&f--,a=a.slice(0,f)+" "+a.slice(m.index+1)}}return l+a+l}function ZP(){return"`"}function Z7(e,t){const n=Q1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}J7.peek=JP;function J7(e,t,n,a){const l=ig(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,m;if(Z7(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let x=c.move("<");return x+=c.move(n.containerPhrasing(e,{before:x,after:">",...c.current()})),x+=c.move(">"),d(),n.stack=p,x}d=n.enter("link"),m=n.enter("label");let f=c.move("[");return f+=c.move(n.containerPhrasing(e,{before:f,after:"](",...c.current()})),f+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(m=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),f+=c.move(" "+l),f+=c.move(n.safe(e.title,{before:f,after:l,...c.current()})),f+=c.move(l),m()),f+=c.move(")"),d(),f}function JP(e,t,n){return Z7(e,n)?"<":"["}e8.peek=eF;function e8(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("[");const f=n.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const x=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),l==="full"||!f||f!==x?m+=d.move(x+"]"):l==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function eF(){return"["}function og(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function tF(e){const t=og(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function nF(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function t8(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function rF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?nF(n):og(n);const d=e.ordered?c==="."?")":".":tF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),t8(n)===c&&p){let x=-1;for(;++x<e.children.length;){const y=e.children[x];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=d),n.bulletCurrent=c;const f=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),f}function aF(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function sF(e,t,n,a){const l=aF(n);let o=n.bulletCurrent||og(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const m=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,d.current()),p);return m(),f;function p(x,y,b){return y?(b?"":" ".repeat(c))+x:(b?o:o+" ".repeat(c-o.length))+x}}function lF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const iF=Gu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oF(e,t,n,a){return(e.children.some(function(c){return iF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function cF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}n8.peek=uF;function n8(e,t,n,a){const l=cF(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:d,...c.current()}));const f=m.charCodeAt(0),p=mm(a.before.charCodeAt(a.before.length-1),f,l);p.inside&&(m=wu(f)+m.slice(1));const x=m.charCodeAt(m.length-1),y=mm(a.after.charCodeAt(0),x,l);y.inside&&(m=m.slice(0,-1)+wu(x));const b=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+b}function uF(e,t,n){return n.options.strong||"*"}function dF(e,t,n,a){return n.safe(e.value,a)}function mF(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function hF(e,t,n){const a=(t8(n)+(n.options.ruleSpaces?" ":"")).repeat(mF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const r8={blockquote:BP,break:S3,code:HP,definition:$P,emphasis:Y7,hardBreak:S3,heading:WP,html:W7,image:X7,imageReference:K7,inlineCode:Q7,link:J7,linkReference:e8,list:rF,listItem:sF,paragraph:lF,root:oF,strong:n8,text:dF,thematicBreak:hF};function fF(){return{enter:{table:pF,tableData:k3,tableHeader:k3,tableRow:gF},exit:{codeText:vF,table:xF,tableData:Qp,tableHeader:Qp,tableRow:Qp}}}function pF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function xF(e){this.exit(e),this.data.inTable=void 0}function gF(e){this.enter({type:"tableRow",children:[]},e)}function Qp(e){this.exit(e)}function k3(e){this.enter({type:"tableCell",children:[]},e)}function vF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yF(e,t){return t==="|"?t:e}function bF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:m,tableRow:d}};function c(b,N,k,S){return f(p(b,k,S),b.align)}function d(b,N,k,S){const T=x(b,k,S),M=f([T]);return M.slice(0,M.indexOf(`
`))}function m(b,N,k,S){const T=k.enter("tableCell"),M=k.enter("phrasing"),A=k.containerPhrasing(b,{...S,before:o,after:o});return M(),T(),A}function f(b,N){return RP(b,{align:N,alignDelimiters:a,padding:n,stringLength:l})}function p(b,N,k){const S=b.children;let T=-1;const M=[],A=N.enter("table");for(;++T<S.length;)M[T]=x(S[T],N,k);return A(),M}function x(b,N,k){const S=b.children;let T=-1;const M=[],A=N.enter("tableRow");for(;++T<S.length;)M[T]=m(S[T],b,N,k);return A(),M}function y(b,N,k){let S=r8.inlineCode(b,N,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function wF(){return{exit:{taskListCheckValueChecked:C3,taskListCheckValueUnchecked:C3,paragraph:NF}}}function jF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SF}}}function C3(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function NF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){c=d;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function SF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(c);let m=r8.listItem(e,t,n,{...a,...d.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),m;function f(p){return p+c}}function kF(){return[aP(),kP(),EP(),fF(),wF()]}function CF(e){return{extensions:[sP(),CP(e),MP(),bF(e),jF()]}}const TF={tokenize:zF,partial:!0},a8={tokenize:OF,partial:!0},s8={tokenize:RF,partial:!0},l8={tokenize:LF,partial:!0},_F={tokenize:BF,partial:!0},i8={name:"wwwAutolink",tokenize:AF,previous:c8},o8={name:"protocolAutolink",tokenize:DF,previous:u8},Us={name:"emailAutolink",tokenize:MF,previous:d8},ls={};function EF(){return{text:ls}}let si=48;for(;si<123;)ls[si]=Us,si++,si===58?si=65:si===91&&(si=97);ls[43]=Us;ls[45]=Us;ls[46]=Us;ls[95]=Us;ls[72]=[Us,o8];ls[104]=[Us,o8];ls[87]=[Us,i8];ls[119]=[Us,i8];function MF(e,t,n){const a=this;let l,o;return c;function c(x){return!Yx(x)||!d8.call(a,a.previous)||cg(a.events)?n(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(x))}function d(x){return Yx(x)?(e.consume(x),d):x===64?(e.consume(x),m):n(x)}function m(x){return x===46?e.check(_F,p,f)(x):x===45||x===95||wr(x)?(o=!0,e.consume(x),m):p(x)}function f(x){return e.consume(x),l=!0,m}function p(x){return o&&l&&Tr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(x)):n(x)}}function AF(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!c8.call(a,a.previous)||cg(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(TF,e.attempt(a8,e.attempt(s8,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function DF(e,t,n){const a=this;let l="",o=!1;return c;function c(x){return(x===72||x===104)&&u8.call(a,a.previous)&&!cg(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(x),e.consume(x),d):n(x)}function d(x){if(Tr(x)&&l.length<5)return l+=String.fromCodePoint(x),e.consume(x),d;if(x===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(x),m}return n(x)}function m(x){return x===47?(e.consume(x),o?f:(o=!0,m)):n(x)}function f(x){return x===null||cm(x)||pn(x)||yi(x)||Um(x)?n(x):e.attempt(a8,e.attempt(s8,p),n)(x)}function p(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(x)}}function zF(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function OF(e,t,n){let a,l,o;return c;function c(f){return f===46||f===95?e.check(l8,m,d)(f):f===null||pn(f)||yi(f)||f!==45&&Um(f)?m(f):(o=!0,e.consume(f),c)}function d(f){return f===95?a=!0:(l=a,a=void 0),e.consume(f),c}function m(f){return l||a||!o?n(f):t(f)}}function RF(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(l8,t,o)(c):c===null||pn(c)||yi(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function LF(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||pn(d)||yi(d)?t(d):n(d)}function l(d){return d===null||d===40||d===91||pn(d)||yi(d)?t(d):a(d)}function o(d){return Tr(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):Tr(d)?(e.consume(d),c):n(d)}}function BF(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return wr(o)?n(o):t(o)}}function c8(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||pn(e)}function u8(e){return!Tr(e)}function d8(e){return!(e===47||Yx(e))}function Yx(e){return e===43||e===45||e===46||e===95||wr(e)}function cg(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const PF={tokenize:GF,partial:!0};function FF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:UF,continuation:{tokenize:$F},exit:VF}},text:{91:{name:"gfmFootnoteCall",tokenize:HF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:IF,resolveTo:qF}}}}function IF(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return d;function d(m){if(!c||!c._balanced)return n(m);const f=qa(a.sliceSerialize({start:c.end,end:a.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function qF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function HF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),m}function m(x){return x!==94?n(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(x){if(o>999||x===93&&!c||x===null||x===91||pn(x))return n(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(qa(a.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(x)}return pn(x)||(c=!0),o++,e.consume(x),x===92?p:f}function p(x){return x===91||x===92||x===93?(e.consume(x),o++,f):f(x)}}function UF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return m;function m(N){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(N){return N===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(N)}function p(N){if(c>999||N===93&&!d||N===null||N===91||pn(N))return n(N);if(N===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=qa(a.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return pn(N)||(d=!0),c++,e.consume(N),N===92?x:p}function x(N){return N===91||N===92||N===93?(e.consume(N),c++,p):p(N)}function y(N){return N===58?(e.enter("definitionMarker"),e.consume(N),e.exit("definitionMarker"),l.includes(o)||l.push(o),St(e,b,"gfmFootnoteDefinitionWhitespace")):n(N)}function b(N){return t(N)}}function $F(e,t,n){return e.check(Vu,t,e.attempt(PF,t,n))}function VF(e){e.exit("gfmFootnoteDefinition")}function GF(e,t,n){const a=this;return St(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function YF(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,d){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let f=m;for(;f--;)if(c[f][0]==="exit"&&c[f][1].type==="strikethroughSequenceTemporary"&&c[f][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[f][1].end.offset-c[f][1].start.offset){c[m][1].type="strikethroughSequence",c[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[f][1].start),end:Object.assign({},c[m][1].end)},x={type:"strikethroughText",start:Object.assign({},c[f][1].end),end:Object.assign({},c[m][1].start)},y=[["enter",p,d],["enter",c[f][1],d],["exit",c[f][1],d],["enter",x,d]],b=d.parser.constructs.insideSpan.null;b&&ua(y,y.length,0,$m(b,c.slice(f+1,m),d)),ua(y,y.length,0,[["exit",x,d],["enter",c[m][1],d],["exit",c[m][1],d],["exit",p,d]]),ua(c,f-1,m-f+3,y),m=f+y.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,d,m){const f=this.previous,p=this.events;let x=0;return y;function y(N){return f===126&&p[p.length-1][1].type!=="characterEscape"?m(N):(c.enter("strikethroughSequenceTemporary"),b(N))}function b(N){const k=Ho(f);if(N===126)return x>1?m(N):(c.consume(N),x++,b);if(x<2&&!n)return m(N);const S=c.exit("strikethroughSequenceTemporary"),T=Ho(N);return S._open=!T||T===2&&!!k,S._close=!k||k===2&&!!T,d(N)}}}class WF{constructor(){this.map=[]}add(t,n,a){XF(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function XF(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function KF(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function QF(){return{flow:{null:{name:"table",tokenize:ZF,resolveAll:JF}}}}function ZF(e,t,n){const a=this;let l=0,o=0,c;return d;function d(I){let G=a.events.length-1;for(;G>-1;){const J=a.events[G][1].type;if(J==="lineEnding"||J==="linePrefix")G--;else break}const ee=G>-1?a.events[G][1].type:null,Ne=ee==="tableHead"||ee==="tableRow"?O:m;return Ne===O&&a.parser.lazy[a.now().line]?n(I):Ne(I)}function m(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(c=!0,o+=1),p(I)}function p(I){return I===null?n(I):We(I)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),b):n(I):Mt(I)?St(e,p,"whitespace")(I):(o+=1,c&&(c=!1,l+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),x(I)))}function x(I){return I===null||I===124||pn(I)?(e.exit("data"),p(I)):(e.consume(I),I===92?y:x)}function y(I){return I===92||I===124?(e.consume(I),x):x(I)}function b(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),c=!1,Mt(I)?St(e,N,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):N(I))}function N(I){return I===45||I===58?S(I):I===124?(c=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):B(I)}function k(I){return Mt(I)?St(e,S,"whitespace")(I):S(I)}function S(I){return I===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),T):I===45?(o+=1,T(I)):I===null||We(I)?R(I):B(I)}function T(I){return I===45?(e.enter("tableDelimiterFiller"),M(I)):B(I)}function M(I){return I===45?(e.consume(I),M):I===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(I))}function A(I){return Mt(I)?St(e,R,"whitespace")(I):R(I)}function R(I){return I===124?N(I):I===null||We(I)?!c||l!==o?B(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):B(I)}function B(I){return n(I)}function O(I){return e.enter("tableRow"),L(I)}function L(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),L):I===null||We(I)?(e.exit("tableRow"),t(I)):Mt(I)?St(e,L,"whitespace")(I):(e.enter("data"),$(I))}function $(I){return I===null||I===124||pn(I)?(e.exit("data"),L(I)):(e.consume(I),I===92?U:$)}function U(I){return I===92||I===124?(e.consume(I),$):$(I)}}function JF(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,f,p,x;const y=new WF;for(;++n<e.length;){const b=e[n],N=b[1];b[0]==="enter"?N.type==="tableHead"?(d=!1,m!==0&&(T3(y,t,m,f,p),p=void 0,m=0),f={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(n,0,[["enter",f,t]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(a=!0,x=void 0,o=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(n,0,[["enter",p,t]])),l=N.type==="tableDelimiterRow"?2:p?3:1):l&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],x=_0(y,t,o,l,void 0,x),o=[0,0,0,0]),c[2]=n)):N.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],x=_0(y,t,o,l,void 0,x)),o=c,c=[o[1],n,0,0])):N.type==="tableHead"?(d=!0,m=n):N.type==="tableRow"||N.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],x=_0(y,t,o,l,n,x)):c[1]!==0&&(x=_0(y,t,c,l,n,x)),l=0):l&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&T3(y,t,m,f,p),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=KF(t.events,n))}return e}function _0(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},_o(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=_o(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=_o(t.events,n[2]),p=_o(t.events,n[3]),x={type:d,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",x,t]]),a!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const N=n[2]+1,k=n[3]-n[2]-1;e.add(N,k,[])}}e.add(n[3]+1,0,[["exit",x,t]])}return l!==void 0&&(o.end=Object.assign({},_o(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function T3(e,t,n,a,l){const o=[],c=_o(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function _o(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const eI={name:"tasklistCheck",tokenize:nI};function tI(){return{text:{91:eI}}}function nI(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return pn(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(m)}function d(m){return We(m)?t(m):Mt(m)?e.check({tokenize:rI},t,n)(m):n(m)}}function rI(e,t,n){return St(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function aI(e){return w7([EF(),FF(),YF(e),QF(),tI()])}const sI={};function lI(e){const t=this,n=e||sI,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(aI(n)),o.push(kF()),c.push(CF(n))}function iI(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:l,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(m){const f={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[f]}},m)}function t(){this.buffer()}function n(){const m=this.resume(),f=this.stack[this.stack.length-1];f.type,f.meta=m}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function l(m){const f=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=f;const x=p.data.hChildren[0];x.type,x.tagName,x.children.push({type:"text",value:f}),this.data.mathFlowInside=void 0}function o(m){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},m),this.buffer()}function c(m){const f=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=f,p.data.hChildren.push({type:"text",value:f})}function d(m){this.config.enter.data.call(this,m),this.config.exit.data.call(this,m)}}function oI(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=l,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,c,d,m){const f=o.value||"",p=d.createTracker(m),x="$".repeat(Math.max(G7(f,"$")+1,2)),y=d.enter("mathFlow");let b=p.move(x);if(o.meta){const N=d.enter("mathFlowMeta");b+=p.move(d.safe(o.meta,{after:`
`,before:b,encode:["$"],...p.current()})),N()}return b+=p.move(`
`),f&&(b+=p.move(f+`
`)),b+=p.move(x),y(),b}function a(o,c,d){let m=o.value||"",f=1;for(t||f++;new RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(m);)f++;const p="$".repeat(f);/[^ \r\n]/.test(m)&&(/^[ \r\n]/.test(m)&&/[ \r\n]$/.test(m)||/^\$|\$$/.test(m))&&(m=" "+m+" ");let x=-1;for(;++x<d.unsafe.length;){const y=d.unsafe[x];if(!y.atBreak)continue;const b=d.compilePattern(y);let N;for(;N=b.exec(m);){let k=N.index;m.codePointAt(k)===10&&m.codePointAt(k-1)===13&&k--,m=m.slice(0,k)+" "+m.slice(N.index+1)}}return p+m+p}function l(){return"$"}}const cI={tokenize:uI,concrete:!0,name:"mathFlow"},_3={tokenize:dI,partial:!0};function uI(e,t,n){const a=this,l=a.events[a.events.length-1],o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0;let c=0;return d;function d(M){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),m(M)}function m(M){return M===36?(e.consume(M),c++,m):c<2?n(M):(e.exit("mathFlowFenceSequence"),St(e,f,"whitespace")(M))}function f(M){return M===null||We(M)?x(M):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(M))}function p(M){return M===null||We(M)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),x(M)):M===36?n(M):(e.consume(M),p)}function x(M){return e.exit("mathFlowFence"),a.interrupt?t(M):e.attempt(_3,y,S)(M)}function y(M){return e.attempt({tokenize:T,partial:!0},S,b)(M)}function b(M){return(o?St(e,N,"linePrefix",o+1):N)(M)}function N(M){return M===null?S(M):We(M)?e.attempt(_3,y,S)(M):(e.enter("mathFlowValue"),k(M))}function k(M){return M===null||We(M)?(e.exit("mathFlowValue"),N(M)):(e.consume(M),k)}function S(M){return e.exit("mathFlow"),t(M)}function T(M,A,R){let B=0;return St(M,O,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function O(U){return M.enter("mathFlowFence"),M.enter("mathFlowFenceSequence"),L(U)}function L(U){return U===36?(B++,M.consume(U),L):B<c?R(U):(M.exit("mathFlowFenceSequence"),St(M,$,"whitespace")(U))}function $(U){return U===null||We(U)?(M.exit("mathFlowFence"),A(U)):R(U)}}}function dI(e,t,n){const a=this;return l;function l(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function mI(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:hI,previous:fI,name:"mathText"};function a(l,o,c){let d=0,m,f;return p;function p(k){return l.enter("mathText"),l.enter("mathTextSequence"),x(k)}function x(k){return k===36?(l.consume(k),d++,x):d<2&&!n?c(k):(l.exit("mathTextSequence"),y(k))}function y(k){return k===null?c(k):k===36?(f=l.enter("mathTextSequence"),m=0,N(k)):k===32?(l.enter("space"),l.consume(k),l.exit("space"),y):We(k)?(l.enter("lineEnding"),l.consume(k),l.exit("lineEnding"),y):(l.enter("mathTextData"),b(k))}function b(k){return k===null||k===32||k===36||We(k)?(l.exit("mathTextData"),y(k)):(l.consume(k),b)}function N(k){return k===36?(l.consume(k),m++,N):m===d?(l.exit("mathTextSequence"),l.exit("mathText"),o(k)):(f.type="mathTextData",b(k))}}}function hI(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="mathTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function fI(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function pI(e){return{flow:{36:cI},text:{36:mI(e)}}}class Ur{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Ur(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class da{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new da(n,Ur.range(this,t))}}class Ae{constructor(t,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+t,l,o,c=n&&n.loc;if(c&&c.start<=c.end){var d=c.lexer.input;l=c.start,o=c.end,l===d.length?a+=" at end of input: ":a+=" at position "+(l+1)+": ";var m=d.slice(l,o).replace(/[^]/g,"$&̲"),f;l>15?f="…"+d.slice(l-15,l):f=d.slice(0,l);var p;o+15<d.length?p=d.slice(o,o+15)+"…":p=d.slice(o),a+=f+m+p}var x=new Error(a);return x.name="ParseError",x.__proto__=Ae.prototype,x.position=l,l!=null&&o!=null&&(x.length=o-l),x.rawMessage=t,x}}Ae.prototype.__proto__=Error.prototype;var xI=function(t,n){return t===void 0?n:t},gI=/([A-Z])/g,vI=function(t){return t.replace(gI,"-$1").toLowerCase()},yI={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},bI=/[&><"']/g;function wI(e){return String(e).replace(bI,t=>yI[t])}var m8=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},jI=function(t){var n=m8(t);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},NI=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},SI=function(t){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Ut={deflt:xI,escape:wI,hyphenate:vI,getBaseElem:m8,isCharacterBox:jI,protocolFromUrl:SI},K0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function kI(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class ug{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n in K0)if(K0.hasOwnProperty(n)){var a=K0[n];this[n]=t[n]!==void 0?a.processor?a.processor(t[n]):t[n]:kI(a)}}reportNonstrict(t,n,a){var l=this.strict;if(typeof l=="function"&&(l=l(t,n,a)),!(!l||l==="ignore")){if(l===!0||l==="error")throw new Ae("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);l==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var l=this.strict;if(typeof l=="function")try{l=l(t,n,a)}catch{l="error"}return!l||l==="ignore"?!1:l===!0||l==="error"?!0:l==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if(t.url&&!t.protocol){var n=Ut.protocolFromUrl(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class vl{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Za[CI[this.id]]}sub(){return Za[TI[this.id]]}fracNum(){return Za[_I[this.id]]}fracDen(){return Za[EI[this.id]]}cramp(){return Za[MI[this.id]]}text(){return Za[AI[this.id]]}isTight(){return this.size>=2}}var dg=0,hm=1,Ro=2,Rs=3,ju=4,Ca=5,Uo=6,_r=7,Za=[new vl(dg,0,!1),new vl(hm,0,!0),new vl(Ro,1,!1),new vl(Rs,1,!0),new vl(ju,2,!1),new vl(Ca,2,!0),new vl(Uo,3,!1),new vl(_r,3,!0)],CI=[ju,Ca,ju,Ca,Uo,_r,Uo,_r],TI=[Ca,Ca,Ca,Ca,_r,_r,_r,_r],_I=[Ro,Rs,ju,Ca,Uo,_r,Uo,_r],EI=[Rs,Rs,Ca,Ca,_r,_r,_r,_r],MI=[hm,hm,Rs,Rs,Ca,Ca,_r,_r],AI=[dg,hm,Ro,Rs,Ro,Rs,Ro,Rs],tt={DISPLAY:Za[dg],TEXT:Za[Ro],SCRIPT:Za[ju],SCRIPTSCRIPT:Za[Uo]},Wx=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function DI(e){for(var t=0;t<Wx.length;t++)for(var n=Wx[t],a=0;a<n.blocks.length;a++){var l=n.blocks[a];if(e>=l[0]&&e<=l[1])return n.name}return null}var Q0=[];Wx.forEach(e=>e.blocks.forEach(t=>Q0.push(...t)));function h8(e){for(var t=0;t<Q0.length;t+=2)if(e>=Q0[t]&&e<=Q0[t+1])return!0;return!1}var wo=80,zI=function(t,n){return"M95,"+(622+t+n)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+t/2.075+" -"+t+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+t)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},OI=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+t/2.084+" -"+t+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+t)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},RI=function(t,n){return"M983 "+(10+t+n)+`
l`+t/3.13+" -"+t+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},LI=function(t,n){return"M424,"+(2398+t+n)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+t)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
h400000v`+(40+t)+"h-400000z"},BI=function(t,n){return"M473,"+(2713+t+n)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},PI=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},FI=function(t,n,a){var l=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
H742v`+l+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},II=function(t,n,a){n=1e3*n;var l="";switch(t){case"sqrtMain":l=zI(n,wo);break;case"sqrtSize1":l=OI(n,wo);break;case"sqrtSize2":l=RI(n,wo);break;case"sqrtSize3":l=LI(n,wo);break;case"sqrtSize4":l=BI(n,wo);break;case"sqrtTall":l=FI(n,wo,a)}return l},qI=function(t,n){switch(t){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},E3={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},HI=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Wu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){var t=n=>n.toText();return this.children.map(t).join("")}}var ts={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},E0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},M3={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function UI(e,t){ts[e]=t}function mg(e,t,n){if(!ts[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),l=ts[t][a];if(!l&&e[0]in M3&&(a=M3[e[0]].charCodeAt(0),l=ts[t][a]),!l&&n==="text"&&h8(a)&&(l=ts[t][77]),l)return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}var Zp={};function $I(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Zp[t]){var n=Zp[t]={cssEmPerMu:E0.quad[t]/18};for(var a in E0)E0.hasOwnProperty(a)&&(n[a]=E0[a][t])}return Zp[t]}var VI=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],A3=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],D3=function(t,n){return n.size<2?t:VI[t-1][n.size-1]};class Ds{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ds.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=A3[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in t)t.hasOwnProperty(a)&&(n[a]=t[a]);return new Ds(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:D3(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:A3[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=D3(Ds.BASESIZE,t);return this.size===n&&this.textSize===Ds.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ds.BASESIZE?["sizing","reset-size"+this.size,"size"+Ds.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=$I(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ds.BASESIZE=6;var Xx={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},GI={ex:!0,em:!0,mu:!0},f8=function(t){return typeof t!="string"&&(t=t.unit),t in Xx||t in GI||t==="ex"},Mn=function(t,n){var a;if(t.unit in Xx)a=Xx[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var l;if(n.style.isTight()?l=n.havingStyle(n.style.text()):l=n,t.unit==="ex")a=l.fontMetrics().xHeight;else if(t.unit==="em")a=l.fontMetrics().quad;else throw new Ae("Invalid unit: '"+t.unit+"'");l!==n&&(a*=l.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Le=function(t){return+t.toFixed(4)+"em"},El=function(t){return t.filter(n=>n).join(" ")},p8=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var l=n.getColor();l&&(this.style.color=l)}},x8=function(t){var n=document.createElement(t);n.className=El(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(n.style[a]=this.style[a]);for(var l in this.attributes)this.attributes.hasOwnProperty(l)&&n.setAttribute(l,this.attributes[l]);for(var o=0;o<this.children.length;o++)n.appendChild(this.children[o].toNode());return n},YI=/[\s"'>/=\x00-\x1f]/,g8=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Ut.escape(El(this.classes))+'"');var a="";for(var l in this.style)this.style.hasOwnProperty(l)&&(a+=Ut.hyphenate(l)+":"+this.style[l]+";");a&&(n+=' style="'+Ut.escape(a)+'"');for(var o in this.attributes)if(this.attributes.hasOwnProperty(o)){if(YI.test(o))throw new Ae("Invalid attribute name '"+o+"'");n+=" "+o+'="'+Ut.escape(this.attributes[o])+'"'}n+=">";for(var c=0;c<this.children.length;c++)n+=this.children[c].toMarkup();return n+="</"+t+">",n};class Xu{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,p8.call(this,t,a,l),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return x8.call(this,"span")}toMarkup(){return g8.call(this,"span")}}class hg{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,p8.call(this,n,l),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return x8.call(this,"a")}toMarkup(){return g8.call(this,"a")}}class WI{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t='<img src="'+Ut.escape(this.src)+'"'+(' alt="'+Ut.escape(this.alt)+'"'),n="";for(var a in this.style)this.style.hasOwnProperty(a)&&(n+=Ut.hyphenate(a)+":"+this.style[a]+";");return n&&(t+=' style="'+Ut.escape(n)+'"'),t+="'/>",t}}var XI={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ea{constructor(t,n,a,l,o,c,d,m){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=l||0,this.skew=o||0,this.width=c||0,this.classes=d||[],this.style=m||{},this.maxFontSize=0;var f=DI(this.text.charCodeAt(0));f&&this.classes.push(f+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=XI[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Le(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=El(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(n=n||document.createElement("span"),n.style[a]=this.style[a]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Ut.escape(El(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+this.italic+"em;");for(var l in this.style)this.style.hasOwnProperty(l)&&(a+=Ut.hyphenate(l)+":"+this.style[l]+";");a&&(t=!0,n+=' style="'+Ut.escape(a)+'"');var o=Ut.escape(this.text);return t?(n+=">",n+=o,n+="</span>",n):o}}class Fs{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ut.escape(this.attributes[n])+'"');t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Ml{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",E3[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Ut.escape(this.alternate)+'"/>':'<path d="'+Ut.escape(E3[this.pathName])+'"/>'}}class Kx{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ut.escape(this.attributes[n])+'"');return t+="/>",t}}function z3(e){if(e instanceof Ea)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function KI(e){if(e instanceof Xu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var QI={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ZI={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},yn={math:{},text:{}};function j(e,t,n,a,l,o){yn[e][l]={font:t,group:n,replace:a},o&&a&&(yn[e][a]=yn[e][l])}var C="math",_e="text",D="main",V="ams",kn="accent-token",Ie="bin",Mr="close",tc="inner",Je="mathord",Yn="op-token",ha="open",Ym="punct",Y="rel",$s="spacing",ae="textord";j(C,D,Y,"≡","\\equiv",!0);j(C,D,Y,"≺","\\prec",!0);j(C,D,Y,"≻","\\succ",!0);j(C,D,Y,"","\\sim",!0);j(C,D,Y,"⊥","\\perp");j(C,D,Y,"⪯","\\preceq",!0);j(C,D,Y,"⪰","\\succeq",!0);j(C,D,Y,"≃","\\simeq",!0);j(C,D,Y,"","\\mid",!0);j(C,D,Y,"≪","\\ll",!0);j(C,D,Y,"≫","\\gg",!0);j(C,D,Y,"≍","\\asymp",!0);j(C,D,Y,"∥","\\parallel");j(C,D,Y,"⋈","\\bowtie",!0);j(C,D,Y,"⌣","\\smile",!0);j(C,D,Y,"⊑","\\sqsubseteq",!0);j(C,D,Y,"⊒","\\sqsupseteq",!0);j(C,D,Y,"≐","\\doteq",!0);j(C,D,Y,"⌢","\\frown",!0);j(C,D,Y,"∋","\\ni",!0);j(C,D,Y,"∝","\\propto",!0);j(C,D,Y,"⊢","\\vdash",!0);j(C,D,Y,"⊣","\\dashv",!0);j(C,D,Y,"∋","\\owns");j(C,D,Ym,".","\\ldotp");j(C,D,Ym,"⋅","\\cdotp");j(C,D,ae,"#","\\#");j(_e,D,ae,"#","\\#");j(C,D,ae,"&","\\&");j(_e,D,ae,"&","\\&");j(C,D,ae,"ℵ","\\aleph",!0);j(C,D,ae,"∀","\\forall",!0);j(C,D,ae,"ℏ","\\hbar",!0);j(C,D,ae,"∃","\\exists",!0);j(C,D,ae,"∇","\\nabla",!0);j(C,D,ae,"♭","\\flat",!0);j(C,D,ae,"","\\ell",!0);j(C,D,ae,"♮","\\natural",!0);j(C,D,ae,"♣","\\clubsuit",!0);j(C,D,ae,"℘","\\wp",!0);j(C,D,ae,"♯","\\sharp",!0);j(C,D,ae,"♢","\\diamondsuit",!0);j(C,D,ae,"","\\Re",!0);j(C,D,ae,"♡","\\heartsuit",!0);j(C,D,ae,"","\\Im",!0);j(C,D,ae,"♠","\\spadesuit",!0);j(C,D,ae,"§","\\S",!0);j(_e,D,ae,"§","\\S");j(C,D,ae,"¶","\\P",!0);j(_e,D,ae,"¶","\\P");j(C,D,ae,"†","\\dag");j(_e,D,ae,"†","\\dag");j(_e,D,ae,"†","\\textdagger");j(C,D,ae,"‡","\\ddag");j(_e,D,ae,"‡","\\ddag");j(_e,D,ae,"‡","\\textdaggerdbl");j(C,D,Mr,"⎱","\\rmoustache",!0);j(C,D,ha,"⎰","\\lmoustache",!0);j(C,D,Mr,"⟯","\\rgroup",!0);j(C,D,ha,"⟮","\\lgroup",!0);j(C,D,Ie,"∓","\\mp",!0);j(C,D,Ie,"⊖","\\ominus",!0);j(C,D,Ie,"⊎","\\uplus",!0);j(C,D,Ie,"⊓","\\sqcap",!0);j(C,D,Ie,"","\\ast");j(C,D,Ie,"⊔","\\sqcup",!0);j(C,D,Ie,"◯","\\bigcirc",!0);j(C,D,Ie,"∙","\\bullet",!0);j(C,D,Ie,"‡","\\ddagger");j(C,D,Ie,"≀","\\wr",!0);j(C,D,Ie,"⨿","\\amalg");j(C,D,Ie,"&","\\And");j(C,D,Y,"⟵","\\longleftarrow",!0);j(C,D,Y,"⇐","\\Leftarrow",!0);j(C,D,Y,"⟸","\\Longleftarrow",!0);j(C,D,Y,"⟶","\\longrightarrow",!0);j(C,D,Y,"⇒","\\Rightarrow",!0);j(C,D,Y,"⟹","\\Longrightarrow",!0);j(C,D,Y,"↔","\\leftrightarrow",!0);j(C,D,Y,"⟷","\\longleftrightarrow",!0);j(C,D,Y,"⇔","\\Leftrightarrow",!0);j(C,D,Y,"⟺","\\Longleftrightarrow",!0);j(C,D,Y,"↦","\\mapsto",!0);j(C,D,Y,"⟼","\\longmapsto",!0);j(C,D,Y,"↗","\\nearrow",!0);j(C,D,Y,"↩","\\hookleftarrow",!0);j(C,D,Y,"↪","\\hookrightarrow",!0);j(C,D,Y,"↘","\\searrow",!0);j(C,D,Y,"↼","\\leftharpoonup",!0);j(C,D,Y,"⇀","\\rightharpoonup",!0);j(C,D,Y,"↙","\\swarrow",!0);j(C,D,Y,"↽","\\leftharpoondown",!0);j(C,D,Y,"⇁","\\rightharpoondown",!0);j(C,D,Y,"↖","\\nwarrow",!0);j(C,D,Y,"⇌","\\rightleftharpoons",!0);j(C,V,Y,"≮","\\nless",!0);j(C,V,Y,"","\\@nleqslant");j(C,V,Y,"","\\@nleqq");j(C,V,Y,"⪇","\\lneq",!0);j(C,V,Y,"≨","\\lneqq",!0);j(C,V,Y,"","\\@lvertneqq");j(C,V,Y,"⋦","\\lnsim",!0);j(C,V,Y,"⪉","\\lnapprox",!0);j(C,V,Y,"⊀","\\nprec",!0);j(C,V,Y,"⋠","\\npreceq",!0);j(C,V,Y,"⋨","\\precnsim",!0);j(C,V,Y,"⪹","\\precnapprox",!0);j(C,V,Y,"≁","\\nsim",!0);j(C,V,Y,"","\\@nshortmid");j(C,V,Y,"∤","\\nmid",!0);j(C,V,Y,"⊬","\\nvdash",!0);j(C,V,Y,"⊭","\\nvDash",!0);j(C,V,Y,"⋪","\\ntriangleleft");j(C,V,Y,"⋬","\\ntrianglelefteq",!0);j(C,V,Y,"⊊","\\subsetneq",!0);j(C,V,Y,"","\\@varsubsetneq");j(C,V,Y,"⫋","\\subsetneqq",!0);j(C,V,Y,"","\\@varsubsetneqq");j(C,V,Y,"≯","\\ngtr",!0);j(C,V,Y,"","\\@ngeqslant");j(C,V,Y,"","\\@ngeqq");j(C,V,Y,"⪈","\\gneq",!0);j(C,V,Y,"≩","\\gneqq",!0);j(C,V,Y,"","\\@gvertneqq");j(C,V,Y,"⋧","\\gnsim",!0);j(C,V,Y,"⪊","\\gnapprox",!0);j(C,V,Y,"⊁","\\nsucc",!0);j(C,V,Y,"⋡","\\nsucceq",!0);j(C,V,Y,"⋩","\\succnsim",!0);j(C,V,Y,"⪺","\\succnapprox",!0);j(C,V,Y,"≆","\\ncong",!0);j(C,V,Y,"","\\@nshortparallel");j(C,V,Y,"∦","\\nparallel",!0);j(C,V,Y,"⊯","\\nVDash",!0);j(C,V,Y,"⋫","\\ntriangleright");j(C,V,Y,"⋭","\\ntrianglerighteq",!0);j(C,V,Y,"","\\@nsupseteqq");j(C,V,Y,"⊋","\\supsetneq",!0);j(C,V,Y,"","\\@varsupsetneq");j(C,V,Y,"⫌","\\supsetneqq",!0);j(C,V,Y,"","\\@varsupsetneqq");j(C,V,Y,"⊮","\\nVdash",!0);j(C,V,Y,"⪵","\\precneqq",!0);j(C,V,Y,"⪶","\\succneqq",!0);j(C,V,Y,"","\\@nsubseteqq");j(C,V,Ie,"⊴","\\unlhd");j(C,V,Ie,"⊵","\\unrhd");j(C,V,Y,"↚","\\nleftarrow",!0);j(C,V,Y,"↛","\\nrightarrow",!0);j(C,V,Y,"⇍","\\nLeftarrow",!0);j(C,V,Y,"⇏","\\nRightarrow",!0);j(C,V,Y,"↮","\\nleftrightarrow",!0);j(C,V,Y,"⇎","\\nLeftrightarrow",!0);j(C,V,Y,"△","\\vartriangle");j(C,V,ae,"ℏ","\\hslash");j(C,V,ae,"▽","\\triangledown");j(C,V,ae,"◊","\\lozenge");j(C,V,ae,"Ⓢ","\\circledS");j(C,V,ae,"®","\\circledR");j(_e,V,ae,"®","\\circledR");j(C,V,ae,"∡","\\measuredangle",!0);j(C,V,ae,"∄","\\nexists");j(C,V,ae,"℧","\\mho");j(C,V,ae,"Ⅎ","\\Finv",!0);j(C,V,ae,"⅁","\\Game",!0);j(C,V,ae,"","\\backprime");j(C,V,ae,"▲","\\blacktriangle");j(C,V,ae,"▼","\\blacktriangledown");j(C,V,ae,"■","\\blacksquare");j(C,V,ae,"⧫","\\blacklozenge");j(C,V,ae,"★","\\bigstar");j(C,V,ae,"∢","\\sphericalangle",!0);j(C,V,ae,"∁","\\complement",!0);j(C,V,ae,"ð","\\eth",!0);j(_e,D,ae,"ð","ð");j(C,V,ae,"","\\diagup");j(C,V,ae,"╲","\\diagdown");j(C,V,ae,"□","\\square");j(C,V,ae,"□","\\Box");j(C,V,ae,"◊","\\Diamond");j(C,V,ae,"¥","\\yen",!0);j(_e,V,ae,"¥","\\yen",!0);j(C,V,ae,"✓","\\checkmark",!0);j(_e,V,ae,"✓","\\checkmark");j(C,V,ae,"ℶ","\\beth",!0);j(C,V,ae,"ℸ","\\daleth",!0);j(C,V,ae,"ℷ","\\gimel",!0);j(C,V,ae,"ϝ","\\digamma",!0);j(C,V,ae,"ϰ","\\varkappa");j(C,V,ha,"┌","\\@ulcorner",!0);j(C,V,Mr,"┐","\\@urcorner",!0);j(C,V,ha,"└","\\@llcorner",!0);j(C,V,Mr,"┘","\\@lrcorner",!0);j(C,V,Y,"≦","\\leqq",!0);j(C,V,Y,"⩽","\\leqslant",!0);j(C,V,Y,"⪕","\\eqslantless",!0);j(C,V,Y,"≲","\\lesssim",!0);j(C,V,Y,"⪅","\\lessapprox",!0);j(C,V,Y,"≊","\\approxeq",!0);j(C,V,Ie,"⋖","\\lessdot");j(C,V,Y,"⋘","\\lll",!0);j(C,V,Y,"≶","\\lessgtr",!0);j(C,V,Y,"⋚","\\lesseqgtr",!0);j(C,V,Y,"⪋","\\lesseqqgtr",!0);j(C,V,Y,"≑","\\doteqdot");j(C,V,Y,"≓","\\risingdotseq",!0);j(C,V,Y,"≒","\\fallingdotseq",!0);j(C,V,Y,"∽","\\backsim",!0);j(C,V,Y,"⋍","\\backsimeq",!0);j(C,V,Y,"⫅","\\subseteqq",!0);j(C,V,Y,"⋐","\\Subset",!0);j(C,V,Y,"⊏","\\sqsubset",!0);j(C,V,Y,"≼","\\preccurlyeq",!0);j(C,V,Y,"⋞","\\curlyeqprec",!0);j(C,V,Y,"≾","\\precsim",!0);j(C,V,Y,"⪷","\\precapprox",!0);j(C,V,Y,"⊲","\\vartriangleleft");j(C,V,Y,"⊴","\\trianglelefteq");j(C,V,Y,"⊨","\\vDash",!0);j(C,V,Y,"⊪","\\Vvdash",!0);j(C,V,Y,"⌣","\\smallsmile");j(C,V,Y,"⌢","\\smallfrown");j(C,V,Y,"≏","\\bumpeq",!0);j(C,V,Y,"≎","\\Bumpeq",!0);j(C,V,Y,"≧","\\geqq",!0);j(C,V,Y,"⩾","\\geqslant",!0);j(C,V,Y,"⪖","\\eqslantgtr",!0);j(C,V,Y,"≳","\\gtrsim",!0);j(C,V,Y,"⪆","\\gtrapprox",!0);j(C,V,Ie,"⋗","\\gtrdot");j(C,V,Y,"⋙","\\ggg",!0);j(C,V,Y,"≷","\\gtrless",!0);j(C,V,Y,"⋛","\\gtreqless",!0);j(C,V,Y,"⪌","\\gtreqqless",!0);j(C,V,Y,"≖","\\eqcirc",!0);j(C,V,Y,"≗","\\circeq",!0);j(C,V,Y,"≜","\\triangleq",!0);j(C,V,Y,"","\\thicksim");j(C,V,Y,"≈","\\thickapprox");j(C,V,Y,"⫆","\\supseteqq",!0);j(C,V,Y,"⋑","\\Supset",!0);j(C,V,Y,"⊐","\\sqsupset",!0);j(C,V,Y,"≽","\\succcurlyeq",!0);j(C,V,Y,"⋟","\\curlyeqsucc",!0);j(C,V,Y,"≿","\\succsim",!0);j(C,V,Y,"⪸","\\succapprox",!0);j(C,V,Y,"⊳","\\vartriangleright");j(C,V,Y,"⊵","\\trianglerighteq");j(C,V,Y,"⊩","\\Vdash",!0);j(C,V,Y,"","\\shortmid");j(C,V,Y,"∥","\\shortparallel");j(C,V,Y,"≬","\\between",!0);j(C,V,Y,"⋔","\\pitchfork",!0);j(C,V,Y,"∝","\\varpropto");j(C,V,Y,"◀","\\blacktriangleleft");j(C,V,Y,"∴","\\therefore",!0);j(C,V,Y,"∍","\\backepsilon");j(C,V,Y,"▶","\\blacktriangleright");j(C,V,Y,"∵","\\because",!0);j(C,V,Y,"⋘","\\llless");j(C,V,Y,"⋙","\\gggtr");j(C,V,Ie,"⊲","\\lhd");j(C,V,Ie,"⊳","\\rhd");j(C,V,Y,"≂","\\eqsim",!0);j(C,D,Y,"⋈","\\Join");j(C,V,Y,"≑","\\Doteq",!0);j(C,V,Ie,"∔","\\dotplus",!0);j(C,V,Ie,"","\\smallsetminus");j(C,V,Ie,"⋒","\\Cap",!0);j(C,V,Ie,"⋓","\\Cup",!0);j(C,V,Ie,"⩞","\\doublebarwedge",!0);j(C,V,Ie,"⊟","\\boxminus",!0);j(C,V,Ie,"⊞","\\boxplus",!0);j(C,V,Ie,"⋇","\\divideontimes",!0);j(C,V,Ie,"⋉","\\ltimes",!0);j(C,V,Ie,"⋊","\\rtimes",!0);j(C,V,Ie,"⋋","\\leftthreetimes",!0);j(C,V,Ie,"⋌","\\rightthreetimes",!0);j(C,V,Ie,"⋏","\\curlywedge",!0);j(C,V,Ie,"⋎","\\curlyvee",!0);j(C,V,Ie,"⊝","\\circleddash",!0);j(C,V,Ie,"⊛","\\circledast",!0);j(C,V,Ie,"⋅","\\centerdot");j(C,V,Ie,"⊺","\\intercal",!0);j(C,V,Ie,"⋒","\\doublecap");j(C,V,Ie,"⋓","\\doublecup");j(C,V,Ie,"⊠","\\boxtimes",!0);j(C,V,Y,"⇢","\\dashrightarrow",!0);j(C,V,Y,"⇠","\\dashleftarrow",!0);j(C,V,Y,"⇇","\\leftleftarrows",!0);j(C,V,Y,"⇆","\\leftrightarrows",!0);j(C,V,Y,"⇚","\\Lleftarrow",!0);j(C,V,Y,"↞","\\twoheadleftarrow",!0);j(C,V,Y,"↢","\\leftarrowtail",!0);j(C,V,Y,"↫","\\looparrowleft",!0);j(C,V,Y,"⇋","\\leftrightharpoons",!0);j(C,V,Y,"↶","\\curvearrowleft",!0);j(C,V,Y,"↺","\\circlearrowleft",!0);j(C,V,Y,"↰","\\Lsh",!0);j(C,V,Y,"⇈","\\upuparrows",!0);j(C,V,Y,"↿","\\upharpoonleft",!0);j(C,V,Y,"⇃","\\downharpoonleft",!0);j(C,D,Y,"⊶","\\origof",!0);j(C,D,Y,"⊷","\\imageof",!0);j(C,V,Y,"⊸","\\multimap",!0);j(C,V,Y,"↭","\\leftrightsquigarrow",!0);j(C,V,Y,"⇉","\\rightrightarrows",!0);j(C,V,Y,"⇄","\\rightleftarrows",!0);j(C,V,Y,"↠","\\twoheadrightarrow",!0);j(C,V,Y,"↣","\\rightarrowtail",!0);j(C,V,Y,"↬","\\looparrowright",!0);j(C,V,Y,"↷","\\curvearrowright",!0);j(C,V,Y,"↻","\\circlearrowright",!0);j(C,V,Y,"↱","\\Rsh",!0);j(C,V,Y,"⇊","\\downdownarrows",!0);j(C,V,Y,"↾","\\upharpoonright",!0);j(C,V,Y,"⇂","\\downharpoonright",!0);j(C,V,Y,"⇝","\\rightsquigarrow",!0);j(C,V,Y,"⇝","\\leadsto");j(C,V,Y,"⇛","\\Rrightarrow",!0);j(C,V,Y,"↾","\\restriction");j(C,D,ae,"","`");j(C,D,ae,"$","\\$");j(_e,D,ae,"$","\\$");j(_e,D,ae,"$","\\textdollar");j(C,D,ae,"%","\\%");j(_e,D,ae,"%","\\%");j(C,D,ae,"_","\\_");j(_e,D,ae,"_","\\_");j(_e,D,ae,"_","\\textunderscore");j(C,D,ae,"∠","\\angle",!0);j(C,D,ae,"∞","\\infty",!0);j(C,D,ae,"","\\prime");j(C,D,ae,"△","\\triangle");j(C,D,ae,"Γ","\\Gamma",!0);j(C,D,ae,"Δ","\\Delta",!0);j(C,D,ae,"Θ","\\Theta",!0);j(C,D,ae,"Λ","\\Lambda",!0);j(C,D,ae,"Ξ","\\Xi",!0);j(C,D,ae,"Π","\\Pi",!0);j(C,D,ae,"Σ","\\Sigma",!0);j(C,D,ae,"Υ","\\Upsilon",!0);j(C,D,ae,"Φ","\\Phi",!0);j(C,D,ae,"Ψ","\\Psi",!0);j(C,D,ae,"Ω","\\Omega",!0);j(C,D,ae,"A","Α");j(C,D,ae,"B","Β");j(C,D,ae,"E","Ε");j(C,D,ae,"Z","Ζ");j(C,D,ae,"H","Η");j(C,D,ae,"I","Ι");j(C,D,ae,"K","Κ");j(C,D,ae,"M","Μ");j(C,D,ae,"N","Ν");j(C,D,ae,"O","Ο");j(C,D,ae,"P","Ρ");j(C,D,ae,"T","Τ");j(C,D,ae,"X","Χ");j(C,D,ae,"¬","\\neg",!0);j(C,D,ae,"¬","\\lnot");j(C,D,ae,"","\\top");j(C,D,ae,"⊥","\\bot");j(C,D,ae,"∅","\\emptyset");j(C,V,ae,"∅","\\varnothing");j(C,D,Je,"α","\\alpha",!0);j(C,D,Je,"β","\\beta",!0);j(C,D,Je,"γ","\\gamma",!0);j(C,D,Je,"δ","\\delta",!0);j(C,D,Je,"ϵ","\\epsilon",!0);j(C,D,Je,"ζ","\\zeta",!0);j(C,D,Je,"η","\\eta",!0);j(C,D,Je,"θ","\\theta",!0);j(C,D,Je,"ι","\\iota",!0);j(C,D,Je,"κ","\\kappa",!0);j(C,D,Je,"λ","\\lambda",!0);j(C,D,Je,"μ","\\mu",!0);j(C,D,Je,"ν","\\nu",!0);j(C,D,Je,"ξ","\\xi",!0);j(C,D,Je,"ο","\\omicron",!0);j(C,D,Je,"π","\\pi",!0);j(C,D,Je,"ρ","\\rho",!0);j(C,D,Je,"σ","\\sigma",!0);j(C,D,Je,"τ","\\tau",!0);j(C,D,Je,"υ","\\upsilon",!0);j(C,D,Je,"ϕ","\\phi",!0);j(C,D,Je,"χ","\\chi",!0);j(C,D,Je,"ψ","\\psi",!0);j(C,D,Je,"ω","\\omega",!0);j(C,D,Je,"ε","\\varepsilon",!0);j(C,D,Je,"ϑ","\\vartheta",!0);j(C,D,Je,"ϖ","\\varpi",!0);j(C,D,Je,"ϱ","\\varrho",!0);j(C,D,Je,"ς","\\varsigma",!0);j(C,D,Je,"φ","\\varphi",!0);j(C,D,Ie,"","*",!0);j(C,D,Ie,"+","+");j(C,D,Ie,"","-",!0);j(C,D,Ie,"⋅","\\cdot",!0);j(C,D,Ie,"∘","\\circ",!0);j(C,D,Ie,"÷","\\div",!0);j(C,D,Ie,"±","\\pm",!0);j(C,D,Ie,"×","\\times",!0);j(C,D,Ie,"∩","\\cap",!0);j(C,D,Ie,"","\\cup",!0);j(C,D,Ie,"","\\setminus",!0);j(C,D,Ie,"∧","\\land");j(C,D,Ie,"","\\lor");j(C,D,Ie,"∧","\\wedge",!0);j(C,D,Ie,"","\\vee",!0);j(C,D,ae,"√","\\surd");j(C,D,ha,"⟨","\\langle",!0);j(C,D,ha,"","\\lvert");j(C,D,ha,"∥","\\lVert");j(C,D,Mr,"?","?");j(C,D,Mr,"!","!");j(C,D,Mr,"⟩","\\rangle",!0);j(C,D,Mr,"","\\rvert");j(C,D,Mr,"∥","\\rVert");j(C,D,Y,"=","=");j(C,D,Y,":",":");j(C,D,Y,"≈","\\approx",!0);j(C,D,Y,"≅","\\cong",!0);j(C,D,Y,"≥","\\ge");j(C,D,Y,"≥","\\geq",!0);j(C,D,Y,"←","\\gets");j(C,D,Y,">","\\gt",!0);j(C,D,Y,"∈","\\in",!0);j(C,D,Y,"","\\@not");j(C,D,Y,"⊂","\\subset",!0);j(C,D,Y,"⊃","\\supset",!0);j(C,D,Y,"⊆","\\subseteq",!0);j(C,D,Y,"⊇","\\supseteq",!0);j(C,V,Y,"⊈","\\nsubseteq",!0);j(C,V,Y,"⊉","\\nsupseteq",!0);j(C,D,Y,"⊨","\\models");j(C,D,Y,"←","\\leftarrow",!0);j(C,D,Y,"≤","\\le");j(C,D,Y,"≤","\\leq",!0);j(C,D,Y,"<","\\lt",!0);j(C,D,Y,"→","\\rightarrow",!0);j(C,D,Y,"→","\\to");j(C,V,Y,"≱","\\ngeq",!0);j(C,V,Y,"≰","\\nleq",!0);j(C,D,$s," ","\\ ");j(C,D,$s," ","\\space");j(C,D,$s," ","\\nobreakspace");j(_e,D,$s," ","\\ ");j(_e,D,$s," "," ");j(_e,D,$s," ","\\space");j(_e,D,$s," ","\\nobreakspace");j(C,D,$s,null,"\\nobreak");j(C,D,$s,null,"\\allowbreak");j(C,D,Ym,",",",");j(C,D,Ym,";",";");j(C,V,Ie,"⊼","\\barwedge",!0);j(C,V,Ie,"⊻","\\veebar",!0);j(C,D,Ie,"⊙","\\odot",!0);j(C,D,Ie,"⊕","\\oplus",!0);j(C,D,Ie,"⊗","\\otimes",!0);j(C,D,ae,"∂","\\partial",!0);j(C,D,Ie,"⊘","\\oslash",!0);j(C,V,Ie,"⊚","\\circledcirc",!0);j(C,V,Ie,"⊡","\\boxdot",!0);j(C,D,Ie,"△","\\bigtriangleup");j(C,D,Ie,"▽","\\bigtriangledown");j(C,D,Ie,"†","\\dagger");j(C,D,Ie,"⋄","\\diamond");j(C,D,Ie,"⋆","\\star");j(C,D,Ie,"◃","\\triangleleft");j(C,D,Ie,"▹","\\triangleright");j(C,D,ha,"{","\\{");j(_e,D,ae,"{","\\{");j(_e,D,ae,"{","\\textbraceleft");j(C,D,Mr,"}","\\}");j(_e,D,ae,"}","\\}");j(_e,D,ae,"}","\\textbraceright");j(C,D,ha,"{","\\lbrace");j(C,D,Mr,"}","\\rbrace");j(C,D,ha,"[","\\lbrack",!0);j(_e,D,ae,"[","\\lbrack",!0);j(C,D,Mr,"]","\\rbrack",!0);j(_e,D,ae,"]","\\rbrack",!0);j(C,D,ha,"(","\\lparen",!0);j(C,D,Mr,")","\\rparen",!0);j(_e,D,ae,"<","\\textless",!0);j(_e,D,ae,">","\\textgreater",!0);j(C,D,ha,"⌊","\\lfloor",!0);j(C,D,Mr,"⌋","\\rfloor",!0);j(C,D,ha,"⌈","\\lceil",!0);j(C,D,Mr,"⌉","\\rceil",!0);j(C,D,ae,"\\","\\backslash");j(C,D,ae,"","|");j(C,D,ae,"","\\vert");j(_e,D,ae,"|","\\textbar",!0);j(C,D,ae,"∥","\\|");j(C,D,ae,"∥","\\Vert");j(_e,D,ae,"∥","\\textbardbl");j(_e,D,ae,"~","\\textasciitilde");j(_e,D,ae,"\\","\\textbackslash");j(_e,D,ae,"^","\\textasciicircum");j(C,D,Y,"↑","\\uparrow",!0);j(C,D,Y,"⇑","\\Uparrow",!0);j(C,D,Y,"↓","\\downarrow",!0);j(C,D,Y,"⇓","\\Downarrow",!0);j(C,D,Y,"↕","\\updownarrow",!0);j(C,D,Y,"⇕","\\Updownarrow",!0);j(C,D,Yn,"∐","\\coprod");j(C,D,Yn,"","\\bigvee");j(C,D,Yn,"⋀","\\bigwedge");j(C,D,Yn,"⨄","\\biguplus");j(C,D,Yn,"⋂","\\bigcap");j(C,D,Yn,"","\\bigcup");j(C,D,Yn,"∫","\\int");j(C,D,Yn,"∫","\\intop");j(C,D,Yn,"∬","\\iint");j(C,D,Yn,"∭","\\iiint");j(C,D,Yn,"∏","\\prod");j(C,D,Yn,"∑","\\sum");j(C,D,Yn,"⨂","\\bigotimes");j(C,D,Yn,"⨁","\\bigoplus");j(C,D,Yn,"⨀","\\bigodot");j(C,D,Yn,"∮","\\oint");j(C,D,Yn,"∯","\\oiint");j(C,D,Yn,"∰","\\oiiint");j(C,D,Yn,"⨆","\\bigsqcup");j(C,D,Yn,"∫","\\smallint");j(_e,D,tc,"…","\\textellipsis");j(C,D,tc,"…","\\mathellipsis");j(_e,D,tc,"…","\\ldots",!0);j(C,D,tc,"…","\\ldots",!0);j(C,D,tc,"⋯","\\@cdots",!0);j(C,D,tc,"⋱","\\ddots",!0);j(C,D,ae,"⋮","\\varvdots");j(_e,D,ae,"⋮","\\varvdots");j(C,D,kn,"ˊ","\\acute");j(C,D,kn,"ˋ","\\grave");j(C,D,kn,"¨","\\ddot");j(C,D,kn,"~","\\tilde");j(C,D,kn,"ˉ","\\bar");j(C,D,kn,"˘","\\breve");j(C,D,kn,"ˇ","\\check");j(C,D,kn,"^","\\hat");j(C,D,kn,"⃗","\\vec");j(C,D,kn,"˙","\\dot");j(C,D,kn,"˚","\\mathring");j(C,D,Je,"","\\@imath");j(C,D,Je,"","\\@jmath");j(C,D,ae,"ı","ı");j(C,D,ae,"ȷ","ȷ");j(_e,D,ae,"ı","\\i",!0);j(_e,D,ae,"ȷ","\\j",!0);j(_e,D,ae,"ß","\\ss",!0);j(_e,D,ae,"æ","\\ae",!0);j(_e,D,ae,"œ","\\oe",!0);j(_e,D,ae,"ø","\\o",!0);j(_e,D,ae,"Æ","\\AE",!0);j(_e,D,ae,"Œ","\\OE",!0);j(_e,D,ae,"Ø","\\O",!0);j(_e,D,kn,"ˊ","\\'");j(_e,D,kn,"ˋ","\\`");j(_e,D,kn,"ˆ","\\^");j(_e,D,kn,"˜","\\~");j(_e,D,kn,"ˉ","\\=");j(_e,D,kn,"˘","\\u");j(_e,D,kn,"˙","\\.");j(_e,D,kn,"¸","\\c");j(_e,D,kn,"˚","\\r");j(_e,D,kn,"ˇ","\\v");j(_e,D,kn,"¨",'\\"');j(_e,D,kn,"˝","\\H");j(_e,D,kn,"◯","\\textcircled");var v8={"--":!0,"---":!0,"``":!0,"''":!0};j(_e,D,ae,"","--",!0);j(_e,D,ae,"","\\textendash");j(_e,D,ae,"—","---",!0);j(_e,D,ae,"—","\\textemdash");j(_e,D,ae,"","`",!0);j(_e,D,ae,"","\\textquoteleft");j(_e,D,ae,"","'",!0);j(_e,D,ae,"","\\textquoteright");j(_e,D,ae,"“","``",!0);j(_e,D,ae,"“","\\textquotedblleft");j(_e,D,ae,"”","''",!0);j(_e,D,ae,"”","\\textquotedblright");j(C,D,ae,"°","\\degree",!0);j(_e,D,ae,"°","\\degree");j(_e,D,ae,"°","\\textdegree",!0);j(C,D,ae,"£","\\pounds");j(C,D,ae,"£","\\mathsterling",!0);j(_e,D,ae,"£","\\pounds");j(_e,D,ae,"£","\\textsterling",!0);j(C,V,ae,"✠","\\maltese");j(_e,V,ae,"✠","\\maltese");var O3='0123456789/@."';for(var Jp=0;Jp<O3.length;Jp++){var R3=O3.charAt(Jp);j(C,D,ae,R3,R3)}var L3='0123456789!@*()-=+";:?/.,';for(var ex=0;ex<L3.length;ex++){var B3=L3.charAt(ex);j(_e,D,ae,B3,B3)}var fm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var tx=0;tx<fm.length;tx++){var M0=fm.charAt(tx);j(C,D,Je,M0,M0),j(_e,D,ae,M0,M0)}j(C,V,ae,"C","");j(_e,V,ae,"C","");j(C,V,ae,"H","");j(_e,V,ae,"H","");j(C,V,ae,"N","");j(_e,V,ae,"N","");j(C,V,ae,"P","");j(_e,V,ae,"P","");j(C,V,ae,"Q","");j(_e,V,ae,"Q","");j(C,V,ae,"R","");j(_e,V,ae,"R","");j(C,V,ae,"Z","");j(_e,V,ae,"Z","");j(C,D,Je,"h","");j(_e,D,Je,"h","");var it="";for(var Cr=0;Cr<fm.length;Cr++){var Rn=fm.charAt(Cr);it=String.fromCharCode(55349,56320+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56372+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56424+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56580+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56684+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56736+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56788+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56840+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56944+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),Cr<26&&(it=String.fromCharCode(55349,56632+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it),it=String.fromCharCode(55349,56476+Cr),j(C,D,Je,Rn,it),j(_e,D,ae,Rn,it))}it="𝕜";j(C,D,Je,"k",it);j(_e,D,ae,"k",it);for(var li=0;li<10;li++){var yl=li.toString();it=String.fromCharCode(55349,57294+li),j(C,D,Je,yl,it),j(_e,D,ae,yl,it),it=String.fromCharCode(55349,57314+li),j(C,D,Je,yl,it),j(_e,D,ae,yl,it),it=String.fromCharCode(55349,57324+li),j(C,D,Je,yl,it),j(_e,D,ae,yl,it),it=String.fromCharCode(55349,57334+li),j(C,D,Je,yl,it),j(_e,D,ae,yl,it)}var Qx="ÐÞþ";for(var nx=0;nx<Qx.length;nx++){var A0=Qx.charAt(nx);j(C,D,Je,A0,A0),j(_e,D,ae,A0,A0)}var D0=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],P3=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],JI=function(t,n){var a=t.charCodeAt(0),l=t.charCodeAt(1),o=(a-55296)*1024+(l-56320)+65536,c=n==="math"?0:1;if(119808<=o&&o<120484){var d=Math.floor((o-119808)/26);return[D0[d][2],D0[d][c]]}else if(120782<=o&&o<=120831){var m=Math.floor((o-120782)/10);return[P3[m][2],P3[m][c]]}else{if(o===120485||o===120486)return[D0[0][2],D0[0][c]];if(120486<o&&o<120782)return["",""];throw new Ae("Unsupported character: "+t)}},Wm=function(t,n,a){return yn[a][t]&&yn[a][t].replace&&(t=yn[a][t].replace),{value:t,metrics:mg(t,n,a)}},Ba=function(t,n,a,l,o){var c=Wm(t,n,a),d=c.metrics;t=c.value;var m;if(d){var f=d.italic;(a==="text"||l&&l.font==="mathit")&&(f=0),m=new Ea(t,d.height,d.depth,f,d.skew,d.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),m=new Ea(t,0,0,0,0,0,o);if(l){m.maxFontSize=l.sizeMultiplier,l.style.isTight()&&m.classes.push("mtight");var p=l.getColor();p&&(m.style.color=p)}return m},eq=function(t,n,a,l){return l===void 0&&(l=[]),a.font==="boldsymbol"&&Wm(t,"Main-Bold",n).metrics?Ba(t,"Main-Bold",n,a,l.concat(["mathbf"])):t==="\\"||yn[n][t].font==="main"?Ba(t,"Main-Regular",n,a,l):Ba(t,"AMS-Regular",n,a,l.concat(["amsrm"]))},tq=function(t,n,a,l,o){return o!=="textord"&&Wm(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},nq=function(t,n,a){var l=t.mode,o=t.text,c=["mord"],d=l==="math"||l==="text"&&n.font,m=d?n.font:n.fontFamily,f="",p="";if(o.charCodeAt(0)===55349&&([f,p]=JI(o,l)),f.length>0)return Ba(o,f,l,n,c.concat(p));if(m){var x,y;if(m==="boldsymbol"){var b=tq(o,l,n,c,a);x=b.fontName,y=[b.fontClass]}else d?(x=w8[m].fontName,y=[m]):(x=z0(m,n.fontWeight,n.fontShape),y=[m,n.fontWeight,n.fontShape]);if(Wm(o,x,l).metrics)return Ba(o,x,l,n,c.concat(y));if(v8.hasOwnProperty(o)&&x.slice(0,10)==="Typewriter"){for(var N=[],k=0;k<o.length;k++)N.push(Ba(o[k],x,l,n,c.concat(y)));return b8(N)}}if(a==="mathord")return Ba(o,"Math-Italic",l,n,c.concat(["mathnormal"]));if(a==="textord"){var S=yn[l][o]&&yn[l][o].font;if(S==="ams"){var T=z0("amsrm",n.fontWeight,n.fontShape);return Ba(o,T,l,n,c.concat("amsrm",n.fontWeight,n.fontShape))}else if(S==="main"||!S){var M=z0("textrm",n.fontWeight,n.fontShape);return Ba(o,M,l,n,c.concat(n.fontWeight,n.fontShape))}else{var A=z0(S,n.fontWeight,n.fontShape);return Ba(o,A,l,n,c.concat(A,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+a+" in makeOrd")},rq=(e,t)=>{if(El(e.classes)!==El(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a in e.style)if(e.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;for(var l in t.style)if(t.style.hasOwnProperty(l)&&e.style[l]!==t.style[l])return!1;return!0},aq=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Ea&&a instanceof Ea&&rq(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},fg=function(t){for(var n=0,a=0,l=0,o=0;o<t.children.length;o++){var c=t.children[o];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>l&&(l=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=l},Hr=function(t,n,a,l){var o=new Xu(t,n,a,l);return fg(o),o},y8=(e,t,n,a)=>new Xu(e,t,n,a),sq=function(t,n,a){var l=Hr([t],[],n);return l.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),l.style.borderBottomWidth=Le(l.height),l.maxFontSize=1,l},lq=function(t,n,a,l){var o=new hg(t,n,a,l);return fg(o),o},b8=function(t){var n=new Wu(t);return fg(n),n},iq=function(t,n){return t instanceof Wu?Hr([],[t],n):t},oq=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],l=-n[0].shift-n[0].elem.depth,o=l,c=1;c<n.length;c++){var d=-n[c].shift-o-n[c].elem.depth,m=d-(n[c-1].elem.height+n[c-1].elem.depth);o=o+d,a.push({type:"kern",size:m}),a.push(n[c])}return{children:a,depth:l}}var f;if(t.positionType==="top"){for(var p=t.positionData,x=0;x<t.children.length;x++){var y=t.children[x];p-=y.type==="kern"?y.size:y.elem.height+y.elem.depth}f=p}else if(t.positionType==="bottom")f=-t.positionData;else{var b=t.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")f=-b.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")f=-b.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:f}},cq=function(t,n){for(var{children:a,depth:l}=oq(t),o=0,c=0;c<a.length;c++){var d=a[c];if(d.type==="elem"){var m=d.elem;o=Math.max(o,m.maxFontSize,m.height)}}o+=2;var f=Hr(["pstrut"],[]);f.style.height=Le(o);for(var p=[],x=l,y=l,b=l,N=0;N<a.length;N++){var k=a[N];if(k.type==="kern")b+=k.size;else{var S=k.elem,T=k.wrapperClasses||[],M=k.wrapperStyle||{},A=Hr(T,[f,S],void 0,M);A.style.top=Le(-o-b-S.depth),k.marginLeft&&(A.style.marginLeft=k.marginLeft),k.marginRight&&(A.style.marginRight=k.marginRight),p.push(A),b+=S.height+S.depth}x=Math.min(x,b),y=Math.max(y,b)}var R=Hr(["vlist"],p);R.style.height=Le(y);var B;if(x<0){var O=Hr([],[]),L=Hr(["vlist"],[O]);L.style.height=Le(-x);var $=Hr(["vlist-s"],[new Ea("")]);B=[Hr(["vlist-r"],[R,$]),Hr(["vlist-r"],[L])]}else B=[Hr(["vlist-r"],[R])];var U=Hr(["vlist-t"],B);return B.length===2&&U.classes.push("vlist-t2"),U.height=y,U.depth=-x,U},uq=(e,t)=>{var n=Hr(["mspace"],[],t),a=Mn(e,t);return n.style.marginRight=Le(a),n},z0=function(t,n,a){var l="";switch(t){case"amsrm":l="AMS";break;case"textrm":l="Main";break;case"textsf":l="SansSerif";break;case"texttt":l="Typewriter";break;default:l=t}var o;return n==="textbf"&&a==="textit"?o="BoldItalic":n==="textbf"?o="Bold":n==="textit"?o="Italic":o="Regular",l+"-"+o},w8={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},j8={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},dq=function(t,n){var[a,l,o]=j8[t],c=new Ml(a),d=new Fs([c],{width:Le(l),height:Le(o),style:"width:"+Le(l),viewBox:"0 0 "+1e3*l+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),m=y8(["overlay"],[d],n);return m.height=o,m.style.height=Le(o),m.style.width=Le(l),m},de={fontMap:w8,makeSymbol:Ba,mathsym:eq,makeSpan:Hr,makeSvgSpan:y8,makeLineSpan:sq,makeAnchor:lq,makeFragment:b8,wrapFragment:iq,makeVList:cq,makeOrd:nq,makeGlue:uq,staticSvg:dq,svgData:j8,tryCombineChars:aq},_n={number:3,unit:"mu"},ii={number:4,unit:"mu"},Ms={number:5,unit:"mu"},mq={mord:{mop:_n,mbin:ii,mrel:Ms,minner:_n},mop:{mord:_n,mop:_n,mrel:Ms,minner:_n},mbin:{mord:ii,mop:ii,mopen:ii,minner:ii},mrel:{mord:Ms,mop:Ms,mopen:Ms,minner:Ms},mopen:{},mclose:{mop:_n,mbin:ii,mrel:Ms,minner:_n},mpunct:{mord:_n,mop:_n,mrel:Ms,mopen:_n,mclose:_n,mpunct:_n,minner:_n},minner:{mord:_n,mop:_n,mbin:ii,mrel:Ms,mopen:_n,mpunct:_n,minner:_n}},hq={mord:{mop:_n},mop:{mord:_n,mop:_n},mbin:{},mrel:{},mopen:{},mclose:{mop:_n},mpunct:{},minner:{mop:_n}},N8={},pm={},xm={};function Be(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:l},m=0;m<n.length;++m)N8[n[m]]=d;t&&(o&&(pm[t]=o),c&&(xm[t]=c))}function Ci(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Be({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var gm=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Pn=function(t){return t.type==="ordgroup"?t.body:[t]},Is=de.makeSpan,fq=["leftmost","mbin","mopen","mrel","mop","mpunct"],pq=["rightmost","mrel","mclose","mpunct"],xq={display:tt.DISPLAY,text:tt.TEXT,script:tt.SCRIPT,scriptscript:tt.SCRIPTSCRIPT},gq={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},nr=function(t,n,a,l){l===void 0&&(l=[null,null]);for(var o=[],c=0;c<t.length;c++){var d=Ft(t[c],n);if(d instanceof Wu){var m=d.children;o.push(...m)}else o.push(d)}if(de.tryCombineChars(o),!a)return o;var f=n;if(t.length===1){var p=t[0];p.type==="sizing"?f=n.havingSize(p.size):p.type==="styling"&&(f=n.havingStyle(xq[p.style]))}var x=Is([l[0]||"leftmost"],[],n),y=Is([l[1]||"rightmost"],[],n),b=a==="root";return F3(o,(N,k)=>{var S=k.classes[0],T=N.classes[0];S==="mbin"&&pq.includes(T)?k.classes[0]="mord":T==="mbin"&&fq.includes(S)&&(N.classes[0]="mord")},{node:x},y,b),F3(o,(N,k)=>{var S=Zx(k),T=Zx(N),M=S&&T?N.hasClass("mtight")?hq[S][T]:mq[S][T]:null;if(M)return de.makeGlue(M,f)},{node:x},y,b),o},F3=function e(t,n,a,l,o){l&&t.push(l);for(var c=0;c<t.length;c++){var d=t[c],m=S8(d);if(m){e(m.children,n,a,null,o);continue}var f=!d.hasClass("mspace");if(f){var p=n(d,a.node);p&&(a.insertAfter?a.insertAfter(p):(t.unshift(p),c++))}f?a.node=d:o&&d.hasClass("newline")&&(a.node=Is(["leftmost"])),a.insertAfter=(x=>y=>{t.splice(x+1,0,y),c++})(c)}l&&t.pop()},S8=function(t){return t instanceof Wu||t instanceof hg||t instanceof Xu&&t.hasClass("enclosing")?t:null},vq=function e(t,n){var a=S8(t);if(a){var l=a.children;if(l.length){if(n==="right")return e(l[l.length-1],"right");if(n==="left")return e(l[0],"left")}}return t},Zx=function(t,n){return t?(n&&(t=vq(t,n)),gq[t.classes[0]]||null):null},Nu=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Is(n.concat(a))},Ft=function(t,n,a){if(!t)return Is();if(pm[t.type]){var l=pm[t.type](t,n);if(a&&n.size!==a.size){l=Is(n.sizingClasses(a),[l],n);var o=n.sizeMultiplier/a.sizeMultiplier;l.height*=o,l.depth*=o}return l}else throw new Ae("Got group of unknown type: '"+t.type+"'")};function O0(e,t){var n=Is(["base"],e,t),a=Is(["strut"]);return a.style.height=Le(n.height+n.depth),n.depth&&(a.style.verticalAlign=Le(-n.depth)),n.children.unshift(a),n}function Jx(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=nr(e,t,"root"),l;a.length===2&&a[1].hasClass("tag")&&(l=a.pop());for(var o=[],c=[],d=0;d<a.length;d++)if(c.push(a[d]),a[d].hasClass("mbin")||a[d].hasClass("mrel")||a[d].hasClass("allowbreak")){for(var m=!1;d<a.length-1&&a[d+1].hasClass("mspace")&&!a[d+1].hasClass("newline");)d++,c.push(a[d]),a[d].hasClass("nobreak")&&(m=!0);m||(o.push(O0(c,t)),c=[])}else a[d].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(O0(c,t)),c=[]),o.push(a[d]));c.length>0&&o.push(O0(c,t));var f;n?(f=O0(nr(n,t,!0)),f.classes=["tag"],o.push(f)):l&&o.push(l);var p=Is(["katex-html"],o);if(p.setAttribute("aria-hidden","true"),f){var x=f.children[0];x.style.height=Le(p.height+p.depth),p.depth&&(x.style.verticalAlign=Le(-p.depth))}return p}function k8(e){return new Wu(e)}class ca{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=El(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof ns&&this.children[a+1]instanceof ns){for(var l=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof ns;)l+=this.children[++a].toText();t.appendChild(new ns(l).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=Ut.escape(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+Ut.escape(El(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class ns{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ut.escape(this.toText())}toText(){return this.text}}class yq{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character="":t>=.1666&&t<=.1667?this.character="":t>=.2222&&t<=.2223?this.character="":t>=.2777&&t<=.2778?this.character="":t>=-.05556&&t<=-.05555?this.character="":t>=-.1667&&t<=-.1666?this.character="":t>=-.2223&&t<=-.2222?this.character="":t>=-.2778&&t<=-.2777?this.character="":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Le(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Le(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Me={MathNode:ca,TextNode:ns,SpaceNode:yq,newDocumentFragment:k8},Ma=function(t,n,a){return yn[n][t]&&yn[n][t].replace&&t.charCodeAt(0)!==55349&&!(v8.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=yn[n][t].replace),new Me.TextNode(t)},pg=function(t){return t.length===1?t[0]:new Me.MathNode("mrow",t)},xg=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var a=n.font;if(!a||a==="mathnormal")return null;var l=t.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathsfit")return"sans-serif-italic";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var o=t.text;if(["\\imath","\\jmath"].includes(o))return null;yn[l][o]&&yn[l][o].replace&&(o=yn[l][o].replace);var c=de.fontMap[a].fontName;return mg(o,c,l)?de.fontMap[a].variant:null};function rx(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof ns&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof ns&&n.text===","}else return!1}var Qr=function(t,n,a){if(t.length===1){var l=xn(t[0],n);return a&&l instanceof ca&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}for(var o=[],c,d=0;d<t.length;d++){var m=xn(t[d],n);if(m instanceof ca&&c instanceof ca){if(m.type==="mtext"&&c.type==="mtext"&&m.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...m.children);continue}else if(m.type==="mn"&&c.type==="mn"){c.children.push(...m.children);continue}else if(rx(m)&&c.type==="mn"){c.children.push(...m.children);continue}else if(m.type==="mn"&&rx(c))m.children=[...c.children,...m.children],o.pop();else if((m.type==="msup"||m.type==="msub")&&m.children.length>=1&&(c.type==="mn"||rx(c))){var f=m.children[0];f instanceof ca&&f.type==="mn"&&(f.children=[...c.children,...f.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof ns&&p.text==="̸"&&(m.type==="mo"||m.type==="mi"||m.type==="mn")){var x=m.children[0];x instanceof ns&&x.text.length>0&&(x.text=x.text.slice(0,1)+"̸"+x.text.slice(1),o.pop())}}}o.push(m),c=m}return o},Al=function(t,n,a){return pg(Qr(t,n,a))},xn=function(t,n){if(!t)return new Me.MathNode("mrow");if(xm[t.type]){var a=xm[t.type](t,n);return a}else throw new Ae("Got group of unknown type: '"+t.type+"'")};function I3(e,t,n,a,l){var o=Qr(e,n),c;o.length===1&&o[0]instanceof ca&&["mrow","mtable"].includes(o[0].type)?c=o[0]:c=new Me.MathNode("mrow",o);var d=new Me.MathNode("annotation",[new Me.TextNode(t)]);d.setAttribute("encoding","application/x-tex");var m=new Me.MathNode("semantics",[c,d]),f=new Me.MathNode("math",[m]);f.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&f.setAttribute("display","block");var p=l?"katex":"katex-mathml";return de.makeSpan([p],[f])}var C8=function(t){return new Ds({style:t.displayMode?tt.DISPLAY:tt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},T8=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=de.makeSpan(a,[t])}return t},bq=function(t,n,a){var l=C8(a),o;if(a.output==="mathml")return I3(t,n,l,a.displayMode,!0);if(a.output==="html"){var c=Jx(t,l);o=de.makeSpan(["katex"],[c])}else{var d=I3(t,n,l,a.displayMode,!1),m=Jx(t,l);o=de.makeSpan(["katex"],[d,m])}return T8(o,a)},wq=function(t,n,a){var l=C8(a),o=Jx(t,l),c=de.makeSpan(["katex"],[o]);return T8(c,a)},jq={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Nq=function(t){var n=new Me.MathNode("mo",[new Me.TextNode(jq[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},Sq={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},kq=function(t){return t.type==="ordgroup"?t.body.length:1},Cq=function(t,n){function a(){var d=4e5,m=t.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(m)){var f=t,p=kq(f.base),x,y,b;if(p>5)m==="widehat"||m==="widecheck"?(x=420,d=2364,b=.42,y=m+"4"):(x=312,d=2340,b=.34,y="tilde4");else{var N=[1,1,2,2,3,3][p];m==="widehat"||m==="widecheck"?(d=[0,1062,2364,2364,2364][N],x=[0,239,300,360,420][N],b=[0,.24,.3,.3,.36,.42][N],y=m+N):(d=[0,600,1033,2339,2340][N],x=[0,260,286,306,312][N],b=[0,.26,.286,.3,.306,.34][N],y="tilde"+N)}var k=new Ml(y),S=new Fs([k],{width:"100%",height:Le(b),viewBox:"0 0 "+d+" "+x,preserveAspectRatio:"none"});return{span:de.makeSvgSpan([],[S],n),minWidth:0,height:b}}else{var T=[],M=Sq[m],[A,R,B]=M,O=B/1e3,L=A.length,$,U;if(L===1){var I=M[3];$=["hide-tail"],U=[I]}else if(L===2)$=["halfarrow-left","halfarrow-right"],U=["xMinYMin","xMaxYMin"];else if(L===3)$=["brace-left","brace-center","brace-right"],U=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+L+" children.");for(var G=0;G<L;G++){var ee=new Ml(A[G]),Ne=new Fs([ee],{width:"400em",height:Le(O),viewBox:"0 0 "+d+" "+B,preserveAspectRatio:U[G]+" slice"}),J=de.makeSvgSpan([$[G]],[Ne],n);if(L===1)return{span:J,minWidth:R,height:O};J.style.height=Le(O),T.push(J)}return{span:de.makeSpan(["stretchy"],T,n),minWidth:R,height:O}}}var{span:l,minWidth:o,height:c}=a();return l.height=c,l.style.height=Le(c),o>0&&(l.style.minWidth=Le(o)),l},Tq=function(t,n,a,l,o){var c,d=t.height+t.depth+a+l;if(/fbox|color|angl/.test(n)){if(c=de.makeSpan(["stretchy",n],[],o),n==="fbox"){var m=o.color&&o.getColor();m&&(c.style.borderColor=m)}}else{var f=[];/^[bx]cancel$/.test(n)&&f.push(new Kx({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&f.push(new Kx({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new Fs(f,{width:"100%",height:Le(d)});c=de.makeSvgSpan([],[p],o)}return c.height=d,c.style.height=Le(d),c},qs={encloseSpan:Tq,mathMLnode:Nq,svgSpan:Cq};function yt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function gg(e){var t=Xm(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Xm(e){return e&&(e.type==="atom"||ZI.hasOwnProperty(e.type))?e:null}var vg=(e,t)=>{var n,a,l;e&&e.type==="supsub"?(a=yt(e.base,"accent"),n=a.base,e.base=n,l=KI(Ft(e,t)),e.base=a):(a=yt(e,"accent"),n=a.base);var o=Ft(n,t.havingCrampedStyle()),c=a.isShifty&&Ut.isCharacterBox(n),d=0;if(c){var m=Ut.getBaseElem(n),f=Ft(m,t.havingCrampedStyle());d=z3(f).skew}var p=a.label==="\\c",x=p?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),y;if(a.isStretchy)y=qs.svgSpan(a,t),y=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:y,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+Le(2*d)+")",marginLeft:Le(2*d)}:void 0}]},t);else{var b,N;a.label==="\\vec"?(b=de.staticSvg("vec",t),N=de.svgData.vec[1]):(b=de.makeOrd({mode:a.mode,text:a.label},t,"textord"),b=z3(b),b.italic=0,N=b.width,p&&(x+=b.depth)),y=de.makeSpan(["accent-body"],[b]);var k=a.label==="\\textcircled";k&&(y.classes.push("accent-full"),x=o.height);var S=d;k||(S-=N/2),y.style.left=Le(S),a.label==="\\textcircled"&&(y.style.top=".2em"),y=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-x},{type:"elem",elem:y}]},t)}var T=de.makeSpan(["mord","accent"],[y],t);return l?(l.children[0]=T,l.height=Math.max(T.height,l.height),l.classes[0]="mord",l):T},_8=(e,t)=>{var n=e.isStretchy?qs.mathMLnode(e.label):new Me.MathNode("mo",[Ma(e.label,e.mode)]),a=new Me.MathNode("mover",[xn(e.base,t),n]);return a.setAttribute("accent","true"),a},_q=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Be({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=gm(t[0]),a=!_q.test(e.funcName),l=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:l,base:n}},htmlBuilder:vg,mathmlBuilder:_8});Be({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:vg,mathmlBuilder:_8});Be({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:l}},htmlBuilder:(e,t)=>{var n=Ft(e.base,t),a=qs.svgSpan(e,t),l=e.label==="\\utilde"?.12:0,o=de.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:n}]},t);return de.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=qs.mathMLnode(e.label),a=new Me.MathNode("munder",[xn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var R0=e=>{var t=new Me.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Be({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:l}=e;return{type:"xArrow",mode:a.mode,label:l,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),l=de.wrapFragment(Ft(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=de.wrapFragment(Ft(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var d=qs.svgSpan(e,t),m=-t.fontMetrics().axisHeight+.5*d.height,f=-t.fontMetrics().axisHeight-.5*d.height-.111;(l.depth>.25||e.label==="\\xleftequilibrium")&&(f-=l.depth);var p;if(c){var x=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:f},{type:"elem",elem:d,shift:m},{type:"elem",elem:c,shift:x}]},t)}else p=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:f},{type:"elem",elem:d,shift:m}]},t);return p.children[0].children[0].children[1].classes.push("svg-align"),de.makeSpan(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=qs.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var l=R0(xn(e.body,t));if(e.below){var o=R0(xn(e.below,t));a=new Me.MathNode("munderover",[n,o,l])}else a=new Me.MathNode("mover",[n,l])}else if(e.below){var c=R0(xn(e.below,t));a=new Me.MathNode("munder",[n,c])}else a=R0(),a=new Me.MathNode("mover",[n,a]);return a}});var Eq=de.makeSpan;function E8(e,t){var n=nr(e.body,t,!0);return Eq([e.mclass],n,t)}function M8(e,t){var n,a=Qr(e.body,t);return e.mclass==="minner"?n=new Me.MathNode("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Me.MathNode("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Me.MathNode("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Be({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Pn(l),isCharacterBox:Ut.isCharacterBox(l)}},htmlBuilder:E8,mathmlBuilder:M8});var Km=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Be({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Km(t[0]),body:Pn(t[1]),isCharacterBox:Ut.isCharacterBox(t[1])}}});Be({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,l=t[1],o=t[0],c;a!=="\\stackrel"?c=Km(l):c="mrel";var d={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Pn(l)},m={type:"supsub",mode:o.mode,base:d,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[m],isCharacterBox:Ut.isCharacterBox(m)}},htmlBuilder:E8,mathmlBuilder:M8});Be({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Km(t[0]),body:Pn(t[0])}},htmlBuilder(e,t){var n=nr(e.body,t,!0),a=de.makeSpan([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Qr(e.body,t),a=new Me.MathNode("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var Mq={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},q3=()=>({type:"styling",body:[],mode:"math",style:"display"}),H3=e=>e.type==="textord"&&e.text==="@",Aq=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function Dq(e,t,n){var a=Mq[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var l=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),m={type:"ordgroup",mode:"math",body:[l,c,d]};return n.callFunction("\\\\cdparent",[m],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var f={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[f],[])}default:return{type:"textord",text:" ",mode:"math"}}}function zq(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Ae("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],l=[a],o=0;o<t.length;o++){for(var c=t[o],d=q3(),m=0;m<c.length;m++)if(!H3(c[m]))d.body.push(c[m]);else{a.push(d),m+=1;var f=gg(c[m]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(f)>-1))if("<>AV".indexOf(f)>-1)for(var x=0;x<2;x++){for(var y=!0,b=m+1;b<c.length;b++){if(Aq(c[b],f)){y=!1,m=b;break}if(H3(c[b]))throw new Ae("Missing a "+f+" character to complete a CD arrow.",c[b]);p[x].body.push(c[b])}if(y)throw new Ae("Missing a "+f+" character to complete a CD arrow.",c[m])}else throw new Ae('Expected one of "<>AV=|." after @',c[m]);var N=Dq(f,p,e),k={type:"styling",body:[N],mode:"math",style:"display"};a.push(k),d=q3()}o%2===0?a.push(d):a.shift(),a=[],l.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var S=new Array(l[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:l,arraystretch:1,addJot:!0,rowGaps:[null],cols:S,colSeparationType:"CD",hLinesBeforeRow:new Array(l.length+1).fill([])}}Be({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=de.wrapFragment(Ft(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Le(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Me.MathNode("mrow",[xn(e.label,t)]);return n=new Me.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Be({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=de.wrapFragment(Ft(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Me.MathNode("mrow",[xn(e.fragment,t)])}});Be({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=yt(t[0],"ordgroup"),l=a.body,o="",c=0;c<l.length;c++){var d=yt(l[c],"textord");o+=d.text}var m=parseInt(o),f;if(isNaN(m))throw new Ae("\\@char has non-numeric argument "+o);if(m<0||m>=1114111)throw new Ae("\\@char with invalid code point "+o);return m<=65535?f=String.fromCharCode(m):(m-=65536,f=String.fromCharCode((m>>10)+55296,(m&1023)+56320)),{type:"textord",mode:n.mode,text:f}}});var A8=(e,t)=>{var n=nr(e.body,t.withColor(e.color),!1);return de.makeFragment(n)},D8=(e,t)=>{var n=Qr(e.body,t.withColor(e.color)),a=new Me.MathNode("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Be({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=yt(t[0],"color-token").color,l=t[1];return{type:"color",mode:n.mode,color:a,body:Pn(l)}},htmlBuilder:A8,mathmlBuilder:D8});Be({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,l=yt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",l);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:l,body:o}},htmlBuilder:A8,mathmlBuilder:D8});Be({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,l=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:l&&yt(l,"size").value}},htmlBuilder(e,t){var n=de.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Le(Mn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Me.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Le(Mn(e.size,t)))),n}});var e1={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},z8=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ae("Expected a control sequence",e);return t},Oq=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},O8=(e,t,n,a)=>{var l=e.gullet.macros.get(n.text);l==null&&(n.noexpand=!0,l={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,l,a)};Be({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(e1[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=e1[a.text]),yt(t.parseFunction(),"internal");throw new Ae("Invalid token after macro prefix",a)}});Be({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),l=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(l))throw new Ae("Expected a control sequence",a);for(var o=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Ae('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Ae('Argument number "'+a.text+'" out of order');o++,d.push([])}else{if(a.text==="EOF")throw new Ae("Expected a macro definition");d[o].push(a.text)}var{tokens:m}=t.gullet.consumeArg();return c&&m.unshift(c),(n==="\\edef"||n==="\\xdef")&&(m=t.gullet.expandTokens(m),m.reverse()),t.gullet.macros.set(l,{tokens:m,numArgs:o,delimiters:d},n===e1[n]),{type:"internal",mode:t.mode}}});Be({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=z8(t.gullet.popToken());t.gullet.consumeSpaces();var l=Oq(t);return O8(t,a,l,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Be({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=z8(t.gullet.popToken()),l=t.gullet.popToken(),o=t.gullet.popToken();return O8(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(l),{type:"internal",mode:t.mode}}});var au=function(t,n,a){var l=yn.math[t]&&yn.math[t].replace,o=mg(l||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},yg=function(t,n,a,l){var o=a.havingBaseStyle(n),c=de.makeSpan(l.concat(o.sizingClasses(a)),[t],a),d=o.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=o.sizeMultiplier,c},R8=function(t,n,a){var l=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/l.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Le(o),t.height-=o,t.depth+=o},Rq=function(t,n,a,l,o,c){var d=de.makeSymbol(t,"Main-Regular",o,l),m=yg(d,n,l,c);return a&&R8(m,l,n),m},Lq=function(t,n,a,l){return de.makeSymbol(t,"Size"+n+"-Regular",a,l)},L8=function(t,n,a,l,o,c){var d=Lq(t,n,o,l),m=yg(de.makeSpan(["delimsizing","size"+n],[d],l),tt.TEXT,l,c);return a&&R8(m,l,tt.TEXT),m},ax=function(t,n,a){var l;n==="Size1-Regular"?l="delim-size1":l="delim-size4";var o=de.makeSpan(["delimsizinginner",l],[de.makeSpan([],[de.makeSymbol(t,n,a)])]);return{type:"elem",elem:o}},sx=function(t,n,a){var l=ts["Size4-Regular"][t.charCodeAt(0)]?ts["Size4-Regular"][t.charCodeAt(0)][4]:ts["Size1-Regular"][t.charCodeAt(0)][4],o=new Ml("inner",qI(t,Math.round(1e3*n))),c=new Fs([o],{width:Le(l),height:Le(n),style:"width:"+Le(l),viewBox:"0 0 "+1e3*l+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=de.makeSvgSpan([],[c],a);return d.height=n,d.style.height=Le(n),d.style.width=Le(l),{type:"elem",elem:d}},t1=.008,L0={type:"kern",size:-1*t1},Bq=["|","\\lvert","\\rvert","\\vert"],Pq=["\\|","\\lVert","\\rVert","\\Vert"],B8=function(t,n,a,l,o,c){var d,m,f,p,x="",y=0;d=f=p=t,m=null;var b="Size1-Regular";t==="\\uparrow"?f=p="⏐":t==="\\Uparrow"?f=p="‖":t==="\\downarrow"?d=f="⏐":t==="\\Downarrow"?d=f="‖":t==="\\updownarrow"?(d="\\uparrow",f="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",f="‖",p="\\Downarrow"):Bq.includes(t)?(f="",x="vert",y=333):Pq.includes(t)?(f="∥",x="doublevert",y=556):t==="["||t==="\\lbrack"?(d="⎡",f="⎢",p="⎣",b="Size4-Regular",x="lbrack",y=667):t==="]"||t==="\\rbrack"?(d="⎤",f="⎥",p="⎦",b="Size4-Regular",x="rbrack",y=667):t==="\\lfloor"||t==="⌊"?(f=d="⎢",p="⎣",b="Size4-Regular",x="lfloor",y=667):t==="\\lceil"||t==="⌈"?(d="⎡",f=p="⎢",b="Size4-Regular",x="lceil",y=667):t==="\\rfloor"||t==="⌋"?(f=d="⎥",p="⎦",b="Size4-Regular",x="rfloor",y=667):t==="\\rceil"||t==="⌉"?(d="⎤",f=p="⎥",b="Size4-Regular",x="rceil",y=667):t==="("||t==="\\lparen"?(d="⎛",f="⎜",p="⎝",b="Size4-Regular",x="lparen",y=875):t===")"||t==="\\rparen"?(d="⎞",f="⎟",p="⎠",b="Size4-Regular",x="rparen",y=875):t==="\\{"||t==="\\lbrace"?(d="⎧",m="⎨",p="⎩",f="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",m="⎬",p="⎭",f="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",f="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",f="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",f="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",f="⎪",b="Size4-Regular");var N=au(d,b,o),k=N.height+N.depth,S=au(f,b,o),T=S.height+S.depth,M=au(p,b,o),A=M.height+M.depth,R=0,B=1;if(m!==null){var O=au(m,b,o);R=O.height+O.depth,B=2}var L=k+A+R,$=Math.max(0,Math.ceil((n-L)/(B*T))),U=L+$*B*T,I=l.fontMetrics().axisHeight;a&&(I*=l.sizeMultiplier);var G=U/2-I,ee=[];if(x.length>0){var Ne=U-k-A,J=Math.round(U*1e3),se=HI(x,Math.round(Ne*1e3)),H=new Ml(x,se),le=(y/1e3).toFixed(3)+"em",re=(J/1e3).toFixed(3)+"em",ge=new Fs([H],{width:le,height:re,viewBox:"0 0 "+y+" "+J}),E=de.makeSvgSpan([],[ge],l);E.height=J/1e3,E.style.width=le,E.style.height=re,ee.push({type:"elem",elem:E})}else{if(ee.push(ax(p,b,o)),ee.push(L0),m===null){var we=U-k-A+2*t1;ee.push(sx(f,we,l))}else{var Z=(U-k-A-R)/2+2*t1;ee.push(sx(f,Z,l)),ee.push(L0),ee.push(ax(m,b,o)),ee.push(L0),ee.push(sx(f,Z,l))}ee.push(L0),ee.push(ax(d,b,o))}var z=l.havingBaseStyle(tt.TEXT),X=de.makeVList({positionType:"bottom",positionData:G,children:ee},z);return yg(de.makeSpan(["delimsizing","mult"],[X],z),tt.TEXT,l,c)},lx=80,ix=.08,ox=function(t,n,a,l,o){var c=II(t,l,a),d=new Ml(t,c),m=new Fs([d],{width:"400em",height:Le(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return de.makeSvgSpan(["hide-tail"],[m],o)},Fq=function(t,n){var a=n.havingBaseSizing(),l=q8("\\surd",t*a.sizeMultiplier,I8,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,m=0,f=0,p=0,x;return l.type==="small"?(p=1e3+1e3*c+lx,t<1?o=1:t<1.4&&(o=.7),m=(1+c+ix)/o,f=(1+c)/o,d=ox("sqrtMain",m,p,c,n),d.style.minWidth="0.853em",x=.833/o):l.type==="large"?(p=(1e3+lx)*hu[l.size],f=(hu[l.size]+c)/o,m=(hu[l.size]+c+ix)/o,d=ox("sqrtSize"+l.size,m,p,c,n),d.style.minWidth="1.02em",x=1/o):(m=t+c+ix,f=t+c,p=Math.floor(1e3*t+c)+lx,d=ox("sqrtTall",m,p,c,n),d.style.minWidth="0.742em",x=1.056),d.height=f,d.style.height=Le(m),{span:d,advanceWidth:x,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},P8=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Iq=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],F8=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],hu=[0,1.2,1.8,2.4,3],qq=function(t,n,a,l,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),P8.includes(t)||F8.includes(t))return L8(t,n,!1,a,l,o);if(Iq.includes(t))return B8(t,hu[n],!1,a,l,o);throw new Ae("Illegal delimiter: '"+t+"'")},Hq=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Uq=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"stack"}],I8=[{type:"small",style:tt.SCRIPTSCRIPT},{type:"small",style:tt.SCRIPT},{type:"small",style:tt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],$q=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},q8=function(t,n,a,l){for(var o=Math.min(2,3-l.style.size),c=o;c<a.length&&a[c].type!=="stack";c++){var d=au(t,$q(a[c]),"math"),m=d.height+d.depth;if(a[c].type==="small"){var f=l.havingBaseStyle(a[c].style);m*=f.sizeMultiplier}if(m>n)return a[c]}return a[a.length-1]},H8=function(t,n,a,l,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;F8.includes(t)?d=Hq:P8.includes(t)?d=I8:d=Uq;var m=q8(t,n,d,l);return m.type==="small"?Rq(t,m.style,a,l,o,c):m.type==="large"?L8(t,m.size,a,l,o,c):B8(t,n,a,l,o,c)},Vq=function(t,n,a,l,o,c){var d=l.fontMetrics().axisHeight*l.sizeMultiplier,m=901,f=5/l.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),x=Math.max(p/500*m,2*p-f);return H8(t,x,!0,l,o,c)},Ls={sqrtImage:Fq,sizedDelim:qq,sizeToMaxHeight:hu,customSizedDelim:H8,leftRightDelim:Vq},U3={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Gq=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Qm(e,t){var n=Xm(e);if(n&&Gq.includes(n.text))return n;throw n?new Ae("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ae("Invalid delimiter type '"+e.type+"'",e)}Be({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Qm(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:U3[e.funcName].size,mclass:U3[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?de.makeSpan([e.mclass]):Ls.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Ma(e.delim,e.mode));var n=new Me.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Le(Ls.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function $3(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Be({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Ae("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Qm(t[0],e).text,color:n}}});Be({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Qm(t[0],e),a=e.parser;++a.leftrightDepth;var l=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=yt(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:l,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{$3(e);for(var n=nr(e.body,t,!0,["mopen","mclose"]),a=0,l=0,o=!1,c=0;c<n.length;c++)n[c].isMiddle?o=!0:(a=Math.max(n[c].height,a),l=Math.max(n[c].depth,l));a*=t.sizeMultiplier,l*=t.sizeMultiplier;var d;if(e.left==="."?d=Nu(t,["mopen"]):d=Ls.leftRightDelim(e.left,a,l,t,e.mode,["mopen"]),n.unshift(d),o)for(var m=1;m<n.length;m++){var f=n[m],p=f.isMiddle;p&&(n[m]=Ls.leftRightDelim(p.delim,a,l,p.options,e.mode,[]))}var x;if(e.right===".")x=Nu(t,["mclose"]);else{var y=e.rightColor?t.withColor(e.rightColor):t;x=Ls.leftRightDelim(e.right,a,l,y,e.mode,["mclose"])}return n.push(x),de.makeSpan(["minner"],n,t)},mathmlBuilder:(e,t)=>{$3(e);var n=Qr(e.body,t);if(e.left!=="."){var a=new Me.MathNode("mo",[Ma(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var l=new Me.MathNode("mo",[Ma(e.right,e.mode)]);l.setAttribute("fence","true"),e.rightColor&&l.setAttribute("mathcolor",e.rightColor),n.push(l)}return pg(n)}});Be({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Qm(t[0],e);if(!e.parser.leftrightDepth)throw new Ae("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=Nu(t,[]);else{n=Ls.sizedDelim(e.delim,1,t,e.mode,[]);var a={delim:e.delim,options:t};n.isMiddle=a}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Ma("|","text"):Ma(e.delim,e.mode),a=new Me.MathNode("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var bg=(e,t)=>{var n=de.wrapFragment(Ft(e.body,t),t),a=e.label.slice(1),l=t.sizeMultiplier,o,c=0,d=Ut.isCharacterBox(e.body);if(a==="sout")o=de.makeSpan(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/l,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var m=Mn({number:.6,unit:"pt"},t),f=Mn({number:.35,unit:"ex"},t),p=t.havingBaseSizing();l=l/p.sizeMultiplier;var x=n.height+n.depth+m+f;n.style.paddingLeft=Le(x/2+m);var y=Math.floor(1e3*x*l),b=PI(y),N=new Fs([new Ml("phase",b)],{width:"400em",height:Le(y/1e3),viewBox:"0 0 400000 "+y,preserveAspectRatio:"xMinYMin slice"});o=de.makeSvgSpan(["hide-tail"],[N],t),o.style.height=Le(x),c=n.depth+m+f}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var k=0,S=0,T=0;/box/.test(a)?(T=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),k=t.fontMetrics().fboxsep+(a==="colorbox"?0:T),S=k):a==="angl"?(T=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),k=4*T,S=Math.max(0,.25-n.depth)):(k=d?.2:0,S=k),o=qs.encloseSpan(n,a,k,S,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Le(T)):a==="angl"&&T!==.049&&(o.style.borderTopWidth=Le(T),o.style.borderRightWidth=Le(T)),c=n.depth+S,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]},t);else{var A=/cancel|phase/.test(a)?["svg-align"]:[];M=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:A}]},t)}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!d?de.makeSpan(["mord","cancel-lap"],[M],t):de.makeSpan(["mord"],[M],t)},wg=(e,t)=>{var n=0,a=new Me.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[xn(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var l=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+l+"em solid "+String(e.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Be({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=yt(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:l,backgroundColor:o,body:c}},htmlBuilder:bg,mathmlBuilder:wg});Be({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=yt(t[0],"color-token").color,c=yt(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:l,backgroundColor:c,borderColor:o,body:d}},htmlBuilder:bg,mathmlBuilder:wg});Be({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Be({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:bg,mathmlBuilder:wg});Be({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var U8={};function is(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:l},m=0;m<n.length;++m)U8[n[m]]=d;o&&(pm[t]=o),c&&(xm[t]=c)}var $8={};function F(e,t){$8[e]=t}function V3(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Zm=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Ae("{"+e.envName+"} can be used only in display mode.")};function jg(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function Bl(e,t,n){var{hskipBeforeAndAfter:a,addJot:l,cols:o,arraystretch:c,colSeparationType:d,autoTag:m,singleRow:f,emptySingleRow:p,maxNumCols:x,leqno:y}=t;if(e.gullet.beginGroup(),f||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)c=1;else if(c=parseFloat(b),!c||c<0)throw new Ae("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var N=[],k=[N],S=[],T=[],M=m!=null?[]:void 0;function A(){m&&e.gullet.macros.set("\\@eqnsw","1",!0)}function R(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new da("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!m&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(A(),T.push(V3(e));;){var B=e.parseExpression(!1,f?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),B={type:"ordgroup",mode:e.mode,body:B},n&&(B={type:"styling",mode:e.mode,style:n,body:[B]}),N.push(B);var O=e.fetch().text;if(O==="&"){if(x&&N.length===x){if(f||d)throw new Ae("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(O==="\\end"){R(),N.length===1&&B.type==="styling"&&B.body[0].body.length===0&&(k.length>1||!p)&&k.pop(),T.length<k.length+1&&T.push([]);break}else if(O==="\\\\"){e.consume();var L=void 0;e.gullet.future().text!==" "&&(L=e.parseSizeGroup(!0)),S.push(L?L.value:null),R(),T.push(V3(e)),N=[],k.push(N),A()}else throw new Ae("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:l,arraystretch:c,body:k,cols:o,rowGaps:S,hskipBeforeAndAfter:a,hLinesBeforeRow:T,colSeparationType:d,tags:M,leqno:y}}function Ng(e){return e.slice(0,1)==="d"?"display":"text"}var os=function(t,n){var a,l,o=t.body.length,c=t.hLinesBeforeRow,d=0,m=new Array(o),f=[],p=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),x=1/n.fontMetrics().ptPerEm,y=5*x;if(t.colSeparationType&&t.colSeparationType==="small"){var b=n.havingStyle(tt.SCRIPT).sizeMultiplier;y=.2778*(b/n.sizeMultiplier)}var N=t.colSeparationType==="CD"?Mn({number:3,unit:"ex"},n):12*x,k=3*x,S=t.arraystretch*N,T=.7*S,M=.3*S,A=0;function R(Xe){for(var wn=0;wn<Xe.length;++wn)wn>0&&(A+=.25),f.push({pos:A,isDashed:Xe[wn]})}for(R(c[0]),a=0;a<t.body.length;++a){var B=t.body[a],O=T,L=M;d<B.length&&(d=B.length);var $=new Array(B.length);for(l=0;l<B.length;++l){var U=Ft(B[l],n);L<U.depth&&(L=U.depth),O<U.height&&(O=U.height),$[l]=U}var I=t.rowGaps[a],G=0;I&&(G=Mn(I,n),G>0&&(G+=M,L<G&&(L=G),G=0)),t.addJot&&(L+=k),$.height=O,$.depth=L,A+=O,$.pos=A,A+=L+G,m[a]=$,R(c[a+1])}var ee=A/2+n.fontMetrics().axisHeight,Ne=t.cols||[],J=[],se,H,le=[];if(t.tags&&t.tags.some(Xe=>Xe))for(a=0;a<o;++a){var re=m[a],ge=re.pos-ee,E=t.tags[a],we=void 0;E===!0?we=de.makeSpan(["eqn-num"],[],n):E===!1?we=de.makeSpan([],[],n):we=de.makeSpan([],nr(E,n,!0),n),we.depth=re.depth,we.height=re.height,le.push({type:"elem",elem:we,shift:ge})}for(l=0,H=0;l<d||H<Ne.length;++l,++H){for(var Z=Ne[H]||{},z=!0;Z.type==="separator";){if(z||(se=de.makeSpan(["arraycolsep"],[]),se.style.width=Le(n.fontMetrics().doubleRuleSep),J.push(se)),Z.separator==="|"||Z.separator===":"){var X=Z.separator==="|"?"solid":"dashed",q=de.makeSpan(["vertical-separator"],[],n);q.style.height=Le(A),q.style.borderRightWidth=Le(p),q.style.borderRightStyle=X,q.style.margin="0 "+Le(-p/2);var ce=A-ee;ce&&(q.style.verticalAlign=Le(-ce)),J.push(q)}else throw new Ae("Invalid separator type: "+Z.separator);H++,Z=Ne[H]||{},z=!1}if(!(l>=d)){var fe=void 0;(l>0||t.hskipBeforeAndAfter)&&(fe=Ut.deflt(Z.pregap,y),fe!==0&&(se=de.makeSpan(["arraycolsep"],[]),se.style.width=Le(fe),J.push(se)));var De=[];for(a=0;a<o;++a){var oe=m[a],He=oe[l];if(He){var at=oe.pos-ee;He.depth=oe.depth,He.height=oe.height,De.push({type:"elem",elem:He,shift:at})}}De=de.makeVList({positionType:"individualShift",children:De},n),De=de.makeSpan(["col-align-"+(Z.align||"c")],[De]),J.push(De),(l<d-1||t.hskipBeforeAndAfter)&&(fe=Ut.deflt(Z.postgap,y),fe!==0&&(se=de.makeSpan(["arraycolsep"],[]),se.style.width=Le(fe),J.push(se)))}}if(m=de.makeSpan(["mtable"],J),f.length>0){for(var je=de.makeLineSpan("hline",n,p),Ze=de.makeLineSpan("hdashline",n,p),qe=[{type:"elem",elem:m,shift:0}];f.length>0;){var Ot=f.pop(),bn=Ot.pos-ee;Ot.isDashed?qe.push({type:"elem",elem:Ze,shift:bn}):qe.push({type:"elem",elem:je,shift:bn})}m=de.makeVList({positionType:"individualShift",children:qe},n)}if(le.length===0)return de.makeSpan(["mord"],[m],n);var Dn=de.makeVList({positionType:"individualShift",children:le},n);return Dn=de.makeSpan(["tag"],[Dn],n),de.makeFragment([m,Dn])},Yq={c:"center ",l:"left ",r:"right "},cs=function(t,n){for(var a=[],l=new Me.MathNode("mtd",[],["mtr-glue"]),o=new Me.MathNode("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var d=t.body[c],m=[],f=0;f<d.length;f++)m.push(new Me.MathNode("mtd",[xn(d[f],n)]));t.tags&&t.tags[c]&&(m.unshift(l),m.push(l),t.leqno?m.unshift(o):m.push(o)),a.push(new Me.MathNode("mtr",m))}var p=new Me.MathNode("mtable",a),x=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);p.setAttribute("rowspacing",Le(x));var y="",b="";if(t.cols&&t.cols.length>0){var N=t.cols,k="",S=!1,T=0,M=N.length;N[0].type==="separator"&&(y+="top ",T=1),N[N.length-1].type==="separator"&&(y+="bottom ",M-=1);for(var A=T;A<M;A++)N[A].type==="align"?(b+=Yq[N[A].align],S&&(k+="none "),S=!0):N[A].type==="separator"&&S&&(k+=N[A].separator==="|"?"solid ":"dashed ",S=!1);p.setAttribute("columnalign",b.trim()),/[sd]/.test(k)&&p.setAttribute("columnlines",k.trim())}if(t.colSeparationType==="align"){for(var R=t.cols||[],B="",O=1;O<R.length;O++)B+=O%2?"0em ":"1em ";p.setAttribute("columnspacing",B.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var L="",$=t.hLinesBeforeRow;y+=$[0].length>0?"left ":"",y+=$[$.length-1].length>0?"right ":"";for(var U=1;U<$.length-1;U++)L+=$[U].length===0?"none ":$[U][0]?"dashed ":"solid ";return/[sd]/.test(L)&&p.setAttribute("rowlines",L.trim()),y!==""&&(p=new Me.MathNode("menclose",[p]),p.setAttribute("notation",y.trim())),t.arraystretch&&t.arraystretch<1&&(p=new Me.MathNode("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},V8=function(t,n){t.envName.indexOf("ed")===-1&&Zm(t);var a=[],l=t.envName.indexOf("at")>-1?"alignat":"align",o=t.envName==="split",c=Bl(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:jg(t.envName),emptySingleRow:!0,colSeparationType:l,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),d,m=0,f={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",x=0;x<n[0].body.length;x++){var y=yt(n[0].body[x],"textord");p+=y.text}d=Number(p),m=d*2}var b=!m;c.body.forEach(function(T){for(var M=1;M<T.length;M+=2){var A=yt(T[M],"styling"),R=yt(A.body[0],"ordgroup");R.body.unshift(f)}if(b)m<T.length&&(m=T.length);else{var B=T.length/2;if(d<B)throw new Ae("Too many math in a row: "+("expected "+d+", but got "+B),T[0])}});for(var N=0;N<m;++N){var k="r",S=0;N%2===1?k="l":N>0&&b&&(S=1),a[N]={type:"align",align:k,pregap:S,postgap:0}}return c.colSeparationType=b?"align":"alignat",c};is({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Xm(t[0]),a=n?[t[0]]:yt(t[0],"ordgroup").body,l=a.map(function(c){var d=gg(c),m=d.text;if("lcr".indexOf(m)!==-1)return{type:"align",align:m};if(m==="|")return{type:"separator",separator:"|"};if(m===":")return{type:"separator",separator:":"};throw new Ae("Unknown column alignment: "+m,c)}),o={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return Bl(e.parser,o,Ng(e.envName))},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var l=e.parser;if(l.consumeSpaces(),l.fetch().text==="["){if(l.consume(),l.consumeSpaces(),n=l.fetch().text,"lcr".indexOf(n)===-1)throw new Ae("Expected l or c or r",l.nextToken);l.consume(),l.consumeSpaces(),l.expect("]"),l.consume(),a.cols=[{type:"align",align:n}]}}var o=Bl(e.parser,a,Ng(e.envName)),c=Math.max(0,...o.body.map(d=>d.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Bl(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Xm(t[0]),a=n?[t[0]]:yt(t[0],"ordgroup").body,l=a.map(function(c){var d=gg(c),m=d.text;if("lc".indexOf(m)!==-1)return{type:"align",align:m};throw new Ae("Unknown column alignment: "+m,c)});if(l.length>1)throw new Ae("{subarray} can contain only one column");var o={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5};if(o=Bl(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new Ae("{subarray} can contain only one column");return o},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Bl(e.parser,t,Ng(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:V8,htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&Zm(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:jg(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Bl(e.parser,t,"display")},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:V8,htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Zm(e);var t={autoTag:jg(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Bl(e.parser,t,"display")},htmlBuilder:os,mathmlBuilder:cs});is({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Zm(e),zq(e.parser)},htmlBuilder:os,mathmlBuilder:cs});F("\\nonumber","\\gdef\\@eqnsw{0}");F("\\notag","\\nonumber");Be({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ae(e.funcName+" valid only within array environment")}});var G3=U8;Be({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];if(l.type!=="ordgroup")throw new Ae("Invalid environment name",l);for(var o="",c=0;c<l.body.length;++c)o+=yt(l.body[c],"textord").text;if(a==="\\begin"){if(!G3.hasOwnProperty(o))throw new Ae("No such environment: "+o,l);var d=G3[o],{args:m,optArgs:f}=n.parseArguments("\\begin{"+o+"}",d),p={mode:n.mode,envName:o,parser:n},x=d.handler(p,m,f);n.expect("\\end",!1);var y=n.nextToken,b=yt(n.parseFunction(),"environment");if(b.name!==o)throw new Ae("Mismatch: \\begin{"+o+"} matched by \\end{"+b.name+"}",y);return x}return{type:"environment",mode:n.mode,name:o,nameGroup:l}}});var G8=(e,t)=>{var n=e.font,a=t.withFont(n);return Ft(e.body,a)},Y8=(e,t)=>{var n=e.font,a=t.withFont(n);return xn(e.body,a)},Y3={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Be({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=gm(t[0]),o=a;return o in Y3&&(o=Y3[o]),{type:"font",mode:n.mode,font:o.slice(1),body:l}},htmlBuilder:G8,mathmlBuilder:Y8});Be({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0],l=Ut.isCharacterBox(a);return{type:"mclass",mode:n.mode,mclass:Km(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:l}}});Be({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:l}=e,{mode:o}=n,c=n.parseExpression(!0,l),d="math"+a.slice(1);return{type:"font",mode:o,font:d,body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:G8,mathmlBuilder:Y8});var W8=(e,t)=>{var n=t;return e==="display"?n=n.id>=tt.SCRIPT.id?n.text():tt.DISPLAY:e==="text"&&n.size===tt.DISPLAY.size?n=tt.TEXT:e==="script"?n=tt.SCRIPT:e==="scriptscript"&&(n=tt.SCRIPTSCRIPT),n},Sg=(e,t)=>{var n=W8(e.size,t.style),a=n.fracNum(),l=n.fracDen(),o;o=t.havingStyle(a);var c=Ft(e.numer,o,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,m=3.5/t.fontMetrics().ptPerEm;c.height=c.height<d?d:c.height,c.depth=c.depth<m?m:c.depth}o=t.havingStyle(l);var f=Ft(e.denom,o,t),p,x,y;e.hasBarLine?(e.barSize?(x=Mn(e.barSize,t),p=de.makeLineSpan("frac-line",t,x)):p=de.makeLineSpan("frac-line",t),x=p.height,y=p.height):(p=null,x=0,y=t.fontMetrics().defaultRuleThickness);var b,N,k;n.size===tt.DISPLAY.size||e.size==="display"?(b=t.fontMetrics().num1,x>0?N=3*y:N=7*y,k=t.fontMetrics().denom1):(x>0?(b=t.fontMetrics().num2,N=y):(b=t.fontMetrics().num3,N=3*y),k=t.fontMetrics().denom2);var S;if(p){var M=t.fontMetrics().axisHeight;b-c.depth-(M+.5*x)<N&&(b+=N-(b-c.depth-(M+.5*x))),M-.5*x-(f.height-k)<N&&(k+=N-(M-.5*x-(f.height-k)));var A=-(M-.5*x);S=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:f,shift:k},{type:"elem",elem:p,shift:A},{type:"elem",elem:c,shift:-b}]},t)}else{var T=b-c.depth-(f.height-k);T<N&&(b+=.5*(N-T),k+=.5*(N-T)),S=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:f,shift:k},{type:"elem",elem:c,shift:-b}]},t)}o=t.havingStyle(n),S.height*=o.sizeMultiplier/t.sizeMultiplier,S.depth*=o.sizeMultiplier/t.sizeMultiplier;var R;n.size===tt.DISPLAY.size?R=t.fontMetrics().delim1:n.size===tt.SCRIPTSCRIPT.size?R=t.havingStyle(tt.SCRIPT).fontMetrics().delim2:R=t.fontMetrics().delim2;var B,O;return e.leftDelim==null?B=Nu(t,["mopen"]):B=Ls.customSizedDelim(e.leftDelim,R,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?O=de.makeSpan([]):e.rightDelim==null?O=Nu(t,["mclose"]):O=Ls.customSizedDelim(e.rightDelim,R,!0,t.havingStyle(n),e.mode,["mclose"]),de.makeSpan(["mord"].concat(o.sizingClasses(t)),[B,de.makeSpan(["mfrac"],[S]),O],t)},kg=(e,t)=>{var n=new Me.MathNode("mfrac",[xn(e.numer,t),xn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=Mn(e.barSize,t);n.setAttribute("linethickness",Le(a))}var l=W8(e.size,t.style);if(l.size!==t.style.size){n=new Me.MathNode("mstyle",[n]);var o=l.size===tt.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var c=[];if(e.leftDelim!=null){var d=new Me.MathNode("mo",[new Me.TextNode(e.leftDelim.replace("\\",""))]);d.setAttribute("fence","true"),c.push(d)}if(c.push(n),e.rightDelim!=null){var m=new Me.MathNode("mo",[new Me.TextNode(e.rightDelim.replace("\\",""))]);m.setAttribute("fence","true"),c.push(m)}return pg(c)}return n};Be({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=t[1],c,d=null,m=null,f="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,d="(",m=")";break;case"\\\\bracefrac":c=!1,d="\\{",m="\\}";break;case"\\\\brackfrac":c=!1,d="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":f="display";break;case"\\tfrac":case"\\tbinom":f="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:l,denom:o,hasBarLine:c,leftDelim:d,rightDelim:m,size:f,barSize:null}},htmlBuilder:Sg,mathmlBuilder:kg});Be({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:l,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Be({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,l;switch(n){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:a}}});var W3=["display","text","script","scriptscript"],X3=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Be({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],l=t[5],o=gm(t[0]),c=o.type==="atom"&&o.family==="open"?X3(o.text):null,d=gm(t[1]),m=d.type==="atom"&&d.family==="close"?X3(d.text):null,f=yt(t[2],"size"),p,x=null;f.isBlank?p=!0:(x=f.value,p=x.number>0);var y="auto",b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var N=yt(b.body[0],"textord");y=W3[Number(N.text)]}}else b=yt(b,"textord"),y=W3[Number(b.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:l,continued:!1,hasBarLine:p,barSize:x,leftDelim:c,rightDelim:m,size:y}},htmlBuilder:Sg,mathmlBuilder:kg});Be({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:l}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:yt(t[0],"size").value,token:l}}});Be({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=NI(yt(t[1],"infix").size),c=t[2],d=o.number>0;return{type:"genfrac",mode:n.mode,numer:l,denom:c,continued:!1,hasBarLine:d,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Sg,mathmlBuilder:kg});var X8=(e,t)=>{var n=t.style,a,l;e.type==="supsub"?(a=e.sup?Ft(e.sup,t.havingStyle(n.sup()),t):Ft(e.sub,t.havingStyle(n.sub()),t),l=yt(e.base,"horizBrace")):l=yt(e,"horizBrace");var o=Ft(l.base,t.havingBaseStyle(tt.DISPLAY)),c=qs.svgSpan(l,t),d;if(l.isOver?(d=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c}]},t),d.children[0].children[0].children[1].classes.push("svg-align")):(d=de.makeVList({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c},{type:"kern",size:.1},{type:"elem",elem:o}]},t),d.children[0].children[0].children[0].classes.push("svg-align")),a){var m=de.makeSpan(["mord",l.isOver?"mover":"munder"],[d],t);l.isOver?d=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:a}]},t):d=de.makeVList({positionType:"bottom",positionData:m.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:m}]},t)}return de.makeSpan(["mord",l.isOver?"mover":"munder"],[d],t)},Wq=(e,t)=>{var n=qs.mathMLnode(e.label);return new Me.MathNode(e.isOver?"mover":"munder",[xn(e.base,t),n])};Be({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:/^\\over/.test(a),base:t[0]}},htmlBuilder:X8,mathmlBuilder:Wq});Be({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],l=yt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:n.mode,href:l,body:Pn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=nr(e.body,t,!1);return de.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Al(e.body,t);return n instanceof ca||(n=new ca("mrow",[n])),n.setAttribute("href",e.href),n}});Be({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=yt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var l=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),l.push({type:"textord",mode:"text",text:c})}var d={type:"text",mode:n.mode,font:"\\texttt",body:l};return{type:"href",mode:n.mode,href:a,body:Pn(d)}}});Be({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Pn(t[0])}},htmlBuilder(e,t){var n=nr(e.body,t,!1);return de.makeFragment(n)},mathmlBuilder(e,t){return new Me.MathNode("mrow",Qr(e.body,t))}});Be({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:l}=e,o=yt(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,m={};switch(a){case"\\htmlClass":m.class=o,d={command:"\\htmlClass",class:o};break;case"\\htmlId":m.id=o,d={command:"\\htmlId",id:o};break;case"\\htmlStyle":m.style=o,d={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var f=o.split(","),p=0;p<f.length;p++){var x=f[p].split("=");if(x.length!==2)throw new Ae("Error parsing key-value for \\htmlData");m["data-"+x[0].trim()]=x[1].trim()}d={command:"\\htmlData",attributes:m};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(d)?{type:"html",mode:n.mode,attributes:m,body:Pn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=nr(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var l=de.makeSpan(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&l.setAttribute(o,e.attributes[o]);return l},mathmlBuilder:(e,t)=>Al(e.body,t)});Be({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Pn(t[0]),mathml:Pn(t[1])}},htmlBuilder:(e,t)=>{var n=nr(e.html,t,!1);return de.makeFragment(n)},mathmlBuilder:(e,t)=>Al(e.mathml,t)});var cx=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ae("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!f8(a))throw new Ae("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Be({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,l={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var m=yt(n[0],"raw").string,f=m.split(","),p=0;p<f.length;p++){var x=f[p].split("=");if(x.length===2){var y=x[1].trim();switch(x[0].trim()){case"alt":d=y;break;case"width":l=cx(y);break;case"height":o=cx(y);break;case"totalheight":c=cx(y);break;default:throw new Ae("Invalid key: '"+x[0]+"' in \\includegraphics.")}}}var b=yt(t[0],"url").url;return d===""&&(d=b,d=d.replace(/^.*[\\/]/,""),d=d.substring(0,d.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:a.mode,alt:d,width:l,height:o,totalheight:c,src:b}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Mn(e.height,t),a=0;e.totalheight.number>0&&(a=Mn(e.totalheight,t)-n);var l=0;e.width.number>0&&(l=Mn(e.width,t));var o={height:Le(n+a)};l>0&&(o.width=Le(l)),a>0&&(o.verticalAlign=Le(-a));var c=new WI(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Me.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var a=Mn(e.height,t),l=0;if(e.totalheight.number>0&&(l=Mn(e.totalheight,t)-a,n.setAttribute("valign",Le(-l))),n.setAttribute("height",Le(a+l)),e.width.number>0){var o=Mn(e.width,t);n.setAttribute("width",Le(o))}return n.setAttribute("src",e.src),n}});Be({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=yt(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=l.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+l.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:l.value}},htmlBuilder(e,t){return de.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=Mn(e.dimension,t);return new Me.SpaceNode(n)}});Be({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:l}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=de.makeSpan([],[Ft(e.body,t)]),n=de.makeSpan(["inner"],[n],t)):n=de.makeSpan(["inner"],[Ft(e.body,t)]);var a=de.makeSpan(["fix"],[]),l=de.makeSpan([e.alignment],[n,a],t),o=de.makeSpan(["strut"]);return o.style.height=Le(l.height+l.depth),l.depth&&(o.style.verticalAlign=Le(-l.depth)),l.children.unshift(o),l=de.makeSpan(["thinbox"],[l],t),de.makeSpan(["mord","vbox"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Me.MathNode("mpadded",[xn(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Be({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,l=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(l),{type:"styling",mode:a.mode,style:"text",body:c}}});Be({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ae("Mismatched "+e.funcName)}});var K3=(e,t)=>{switch(t.style.size){case tt.DISPLAY.size:return e.display;case tt.TEXT.size:return e.text;case tt.SCRIPT.size:return e.script;case tt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Be({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Pn(t[0]),text:Pn(t[1]),script:Pn(t[2]),scriptscript:Pn(t[3])}},htmlBuilder:(e,t)=>{var n=K3(e,t),a=nr(n,t,!1);return de.makeFragment(a)},mathmlBuilder:(e,t)=>{var n=K3(e,t);return Al(n,t)}});var K8=(e,t,n,a,l,o,c)=>{e=de.makeSpan([],[e]);var d=n&&Ut.isCharacterBox(n),m,f;if(t){var p=Ft(t,a.havingStyle(l.sup()),a);f={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var x=Ft(n,a.havingStyle(l.sub()),a);m={elem:x,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-x.height)}}var y;if(f&&m){var b=a.fontMetrics().bigOpSpacing5+m.elem.height+m.elem.depth+m.kern+e.depth+c;y=de.makeVList({positionType:"bottom",positionData:b,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Le(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Le(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(m){var N=e.height-c;y=de.makeVList({positionType:"top",positionData:N,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Le(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e}]},a)}else if(f){var k=e.depth+c;y=de.makeVList({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:f.kern},{type:"elem",elem:f.elem,marginLeft:Le(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return e;var S=[y];if(m&&o!==0&&!d){var T=de.makeSpan(["mspace"],[],a);T.style.marginRight=Le(o),S.unshift(T)}return de.makeSpan(["mop","op-limits"],S,a)},Q8=["\\smallint"],nc=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=yt(e.base,"op"),l=!0):o=yt(e,"op");var c=t.style,d=!1;c.size===tt.DISPLAY.size&&o.symbol&&!Q8.includes(o.name)&&(d=!0);var m;if(o.symbol){var f=d?"Size2-Regular":"Size1-Regular",p="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(p=o.name.slice(1),o.name=p==="oiint"?"\\iint":"\\iiint"),m=de.makeSymbol(o.name,f,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),p.length>0){var x=m.italic,y=de.staticSvg(p+"Size"+(d?"2":"1"),t);m=de.makeVList({positionType:"individualShift",children:[{type:"elem",elem:m,shift:0},{type:"elem",elem:y,shift:d?.08:0}]},t),o.name="\\"+p,m.classes.unshift("mop"),m.italic=x}}else if(o.body){var b=nr(o.body,t,!0);b.length===1&&b[0]instanceof Ea?(m=b[0],m.classes[0]="mop"):m=de.makeSpan(["mop"],b,t)}else{for(var N=[],k=1;k<o.name.length;k++)N.push(de.mathsym(o.name[k],o.mode,t));m=de.makeSpan(["mop"],N,t)}var S=0,T=0;return(m instanceof Ea||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift&&(S=(m.height-m.depth)/2-t.fontMetrics().axisHeight,T=m.italic),l?K8(m,n,a,t,c,T,S):(S&&(m.style.position="relative",m.style.top=Le(S)),m)},Ku=(e,t)=>{var n;if(e.symbol)n=new ca("mo",[Ma(e.name,e.mode)]),Q8.includes(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ca("mo",Qr(e.body,t));else{n=new ca("mi",[new ns(e.name.slice(1))]);var a=new ca("mo",[Ma("","text")]);e.parentIsSupSub?n=new ca("mrow",[n,a]):n=k8([n,a])}return n},Xq={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Be({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=a;return l.length===1&&(l=Xq[l]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:l}},htmlBuilder:nc,mathmlBuilder:Ku});Be({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Pn(a)}},htmlBuilder:nc,mathmlBuilder:Ku});var Kq={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Be({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:nc,mathmlBuilder:Ku});Be({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:nc,mathmlBuilder:Ku});Be({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=Kq[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:nc,mathmlBuilder:Ku});var Z8=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=yt(e.base,"operatorname"),l=!0):o=yt(e,"operatorname");var c;if(o.body.length>0){for(var d=o.body.map(x=>{var y=x.text;return typeof y=="string"?{type:"textord",mode:x.mode,text:y}:x}),m=nr(d,t.withFont("mathrm"),!0),f=0;f<m.length;f++){var p=m[f];p instanceof Ea&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=de.makeSpan(["mop"],m,t)}else c=de.makeSpan(["mop"],[],t);return l?K8(c,n,a,t,t.style,0,0):c},Qq=(e,t)=>{for(var n=Qr(e.body,t.withFont("mathrm")),a=!0,l=0;l<n.length;l++){var o=n[l];if(!(o instanceof Me.SpaceNode))if(o instanceof Me.MathNode)switch(o.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var c=o.children[0];o.children.length===1&&c instanceof Me.TextNode?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var d=n.map(p=>p.toText()).join("");n=[new Me.TextNode(d)]}var m=new Me.MathNode("mi",n);m.setAttribute("mathvariant","normal");var f=new Me.MathNode("mo",[Ma("","text")]);return e.parentIsSupSub?new Me.MathNode("mrow",[m,f]):Me.newDocumentFragment([m,f])};Be({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"operatorname",mode:n.mode,body:Pn(l),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Z8,mathmlBuilder:Qq});F("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Ci({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?de.makeFragment(nr(e.body,t,!1)):de.makeSpan(["mord"],nr(e.body,t,!0),t)},mathmlBuilder(e,t){return Al(e.body,t,!0)}});Be({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=Ft(e.body,t.havingCrampedStyle()),a=de.makeLineSpan("overline-line",t),l=t.fontMetrics().defaultRuleThickness,o=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*l},{type:"elem",elem:a},{type:"kern",size:l}]},t);return de.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Me.MathNode("mo",[new Me.TextNode("‾")]);n.setAttribute("stretchy","true");var a=new Me.MathNode("mover",[xn(e.body,t),n]);return a.setAttribute("accent","true"),a}});Be({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:Pn(a)}},htmlBuilder:(e,t)=>{var n=nr(e.body,t.withPhantom(),!1);return de.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Qr(e.body,t);return new Me.MathNode("mphantom",n)}});Be({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"hphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=de.makeSpan([],[Ft(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var a=0;a<n.children.length;a++)n.children[a].height=0,n.children[a].depth=0;return n=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),de.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Qr(Pn(e.body),t),a=new Me.MathNode("mphantom",n),l=new Me.MathNode("mpadded",[a]);return l.setAttribute("height","0px"),l.setAttribute("depth","0px"),l}});Be({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=de.makeSpan(["inner"],[Ft(e.body,t.withPhantom())]),a=de.makeSpan(["fix"],[]);return de.makeSpan(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Qr(Pn(e.body),t),a=new Me.MathNode("mphantom",n),l=new Me.MathNode("mpadded",[a]);return l.setAttribute("width","0px"),l}});Be({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=yt(t[0],"size").value,l=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:l}},htmlBuilder(e,t){var n=Ft(e.body,t),a=Mn(e.dy,t);return de.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Me.MathNode("mpadded",[xn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Be({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Be({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,l=n[0],o=yt(t[0],"size"),c=yt(t[1],"size");return{type:"rule",mode:a.mode,shift:l&&yt(l,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=de.makeSpan(["mord","rule"],[],t),a=Mn(e.width,t),l=Mn(e.height,t),o=e.shift?Mn(e.shift,t):0;return n.style.borderRightWidth=Le(a),n.style.borderTopWidth=Le(l),n.style.bottom=Le(o),n.width=a,n.height=l+o,n.depth=-o,n.maxFontSize=l*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Mn(e.width,t),a=Mn(e.height,t),l=e.shift?Mn(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Me.MathNode("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Le(n)),c.setAttribute("height",Le(a));var d=new Me.MathNode("mpadded",[c]);return l>=0?d.setAttribute("height",Le(l)):(d.setAttribute("height",Le(l)),d.setAttribute("depth",Le(-l))),d.setAttribute("voffset",Le(l)),d}});function J8(e,t,n){for(var a=nr(e,t,!1),l=t.sizeMultiplier/n.sizeMultiplier,o=0;o<a.length;o++){var c=a[o].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[o].classes,t.sizingClasses(n)):a[o].classes[c+1]==="reset-size"+t.size&&(a[o].classes[c+1]="reset-size"+n.size),a[o].height*=l,a[o].depth*=l}return de.makeFragment(a)}var Q3=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Zq=(e,t)=>{var n=t.havingSize(e.size);return J8(e.body,n,t)};Be({type:"sizing",names:Q3,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!1,n);return{type:"sizing",mode:l.mode,size:Q3.indexOf(a)+1,body:o}},htmlBuilder:Zq,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Qr(e.body,n),l=new Me.MathNode("mstyle",a);return l.setAttribute("mathsize",Le(n.sizeMultiplier)),l}});Be({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,l=!1,o=!1,c=n[0]&&yt(n[0],"ordgroup");if(c)for(var d="",m=0;m<c.body.length;++m){var f=c.body[m];if(d=f.text,d==="t")l=!0;else if(d==="b")o=!0;else{l=!1,o=!1;break}}else l=!0,o=!0;var p=t[0];return{type:"smash",mode:a.mode,body:p,smashHeight:l,smashDepth:o}},htmlBuilder:(e,t)=>{var n=de.makeSpan([],[Ft(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var a=0;a<n.children.length;a++)n.children[a].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var l=0;l<n.children.length;l++)n.children[l].depth=0;var o=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return de.makeSpan(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n=new Me.MathNode("mpadded",[xn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Be({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,l=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:l}},htmlBuilder(e,t){var n=Ft(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=de.wrapFragment(n,t);var a=t.fontMetrics(),l=a.defaultRuleThickness,o=l;t.style.id<tt.TEXT.id&&(o=t.fontMetrics().xHeight);var c=l+o/4,d=n.height+n.depth+c+l,{span:m,ruleWidth:f,advanceWidth:p}=Ls.sqrtImage(d,t),x=m.height-f;x>n.height+n.depth+c&&(c=(c+x-n.height-n.depth)/2);var y=m.height-n.height-c-f;n.style.paddingLeft=Le(p);var b=de.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+y)},{type:"elem",elem:m},{type:"kern",size:f}]},t);if(e.index){var N=t.havingStyle(tt.SCRIPTSCRIPT),k=Ft(e.index,N,t),S=.6*(b.height-b.depth),T=de.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:k}]},t),M=de.makeSpan(["root"],[T]);return de.makeSpan(["mord","sqrt"],[M,b],t)}else return de.makeSpan(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Me.MathNode("mroot",[xn(n,t),xn(a,t)]):new Me.MathNode("msqrt",[xn(n,t)])}});var Z3={display:tt.DISPLAY,text:tt.TEXT,script:tt.SCRIPT,scriptscript:tt.SCRIPTSCRIPT};Be({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!0,n),c=a.slice(1,a.length-5);return{type:"styling",mode:l.mode,style:c,body:o}},htmlBuilder(e,t){var n=Z3[e.style],a=t.havingStyle(n).withFont("");return J8(e.body,a,t)},mathmlBuilder(e,t){var n=Z3[e.style],a=t.havingStyle(n),l=Qr(e.body,a),o=new Me.MathNode("mstyle",l),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return o.setAttribute("scriptlevel",d[0]),o.setAttribute("displaystyle",d[1]),o}});var Jq=function(t,n){var a=t.base;if(a)if(a.type==="op"){var l=a.limits&&(n.style.size===tt.DISPLAY.size||a.alwaysHandleSupSub);return l?nc:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===tt.DISPLAY.size||a.limits);return o?Z8:null}else{if(a.type==="accent")return Ut.isCharacterBox(a.base)?vg:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?X8:null}else return null}else return null};Ci({type:"supsub",htmlBuilder(e,t){var n=Jq(e,t);if(n)return n(e,t);var{base:a,sup:l,sub:o}=e,c=Ft(a,t),d,m,f=t.fontMetrics(),p=0,x=0,y=a&&Ut.isCharacterBox(a);if(l){var b=t.havingStyle(t.style.sup());d=Ft(l,b,t),y||(p=c.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(o){var N=t.havingStyle(t.style.sub());m=Ft(o,N,t),y||(x=c.depth+N.fontMetrics().subDrop*N.sizeMultiplier/t.sizeMultiplier)}var k;t.style===tt.DISPLAY?k=f.sup1:t.style.cramped?k=f.sup3:k=f.sup2;var S=t.sizeMultiplier,T=Le(.5/f.ptPerEm/S),M=null;if(m){var A=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(c instanceof Ea||A)&&(M=Le(-c.italic))}var R;if(d&&m){p=Math.max(p,k,d.depth+.25*f.xHeight),x=Math.max(x,f.sub2);var B=f.defaultRuleThickness,O=4*B;if(p-d.depth-(m.height-x)<O){x=O-(p-d.depth)+m.height;var L=.8*f.xHeight-(p-d.depth);L>0&&(p+=L,x-=L)}var $=[{type:"elem",elem:m,shift:x,marginRight:T,marginLeft:M},{type:"elem",elem:d,shift:-p,marginRight:T}];R=de.makeVList({positionType:"individualShift",children:$},t)}else if(m){x=Math.max(x,f.sub1,m.height-.8*f.xHeight);var U=[{type:"elem",elem:m,marginLeft:M,marginRight:T}];R=de.makeVList({positionType:"shift",positionData:x,children:U},t)}else if(d)p=Math.max(p,k,d.depth+.25*f.xHeight),R=de.makeVList({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:T}]},t);else throw new Error("supsub must have either sup or sub.");var I=Zx(c,"right")||"mord";return de.makeSpan([I],[c,de.makeSpan(["msupsub"],[R])],t)},mathmlBuilder(e,t){var n=!1,a,l;e.base&&e.base.type==="horizBrace"&&(l=!!e.sup,l===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[xn(e.base,t)];e.sub&&o.push(xn(e.sub,t)),e.sup&&o.push(xn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var f=e.base;f&&f.type==="op"&&f.limits&&t.style===tt.DISPLAY||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(t.style===tt.DISPLAY||f.limits)?c="munderover":c="msubsup"}else{var m=e.base;m&&m.type==="op"&&m.limits&&(t.style===tt.DISPLAY||m.alwaysHandleSupSub)||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(m.limits||t.style===tt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===tt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===tt.DISPLAY)?c="mover":c="msup"}return new Me.MathNode(c,o)}});Ci({type:"atom",htmlBuilder(e,t){return de.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Me.MathNode("mo",[Ma(e.text,e.mode)]);if(e.family==="bin"){var a=xg(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var eN={mi:"italic",mn:"normal",mtext:"normal"};Ci({type:"mathord",htmlBuilder(e,t){return de.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Me.MathNode("mi",[Ma(e.text,e.mode,t)]),a=xg(e,t)||"italic";return a!==eN[n.type]&&n.setAttribute("mathvariant",a),n}});Ci({type:"textord",htmlBuilder(e,t){return de.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=Ma(e.text,e.mode,t),a=xg(e,t)||"normal",l;return e.mode==="text"?l=new Me.MathNode("mtext",[n]):/[0-9]/.test(e.text)?l=new Me.MathNode("mn",[n]):e.text==="\\prime"?l=new Me.MathNode("mo",[n]):l=new Me.MathNode("mi",[n]),a!==eN[l.type]&&l.setAttribute("mathvariant",a),l}});var ux={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},dx={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ci({type:"spacing",htmlBuilder(e,t){if(dx.hasOwnProperty(e.text)){var n=dx[e.text].className||"";if(e.mode==="text"){var a=de.makeOrd(e,t,"textord");return a.classes.push(n),a}else return de.makeSpan(["mspace",n],[de.mathsym(e.text,e.mode,t)],t)}else{if(ux.hasOwnProperty(e.text))return de.makeSpan(["mspace",ux[e.text]],[],t);throw new Ae('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(dx.hasOwnProperty(e.text))n=new Me.MathNode("mtext",[new Me.TextNode(" ")]);else{if(ux.hasOwnProperty(e.text))return new Me.MathNode("mspace");throw new Ae('Unknown type of space "'+e.text+'"')}return n}});var J3=()=>{var e=new Me.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Ci({type:"tag",mathmlBuilder(e,t){var n=new Me.MathNode("mtable",[new Me.MathNode("mtr",[J3(),new Me.MathNode("mtd",[Al(e.body,t)]),J3(),new Me.MathNode("mtd",[Al(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var e5={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},t5={"\\textbf":"textbf","\\textmd":"textmd"},eH={"\\textit":"textit","\\textup":"textup"},n5=(e,t)=>{var n=e.font;if(n){if(e5[n])return t.withTextFontFamily(e5[n]);if(t5[n])return t.withTextFontWeight(t5[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(eH[n])};Be({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"text",mode:n.mode,body:Pn(l),font:a}},htmlBuilder(e,t){var n=n5(e,t),a=nr(e.body,n,!0);return de.makeSpan(["mord","text"],a,n)},mathmlBuilder(e,t){var n=n5(e,t);return Al(e.body,n)}});Be({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ft(e.body,t),a=de.makeLineSpan("underline-line",t),l=t.fontMetrics().defaultRuleThickness,o=de.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:l},{type:"elem",elem:a},{type:"kern",size:3*l},{type:"elem",elem:n}]},t);return de.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Me.MathNode("mo",[new Me.TextNode("‾")]);n.setAttribute("stretchy","true");var a=new Me.MathNode("munder",[xn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Be({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ft(e.body,t),a=t.fontMetrics().axisHeight,l=.5*(n.height-a-(n.depth+a));return de.makeVList({positionType:"shift",positionData:l,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new Me.MathNode("mpadded",[xn(e.body,t)],["vcenter"])}});Be({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ae("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=r5(e),a=[],l=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(de.makeSymbol(c,"Typewriter-Regular",e.mode,l,["mord","texttt"]))}return de.makeSpan(["mord","text"].concat(l.sizingClasses(t)),de.tryCombineChars(a),l)},mathmlBuilder(e,t){var n=new Me.TextNode(r5(e)),a=new Me.MathNode("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var r5=e=>e.body.replace(/ /g,e.star?"␣":" "),jl=N8,tN=`[ \r
]`,tH="\\\\[a-zA-Z@]+",nH="\\\\[^\uD800-\uDFFF]",rH="("+tH+")"+tN+"*",aH=`\\\\(
|[ \r ]+
?)[ \r ]*`,n1="[̀-ͯ]",sH=new RegExp(n1+"+$"),lH="("+tN+"+)|"+(aH+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(n1+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(n1+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+rH)+("|"+nH+")");class a5{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(lH,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new da("EOF",new Ur(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Ae("Unexpected character: '"+t[n]+"'",new da(t[n],new Ur(this,n,n+1)));var l=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[l]===14){var o=t.indexOf(`
`,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new da(l,new Ur(this,n,this.tokenRegex.lastIndex))}}class iH{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ae("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var l=0;l<this.undefStack.length;l++)delete this.undefStack[l][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var oH=$8;F("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});F("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});F("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});F("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});F("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});F("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");F("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var s5={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};F("\\char",function(e){var t=e.popToken(),n,a="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ae("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=s5[t.text],a==null||a>=n)throw new Ae("Invalid base-"+n+" digit "+t.text);for(var l;(l=s5[e.future().text])!=null&&l<n;)a*=n,a+=l,e.popToken()}return"\\@char{"+a+"}"});var Cg=(e,t,n,a)=>{var l=e.consumeArg().tokens;if(l.length!==1)throw new Ae("\\newcommand's first argument must be a macro name");var o=l[0].text,c=e.isDefined(o);if(c&&!t)throw new Ae("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!c&&!n)throw new Ae("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var d=0;if(l=e.consumeArg().tokens,l.length===1&&l[0].text==="["){for(var m="",f=e.expandNextToken();f.text!=="]"&&f.text!=="EOF";)m+=f.text,f=e.expandNextToken();if(!m.match(/^\s*[0-9]+\s*$/))throw new Ae("Invalid number of arguments: "+m);d=parseInt(m),l=e.consumeArg().tokens}return c&&a||e.macros.set(o,{tokens:l,numArgs:d}),""};F("\\newcommand",e=>Cg(e,!1,!0,!1));F("\\renewcommand",e=>Cg(e,!0,!1,!1));F("\\providecommand",e=>Cg(e,!0,!0,!0));F("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});F("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});F("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),jl[n],yn.math[n],yn.text[n]),""});F("\\bgroup","{");F("\\egroup","}");F("~","\\nobreakspace");F("\\lq","`");F("\\rq","'");F("\\aa","\\r a");F("\\AA","\\r A");F("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");F("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");F("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");F("","\\mathscr{B}");F("","\\mathscr{E}");F("","\\mathscr{F}");F("","\\mathscr{H}");F("","\\mathscr{I}");F("","\\mathscr{L}");F("","\\mathscr{M}");F("","\\mathscr{R}");F("","\\mathfrak{C}");F("","\\mathfrak{H}");F("","\\mathfrak{Z}");F("\\Bbbk","\\Bbb{k}");F("·","\\cdotp");F("\\llap","\\mathllap{\\textrm{#1}}");F("\\rlap","\\mathrlap{\\textrm{#1}}");F("\\clap","\\mathclap{\\textrm{#1}}");F("\\mathstrut","\\vphantom{(}");F("\\underbar","\\underline{\\text{#1}}");F("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');F("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");F("\\ne","\\neq");F("≠","\\neq");F("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");F("∉","\\notin");F("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");F("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");F("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");F("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");F("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");F("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");F("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");F("⟂","\\perp");F("‼","\\mathclose{!\\mkern-0.8mu!}");F("∌","\\notni");F("⌜","\\ulcorner");F("⌝","\\urcorner");F("⌞","\\llcorner");F("⌟","\\lrcorner");F("©","\\copyright");F("®","\\textregistered");F("","\\textregistered");F("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');F("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');F("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');F("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');F("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");F("⋮","\\vdots");F("\\varGamma","\\mathit{\\Gamma}");F("\\varDelta","\\mathit{\\Delta}");F("\\varTheta","\\mathit{\\Theta}");F("\\varLambda","\\mathit{\\Lambda}");F("\\varXi","\\mathit{\\Xi}");F("\\varPi","\\mathit{\\Pi}");F("\\varSigma","\\mathit{\\Sigma}");F("\\varUpsilon","\\mathit{\\Upsilon}");F("\\varPhi","\\mathit{\\Phi}");F("\\varPsi","\\mathit{\\Psi}");F("\\varOmega","\\mathit{\\Omega}");F("\\substack","\\begin{subarray}{c}#1\\end{subarray}");F("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");F("\\boxed","\\fbox{$\\displaystyle{#1}$}");F("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");F("\\implies","\\DOTSB\\;\\Longrightarrow\\;");F("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");F("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");F("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var l5={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};F("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in l5?t=l5[n]:(n.slice(0,4)==="\\not"||n in yn.math&&["bin","rel"].includes(yn.math[n].group))&&(t="\\dotsb"),t});var Tg={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};F("\\dotso",function(e){var t=e.future().text;return t in Tg?"\\ldots\\,":"\\ldots"});F("\\dotsc",function(e){var t=e.future().text;return t in Tg&&t!==","?"\\ldots\\,":"\\ldots"});F("\\cdots",function(e){var t=e.future().text;return t in Tg?"\\@cdots\\,":"\\@cdots"});F("\\dotsb","\\cdots");F("\\dotsm","\\cdots");F("\\dotsi","\\!\\cdots");F("\\dotsx","\\ldots\\,");F("\\DOTSI","\\relax");F("\\DOTSB","\\relax");F("\\DOTSX","\\relax");F("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");F("\\,","\\tmspace+{3mu}{.1667em}");F("\\thinspace","\\,");F("\\>","\\mskip{4mu}");F("\\:","\\tmspace+{4mu}{.2222em}");F("\\medspace","\\:");F("\\;","\\tmspace+{5mu}{.2777em}");F("\\thickspace","\\;");F("\\!","\\tmspace-{3mu}{.1667em}");F("\\negthinspace","\\!");F("\\negmedspace","\\tmspace-{4mu}{.2222em}");F("\\negthickspace","\\tmspace-{5mu}{.277em}");F("\\enspace","\\kern.5em ");F("\\enskip","\\hskip.5em\\relax");F("\\quad","\\hskip1em\\relax");F("\\qquad","\\hskip2em\\relax");F("\\tag","\\@ifstar\\tag@literal\\tag@paren");F("\\tag@paren","\\tag@literal{({#1})}");F("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ae("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});F("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");F("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");F("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");F("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");F("\\newline","\\\\\\relax");F("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var nN=Le(ts["Main-Regular"][84][1]-.7*ts["Main-Regular"][65][1]);F("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+nN+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");F("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+nN+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");F("\\hspace","\\@ifstar\\@hspacer\\@hspace");F("\\@hspace","\\hskip #1\\relax");F("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");F("\\ordinarycolon",":");F("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");F("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');F("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');F("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');F("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');F("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');F("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');F("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');F("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');F("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');F("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');F("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');F("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');F("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');F("∷","\\dblcolon");F("∹","\\eqcolon");F("≔","\\coloneqq");F("≕","\\eqqcolon");F("⩴","\\Coloneqq");F("\\ratio","\\vcentcolon");F("\\coloncolon","\\dblcolon");F("\\colonequals","\\coloneqq");F("\\coloncolonequals","\\Coloneqq");F("\\equalscolon","\\eqqcolon");F("\\equalscoloncolon","\\Eqqcolon");F("\\colonminus","\\coloneq");F("\\coloncolonminus","\\Coloneq");F("\\minuscolon","\\eqcolon");F("\\minuscoloncolon","\\Eqcolon");F("\\coloncolonapprox","\\Colonapprox");F("\\coloncolonsim","\\Colonsim");F("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");F("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");F("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");F("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");F("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");F("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");F("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");F("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");F("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");F("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");F("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");F("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");F("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");F("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");F("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");F("\\nleqq","\\html@mathml{\\@nleqq}{≰}");F("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");F("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");F("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");F("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");F("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");F("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");F("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");F("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");F("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");F("\\imath","\\html@mathml{\\@imath}{ı}");F("\\jmath","\\html@mathml{\\@jmath}{ȷ}");F("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");F("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");F("⟦","\\llbracket");F("⟧","\\rrbracket");F("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");F("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");F("⦃","\\lBrace");F("⦄","\\rBrace");F("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");F("⦵","\\minuso");F("\\darr","\\downarrow");F("\\dArr","\\Downarrow");F("\\Darr","\\Downarrow");F("\\lang","\\langle");F("\\rang","\\rangle");F("\\uarr","\\uparrow");F("\\uArr","\\Uparrow");F("\\Uarr","\\Uparrow");F("\\N","\\mathbb{N}");F("\\R","\\mathbb{R}");F("\\Z","\\mathbb{Z}");F("\\alef","\\aleph");F("\\alefsym","\\aleph");F("\\Alpha","\\mathrm{A}");F("\\Beta","\\mathrm{B}");F("\\bull","\\bullet");F("\\Chi","\\mathrm{X}");F("\\clubs","\\clubsuit");F("\\cnums","\\mathbb{C}");F("\\Complex","\\mathbb{C}");F("\\Dagger","\\ddagger");F("\\diamonds","\\diamondsuit");F("\\empty","\\emptyset");F("\\Epsilon","\\mathrm{E}");F("\\Eta","\\mathrm{H}");F("\\exist","\\exists");F("\\harr","\\leftrightarrow");F("\\hArr","\\Leftrightarrow");F("\\Harr","\\Leftrightarrow");F("\\hearts","\\heartsuit");F("\\image","\\Im");F("\\infin","\\infty");F("\\Iota","\\mathrm{I}");F("\\isin","\\in");F("\\Kappa","\\mathrm{K}");F("\\larr","\\leftarrow");F("\\lArr","\\Leftarrow");F("\\Larr","\\Leftarrow");F("\\lrarr","\\leftrightarrow");F("\\lrArr","\\Leftrightarrow");F("\\Lrarr","\\Leftrightarrow");F("\\Mu","\\mathrm{M}");F("\\natnums","\\mathbb{N}");F("\\Nu","\\mathrm{N}");F("\\Omicron","\\mathrm{O}");F("\\plusmn","\\pm");F("\\rarr","\\rightarrow");F("\\rArr","\\Rightarrow");F("\\Rarr","\\Rightarrow");F("\\real","\\Re");F("\\reals","\\mathbb{R}");F("\\Reals","\\mathbb{R}");F("\\Rho","\\mathrm{P}");F("\\sdot","\\cdot");F("\\sect","\\S");F("\\spades","\\spadesuit");F("\\sub","\\subset");F("\\sube","\\subseteq");F("\\supe","\\supseteq");F("\\Tau","\\mathrm{T}");F("\\thetasym","\\vartheta");F("\\weierp","\\wp");F("\\Zeta","\\mathrm{Z}");F("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");F("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");F("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");F("\\bra","\\mathinner{\\langle{#1}|}");F("\\ket","\\mathinner{|{#1}\\rangle}");F("\\braket","\\mathinner{\\langle{#1}\\rangle}");F("\\Bra","\\left\\langle#1\\right|");F("\\Ket","\\left|#1\\right\\rangle");var rN=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,l=t.consumeArg().tokens,o=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var m=x=>y=>{e&&(y.macros.set("|",c),l.length&&y.macros.set("\\|",d));var b=x;if(!x&&l.length){var N=y.future();N.text==="|"&&(y.popToken(),b=!0)}return{tokens:b?l:a,numArgs:0}};t.macros.set("|",m(!1)),l.length&&t.macros.set("\\|",m(!0));var f=t.consumeArg().tokens,p=t.expandTokens([...o,...f,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};F("\\bra@ket",rN(!1));F("\\bra@set",rN(!0));F("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");F("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");F("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");F("\\angln","{\\angl n}");F("\\blue","\\textcolor{##6495ed}{#1}");F("\\orange","\\textcolor{##ffa500}{#1}");F("\\pink","\\textcolor{##ff00af}{#1}");F("\\red","\\textcolor{##df0030}{#1}");F("\\green","\\textcolor{##28ae7b}{#1}");F("\\gray","\\textcolor{gray}{#1}");F("\\purple","\\textcolor{##9d38bd}{#1}");F("\\blueA","\\textcolor{##ccfaff}{#1}");F("\\blueB","\\textcolor{##80f6ff}{#1}");F("\\blueC","\\textcolor{##63d9ea}{#1}");F("\\blueD","\\textcolor{##11accd}{#1}");F("\\blueE","\\textcolor{##0c7f99}{#1}");F("\\tealA","\\textcolor{##94fff5}{#1}");F("\\tealB","\\textcolor{##26edd5}{#1}");F("\\tealC","\\textcolor{##01d1c1}{#1}");F("\\tealD","\\textcolor{##01a995}{#1}");F("\\tealE","\\textcolor{##208170}{#1}");F("\\greenA","\\textcolor{##b6ffb0}{#1}");F("\\greenB","\\textcolor{##8af281}{#1}");F("\\greenC","\\textcolor{##74cf70}{#1}");F("\\greenD","\\textcolor{##1fab54}{#1}");F("\\greenE","\\textcolor{##0d923f}{#1}");F("\\goldA","\\textcolor{##ffd0a9}{#1}");F("\\goldB","\\textcolor{##ffbb71}{#1}");F("\\goldC","\\textcolor{##ff9c39}{#1}");F("\\goldD","\\textcolor{##e07d10}{#1}");F("\\goldE","\\textcolor{##a75a05}{#1}");F("\\redA","\\textcolor{##fca9a9}{#1}");F("\\redB","\\textcolor{##ff8482}{#1}");F("\\redC","\\textcolor{##f9685d}{#1}");F("\\redD","\\textcolor{##e84d39}{#1}");F("\\redE","\\textcolor{##bc2612}{#1}");F("\\maroonA","\\textcolor{##ffbde0}{#1}");F("\\maroonB","\\textcolor{##ff92c6}{#1}");F("\\maroonC","\\textcolor{##ed5fa6}{#1}");F("\\maroonD","\\textcolor{##ca337c}{#1}");F("\\maroonE","\\textcolor{##9e034e}{#1}");F("\\purpleA","\\textcolor{##ddd7ff}{#1}");F("\\purpleB","\\textcolor{##c6b9fc}{#1}");F("\\purpleC","\\textcolor{##aa87ff}{#1}");F("\\purpleD","\\textcolor{##7854ab}{#1}");F("\\purpleE","\\textcolor{##543b78}{#1}");F("\\mintA","\\textcolor{##f5f9e8}{#1}");F("\\mintB","\\textcolor{##edf2df}{#1}");F("\\mintC","\\textcolor{##e0e5cc}{#1}");F("\\grayA","\\textcolor{##f6f7f7}{#1}");F("\\grayB","\\textcolor{##f0f1f2}{#1}");F("\\grayC","\\textcolor{##e3e5e6}{#1}");F("\\grayD","\\textcolor{##d6d8da}{#1}");F("\\grayE","\\textcolor{##babec2}{#1}");F("\\grayF","\\textcolor{##888d93}{#1}");F("\\grayG","\\textcolor{##626569}{#1}");F("\\grayH","\\textcolor{##3b3e40}{#1}");F("\\grayI","\\textcolor{##21242c}{#1}");F("\\kaBlue","\\textcolor{##314453}{#1}");F("\\kaGreen","\\textcolor{##71B307}{#1}");var aN={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class cH{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new iH(oH,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new a5(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,l;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:l,end:a}=this.consumeArg(["]"])}else({tokens:l,start:n,end:a}=this.consumeArg());return this.pushToken(new da("EOF",a.loc)),this.pushTokens(l),new da("",Ur.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var l=this.future(),o,c=0,d=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++c;else if(o.text==="}"){if(--c,c===-1)throw new Ae("Extra }",o)}else if(o.text==="EOF")throw new Ae("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",o);if(t&&a)if((c===0||c===1&&t[d]==="{")&&o.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return l.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:l,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Ae("The length of delimiters doesn't match the number of args!");for(var a=n[0],l=0;l<a.length;l++){var o=this.popToken();if(a[l]!==o.text)throw new Ae("Use of the macro doesn't match its definition",o)}}for(var c=[],d=0;d<t;d++)c.push(this.consumeArg(n&&n[d+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Ae("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,l=n.noexpand?null:this._getExpansion(a);if(l==null||t&&l.unexpandable){if(t&&l==null&&a[0]==="\\"&&!this.isDefined(a))throw new Ae("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var o=l.tokens,c=this.consumeArgs(l.numArgs,l.delimiters);if(l.numArgs){o=o.slice();for(var d=o.length-1;d>=0;--d){var m=o[d];if(m.text==="#"){if(d===0)throw new Ae("Incomplete placeholder at end of macro body",m);if(m=o[--d],m.text==="#")o.splice(d+1,1);else if(/^[1-9]$/.test(m.text))o.splice(d,2,...c[+m.text-1]);else throw new Ae("Not a valid argument number",m)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new da(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var l=this.stack.pop();l.treatAsRelax&&(l.noexpand=!1,l.treatAsRelax=!1),n.push(l)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var l=typeof n=="function"?n(this):n;if(typeof l=="string"){var o=0;if(l.indexOf("#")!==-1)for(var c=l.replace(/##/g,"");c.indexOf("#"+(o+1))!==-1;)++o;for(var d=new a5(l,this.settings),m=[],f=d.lex();f.text!=="EOF";)m.push(f),f=d.lex();m.reverse();var p={tokens:m,numArgs:o};return p}return l}isDefined(t){return this.macros.has(t)||jl.hasOwnProperty(t)||yn.math.hasOwnProperty(t)||yn.text.hasOwnProperty(t)||aN.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:jl.hasOwnProperty(t)&&!jl[t].primitive}}var i5=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,B0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),mx={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},o5={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Jm{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new cH(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Ae("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new da("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var l=this.fetch();if(Jm.endOfExpression.indexOf(l.text)!==-1||n&&l.text===n||t&&jl[l.text]&&jl[l.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;a.push(o)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,l=0;l<t.length;l++)if(t[l].type==="infix"){if(n!==-1)throw new Ae("only one infix operator per group",t[l].token);n=l,a=t[l].replaceWith}if(n!==-1&&a){var o,c,d=t.slice(0,n),m=t.slice(n+1);d.length===1&&d[0].type==="ordgroup"?o=d[0]:o={type:"ordgroup",mode:this.mode,body:d},m.length===1&&m[0].type==="ordgroup"?c=m[0]:c={type:"ordgroup",mode:this.mode,body:m};var f;return a==="\\\\abovefrac"?f=this.callFunction(a,[o,t[n],c],[]):f=this.callFunction(a,[o,c],[]),[f]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var l;do{var o;l=this.parseGroup(t)}while(((o=l)==null?void 0:o.type)==="internal");if(!l)throw new Ae("Expected group after '"+a+"'",n);return l}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var l={type:"text",mode:this.mode,body:n},o={type:"color",mode:this.mode,color:this.settings.errorColor,body:[l]};return o}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var a,l;;){this.consumeSpaces();var o=this.fetch();if(o.text==="\\limits"||o.text==="\\nolimits"){if(n&&n.type==="op"){var c=o.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=o.text==="\\limits");else throw new Ae("Limit controls must follow a math operator",o);this.consume()}else if(o.text==="^"){if(a)throw new Ae("Double superscript",o);a=this.handleSupSubscript("superscript")}else if(o.text==="_"){if(l)throw new Ae("Double subscript",o);l=this.handleSupSubscript("subscript")}else if(o.text==="'"){if(a)throw new Ae("Double superscript",o);var d={type:"textord",mode:this.mode,text:"\\prime"},m=[d];for(this.consume();this.fetch().text==="'";)m.push(d),this.consume();this.fetch().text==="^"&&m.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:m}}else if(B0[o.text]){var f=i5.test(o.text),p=[];for(p.push(new da(B0[o.text])),this.consume();;){var x=this.fetch().text;if(!B0[x]||i5.test(x)!==f)break;p.unshift(new da(B0[x])),this.consume()}var y=this.subparse(p);f?l={type:"ordgroup",mode:"math",body:y}:a={type:"ordgroup",mode:"math",body:y}}else break}return a||l?{type:"supsub",mode:this.mode,base:n,sup:a,sub:l}:n}parseFunction(t,n){var a=this.fetch(),l=a.text,o=jl[l];if(!o)return null;if(this.consume(),n&&n!=="atom"&&!o.allowedInArgument)throw new Ae("Got function '"+l+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!o.allowedInText)throw new Ae("Can't use function '"+l+"' in text mode",a);if(this.mode==="math"&&o.allowedInMath===!1)throw new Ae("Can't use function '"+l+"' in math mode",a);var{args:c,optArgs:d}=this.parseArguments(l,o);return this.callFunction(l,c,d,a,t)}callFunction(t,n,a,l,o){var c={funcName:t,parser:this,token:l,breakOnTokenText:o},d=jl[t];if(d&&d.handler)return d.handler(c,n,a);throw new Ae("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var l=[],o=[],c=0;c<a;c++){var d=n.argTypes&&n.argTypes[c],m=c<n.numOptionalArgs;(n.primitive&&d==null||n.type==="sqrt"&&c===1&&o[0]==null)&&(d="primitive");var f=this.parseGroupOfType("argument to '"+t+"'",d,m);if(m)o.push(f);else if(f!=null)l.push(f);else throw new Ae("Null argument, please report this as a bug")}return{args:l,optArgs:o}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var l=this.parseArgumentGroup(a,"text");return l!=null?{type:"styling",mode:l.mode,body:[l],style:"text"}:null}case"raw":{var o=this.parseStringGroup("raw",a);return o!=null?{type:"raw",mode:"text",string:o.text}:null}case"primitive":{if(a)throw new Ae("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new Ae("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new Ae("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var l="",o;(o=this.fetch()).text!=="EOF";)l+=o.text,this.consume();return this.consume(),a.text=l,a}parseRegexGroup(t,n){for(var a=this.fetch(),l=a,o="",c;(c=this.fetch()).text!=="EOF"&&t.test(o+c.text);)l=c,o+=l.text,this.consume();if(o==="")throw new Ae("Invalid "+n+": '"+a.text+"'",a);return a.range(l,o)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new Ae("Invalid color: '"+n.text+"'",n);var l=a[0];return/^[0-9a-f]{6}$/i.test(l)&&(l="#"+l),{type:"color-token",mode:this.mode,color:l}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var l=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!l)throw new Ae("Invalid size: '"+n.text+"'",n);var o={number:+(l[1]+l[2]),unit:l[3]};if(!f8(o))throw new Ae("Invalid unit: '"+o.unit+"'",n);return{type:"size",mode:this.mode,value:o,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var l=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:o};return n&&this.switchMode(l),c}parseGroup(t,n){var a=this.fetch(),l=a.text,o;if(l==="{"||l==="\\begingroup"){this.consume();var c=l==="{"?"}":"\\endgroup";this.gullet.beginGroup();var d=this.parseExpression(!1,c),m=this.fetch();this.expect(c),this.gullet.endGroup(),o={type:"ordgroup",mode:this.mode,loc:Ur.range(a,m),body:d,semisimple:l==="\\begingroup"||void 0}}else if(o=this.parseFunction(n,t)||this.parseSymbol(),o==null&&l[0]==="\\"&&!aN.hasOwnProperty(l)){if(this.settings.throwOnError)throw new Ae("Undefined control sequence: "+l,a);o=this.formatUnsupportedCmd(l),this.consume()}return o}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var l=t[a],o=l.text;o==="-"&&t[a+1].text==="-"&&(a+1<n&&t[a+2].text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:Ur.range(l,t[a+2]),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:Ur.range(l,t[a+1]),text:"--"}),n-=1)),(o==="'"||o==="`")&&t[a+1].text===o&&(t.splice(a,2,{type:"textord",mode:"text",loc:Ur.range(l,t[a+1]),text:o+o}),n-=1)}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),l=a.charAt(0)==="*";if(l&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new Ae(`\\verb assertion failed --
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:l}}o5.hasOwnProperty(n[0])&&!yn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=o5[n[0]]+n.slice(1));var o=sH.exec(n);o&&(n=n.substring(0,o.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(yn[this.mode][n]){this.settings.strict&&this.mode==="math"&&Qx.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=yn[this.mode][n].group,m=Ur.range(t),f;if(QI.hasOwnProperty(d)){var p=d;f={type:"atom",mode:this.mode,family:p,loc:m,text:n}}else f={type:d,mode:this.mode,loc:m,text:n};c=f}else if(n.charCodeAt(0)>=128)this.settings.strict&&(h8(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Ur.range(t),text:n};else return null;if(this.consume(),o)for(var x=0;x<o[0].length;x++){var y=o[0][x];if(!mx[y])throw new Ae("Unknown accent ' "+y+"'",t);var b=mx[y][this.mode]||mx[y].text;if(!b)throw new Ae("Accent "+y+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:Ur.range(t),label:b,isStretchy:!1,isShifty:!0,base:c}}return c}}Jm.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var _g=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Jm(t,n);delete a.gullet.macros.current["\\df@tag"];var l=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Ae("\\tag works only in display equations");l=[{type:"tag",mode:"text",body:l,tag:a.subparse([new da("\\df@tag")])}]}return l},sN=function(t,n,a){n.textContent="";var l=Eg(t,a).toNode();n.appendChild(l)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),sN=function(){throw new Ae("KaTeX doesn't work in quirks mode.")});var uH=function(t,n){var a=Eg(t,n).toMarkup();return a},dH=function(t,n){var a=new ug(n);return _g(t,a)},lN=function(t,n,a){if(a.throwOnError||!(t instanceof Ae))throw t;var l=de.makeSpan(["katex-error"],[new Ea(n)]);return l.setAttribute("title",t.toString()),l.setAttribute("style","color:"+a.errorColor),l},Eg=function(t,n){var a=new ug(n);try{var l=_g(t,a);return bq(l,t,a)}catch(o){return lN(o,t,a)}},mH=function(t,n){var a=new ug(n);try{var l=_g(t,a);return wq(l,t,a)}catch(o){return lN(o,t,a)}},hH="0.16.25",fH={Span:Xu,Anchor:hg,SymbolNode:Ea,SvgNode:Fs,PathNode:Ml,LineNode:Kx},c5={version:hH,render:sN,renderToString:uH,ParseError:Ae,SETTINGS_SCHEMA:K0,__parse:dH,__renderToDomTree:Eg,__renderToHTMLTree:mH,__setFontMetrics:UI,__defineSymbol:j,__defineFunction:Be,__defineMacro:F,__domTree:fH};const pH={};function xH(e){const t=this,n=e||pH,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(pI(n)),o.push(iI()),c.push(oI(n))}const u5=/[#.]/g;function gH(e,t){const n=e||"",a={};let l=0,o,c;for(;l<n.length;){u5.lastIndex=l;const d=u5.exec(n),m=n.slice(l,d?d.index:n.length);m&&(o?o==="#"?a.id=m:Array.isArray(a.className)?a.className.push(m):a.className=[m]:c=m,l+=m.length),d&&(o=d[0],l++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function iN(e,t,n){const a=n?wH(n):void 0;function l(o,c,...d){let m;if(o==null){m={type:"root",children:[]};const f=c;d.unshift(f)}else{m=gH(o,t);const f=m.tagName.toLowerCase(),p=a?a.get(f):void 0;if(m.tagName=p||f,vH(c))d.unshift(c);else for(const[x,y]of Object.entries(c))yH(e,m.properties,x,y)}for(const f of d)r1(m.children,f);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return l}function vH(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const l=t[a];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const o=l;for(const c of o)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function yH(e,t,n,a){const l=m7(e,n);let o;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;o=a}else typeof a=="boolean"?o=a:typeof a=="string"?l.spaceSeparated?o=Hb(a):l.commaSeparated?o=Bb(a):l.commaOrSpaceSeparated?o=Hb(Bb(a).join(" ")):o=d5(l,l.property,a):Array.isArray(a)?o=[...a]:o=l.property==="style"?bH(a):String(a);if(Array.isArray(o)){const c=[];for(const d of o)c.push(d5(l,l.property,d));o=c}l.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[l.property]=o}}function r1(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)r1(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?r1(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function d5(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||yu(n)===yu(t)))return!0}return n}function bH(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function wH(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const jH=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],NH=iN(h7,"div"),SH=iN(Hm,"g",jH),hx={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function kH(e,t){return oN(e,{})||{type:"root",children:[]}}function oN(e,t){const n=CH(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function CH(e,t){switch(e.nodeType){case 1:return MH(e,t);case 3:return _H(e);case 8:return EH(e);case 9:return m5(e,t);case 10:return TH();case 11:return m5(e,t);default:return}}function m5(e,t){return{type:"root",children:cN(e,t)}}function TH(){return{type:"doctype"}}function _H(e){return{type:"text",value:e.nodeValue||""}}function EH(e){return{type:"comment",value:e.nodeValue||""}}function MH(e,t){const n=e.namespaceURI,a=n===hx.svg?SH:NH,l=n===hx.html?e.tagName.toLowerCase():e.tagName,o=n===hx.html&&l==="template"?e.content:e,c=e.getAttributeNames(),d={};let m=-1;for(;++m<c.length;)d[c[m]]=e.getAttribute(c[m])||"";return a(l,d,cN(o,t))}function cN(e,t){const n=e.childNodes,a=[];let l=-1;for(;++l<n.length;){const o=oN(n[l],t);o!==void 0&&a.push(o)}return a}new DOMParser;function AH(e,t){const n=DH(e);return kH(n)}function DH(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const h5=(function(e,t,n){const a=Gu(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),Ti=(function(e){if(e==null)return RH;if(typeof e=="string")return OH(e);if(typeof e=="object")return zH(e);if(typeof e=="function")return Mg(e);throw new Error("Expected function, string, or array as `test`")});function zH(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ti(e[n]);return Mg(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function OH(e){return Mg(t);function t(n){return n.tagName===e}}function Mg(e){return t;function t(n,a,l){return!!(LH(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function RH(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function LH(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const f5=/\n/g,p5=/[\t ]+/g,a1=Ti("br"),x5=Ti($H),BH=Ti("p"),g5=Ti("tr"),PH=Ti(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",UH,VH]),uN=Ti(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function FH(e,t){const n=t||{},a="children"in e?e.children:[],l=uN(e),o=hN(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...mN(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)c.push(...dN(a[d],e,{whitespace:o,breakBefore:d?void 0:l,breakAfter:d<a.length-1?a1(a[d+1]):l}));const m=[];let f;for(d=-1;++d<c.length;){const p=c[d];typeof p=="number"?f!==void 0&&p>f&&(f=p):p&&(f!==void 0&&f>-1&&m.push(`
`.repeat(f)||" "),f=-1,m.push(p))}return m.join("")}function dN(e,t,n){return e.type==="element"?IH(e,t,n):e.type==="text"?n.whitespace==="normal"?mN(e,n):qH(e):[]}function IH(e,t,n){const a=hN(e,n),l=e.children||[];let o=-1,c=[];if(PH(e))return c;let d,m;for(a1(e)||g5(e)&&h5(t,e,g5)?m=`
`:BH(e)?(d=2,m=2):uN(e)&&(d=1,m=1);++o<l.length;)c=c.concat(dN(l[o],e,{whitespace:a,breakBefore:o?void 0:d,breakAfter:o<l.length-1?a1(l[o+1]):m}));return x5(e)&&h5(t,e,x5)&&c.push(" "),d&&c.unshift(d),m&&c.push(m),c}function mN(e,t){const n=String(e.value),a=[],l=[];let o=0;for(;o<=n.length;){f5.lastIndex=o;const m=f5.exec(n),f=m&&"index"in m?m.index:n.length;a.push(HH(n.slice(o,f).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,f===n.length?t.breakAfter:!0)),o=f+1}let c=-1,d;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),d=void 0):a[c]?(typeof d=="number"&&l.push(d),l.push(a[c]),d=0):(c===0||c===a.length-1)&&l.push(0);return l}function qH(e){return[String(e.value)]}function HH(e,t,n){const a=[];let l=0,o;for(;l<e.length;){p5.lastIndex=l;const c=p5.exec(e);o=c?c.index:e.length,!l&&!o&&c&&!t&&a.push(""),l!==o&&a.push(e.slice(l,o)),l=c?o+c[0].length:o}return l!==o&&!n&&a.push(""),a.join(" ")}function hN(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function UH(e){return!!(e.properties||{}).hidden}function $H(e){return e.tagName==="td"||e.tagName==="th"}function VH(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const GH={},YH=[];function WH(e){const t=e||GH;return function(n,a){ag(n,"element",function(l,o){const c=Array.isArray(l.properties.className)?l.properties.className:YH,d=c.includes("language-math"),m=c.includes("math-display"),f=c.includes("math-inline");let p=m;if(!d&&!m&&!f)return;let x=o[o.length-1],y=l;if(l.tagName==="code"&&d&&x&&x.type==="element"&&x.tagName==="pre"&&(y=x,x=o[o.length-2],p=!0),!x)return;const b=FH(y,{whitespace:"pre"});let N;try{N=c5.renderToString(b,{...t,displayMode:p,throwOnError:!0})}catch(S){const T=S,M=T.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,l],cause:T,place:l.position,ruleId:M,source:"rehype-katex"});try{N=c5.renderToString(b,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{N=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(S)},children:[{type:"text",value:b}]}]}}typeof N=="string"&&(N=AH(N).children);const k=x.children.indexOf(y);return x.children.splice(k,1,...N),I7})}}function XH({content:e,className:t=""}){return r.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none ${t}`,children:r.jsx(WB,{remarkPlugins:[lI,xH],rehypePlugins:[WH],components:{code({inline:n,className:a,children:l,...o}){return n?r.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",...o,children:l}):r.jsx("code",{className:`${a} block bg-muted p-4 rounded-lg overflow-x-auto`,...o,children:l})},table({children:n,...a}){return r.jsx("div",{className:"overflow-x-auto",children:r.jsx("table",{className:"border-collapse border border-border",...a,children:n})})},th({children:n,...a}){return r.jsx("th",{className:"border border-border bg-muted px-4 py-2 text-left font-semibold",...a,children:n})},td({children:n,...a}){return r.jsx("td",{className:"border border-border px-4 py-2",...a,children:n})},a({children:n,...a}){return r.jsx("a",{className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",...a,children:n})},blockquote({children:n,...a}){return r.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",...a,children:n})},h1({children:n,...a}){return r.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4",...a,children:n})},h2({children:n,...a}){return r.jsx("h2",{className:"text-2xl font-bold mt-5 mb-3",...a,children:n})},h3({children:n,...a}){return r.jsx("h3",{className:"text-xl font-bold mt-4 mb-2",...a,children:n})},h4({children:n,...a}){return r.jsx("h4",{className:"text-lg font-semibold mt-3 mb-2",...a,children:n})},ul({children:n,...a}){return r.jsx("ul",{className:"list-disc list-inside space-y-1 my-2",...a,children:n})},ol({children:n,...a}){return r.jsx("ol",{className:"list-decimal list-inside space-y-1 my-2",...a,children:n})},p({children:n,...a}){return r.jsx("p",{className:"my-2 leading-relaxed",...a,children:n})},hr({...n}){return r.jsx("hr",{className:"my-4 border-border",...n})}},children:e})})}function KH({children:e,className:t}){return r.jsx(XH,{content:e,className:t})}const Vs="/api/webui/emoji";async function QH(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await lt(`${Vs}/list?${t}`,{headers:pt()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function ZH(e){const t=await lt(`${Vs}/${e}`,{headers:pt()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function JH(e,t){const n=await lt(`${Vs}/${e}`,{method:"PATCH",headers:pt(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function eU(e){const t=await lt(`${Vs}/${e}`,{method:"DELETE",headers:pt()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function tU(){const e=await lt(`${Vs}/stats/summary`,{headers:pt()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function nU(e){const t=await lt(`${Vs}/${e}/register`,{method:"POST",headers:pt()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function rU(e){const t=await lt(`${Vs}/${e}/ban`,{method:"POST",headers:pt()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function s1(e){const t=localStorage.getItem("access-token");return`${Vs}/${e}/thumbnail?token=${encodeURIComponent(t||"")}`}async function aU(e){const t=await lt(`${Vs}/batch/delete`,{method:"POST",headers:pt(),body:JSON.stringify({emoji_ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除失败")}return t.json()}function sU(){const[e,t]=w.useState([]),[n,a]=w.useState(null),[l,o]=w.useState(!1),[c,d]=w.useState(1),[m,f]=w.useState(0),[p,x]=w.useState(20),[y,b]=w.useState(""),[N,k]=w.useState("all"),[S,T]=w.useState("all"),[M,A]=w.useState("all"),[R,B]=w.useState(null),[O,L]=w.useState(!1),[$,U]=w.useState(!1),[I,G]=w.useState(!1),[ee,Ne]=w.useState(new Set),[J,se]=w.useState(!1),[H,le]=w.useState(""),{toast:re}=or(),ge=w.useCallback(async()=>{try{o(!0);const je=await QH({page:c,page_size:p,search:y||void 0,is_registered:N==="all"?void 0:N==="registered",is_banned:S==="all"?void 0:S==="banned",format:M==="all"?void 0:M,sort_by:"usage_count",sort_order:"desc"});t(je.data),f(je.total)}catch(je){const Ze=je instanceof Error?je.message:"加载表情包列表失败";re({title:"错误",description:Ze,variant:"destructive"})}finally{o(!1)}},[c,p,y,N,S,M,re]),E=async()=>{try{const je=await tU();a(je.data)}catch(je){console.error("加载统计数据失败:",je)}};w.useEffect(()=>{ge()},[ge]),w.useEffect(()=>{E()},[]);const we=async je=>{try{const Ze=await ZH(je.id);B(Ze.data),L(!0)}catch(Ze){const qe=Ze instanceof Error?Ze.message:"加载详情失败";re({title:"错误",description:qe,variant:"destructive"})}},Z=je=>{B(je),U(!0)},z=je=>{B(je),G(!0)},X=async()=>{if(R)try{await eU(R.id),re({title:"成功",description:"表情包已删除"}),G(!1),B(null),ge(),E()}catch(je){const Ze=je instanceof Error?je.message:"删除失败";re({title:"错误",description:Ze,variant:"destructive"})}},q=async je=>{try{await nU(je.id),re({title:"成功",description:"表情包已注册"}),ge(),E()}catch(Ze){const qe=Ze instanceof Error?Ze.message:"注册失败";re({title:"错误",description:qe,variant:"destructive"})}},ce=async je=>{try{await rU(je.id),re({title:"成功",description:"表情包已封禁"}),ge(),E()}catch(Ze){const qe=Ze instanceof Error?Ze.message:"封禁失败";re({title:"错误",description:qe,variant:"destructive"})}},fe=je=>{const Ze=new Set(ee);Ze.has(je)?Ze.delete(je):Ze.add(je),Ne(Ze)},De=()=>{ee.size===e.length&&e.length>0?Ne(new Set):Ne(new Set(e.map(je=>je.id)))},oe=async()=>{try{const je=await aU(Array.from(ee));re({title:"批量删除完成",description:je.message}),Ne(new Set),se(!1),ge(),E()}catch(je){re({title:"批量删除失败",description:je instanceof Error?je.message:"批量删除失败",variant:"destructive"})}},He=()=>{const je=parseInt(H),Ze=Math.ceil(m/p);je>=1&&je<=Ze?(d(je),le("")):re({title:"无效的页码",description:`请输入1-${Ze}之间的页码`,variant:"destructive"})},at=n?.formats?Object.keys(n.formats):[];return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsxs("div",{className:"mb-4 sm:mb-6",children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),r.jsx(an,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&r.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[r.jsx(ct,{children:r.jsxs(Lt,{className:"pb-2",children:[r.jsx(Qn,{children:"总数"}),r.jsx(Bt,{className:"text-2xl",children:n.total})]})}),r.jsx(ct,{children:r.jsxs(Lt,{className:"pb-2",children:[r.jsx(Qn,{children:"已注册"}),r.jsx(Bt,{className:"text-2xl text-green-600",children:n.registered})]})}),r.jsx(ct,{children:r.jsxs(Lt,{className:"pb-2",children:[r.jsx(Qn,{children:"已封禁"}),r.jsx(Bt,{className:"text-2xl text-red-600",children:n.banned})]})}),r.jsx(ct,{children:r.jsxs(Lt,{className:"pb-2",children:[r.jsx(Qn,{children:"未注册"}),r.jsx(Bt,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),r.jsxs(ct,{children:[r.jsx(Lt,{children:r.jsxs(Bt,{className:"flex items-center gap-2",children:[r.jsx(Sx,{className:"h-5 w-5"}),"搜索和筛选"]})}),r.jsxs(Gt,{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"搜索"}),r.jsxs("div",{className:"relative",children:[r.jsx(Yr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"描述或哈希值...",value:y,onChange:je=>{b(je.target.value),d(1)},className:"pl-8"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"注册状态"}),r.jsxs(_t,{value:N,onValueChange:je=>{k(je),d(1)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部"}),r.jsx(Oe,{value:"registered",children:"已注册"}),r.jsx(Oe,{value:"unregistered",children:"未注册"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"封禁状态"}),r.jsxs(_t,{value:S,onValueChange:je=>{T(je),d(1)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部"}),r.jsx(Oe,{value:"banned",children:"已封禁"}),r.jsx(Oe,{value:"unbanned",children:"未封禁"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"格式"}),r.jsxs(_t,{value:M,onValueChange:je=>{A(je),d(1)},children:[r.jsx(jt,{children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部"}),at.map(je=>r.jsxs(Oe,{value:je,children:[je.toUpperCase()," (",n?.formats[je],")"]},je))]})]})]})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:ee.size>0&&r.jsxs("span",{children:["已选择 ",ee.size," 个表情包"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:p.toString(),onValueChange:je=>{x(parseInt(je)),d(1),Ne(new Set)},children:[r.jsx(jt,{id:"emoji-page-size",className:"w-20",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"10",children:"10"}),r.jsx(Oe,{value:"20",children:"20"}),r.jsx(Oe,{value:"50",children:"50"}),r.jsx(Oe,{value:"100",children:"100"})]})]}),ee.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>Ne(new Set),children:"取消选择"}),r.jsxs(ne,{variant:"destructive",size:"sm",onClick:()=>se(!0),children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),r.jsx("div",{className:"flex justify-end pt-4 border-t",children:r.jsxs(ne,{variant:"outline",size:"sm",onClick:ge,disabled:l,children:[r.jsx(Ia,{className:`h-4 w-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"表情包列表"}),r.jsxs(Qn,{children:["共 ",m," 个表情包,当前第 ",c," 页"]})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"hidden md:block rounded-md border overflow-hidden",children:r.jsxs(ji,{children:[r.jsx(Ni,{children:r.jsxs(Vn,{children:[r.jsx(ut,{className:"w-12",children:r.jsx(jr,{checked:e.length>0&&ee.size===e.length,onCheckedChange:De,"aria-label":"全选"})}),r.jsx(ut,{className:"w-16",children:"预览"}),r.jsx(ut,{children:"描述"}),r.jsx(ut,{children:"格式"}),r.jsx(ut,{children:"情绪标签"}),r.jsx(ut,{className:"text-center",children:"状态"}),r.jsx(ut,{className:"text-right",children:"使用次数"}),r.jsx(ut,{className:"text-right",children:"操作"})]})}),r.jsx(Si,{children:e.length===0?r.jsx(Vn,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(je=>r.jsxs(Vn,{children:[r.jsx(et,{children:r.jsx(jr,{checked:ee.has(je.id),onCheckedChange:()=>fe(je.id),"aria-label":`选择 ${je.description}`})}),r.jsx(et,{children:r.jsx("div",{className:"w-20 h-20 bg-muted rounded flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:s1(je.id),alt:je.description||"表情包",className:"w-full h-full object-cover",onError:Ze=>{const qe=Ze.target;qe.style.display="none";const Ot=qe.parentElement;Ot&&(Ot.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>')}})})}),r.jsx(et,{children:r.jsxs("div",{className:"space-y-1 max-w-xs",children:[r.jsx("div",{className:"font-medium truncate",title:je.description||"无描述",children:je.description||"无描述"}),r.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[je.emoji_hash.slice(0,16),"..."]})]})}),r.jsx(et,{children:r.jsx(un,{variant:"outline",children:je.format.toUpperCase()})}),r.jsx(et,{children:r.jsx(v5,{emotions:je.emotion})}),r.jsx(et,{className:"align-middle",children:r.jsxs("div",{className:"flex gap-2 justify-center",children:[je.is_registered&&r.jsxs(un,{variant:"default",className:"bg-green-600",children:[r.jsx($r,{className:"h-3 w-3 mr-1"}),"已注册"]}),je.is_banned&&r.jsxs(un,{variant:"destructive",children:[r.jsx(bx,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),r.jsx(et,{className:"text-right font-mono",children:je.usage_count}),r.jsx(et,{children:r.jsxs("div",{className:"flex items-center justify-end gap-1 flex-wrap",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>we(je),children:[r.jsx(pi,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>Z(je),children:[r.jsx(Po,{className:"h-4 w-4 mr-1"}),"编辑"]}),!je.is_registered&&r.jsxs(ne,{size:"sm",onClick:()=>q(je),className:"bg-green-600 hover:bg-green-700 text-white",children:[r.jsx($r,{className:"h-4 w-4 mr-1"}),"注册"]}),!je.is_banned&&r.jsxs(ne,{size:"sm",onClick:()=>ce(je),className:"bg-orange-600 hover:bg-orange-700 text-white",children:[r.jsx(Gy,{className:"h-4 w-4 mr-1"}),"封禁"]}),r.jsxs(ne,{size:"sm",onClick:()=>z(je),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},je.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3",children:e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(je=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex gap-3",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-16 h-16 bg-muted rounded flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:s1(je.id),alt:je.description||"表情包",className:"w-full h-full object-cover",onError:Ze=>{const qe=Ze.target;qe.style.display="none";const Ot=qe.parentElement;Ot&&(Ot.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>')}})})}),r.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[r.jsxs("div",{className:"min-w-0 w-full overflow-hidden",children:[r.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",title:je.description||"无描述",children:je.description||"无描述"}),r.jsxs("p",{className:"text-xs text-muted-foreground font-mono line-clamp-1 w-full break-all",children:[je.emoji_hash.slice(0,16),"..."]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 items-center min-w-0",children:[r.jsx(un,{variant:"outline",className:"text-xs flex-shrink-0",children:je.format.toUpperCase()}),je.is_registered&&r.jsxs(un,{variant:"default",className:"bg-green-600 text-xs flex-shrink-0",children:[r.jsx($r,{className:"h-3 w-3 mr-1"}),"已注册"]}),je.is_banned&&r.jsxs(un,{variant:"destructive",className:"text-xs flex-shrink-0",children:[r.jsx(bx,{className:"h-3 w-3 mr-1"}),"已封禁"]}),r.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:["使用: ",je.usage_count]})]}),je.emotion&&je.emotion.length>0&&r.jsx("div",{className:"min-w-0 overflow-hidden",children:r.jsx(v5,{emotions:je.emotion})})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>we(je),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(pi,{className:"h-3 w-3 mr-1"}),"详情"]}),r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>Z(je),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Po,{className:"h-3 w-3 mr-1"}),"编辑"]}),!je.is_registered&&r.jsxs(ne,{size:"sm",onClick:()=>q(je),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-green-600 hover:bg-green-700 text-white",children:[r.jsx($r,{className:"h-3 w-3 mr-1"}),"注册"]}),!je.is_banned&&r.jsxs(ne,{size:"sm",onClick:()=>ce(je),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-orange-600 hover:bg-orange-700 text-white",children:[r.jsx(Gy,{className:"h-3 w-3 mr-1"}),"封禁"]}),r.jsxs(ne,{size:"sm",onClick:()=>z(je),className:"text-xs px-2 py-1 h-auto flex-shrink-0 bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},je.id))}),m>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(c-1)*p+1," 到"," ",Math.min(c*p,m)," 条,共 ",m," 条"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Du,{className:"h-4 w-4"})}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>d(je=>Math.max(1,je-1)),disabled:c===1,children:[r.jsx(bi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:H,onChange:je=>le(je.target.value),onKeyDown:je=>je.key==="Enter"&&He(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(m/p)}),r.jsx(ne,{variant:"outline",size:"sm",onClick:He,disabled:!H,className:"h-8",children:"跳转"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>d(je=>je+1),disabled:c>=Math.ceil(m/p),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(wi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(m/p)),disabled:c>=Math.ceil(m/p),className:"hidden sm:flex",children:r.jsx(zu,{className:"h-4 w-4"})})]})]})]})]}),r.jsx(lU,{emoji:R,open:O,onOpenChange:L}),r.jsx(iU,{emoji:R,open:$,onOpenChange:U,onSuccess:()=>{ge(),E()}})]})}),r.jsx(en,{open:J,onOpenChange:se,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认批量删除"}),r.jsxs(Qt,{children:["你确定要删除选中的 ",ee.size," 个表情包吗?此操作不可撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:oe,children:"确认删除"})]})]})}),r.jsx(ir,{open:I,onOpenChange:G,children:r.jsxs(Jn,{children:[r.jsxs(er,{children:[r.jsx(tr,{children:"确认删除"}),r.jsx(xr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>G(!1),children:"取消"}),r.jsx(ne,{variant:"destructive",onClick:X,children:"删除"})]})]})})]})}function lU({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(ir,{open:t,onOpenChange:n,children:r.jsxs(Jn,{className:"max-w-2xl max-h-[90vh]",children:[r.jsx(er,{children:r.jsx(tr,{children:"表情包详情"})}),r.jsx(an,{className:"max-h-[calc(90vh-8rem)] pr-4",children:r.jsxs("div",{className:"space-y-4",children:[r.jsx("div",{className:"flex justify-center",children:r.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:r.jsx("img",{src:s1(e.id),alt:e.description||"表情包",className:"w-full h-full object-cover",onError:l=>{const o=l.target;o.style.display="none";const c=o.parentElement;c&&(c.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>')}})})}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"ID"}),r.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"格式"}),r.jsx("div",{className:"mt-1",children:r.jsx(un,{variant:"outline",children:e.format.toUpperCase()})})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"文件路径"}),r.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"哈希值"}),r.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"描述"}),e.description?r.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:r.jsx(KH,{className:"prose-sm",children:e.description})}):r.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"情绪标签"}),r.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:(()=>{const l=e.emotion?e.emotion.split(/[,,]/).map(o=>o.trim()).filter(Boolean):[];return l.length>0?l.map((o,c)=>r.jsx(un,{variant:"secondary",children:o},c)):r.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})()})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"状态"}),r.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&r.jsx(un,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&r.jsx(un,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&r.jsx(un,{variant:"outline",children:"未注册"})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"使用次数"}),r.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"记录时间"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.record_time)})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"注册时间"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.register_time)})]})]}),r.jsxs("div",{children:[r.jsx(Q,{className:"text-muted-foreground",children:"最后使用"}),r.jsx("div",{className:"mt-1 text-sm",children:a(e.last_used_time)})]})]})})]})})}function iU({emoji:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState(""),[c,d]=w.useState(""),[m,f]=w.useState(!1),[p,x]=w.useState(!1),[y,b]=w.useState(!1),{toast:N}=or();w.useEffect(()=>{e&&(o(e.description||""),d(e.emotion||""),f(e.is_registered),x(e.is_banned))},[e]);const k=async()=>{if(e)try{b(!0);const S=c.split(/[,,]/).map(T=>T.trim()).filter(Boolean).join(",");await JH(e.id,{description:l||void 0,emotion:S||void 0,is_registered:m,is_banned:p}),N({title:"成功",description:"表情包信息已更新"}),n(!1),a()}catch(S){const T=S instanceof Error?S.message:"保存失败";N({title:"错误",description:T,variant:"destructive"})}finally{b(!1)}};return e?r.jsx(ir,{open:t,onOpenChange:n,children:r.jsxs(Jn,{className:"max-w-2xl",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"编辑表情包"}),r.jsx(xr,{children:"修改表情包的描述和标签信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(Q,{children:"描述"}),r.jsx(fn,{value:l,onChange:S=>o(S.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),r.jsxs("div",{children:[r.jsx(Q,{children:"情绪标签"}),r.jsx(Te,{value:c,onChange:S=>d(S.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔(支持中英文逗号)"})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(jr,{id:"is_registered",checked:m,onCheckedChange:S=>f(S===!0)}),r.jsx(Q,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(jr,{id:"is_banned",checked:p,onCheckedChange:S=>x(S===!0)}),r.jsx(Q,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(ne,{onClick:k,disabled:y,children:y?"保存中...":"保存"})]})]})}):null}function v5({emotions:e}){const t=e?e.split(/[,,]/).map(o=>o.trim()).filter(Boolean):[];if(t.length===0)return r.jsx("span",{className:"text-xs text-muted-foreground",children:"-"});const n=(o,c=6)=>o.length<=c?o:o.slice(0,c)+"...",a=t.slice(0,3),l=t.length-3;return r.jsxs("div",{className:"flex flex-wrap gap-1 max-w-full overflow-hidden",children:[a.map((o,c)=>r.jsx(un,{variant:"secondary",className:"text-xs flex-shrink-0",title:o,children:n(o)},c)),l>0&&r.jsxs(un,{variant:"outline",className:"text-xs flex-shrink-0",title:`还有 ${l} 个标签: ${t.slice(3).join(", ")}`,children:["+",l]})]})}const _i="/api/webui/expression";async function oU(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await lt(`${_i}/list?${t}`,{headers:pt()});if(!n.ok){const a=await n.json();throw new Error(a.detail||"获取表达方式列表失败")}return n.json()}async function cU(e){const t=await lt(`${_i}/${e}`,{headers:pt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function uU(e){const t=await lt(`${_i}/`,{method:"POST",headers:pt(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function dU(e,t){const n=await lt(`${_i}/${e}`,{method:"PATCH",headers:pt(),body:JSON.stringify(t)});if(!n.ok){const a=await n.json();throw new Error(a.detail||"更新表达方式失败")}return n.json()}async function mU(e){const t=await lt(`${_i}/${e}`,{method:"DELETE",headers:pt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function hU(e){const t=await lt(`${_i}/batch/delete`,{method:"POST",headers:pt(),body:JSON.stringify({ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除表达方式失败")}return t.json()}async function fU(){const e=await lt(`${_i}/stats/summary`,{headers:pt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function pU(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(1),[m,f]=w.useState(20),[p,x]=w.useState(""),[y,b]=w.useState(null),[N,k]=w.useState(!1),[S,T]=w.useState(!1),[M,A]=w.useState(!1),[R,B]=w.useState(null),[O,L]=w.useState(new Set),[$,U]=w.useState(!1),[I,G]=w.useState(""),[ee,Ne]=w.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:J}=or(),se=async()=>{try{a(!0);const q=await oU({page:c,page_size:m,search:p||void 0});t(q.data),o(q.total)}catch(q){J({title:"加载失败",description:q instanceof Error?q.message:"无法加载表达方式",variant:"destructive"})}finally{a(!1)}},H=async()=>{try{const q=await fU();Ne(q.data)}catch(q){console.error("加载统计数据失败:",q)}};w.useEffect(()=>{se(),H()},[c,m,p]);const le=async q=>{try{const ce=await cU(q.id);b(ce.data),k(!0)}catch(ce){J({title:"加载详情失败",description:ce instanceof Error?ce.message:"无法加载表达方式详情",variant:"destructive"})}},re=q=>{b(q),T(!0)},ge=async q=>{try{await mU(q.id),J({title:"删除成功",description:`已删除表达方式: ${q.situation}`}),B(null),se(),H()}catch(ce){J({title:"删除失败",description:ce instanceof Error?ce.message:"无法删除表达方式",variant:"destructive"})}},E=q=>{const ce=new Set(O);ce.has(q)?ce.delete(q):ce.add(q),L(ce)},we=()=>{O.size===e.length&&e.length>0?L(new Set):L(new Set(e.map(q=>q.id)))},Z=async()=>{try{await hU(Array.from(O)),J({title:"批量删除成功",description:`已删除 ${O.size} 个表达方式`}),L(new Set),U(!1),se(),H()}catch(q){J({title:"批量删除失败",description:q instanceof Error?q.message:"无法批量删除表达方式",variant:"destructive"})}},z=()=>{const q=parseInt(I),ce=Math.ceil(l/m);q>=1&&q<=ce?(d(q),G("")):J({title:"无效的页码",description:`请输入1-${ce}之间的页码`,variant:"destructive"})},X=q=>q?new Date(q*1e3).toLocaleString("zh-CN"):"-";return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsx("div",{className:"mb-4 sm:mb-6",children:r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[r.jsx(Mu,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),r.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),r.jsxs(ne,{onClick:()=>A(!0),className:"gap-2",children:[r.jsx(pr,{className:"h-4 w-4"}),"新增表达方式"]})]})}),r.jsx(an,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),r.jsx("div",{className:"text-2xl font-bold mt-1",children:ee.total})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:ee.recent_7days})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:ee.chat_count})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx(Q,{htmlFor:"search",children:"搜索"}),r.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Yr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{id:"search",placeholder:"搜索情境、风格或上下文...",value:p,onChange:q=>x(q.target.value),className:"pl-9"})]})}),r.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:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:O.size>0&&r.jsxs("span",{children:["已选择 ",O.size," 个表达方式"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:m.toString(),onValueChange:q=>{f(parseInt(q)),d(1),L(new Set)},children:[r.jsx(jt,{id:"page-size",className:"w-20",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"10",children:"10"}),r.jsx(Oe,{value:"20",children:"20"}),r.jsx(Oe,{value:"50",children:"50"}),r.jsx(Oe,{value:"100",children:"100"})]})]}),O.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>L(new Set),children:"取消选择"}),r.jsxs(ne,{variant:"destructive",size:"sm",onClick:()=>U(!0),children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card",children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(ji,{children:[r.jsx(Ni,{children:r.jsxs(Vn,{children:[r.jsx(ut,{className:"w-12",children:r.jsx(jr,{checked:O.size===e.length&&e.length>0,onCheckedChange:we})}),r.jsx(ut,{children:"情境"}),r.jsx(ut,{children:"风格"}),r.jsx(ut,{children:"聊天ID"}),r.jsx(ut,{children:"最后活跃"}),r.jsx(ut,{className:"text-right",children:"操作"})]})}),r.jsx(Si,{children:n?r.jsx(Vn,{children:r.jsx(et,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?r.jsx(Vn,{children:r.jsx(et,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(q=>r.jsxs(Vn,{children:[r.jsx(et,{children:r.jsx(jr,{checked:O.has(q.id),onCheckedChange:()=>E(q.id)})}),r.jsx(et,{className:"font-medium max-w-xs truncate",children:q.situation}),r.jsx(et,{className:"max-w-xs truncate",children:q.style}),r.jsx(et,{className:"font-mono text-sm",children:q.chat_id}),r.jsx(et,{className:"text-sm text-muted-foreground",children:X(q.last_active_time)}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>le(q),children:[r.jsx(Ha,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>re(q),children:[r.jsx(Po,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsxs(ne,{size:"sm",onClick:()=>B(q),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},q.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(q=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(jr,{checked:O.has(q.id),onCheckedChange:()=>E(q.id),className:"mt-1"}),r.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),r.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:q.situation,children:q.situation})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),r.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:q.style,children:q.style})]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天ID"}),r.jsx("p",{className:"font-mono text-xs truncate",children:q.chat_id})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后活跃"}),r.jsx("p",{className:"text-xs",children:X(q.last_active_time)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>le(q),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Ha,{className:"h-3 w-3 mr-1"}),"查看"]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>re(q),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Po,{className:"h-3 w-3 mr-1"}),"编辑"]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>B(q),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[r.jsx(zt,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},q.id))}),l>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",l," 条记录,第 ",c," / ",Math.ceil(l/m)," 页"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Du,{className:"h-4 w-4"})}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>d(c-1),disabled:c===1,children:[r.jsx(bi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:I,onChange:q=>G(q.target.value),onKeyDown:q=>q.key==="Enter"&&z(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(l/m)}),r.jsx(ne,{variant:"outline",size:"sm",onClick:z,disabled:!I,className:"h-8",children:"跳转"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>d(c+1),disabled:c>=Math.ceil(l/m),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(wi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(l/m)),disabled:c>=Math.ceil(l/m),className:"hidden sm:flex",children:r.jsx(zu,{className:"h-4 w-4"})})]})]})]})]})}),r.jsx(xU,{expression:y,open:N,onOpenChange:k}),r.jsx(gU,{open:M,onOpenChange:A,onSuccess:()=>{se(),H(),A(!1)}}),r.jsx(vU,{expression:y,open:S,onOpenChange:T,onSuccess:()=>{se(),H(),T(!1)}}),r.jsx(en,{open:!!R,onOpenChange:()=>B(null),children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除表达方式 "',R?.situation,'" 吗? 此操作不可撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>R&&ge(R),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),r.jsx(yU,{open:$,onOpenChange:U,onConfirm:Z,count:O.size})]})}function xU({expression:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(ir,{open:t,onOpenChange:n,children:r.jsxs(Jn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"表达方式详情"}),r.jsx(xr,{children:"查看表达方式的完整信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(jo,{label:"情境",value:e.situation}),r.jsx(jo,{label:"风格",value:e.style}),r.jsx(jo,{icon:tm,label:"聊天ID",value:e.chat_id,mono:!0}),r.jsx(jo,{icon:tm,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"上下文"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"上文内容"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(jo,{icon:di,label:"最后活跃",value:a(e.last_active_time)}),r.jsx(jo,{icon:di,label:"创建时间",value:a(e.create_date)})]})]}),r.jsx(Er,{children:r.jsx(ne,{onClick:()=>n(!1),children:"关闭"})})]})})}function jo({icon:e,label:t,value:n,mono:a=!1}){return r.jsxs("div",{className:"space-y-1",children:[r.jsxs(Q,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&r.jsx(e,{className:"h-3 w-3"}),t]}),r.jsx("div",{className:he("text-sm",a&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function gU({open:e,onOpenChange:t,onSuccess:n}){const[a,l]=w.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[o,c]=w.useState(!1),{toast:d}=or(),m=async()=>{if(!a.situation||!a.style||!a.chat_id){d({title:"验证失败",description:"请填写必填字段情境、风格和聊天ID",variant:"destructive"});return}try{c(!0),await uU(a),d({title:"创建成功",description:"表达方式已创建"}),l({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(f){d({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{c(!1)}};return r.jsx(ir,{open:e,onOpenChange:t,children:r.jsxs(Jn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"新增表达方式"}),r.jsx(xr,{children:"创建新的表达方式记录"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"situation",children:["情境 ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"situation",value:a.situation,onChange:f=>l({...a,situation:f.target.value}),placeholder:"描述使用场景"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"style",children:["风格 ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"style",value:a.style,onChange:f=>l({...a,style:f.target.value}),placeholder:"描述表达风格"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(Q,{htmlFor:"chat_id",children:["聊天ID ",r.jsx("span",{className:"text-destructive",children:"*"})]}),r.jsx(Te,{id:"chat_id",value:a.chat_id,onChange:f=>l({...a,chat_id:f.target.value}),placeholder:"关联的聊天ID"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"context",children:"上下文"}),r.jsx(fn,{id:"context",value:a.context,onChange:f=>l({...a,context:f.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"up_content",children:"上文内容"}),r.jsx(fn,{id:"up_content",value:a.up_content,onChange:f=>l({...a,up_content:f.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>t(!1),children:"取消"}),r.jsx(ne,{onClick:m,disabled:o,children:o?"创建中...":"创建"})]})]})})}function vU({expression:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState({}),[c,d]=w.useState(!1),{toast:m}=or();w.useEffect(()=>{e&&o({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const f=async()=>{if(e)try{d(!0),await dU(e.id,l),m({title:"保存成功",description:"表达方式已更新"}),a()}catch(p){m({title:"保存失败",description:p instanceof Error?p.message:"无法更新表达方式",variant:"destructive"})}finally{d(!1)}};return e?r.jsx(ir,{open:t,onOpenChange:n,children:r.jsxs(Jn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"编辑表达方式"}),r.jsx(xr,{children:"修改表达方式的信息"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_situation",children:"情境"}),r.jsx(Te,{id:"edit_situation",value:l.situation||"",onChange:p=>o({...l,situation:p.target.value}),placeholder:"描述使用场景"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_style",children:"风格"}),r.jsx(Te,{id:"edit_style",value:l.style||"",onChange:p=>o({...l,style:p.target.value}),placeholder:"描述表达风格"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_chat_id",children:"聊天ID"}),r.jsx(Te,{id:"edit_chat_id",value:l.chat_id||"",onChange:p=>o({...l,chat_id:p.target.value}),placeholder:"关联的聊天ID"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_context",children:"上下文"}),r.jsx(fn,{id:"edit_context",value:l.context||"",onChange:p=>o({...l,context:p.target.value}),placeholder:"上下文信息",rows:3})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit_up_content",children:"上文内容"}),r.jsx(fn,{id:"edit_up_content",value:l.up_content||"",onChange:p=>o({...l,up_content:p.target.value}),placeholder:"上文内容",rows:3})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(ne,{onClick:f,disabled:c,children:c?"保存中...":"保存"})]})]})}):null}function yU({open:e,onOpenChange:t,onConfirm:n,count:a}){return r.jsx(en,{open:e,onOpenChange:t,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认批量删除"}),r.jsxs(Qt,{children:["您即将删除 ",a," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const rc="/api/webui/person";async function bU(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await lt(`${rc}/list?${t}`,{headers:pt()});if(!n.ok){const a=await n.json();throw new Error(a.detail||"获取人物列表失败")}return n.json()}async function wU(e){const t=await lt(`${rc}/${e}`,{headers:pt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function jU(e,t){const n=await lt(`${rc}/${e}`,{method:"PATCH",headers:pt(),body:JSON.stringify(t)});if(!n.ok){const a=await n.json();throw new Error(a.detail||"更新人物信息失败")}return n.json()}async function NU(e){const t=await lt(`${rc}/${e}`,{method:"DELETE",headers:pt()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function SU(){const e=await lt(`${rc}/stats/summary`,{headers:pt()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}async function kU(e){const t=await lt(`${rc}/batch/delete`,{method:"POST",headers:pt(),body:JSON.stringify({person_ids:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"批量删除失败")}return t.json()}function CU(){const[e,t]=w.useState([]),[n,a]=w.useState(!0),[l,o]=w.useState(0),[c,d]=w.useState(1),[m,f]=w.useState(20),[p,x]=w.useState(""),[y,b]=w.useState(void 0),[N,k]=w.useState(void 0),[S,T]=w.useState(null),[M,A]=w.useState(!1),[R,B]=w.useState(!1),[O,L]=w.useState(null),[$,U]=w.useState({total:0,known:0,unknown:0,platforms:{}}),[I,G]=w.useState(new Set),[ee,Ne]=w.useState(!1),[J,se]=w.useState(""),{toast:H}=or(),le=async()=>{try{a(!0);const oe=await bU({page:c,page_size:m,search:p||void 0,is_known:y,platform:N});t(oe.data),o(oe.total)}catch(oe){H({title:"加载失败",description:oe instanceof Error?oe.message:"无法加载人物信息",variant:"destructive"})}finally{a(!1)}},re=async()=>{try{const oe=await SU();U(oe.data)}catch(oe){console.error("加载统计数据失败:",oe)}};w.useEffect(()=>{le(),re()},[c,m,p,y,N]);const ge=async oe=>{try{const He=await wU(oe.person_id);T(He.data),A(!0)}catch(He){H({title:"加载详情失败",description:He instanceof Error?He.message:"无法加载人物详情",variant:"destructive"})}},E=oe=>{T(oe),B(!0)},we=async oe=>{try{await NU(oe.person_id),H({title:"删除成功",description:`已删除人物信息: ${oe.person_name||oe.nickname||oe.user_id}`}),L(null),le(),re()}catch(He){H({title:"删除失败",description:He instanceof Error?He.message:"无法删除人物信息",variant:"destructive"})}},Z=w.useMemo(()=>Object.keys($.platforms),[$.platforms]),z=oe=>{const He=new Set(I);He.has(oe)?He.delete(oe):He.add(oe),G(He)},X=()=>{I.size===e.length&&e.length>0?G(new Set):G(new Set(e.map(oe=>oe.person_id)))},q=()=>{if(I.size===0){H({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}Ne(!0)},ce=async()=>{try{const oe=await kU(Array.from(I));H({title:"批量删除完成",description:oe.message}),G(new Set),Ne(!1),le(),re()}catch(oe){H({title:"批量删除失败",description:oe instanceof Error?oe.message:"批量删除失败",variant:"destructive"})}},fe=()=>{const oe=parseInt(J),He=Math.ceil(l/m);oe>=1&&oe<=He?(d(oe),se("")):H({title:"无效的页码",description:`请输入1-${He}之间的页码`,variant:"destructive"})},De=oe=>oe?new Date(oe*1e3).toLocaleString("zh-CN"):"-";return r.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[r.jsx("div",{className:"mb-4 sm:mb-6",children:r.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[r.jsx(TT,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),r.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),r.jsx(an,{className:"flex-1",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),r.jsx("div",{className:"text-2xl font-bold mt-1",children:$.total})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:$.known})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),r.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:$.unknown})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx(Q,{htmlFor:"search",children:"搜索"}),r.jsxs("div",{className:"relative mt-1.5",children:[r.jsx(Yr,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:p,onChange:oe=>x(oe.target.value),className:"pl-9"})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"filter-known",children:"认识状态"}),r.jsxs(_t,{value:y===void 0?"all":y.toString(),onValueChange:oe=>{b(oe==="all"?void 0:oe==="true"),d(1)},children:[r.jsx(jt,{id:"filter-known",className:"mt-1.5",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部"}),r.jsx(Oe,{value:"true",children:"已认识"}),r.jsx(Oe,{value:"false",children:"未认识"})]})]})]}),r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"filter-platform",children:"平台"}),r.jsxs(_t,{value:N||"all",onValueChange:oe=>{k(oe==="all"?void 0:oe),d(1)},children:[r.jsx(jt,{id:"filter-platform",className:"mt-1.5",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部平台"}),Z.map(oe=>r.jsxs(Oe,{value:oe,children:[oe," (",$.platforms[oe],")"]},oe))]})]})]})]}),r.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:[r.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:I.size>0&&r.jsxs("span",{children:["已选择 ",I.size," 个人物"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),r.jsxs(_t,{value:m.toString(),onValueChange:oe=>{f(parseInt(oe)),d(1),G(new Set)},children:[r.jsx(jt,{id:"page-size",className:"w-20",children:r.jsx(Et,{})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"10",children:"10"}),r.jsx(Oe,{value:"20",children:"20"}),r.jsx(Oe,{value:"50",children:"50"}),r.jsx(Oe,{value:"100",children:"100"})]})]}),I.size>0&&r.jsxs(r.Fragment,{children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>G(new Set),children:"取消选择"}),r.jsxs(ne,{variant:"destructive",size:"sm",onClick:q,children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),r.jsxs("div",{className:"rounded-lg border bg-card",children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(ji,{children:[r.jsx(Ni,{children:r.jsxs(Vn,{children:[r.jsx(ut,{className:"w-12",children:r.jsx(jr,{checked:e.length>0&&I.size===e.length,onCheckedChange:X,"aria-label":"全选"})}),r.jsx(ut,{children:"状态"}),r.jsx(ut,{children:"名称"}),r.jsx(ut,{children:"昵称"}),r.jsx(ut,{children:"平台"}),r.jsx(ut,{children:"用户ID"}),r.jsx(ut,{children:"最后更新"}),r.jsx(ut,{className:"text-right",children:"操作"})]})}),r.jsx(Si,{children:n?r.jsx(Vn,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?r.jsx(Vn,{children:r.jsx(et,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(oe=>r.jsxs(Vn,{children:[r.jsx(et,{children:r.jsx(jr,{checked:I.has(oe.person_id),onCheckedChange:()=>z(oe.person_id),"aria-label":`选择 ${oe.person_name||oe.nickname||oe.user_id}`})}),r.jsx(et,{children:r.jsx("div",{className:he("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",oe.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:oe.is_known?"已认识":"未认识"})}),r.jsx(et,{className:"font-medium",children:oe.person_name||r.jsx("span",{className:"text-muted-foreground",children:"-"})}),r.jsx(et,{children:oe.nickname||"-"}),r.jsx(et,{children:oe.platform}),r.jsx(et,{className:"font-mono text-sm",children:oe.user_id}),r.jsx(et,{className:"text-sm text-muted-foreground",children:De(oe.last_know)}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>ge(oe),children:[r.jsx(Ha,{className:"h-4 w-4 mr-1"}),"详情"]}),r.jsxs(ne,{variant:"default",size:"sm",onClick:()=>E(oe),children:[r.jsx(Po,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsxs(ne,{size:"sm",onClick:()=>L(oe),className:"bg-red-600 hover:bg-red-700 text-white",children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},oe.id))})]})}),r.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):e.length===0?r.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):e.map(oe=>r.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(jr,{checked:I.has(oe.person_id),onCheckedChange:()=>z(oe.person_id),className:"mt-1"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:he("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium mb-2",oe.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:oe.is_known?"已认识":"未认识"}),r.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:oe.person_name||r.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),oe.nickname&&r.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",oe.nickname]})]})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),r.jsx("p",{className:"font-medium text-xs",children:oe.platform})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),r.jsx("p",{className:"font-mono text-xs truncate",title:oe.user_id,children:oe.user_id})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),r.jsx("p",{className:"text-xs",children:De(oe.last_know)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>ge(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Ha,{className:"h-3 w-3 mr-1"}),"查看"]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>E(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[r.jsx(Po,{className:"h-3 w-3 mr-1"}),"编辑"]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>L(oe),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[r.jsx(zt,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},oe.id))}),l>0&&r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",l," 条记录,第 ",c," / ",Math.ceil(l/m)," 页"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:c===1,className:"hidden sm:flex",children:r.jsx(Du,{className:"h-4 w-4"})}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>d(c-1),disabled:c===1,children:[r.jsx(bi,{className:"h-4 w-4 sm:mr-1"}),r.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{type:"number",value:J,onChange:oe=>se(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&fe(),placeholder:c.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(l/m)}),r.jsx(ne,{variant:"outline",size:"sm",onClick:fe,disabled:!J,className:"h-8",children:"跳转"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>d(c+1),disabled:c>=Math.ceil(l/m),children:[r.jsx("span",{className:"hidden sm:inline",children:"下一页"}),r.jsx(wi,{className:"h-4 w-4 sm:ml-1"})]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(Math.ceil(l/m)),disabled:c>=Math.ceil(l/m),className:"hidden sm:flex",children:r.jsx(zu,{className:"h-4 w-4"})})]})]})]})]})}),r.jsx(TU,{person:S,open:M,onOpenChange:A}),r.jsx(_U,{person:S,open:R,onOpenChange:B,onSuccess:()=>{le(),re(),B(!1)}}),r.jsx(en,{open:!!O,onOpenChange:()=>L(null),children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认删除"}),r.jsxs(Qt,{children:['确定要删除人物信息 "',O?.person_name||O?.nickname||O?.user_id,'" 吗? 此操作不可撤销。']})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:()=>O&&we(O),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),r.jsx(en,{open:ee,onOpenChange:Ne,children:r.jsxs(Yt,{children:[r.jsxs(Wt,{children:[r.jsx(Kt,{children:"确认批量删除"}),r.jsxs(Qt,{children:["确定要删除选中的 ",I.size," 个人物信息吗? 此操作不可撤销。"]})]}),r.jsxs(Xt,{children:[r.jsx(Jt,{children:"取消"}),r.jsx(Zt,{onClick:ce,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function TU({person:e,open:t,onOpenChange:n}){if(!e)return null;const a=l=>l?new Date(l*1e3).toLocaleString("zh-CN"):"-";return r.jsx(ir,{open:t,onOpenChange:n,children:r.jsxs(Jn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"人物详情"}),r.jsxs(xr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsx(As,{icon:l6,label:"人物名称",value:e.person_name}),r.jsx(As,{icon:Mu,label:"昵称",value:e.nickname}),r.jsx(As,{icon:tm,label:"用户ID",value:e.user_id,mono:!0}),r.jsx(As,{icon:tm,label:"人物ID",value:e.person_id,mono:!0}),r.jsx(As,{label:"平台",value:e.platform}),r.jsx(As,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),r.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"个人印象"}),r.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&r.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[r.jsx(Q,{className:"text-xs text-muted-foreground",children:"群昵称"}),r.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((l,o)=>r.jsxs("div",{className:"text-sm flex items-center gap-2",children:[r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:l.group_id}),r.jsx("span",{children:"→"}),r.jsx("span",{children:l.group_nick_name})]},o))})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsx(As,{icon:di,label:"认识时间",value:a(e.know_times)}),r.jsx(As,{icon:di,label:"首次记录",value:a(e.know_since)}),r.jsx(As,{icon:di,label:"最后更新",value:a(e.last_know)})]})]}),r.jsx(Er,{children:r.jsx(ne,{onClick:()=>n(!1),children:"关闭"})})]})})}function As({icon:e,label:t,value:n,mono:a=!1}){return r.jsxs("div",{className:"space-y-1",children:[r.jsxs(Q,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&r.jsx(e,{className:"h-3 w-3"}),t]}),r.jsx("div",{className:he("text-sm",a&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function _U({person:e,open:t,onOpenChange:n,onSuccess:a}){const[l,o]=w.useState({}),[c,d]=w.useState(!1),{toast:m}=or();w.useEffect(()=>{e&&o({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const f=async()=>{if(e)try{d(!0),await jU(e.person_id,l),m({title:"保存成功",description:"人物信息已更新"}),a()}catch(p){m({title:"保存失败",description:p instanceof Error?p.message:"无法更新人物信息",variant:"destructive"})}finally{d(!1)}};return e?r.jsx(ir,{open:t,onOpenChange:n,children:r.jsxs(Jn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"编辑人物信息"}),r.jsxs(xr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"person_name",children:"人物名称"}),r.jsx(Te,{id:"person_name",value:l.person_name||"",onChange:p=>o({...l,person_name:p.target.value}),placeholder:"为这个人设置一个名称"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"nickname",children:"昵称"}),r.jsx(Te,{id:"nickname",value:l.nickname||"",onChange:p=>o({...l,nickname:p.target.value}),placeholder:"昵称"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"name_reason",children:"名称设定原因"}),r.jsx(fn,{id:"name_reason",value:l.name_reason||"",onChange:p=>o({...l,name_reason:p.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"memory_points",children:"个人印象"}),r.jsx(fn,{id:"memory_points",value:l.memory_points||"",onChange:p=>o({...l,memory_points:p.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),r.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[r.jsxs("div",{children:[r.jsx(Q,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),r.jsx(vt,{id:"is_known",checked:l.is_known,onCheckedChange:p=>o({...l,is_known:p})})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>n(!1),children:"取消"}),r.jsx(ne,{onClick:f,disabled:c,children:c?"保存中...":"保存"})]})]})}):null}function EU(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const MU={},su={};function ui(e,t){try{const a=(MU[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return a in su?su[a]:y5(a,a.split(":"))}catch{if(e in su)return su[e];const n=e?.match(AU);return n?y5(e,n.slice(1)):NaN}}const AU=/([+-]\d\d):?(\d\d)?/;function y5(e,t){const n=+(t[0]||0),a=+(t[1]||0),l=+(t[2]||0)/60;return su[e]=n*60+a>0?n*60+a+l:n*60-a-l}class rs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ui(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),fN(this),l1(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new rs(...n,t):new rs(Date.now(),t)}withTimeZone(t){return new rs(+this,t)}getTimezoneOffset(){const t=-ui(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),l1(this),+this}[Symbol.for("constructDateFrom")](t){return new rs(+new Date(t),this.timeZone)}}const b5=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!b5.test(e))return;const t=e.replace(b5,"$1UTC");rs.prototype[t]&&(e.startsWith("get")?rs.prototype[e]=function(){return this.internal[t]()}:(rs.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),DU(this),+this},rs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),l1(this),+this}))});function l1(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ui(e.timeZone,e)*60))}function DU(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),fN(e)}function fN(e){const t=ui(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);const l=-new Date(+e).getTimezoneOffset(),o=-new Date(+a).getTimezoneOffset(),c=l-o,d=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();c&&d&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+c);const m=l-n;m&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);const f=new Date(+e);f.setUTCSeconds(0);const p=l>0?f.getSeconds():(f.getSeconds()-60)%60,x=Math.round(-(ui(e.timeZone,e)*60))%60;(x||p)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+x+p));const y=ui(e.timeZone,e),b=y>0?Math.floor(y):Math.ceil(y),k=-new Date(+e).getTimezoneOffset()-b,S=b!==n,T=k-m;if(S&&T){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+T);const M=ui(e.timeZone,e),A=M>0?Math.floor(M):Math.ceil(M),R=b-A;R&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+R))}}class vr extends rs{static tz(t,...n){return n.length?new vr(...n,t):new vr(Date.now(),t)}toISOString(){const[t,n,a]=this.tzComponents(),l=`${t}${n}:${a}`;return this.internal.toISOString().slice(0,-1)+l}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,a,l]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${a} ${n} ${l}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,a,l]=this.tzComponents();return`${t} GMT${n}${a}${l} (${EU(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",a=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),l=String(Math.abs(t)%60).padStart(2,"0");return[n,a,l]}withTimeZone(t){return new vr(+this,t)}[Symbol.for("constructDateFrom")](t){return new vr(+new Date(t),this.timeZone)}}const pN=6048e5,zU=864e5,w5=Symbol.for("constructDateFrom");function Gn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&w5 in e?e[w5](t):e instanceof Date?new e.constructor(t):new Date(t)}function dn(e,t){return Gn(t||e,e)}function xN(e,t,n){const a=dn(e,n?.in);return isNaN(t)?Gn(e,NaN):(t&&a.setDate(a.getDate()+t),a)}function gN(e,t,n){const a=dn(e,n?.in);if(isNaN(t))return Gn(e,NaN);if(!t)return a;const l=a.getDate(),o=Gn(e,a.getTime());o.setMonth(a.getMonth()+t+1,0);const c=o.getDate();return l>=c?o:(a.setFullYear(o.getFullYear(),o.getMonth(),l),a)}let OU={};function Qu(){return OU}function Dl(e,t){const n=Qu(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=dn(e,t?.in),o=l.getDay(),c=(o<a?7:0)+o-a;return l.setDate(l.getDate()-c),l.setHours(0,0,0,0),l}function Su(e,t){return Dl(e,{...t,weekStartsOn:1})}function vN(e,t){const n=dn(e,t?.in),a=n.getFullYear(),l=Gn(n,0);l.setFullYear(a+1,0,4),l.setHours(0,0,0,0);const o=Su(l),c=Gn(n,0);c.setFullYear(a,0,4),c.setHours(0,0,0,0);const d=Su(c);return n.getTime()>=o.getTime()?a+1:n.getTime()>=d.getTime()?a:a-1}function j5(e){const t=dn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ei(e,...t){const n=Gn.bind(null,e||t.find(a=>typeof a=="object"));return t.map(n)}function ku(e,t){const n=dn(e,t?.in);return n.setHours(0,0,0,0),n}function yN(e,t,n){const[a,l]=Ei(n?.in,e,t),o=ku(a),c=ku(l),d=+o-j5(o),m=+c-j5(c);return Math.round((d-m)/zU)}function RU(e,t){const n=vN(e,t),a=Gn(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),Su(a)}function LU(e,t,n){return xN(e,t*7,n)}function BU(e,t,n){return gN(e,t*12,n)}function PU(e,t){let n,a=t?.in;return e.forEach(l=>{!a&&typeof l=="object"&&(a=Gn.bind(null,l));const o=dn(l,a);(!n||n<o||isNaN(+o))&&(n=o)}),Gn(a,n||NaN)}function FU(e,t){let n,a=t?.in;return e.forEach(l=>{!a&&typeof l=="object"&&(a=Gn.bind(null,l));const o=dn(l,a);(!n||n>o||isNaN(+o))&&(n=o)}),Gn(a,n||NaN)}function IU(e,t,n){const[a,l]=Ei(n?.in,e,t);return+ku(a)==+ku(l)}function bN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qU(e){return!(!bN(e)&&typeof e!="number"||isNaN(+dn(e)))}function HU(e,t,n){const[a,l]=Ei(n?.in,e,t),o=a.getFullYear()-l.getFullYear(),c=a.getMonth()-l.getMonth();return o*12+c}function UU(e,t){const n=dn(e,t?.in),a=n.getMonth();return n.setFullYear(n.getFullYear(),a+1,0),n.setHours(23,59,59,999),n}function wN(e,t){const[n,a]=Ei(e,t.start,t.end);return{start:n,end:a}}function $U(e,t){const{start:n,end:a}=wN(t?.in,e);let l=+n>+a;const o=l?+n:+a,c=l?a:n;c.setHours(0,0,0,0),c.setDate(1);let d=1;const m=[];for(;+c<=o;)m.push(Gn(n,c)),c.setMonth(c.getMonth()+d);return l?m.reverse():m}function VU(e,t){const n=dn(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function GU(e,t){const n=dn(e,t?.in),a=n.getFullYear();return n.setFullYear(a+1,0,0),n.setHours(23,59,59,999),n}function jN(e,t){const n=dn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function YU(e,t){const{start:n,end:a}=wN(t?.in,e);let l=+n>+a;const o=l?+n:+a,c=l?a:n;c.setHours(0,0,0,0),c.setMonth(0,1);let d=1;const m=[];for(;+c<=o;)m.push(Gn(n,c)),c.setFullYear(c.getFullYear()+d);return l?m.reverse():m}function NN(e,t){const n=Qu(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=dn(e,t?.in),o=l.getDay(),c=(o<a?-7:0)+6-(o-a);return l.setDate(l.getDate()+c),l.setHours(23,59,59,999),l}function WU(e,t){return NN(e,{...t,weekStartsOn:1})}const XU={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"}},KU=(e,t,n)=>{let a;const l=XU[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Lo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const QU={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ZU={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JU={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},e$={date:Lo({formats:QU,defaultWidth:"full"}),time:Lo({formats:ZU,defaultWidth:"full"}),dateTime:Lo({formats:JU,defaultWidth:"full"})},t$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},n$=(e,t,n,a)=>t$[e];function Ja(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let l;if(a==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=n?.width?String(n.width):c;l=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n?.width?String(n.width):e.defaultWidth;l=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return l[o]}}const r$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},l$={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"]},i$={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"}},o$={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"}},c$=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},u$={ordinalNumber:c$,era:Ja({values:r$,defaultWidth:"wide"}),quarter:Ja({values:a$,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ja({values:s$,defaultWidth:"wide"}),day:Ja({values:l$,defaultWidth:"wide"}),dayPeriod:Ja({values:i$,defaultWidth:"wide",formattingValues:o$,defaultFormattingWidth:"wide"})};function es(e){return(t,n={})=>{const a=n.width,l=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(l);if(!o)return null;const c=o[0],d=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?m$(d,x=>x.test(c)):d$(d,x=>x.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=n.valueCallback?n.valueCallback(f):f;const p=t.slice(c.length);return{value:f,rest:p}}}function d$(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function m$(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function SN(e){return(t,n={})=>{const a=t.match(e.matchPattern);if(!a)return null;const l=a[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(l.length);return{value:c,rest:d}}}const h$=/^(\d+)(th|st|nd|rd)?/i,f$=/\d+/i,p$={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},x$={any:[/^b/i,/^(a|c)/i]},g$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},v$={any:[/1/i,/2/i,/3/i,/4/i]},y$={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},b$={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]},w$={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},j$={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]},N$={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},S$={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}},k$={ordinalNumber:SN({matchPattern:h$,parsePattern:f$,valueCallback:e=>parseInt(e,10)}),era:es({matchPatterns:p$,defaultMatchWidth:"wide",parsePatterns:x$,defaultParseWidth:"any"}),quarter:es({matchPatterns:g$,defaultMatchWidth:"wide",parsePatterns:v$,defaultParseWidth:"any",valueCallback:e=>e+1}),month:es({matchPatterns:y$,defaultMatchWidth:"wide",parsePatterns:b$,defaultParseWidth:"any"}),day:es({matchPatterns:w$,defaultMatchWidth:"wide",parsePatterns:j$,defaultParseWidth:"any"}),dayPeriod:es({matchPatterns:N$,defaultMatchWidth:"any",parsePatterns:S$,defaultParseWidth:"any"})},Ag={code:"en-US",formatDistance:KU,formatLong:e$,formatRelative:n$,localize:u$,match:k$,options:{weekStartsOn:0,firstWeekContainsDate:1}};function C$(e,t){const n=dn(e,t?.in);return yN(n,jN(n))+1}function kN(e,t){const n=dn(e,t?.in),a=+Su(n)-+RU(n);return Math.round(a/pN)+1}function CN(e,t){const n=dn(e,t?.in),a=n.getFullYear(),l=Qu(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,c=Gn(t?.in||e,0);c.setFullYear(a+1,0,o),c.setHours(0,0,0,0);const d=Dl(c,t),m=Gn(t?.in||e,0);m.setFullYear(a,0,o),m.setHours(0,0,0,0);const f=Dl(m,t);return+n>=+d?a+1:+n>=+f?a:a-1}function T$(e,t){const n=Qu(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,l=CN(e,t),o=Gn(t?.in||e,0);return o.setFullYear(l,0,a),o.setHours(0,0,0,0),Dl(o,t)}function TN(e,t){const n=dn(e,t?.in),a=+Dl(n,t)-+T$(n,t);return Math.round(a/pN)+1}function rn(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const bl={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return rn(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):rn(n+1,2)},d(e,t){return rn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return rn(e.getHours()%12||12,t.length)},H(e,t){return rn(e.getHours(),t.length)},m(e,t){return rn(e.getMinutes(),t.length)},s(e,t){return rn(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),l=Math.trunc(a*Math.pow(10,n-3));return rn(l,t.length)}},No={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},N5={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),l=a>0?a:1-a;return n.ordinalNumber(l,{unit:"year"})}return bl.y(e,t)},Y:function(e,t,n,a){const l=CN(e,a),o=l>0?l:1-l;if(t==="YY"){const c=o%100;return rn(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):rn(o,t.length)},R:function(e,t){const n=vN(e);return rn(n,t.length)},u:function(e,t){const n=e.getFullYear();return rn(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return rn(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return rn(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return bl.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return rn(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const l=TN(e,a);return t==="wo"?n.ordinalNumber(l,{unit:"week"}):rn(l,t.length)},I:function(e,t,n){const a=kN(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):rn(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):bl.d(e,t)},D:function(e,t,n){const a=C$(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):rn(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const l=e.getDay(),o=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return rn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const l=e.getDay(),o=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return rn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return rn(l,t.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const l=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let l;switch(a===12?l=No.noon:a===0?l=No.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let l;switch(a>=17?l=No.evening:a>=12?l=No.afternoon:a>=4?l=No.morning:l=No.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return bl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):bl.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):rn(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):rn(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):bl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):bl.s(e,t)},S:function(e,t){return bl.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return k5(a);case"XXXX":case"XX":return oi(a);case"XXXXX":case"XXX":default:return oi(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return k5(a);case"xxxx":case"xx":return oi(a);case"xxxxx":case"xxx":default:return oi(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+S5(a,":");case"OOOO":default:return"GMT"+oi(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+S5(a,":");case"zzzz":default:return"GMT"+oi(a,":")}},t:function(e,t,n){const a=Math.trunc(+e/1e3);return rn(a,t.length)},T:function(e,t,n){return rn(+e,t.length)}};function S5(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),l=Math.trunc(a/60),o=a%60;return o===0?n+String(l):n+String(l)+t+rn(o,2)}function k5(e,t){return e%60===0?(e>0?"-":"+")+rn(Math.abs(e)/60,2):oi(e,t)}function oi(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),l=rn(Math.trunc(a/60),2),o=rn(a%60,2);return n+l+t+o}const C5=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},_N=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},_$=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],l=n[2];if(!l)return C5(e,t);let o;switch(a){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",C5(a,t)).replace("{{time}}",_N(l,t))},E$={p:_N,P:_$},M$=/^D+$/,A$=/^Y+$/,D$=["D","DD","YY","YYYY"];function z$(e){return M$.test(e)}function O$(e){return A$.test(e)}function R$(e,t,n){const a=L$(e,t,n);if(console.warn(a),D$.includes(e))throw new RangeError(a)}function L$(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const B$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,P$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,F$=/^'([^]*?)'?$/,I$=/''/g,q$=/[a-zA-Z]/;function Z0(e,t,n){const a=Qu(),l=n?.locale??a.locale??Ag,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,d=dn(e,n?.in);if(!qU(d))throw new RangeError("Invalid time value");let m=t.match(P$).map(p=>{const x=p[0];if(x==="p"||x==="P"){const y=E$[x];return y(p,l.formatLong)}return p}).join("").match(B$).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const x=p[0];if(x==="'")return{isToken:!1,value:H$(p)};if(N5[x])return{isToken:!0,value:p};if(x.match(q$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:p}});l.localize.preprocessor&&(m=l.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:l};return m.map(p=>{if(!p.isToken)return p.value;const x=p.value;(!n?.useAdditionalWeekYearTokens&&O$(x)||!n?.useAdditionalDayOfYearTokens&&z$(x))&&R$(x,t,String(e));const y=N5[x[0]];return y(d,x,l.localize,f)}).join("")}function H$(e){const t=e.match(F$);return t?t[1].replace(I$,"'"):e}function U$(e,t){const n=dn(e,t?.in),a=n.getFullYear(),l=n.getMonth(),o=Gn(n,0);return o.setFullYear(a,l+1,0),o.setHours(0,0,0,0),o.getDate()}function $$(e,t){return dn(e,t?.in).getMonth()}function V$(e,t){return dn(e,t?.in).getFullYear()}function G$(e,t){return+dn(e)>+dn(t)}function Y$(e,t){return+dn(e)<+dn(t)}function W$(e,t,n){const[a,l]=Ei(n?.in,e,t);return+Dl(a,n)==+Dl(l,n)}function X$(e,t,n){const[a,l]=Ei(n?.in,e,t);return a.getFullYear()===l.getFullYear()&&a.getMonth()===l.getMonth()}function K$(e,t,n){const[a,l]=Ei(n?.in,e,t);return a.getFullYear()===l.getFullYear()}function Q$(e,t,n){const a=dn(e,n?.in),l=a.getFullYear(),o=a.getDate(),c=Gn(e,0);c.setFullYear(l,t,15),c.setHours(0,0,0,0);const d=U$(c);return a.setMonth(t,Math.min(o,d)),a}function Z$(e,t,n){const a=dn(e,n?.in);return isNaN(+a)?Gn(e,NaN):(a.setFullYear(t),a)}const T5=5,J$=4;function eV(e,t){const n=t.startOfMonth(e),a=n.getDay()>0?n.getDay():7,l=t.addDays(e,-a+1),o=t.addDays(l,T5*7-1);return t.getMonth(e)===t.getMonth(o)?T5:J$}function EN(e,t){const n=t.startOfMonth(e),a=n.getDay();return a===1?n:a===0?t.addDays(n,-6):t.addDays(n,-1*(a-1))}function tV(e,t){const n=EN(e,t),a=eV(e,t);return t.addDays(n,a*7-1)}class ma{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?vr.tz(this.options.timeZone):new this.Date,this.newDate=(a,l,o)=>this.overrides?.newDate?this.overrides.newDate(a,l,o):this.options.timeZone?new vr(a,l,o,this.options.timeZone):new Date(a,l,o),this.addDays=(a,l)=>this.overrides?.addDays?this.overrides.addDays(a,l):xN(a,l),this.addMonths=(a,l)=>this.overrides?.addMonths?this.overrides.addMonths(a,l):gN(a,l),this.addWeeks=(a,l)=>this.overrides?.addWeeks?this.overrides.addWeeks(a,l):LU(a,l),this.addYears=(a,l)=>this.overrides?.addYears?this.overrides.addYears(a,l):BU(a,l),this.differenceInCalendarDays=(a,l)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(a,l):yN(a,l),this.differenceInCalendarMonths=(a,l)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(a,l):HU(a,l),this.eachMonthOfInterval=a=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(a):$U(a),this.eachYearOfInterval=a=>{const l=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(a):YU(a),o=new Set(l.map(d=>this.getYear(d)));if(o.size===l.length)return l;const c=[];return o.forEach(d=>{c.push(new Date(d,0,1))}),c},this.endOfBroadcastWeek=a=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(a):tV(a,this),this.endOfISOWeek=a=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(a):WU(a),this.endOfMonth=a=>this.overrides?.endOfMonth?this.overrides.endOfMonth(a):UU(a),this.endOfWeek=(a,l)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(a,l):NN(a,this.options),this.endOfYear=a=>this.overrides?.endOfYear?this.overrides.endOfYear(a):GU(a),this.format=(a,l,o)=>{const c=this.overrides?.format?this.overrides.format(a,l,this.options):Z0(a,l,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(c):c},this.getISOWeek=a=>this.overrides?.getISOWeek?this.overrides.getISOWeek(a):kN(a),this.getMonth=(a,l)=>this.overrides?.getMonth?this.overrides.getMonth(a,this.options):$$(a,this.options),this.getYear=(a,l)=>this.overrides?.getYear?this.overrides.getYear(a,this.options):V$(a,this.options),this.getWeek=(a,l)=>this.overrides?.getWeek?this.overrides.getWeek(a,this.options):TN(a,this.options),this.isAfter=(a,l)=>this.overrides?.isAfter?this.overrides.isAfter(a,l):G$(a,l),this.isBefore=(a,l)=>this.overrides?.isBefore?this.overrides.isBefore(a,l):Y$(a,l),this.isDate=a=>this.overrides?.isDate?this.overrides.isDate(a):bN(a),this.isSameDay=(a,l)=>this.overrides?.isSameDay?this.overrides.isSameDay(a,l):IU(a,l),this.isSameMonth=(a,l)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(a,l):X$(a,l),this.isSameYear=(a,l)=>this.overrides?.isSameYear?this.overrides.isSameYear(a,l):K$(a,l),this.max=a=>this.overrides?.max?this.overrides.max(a):PU(a),this.min=a=>this.overrides?.min?this.overrides.min(a):FU(a),this.setMonth=(a,l)=>this.overrides?.setMonth?this.overrides.setMonth(a,l):Q$(a,l),this.setYear=(a,l)=>this.overrides?.setYear?this.overrides.setYear(a,l):Z$(a,l),this.startOfBroadcastWeek=(a,l)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(a,this):EN(a,this),this.startOfDay=a=>this.overrides?.startOfDay?this.overrides.startOfDay(a):ku(a),this.startOfISOWeek=a=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(a):Su(a),this.startOfMonth=a=>this.overrides?.startOfMonth?this.overrides.startOfMonth(a):VU(a),this.startOfWeek=(a,l)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(a,this.options):Dl(a,this.options),this.startOfYear=a=>this.overrides?.startOfYear?this.overrides.startOfYear(a):jN(a),this.options={locale:Ag,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),a={};for(let l=0;l<10;l++)a[l.toString()]=n.format(l);return a}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,a=>n[a]||a)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&ma.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:a,numerals:l}=this.options,o=n?.code;if(o&&ma.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:a,numberingSystem:l}).format(t)}catch{}const c=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,c)}}ma.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 us=new ma;class MN{constructor(t,n,a=us){this.date=t,this.displayMonth=n,this.outside=!!(n&&!a.isSameMonth(t,n)),this.dateLib=a}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class nV{constructor(t,n){this.date=t,this.weeks=n}}class rV{constructor(t,n){this.days=n,this.weekNumber=t}}function aV(e){return Fe.createElement("button",{...e})}function sV(e){return Fe.createElement("span",{...e})}function lV(e){const{size:t=24,orientation:n="left",className:a}=e;return Fe.createElement("svg",{className:a,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Fe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Fe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Fe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Fe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function iV(e){const{day:t,modifiers:n,...a}=e;return Fe.createElement("td",{...a})}function oV(e){const{day:t,modifiers:n,...a}=e,l=Fe.useRef(null);return Fe.useEffect(()=>{n.focused&&l.current?.focus()},[n.focused]),Fe.createElement("button",{ref:l,...a})}var Ke;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Ke||(Ke={}));var En;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(En||(En={}));var Fa;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Fa||(Fa={}));var oa;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(oa||(oa={}));function cV(e){const{options:t,className:n,components:a,classNames:l,...o}=e,c=[l[Ke.Dropdown],n].join(" "),d=t?.find(({value:m})=>m===o.value);return Fe.createElement("span",{"data-disabled":o.disabled,className:l[Ke.DropdownRoot]},Fe.createElement(a.Select,{className:c,...o},t?.map(({value:m,label:f,disabled:p})=>Fe.createElement(a.Option,{key:m,value:m,disabled:p},f))),Fe.createElement("span",{className:l[Ke.CaptionLabel],"aria-hidden":!0},d?.label,Fe.createElement(a.Chevron,{orientation:"down",size:18,className:l[Ke.Chevron]})))}function uV(e){return Fe.createElement("div",{...e})}function dV(e){return Fe.createElement("div",{...e})}function mV(e){const{calendarMonth:t,displayIndex:n,...a}=e;return Fe.createElement("div",{...a},e.children)}function hV(e){const{calendarMonth:t,displayIndex:n,...a}=e;return Fe.createElement("div",{...a})}function fV(e){return Fe.createElement("table",{...e})}function pV(e){return Fe.createElement("div",{...e})}const AN=w.createContext(void 0);function Zu(){const e=w.useContext(AN);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function xV(e){const{components:t}=Zu();return Fe.createElement(t.Dropdown,{...e})}function gV(e){const{onPreviousClick:t,onNextClick:n,previousMonth:a,nextMonth:l,...o}=e,{components:c,classNames:d,labels:{labelPrevious:m,labelNext:f}}=Zu(),p=w.useCallback(y=>{l&&n?.(y)},[l,n]),x=w.useCallback(y=>{a&&t?.(y)},[a,t]);return Fe.createElement("nav",{...o},Fe.createElement(c.PreviousMonthButton,{type:"button",className:d[Ke.PreviousMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":m(a),onClick:x},Fe.createElement(c.Chevron,{disabled:a?void 0:!0,className:d[Ke.Chevron],orientation:"left"})),Fe.createElement(c.NextMonthButton,{type:"button",className:d[Ke.NextMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":f(l),onClick:p},Fe.createElement(c.Chevron,{disabled:l?void 0:!0,orientation:"right",className:d[Ke.Chevron]})))}function vV(e){const{components:t}=Zu();return Fe.createElement(t.Button,{...e})}function yV(e){return Fe.createElement("option",{...e})}function bV(e){const{components:t}=Zu();return Fe.createElement(t.Button,{...e})}function wV(e){const{rootRef:t,...n}=e;return Fe.createElement("div",{...n,ref:t})}function jV(e){return Fe.createElement("select",{...e})}function NV(e){const{week:t,...n}=e;return Fe.createElement("tr",{...n})}function SV(e){return Fe.createElement("th",{...e})}function kV(e){return Fe.createElement("thead",{"aria-hidden":!0},Fe.createElement("tr",{...e}))}function CV(e){const{week:t,...n}=e;return Fe.createElement("th",{...n})}function TV(e){return Fe.createElement("th",{...e})}function _V(e){return Fe.createElement("tbody",{...e})}function EV(e){const{components:t}=Zu();return Fe.createElement(t.Dropdown,{...e})}const MV=Object.freeze(Object.defineProperty({__proto__:null,Button:aV,CaptionLabel:sV,Chevron:lV,Day:iV,DayButton:oV,Dropdown:cV,DropdownNav:uV,Footer:dV,Month:mV,MonthCaption:hV,MonthGrid:fV,Months:pV,MonthsDropdown:xV,Nav:gV,NextMonthButton:vV,Option:yV,PreviousMonthButton:bV,Root:wV,Select:jV,Week:NV,WeekNumber:CV,WeekNumberHeader:TV,Weekday:SV,Weekdays:kV,Weeks:_V,YearsDropdown:EV},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n=!1,a=us){let{from:l,to:o}=e;const{differenceInCalendarDays:c,isSameDay:d}=a;return l&&o?(c(o,l)<0&&([l,o]=[o,l]),c(t,l)>=(n?1:0)&&c(o,t)>=(n?1:0)):!n&&o?d(o,t):!n&&l?d(l,t):!1}function DN(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Dg(e){return!!(e&&typeof e=="object"&&"from"in e)}function zN(e){return!!(e&&typeof e=="object"&&"after"in e)}function ON(e){return!!(e&&typeof e=="object"&&"before"in e)}function RN(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function LN(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Os(e,t,n=us){const a=Array.isArray(t)?t:[t],{isSameDay:l,differenceInCalendarDays:o,isAfter:c}=n;return a.some(d=>{if(typeof d=="boolean")return d;if(n.isDate(d))return l(e,d);if(LN(d,n))return d.includes(e);if(Dg(d))return zs(d,e,!1,n);if(RN(d))return Array.isArray(d.dayOfWeek)?d.dayOfWeek.includes(e.getDay()):d.dayOfWeek===e.getDay();if(DN(d)){const m=o(d.before,e),f=o(d.after,e),p=m>0,x=f<0;return c(d.before,d.after)?x&&p:p||x}return zN(d)?o(e,d.after)>0:ON(d)?o(d.before,e)>0:typeof d=="function"?d(e):!1})}function AV(e,t,n,a,l){const{disabled:o,hidden:c,modifiers:d,showOutsideDays:m,broadcastCalendar:f,today:p}=t,{isSameDay:x,isSameMonth:y,startOfMonth:b,isBefore:N,endOfMonth:k,isAfter:S}=l,T=n&&b(n),M=a&&k(a),A={[En.focused]:[],[En.outside]:[],[En.disabled]:[],[En.hidden]:[],[En.today]:[]},R={};for(const B of e){const{date:O,displayMonth:L}=B,$=!!(L&&!y(O,L)),U=!!(T&&N(O,T)),I=!!(M&&S(O,M)),G=!!(o&&Os(O,o,l)),ee=!!(c&&Os(O,c,l))||U||I||!f&&!m&&$||f&&m===!1&&$,Ne=x(O,p??l.today());$&&A.outside.push(B),G&&A.disabled.push(B),ee&&A.hidden.push(B),Ne&&A.today.push(B),d&&Object.keys(d).forEach(J=>{const se=d?.[J];se&&Os(O,se,l)&&(R[J]?R[J].push(B):R[J]=[B])})}return B=>{const O={[En.focused]:!1,[En.disabled]:!1,[En.hidden]:!1,[En.outside]:!1,[En.today]:!1},L={};for(const $ in A){const U=A[$];O[$]=U.some(I=>I===B)}for(const $ in R)L[$]=R[$].some(U=>U===B);return{...O,...L}}}function DV(e,t,n={}){return Object.entries(e).filter(([,l])=>l===!0).reduce((l,[o])=>(n[o]?l.push(n[o]):t[En[o]]?l.push(t[En[o]]):t[Fa[o]]&&l.push(t[Fa[o]]),l),[t[Ke.Day]])}function zV(e){return{...MV,...e}}function OV(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,a])=>{n.startsWith("data-")&&(t[n]=a)}),t}function zg(){const e={};for(const t in Ke)e[Ke[t]]=`rdp-${Ke[t]}`;for(const t in En)e[En[t]]=`rdp-${En[t]}`;for(const t in Fa)e[Fa[t]]=`rdp-${Fa[t]}`;for(const t in oa)e[oa[t]]=`rdp-${oa[t]}`;return e}function BN(e,t,n){return(n??new ma(t)).formatMonthYear(e)}const RV=BN;function LV(e,t,n){return(n??new ma(t)).format(e,"d")}function BV(e,t=us){return t.format(e,"LLLL")}function PV(e,t,n){return(n??new ma(t)).format(e,"cccccc")}function FV(e,t=us){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function IV(){return""}function PN(e,t=us){return t.format(e,"yyyy")}const qV=PN,HV=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:BN,formatDay:LV,formatMonthCaption:RV,formatMonthDropdown:BV,formatWeekNumber:FV,formatWeekNumberHeader:IV,formatWeekdayName:PV,formatYearCaption:qV,formatYearDropdown:PN},Symbol.toStringTag,{value:"Module"}));function UV(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...HV,...e}}function $V(e,t,n,a,l){const{startOfMonth:o,startOfYear:c,endOfYear:d,eachMonthOfInterval:m,getMonth:f}=l;return m({start:c(e),end:d(e)}).map(y=>{const b=a.formatMonthDropdown(y,l),N=f(y),k=t&&y<o(t)||n&&y>o(n)||!1;return{value:N,label:b,disabled:k}})}function VV(e,t={},n={}){let a={...t?.[Ke.Day]};return Object.entries(e).filter(([,l])=>l===!0).forEach(([l])=>{a={...a,...n?.[l]}}),a}function GV(e,t,n){const a=e.today(),l=t?e.startOfISOWeek(a):e.startOfWeek(a),o=[];for(let c=0;c<7;c++){const d=e.addDays(l,c);o.push(d)}return o}function YV(e,t,n,a,l=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:c,eachYearOfInterval:d,getYear:m}=a,f=o(e),p=c(t),x=d({start:f,end:p});return l&&x.reverse(),x.map(y=>{const b=n.formatYearDropdown(y,a);return{value:m(y),label:b,disabled:!1}})}function FN(e,t,n,a){let l=(a??new ma(n)).format(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l}const WV=FN;function IN(e,t,n){return(n??new ma(t)).formatMonthYear(e)}const XV=IN;function KV(e,t,n,a){let l=(a??new ma(n)).format(e,"PPPP");return t?.today&&(l=`Today, ${l}`),l}function QV(e){return"Choose the Month"}function ZV(){return""}function JV(e){return"Go to the Next Month"}function eG(e){return"Go to the Previous Month"}function tG(e,t,n){return(n??new ma(t)).format(e,"cccc")}function nG(e,t){return`Week ${e}`}function rG(e){return"Week Number"}function aG(e){return"Choose the Year"}const sG=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:XV,labelDay:WV,labelDayButton:FN,labelGrid:IN,labelGridcell:KV,labelMonthDropdown:QV,labelNav:ZV,labelNext:JV,labelPrevious:eG,labelWeekNumber:nG,labelWeekNumberHeader:rG,labelWeekday:tG,labelYearDropdown:aG},Symbol.toStringTag,{value:"Module"})),Ju=e=>e instanceof HTMLElement?e:null,fx=e=>[...e.querySelectorAll("[data-animated-month]")??[]],lG=e=>Ju(e.querySelector("[data-animated-month]")),px=e=>Ju(e.querySelector("[data-animated-caption]")),xx=e=>Ju(e.querySelector("[data-animated-weeks]")),iG=e=>Ju(e.querySelector("[data-animated-nav]")),oG=e=>Ju(e.querySelector("[data-animated-weekdays]"));function cG(e,t,{classNames:n,months:a,focused:l,dateLib:o}){const c=w.useRef(null),d=w.useRef(a),m=w.useRef(!1);w.useLayoutEffect(()=>{const f=d.current;if(d.current=a,!t||!e.current||!(e.current instanceof HTMLElement)||a.length===0||f.length===0||a.length!==f.length)return;const p=o.isSameMonth(a[0].date,f[0].date),x=o.isAfter(a[0].date,f[0].date),y=x?n[oa.caption_after_enter]:n[oa.caption_before_enter],b=x?n[oa.weeks_after_enter]:n[oa.weeks_before_enter],N=c.current,k=e.current.cloneNode(!0);if(k instanceof HTMLElement?(fx(k).forEach(A=>{if(!(A instanceof HTMLElement))return;const R=lG(A);R&&A.contains(R)&&A.removeChild(R);const B=px(A);B&&B.classList.remove(y);const O=xx(A);O&&O.classList.remove(b)}),c.current=k):c.current=null,m.current||p||l)return;const S=N instanceof HTMLElement?fx(N):[],T=fx(e.current);if(T?.every(M=>M instanceof HTMLElement)&&S&&S.every(M=>M instanceof HTMLElement)){m.current=!0,e.current.style.isolation="isolate";const M=iG(e.current);M&&(M.style.zIndex="1"),T.forEach((A,R)=>{const B=S[R];if(!B)return;A.style.position="relative",A.style.overflow="hidden";const O=px(A);O&&O.classList.add(y);const L=xx(A);L&&L.classList.add(b);const $=()=>{m.current=!1,e.current&&(e.current.style.isolation=""),M&&(M.style.zIndex=""),O&&O.classList.remove(y),L&&L.classList.remove(b),A.style.position="",A.style.overflow="",A.contains(B)&&A.removeChild(B)};B.style.pointerEvents="none",B.style.position="absolute",B.style.overflow="hidden",B.setAttribute("aria-hidden","true");const U=oG(B);U&&(U.style.opacity="0");const I=px(B);I&&(I.classList.add(x?n[oa.caption_before_exit]:n[oa.caption_after_exit]),I.addEventListener("animationend",$));const G=xx(B);G&&G.classList.add(x?n[oa.weeks_before_exit]:n[oa.weeks_after_exit]),A.insertBefore(B,A.firstChild)})}})}function uG(e,t,n,a){const l=e[0],o=e[e.length-1],{ISOWeek:c,fixedWeeks:d,broadcastCalendar:m}=n??{},{addDays:f,differenceInCalendarDays:p,differenceInCalendarMonths:x,endOfBroadcastWeek:y,endOfISOWeek:b,endOfMonth:N,endOfWeek:k,isAfter:S,startOfBroadcastWeek:T,startOfISOWeek:M,startOfWeek:A}=a,R=m?T(l,a):c?M(l):A(l),B=m?y(o):c?b(N(o)):k(N(o)),O=p(B,R),L=x(o,l)+1,$=[];for(let G=0;G<=O;G++){const ee=f(R,G);if(t&&S(ee,t))break;$.push(ee)}const I=(m?35:42)*L;if(d&&$.length<I){const G=I-$.length;for(let ee=0;ee<G;ee++){const Ne=f($[$.length-1],1);$.push(Ne)}}return $}function dG(e){const t=[];return e.reduce((n,a)=>{const l=a.weeks.reduce((o,c)=>o.concat(c.days.slice()),t.slice());return n.concat(l.slice())},t.slice())}function mG(e,t,n,a){const{numberOfMonths:l=1}=n,o=[];for(let c=0;c<l;c++){const d=a.addMonths(e,c);if(t&&d>t)break;o.push(d)}return o}function _5(e,t,n,a){const{month:l,defaultMonth:o,today:c=a.today(),numberOfMonths:d=1}=e;let m=l||o||c;const{differenceInCalendarMonths:f,addMonths:p,startOfMonth:x}=a;if(n&&f(n,m)<d-1){const y=-1*(d-1);m=p(n,y)}return t&&f(m,t)<0&&(m=t),x(m)}function hG(e,t,n,a){const{addDays:l,endOfBroadcastWeek:o,endOfISOWeek:c,endOfMonth:d,endOfWeek:m,getISOWeek:f,getWeek:p,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:b}=a,N=e.reduce((k,S)=>{const T=n.broadcastCalendar?x(S,a):n.ISOWeek?y(S):b(S),M=n.broadcastCalendar?o(S):n.ISOWeek?c(d(S)):m(d(S)),A=t.filter(L=>L>=T&&L<=M),R=n.broadcastCalendar?35:42;if(n.fixedWeeks&&A.length<R){const L=t.filter($=>{const U=R-A.length;return $>M&&$<=l(M,U)});A.push(...L)}const B=A.reduce((L,$)=>{const U=n.ISOWeek?f($):p($),I=L.find(ee=>ee.weekNumber===U),G=new MN($,S,a);return I?I.days.push(G):L.push(new rV(U,[G])),L},[]),O=new nV(S,B);return k.push(O),k},[]);return n.reverseMonths?N.reverse():N}function fG(e,t){let{startMonth:n,endMonth:a}=e;const{startOfYear:l,startOfDay:o,startOfMonth:c,endOfMonth:d,addYears:m,endOfYear:f,newDate:p,today:x}=t,{fromYear:y,toYear:b,fromMonth:N,toMonth:k}=e;!n&&N&&(n=N),!n&&y&&(n=t.newDate(y,0,1)),!a&&k&&(a=k),!a&&b&&(a=p(b,11,31));const S=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=c(n):y?n=p(y,0,1):!n&&S&&(n=l(m(e.today??x(),-100))),a?a=d(a):b?a=p(b,11,31):!a&&S&&(a=f(e.today??x())),[n&&o(n),a&&o(a)]}function pG(e,t,n,a){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:o=1}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:m}=a,f=l?o:1,p=c(e);if(!t)return d(p,f);if(!(m(t,e)<o))return d(p,f)}function xG(e,t,n,a){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:o}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:m}=a,f=l?o??1:1,p=c(e);if(!t)return d(p,-f);if(!(m(p,t)<=0))return d(p,-f)}function gG(e){const t=[];return e.reduce((n,a)=>n.concat(a.weeks.slice()),t.slice())}function eh(e,t){const[n,a]=w.useState(e);return[t===void 0?n:t,a]}function vG(e,t){const[n,a]=fG(e,t),{startOfMonth:l,endOfMonth:o}=t,c=_5(e,n,a,t),[d,m]=eh(c,e.month?c:void 0);w.useEffect(()=>{const O=_5(e,n,a,t);m(O)},[e.timeZone]);const f=mG(d,a,e,t),p=uG(f,e.endMonth?o(e.endMonth):void 0,e,t),x=hG(f,p,e,t),y=gG(x),b=dG(x),N=xG(d,n,e,t),k=pG(d,a,e,t),{disableNavigation:S,onMonthChange:T}=e,M=O=>y.some(L=>L.days.some($=>$.isEqualTo(O))),A=O=>{if(S)return;let L=l(O);n&&L<l(n)&&(L=l(n)),a&&L>l(a)&&(L=l(a)),m(L),T?.(L)};return{months:x,weeks:y,days:b,navStart:n,navEnd:a,previousMonth:N,nextMonth:k,goToMonth:A,goToDay:O=>{M(O)||A(O.date)}}}var Qa;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Qa||(Qa={}));function E5(e){return!e[En.disabled]&&!e[En.hidden]&&!e[En.outside]}function yG(e,t,n,a){let l,o=-1;for(const c of e){const d=t(c);E5(d)&&(d[En.focused]&&o<Qa.FocusedModifier?(l=c,o=Qa.FocusedModifier):a?.isEqualTo(c)&&o<Qa.LastFocused?(l=c,o=Qa.LastFocused):n(c.date)&&o<Qa.Selected?(l=c,o=Qa.Selected):d[En.today]&&o<Qa.Today&&(l=c,o=Qa.Today))}return l||(l=e.find(c=>E5(t(c)))),l}function bG(e,t,n,a,l,o,c){const{ISOWeek:d,broadcastCalendar:m}=o,{addDays:f,addMonths:p,addWeeks:x,addYears:y,endOfBroadcastWeek:b,endOfISOWeek:N,endOfWeek:k,max:S,min:T,startOfBroadcastWeek:M,startOfISOWeek:A,startOfWeek:R}=c;let O={day:f,week:x,month:p,year:y,startOfWeek:L=>m?M(L,c):d?A(L):R(L),endOfWeek:L=>m?b(L):d?N(L):k(L)}[e](n,t==="after"?1:-1);return t==="before"&&a?O=S([a,O]):t==="after"&&l&&(O=T([l,O])),O}function qN(e,t,n,a,l,o,c,d=0){if(d>365)return;const m=bG(e,t,n.date,a,l,o,c),f=!!(o.disabled&&Os(m,o.disabled,c)),p=!!(o.hidden&&Os(m,o.hidden,c)),x=m,y=new MN(m,x,c);return!f&&!p?y:qN(e,t,y,a,l,o,c,d+1)}function wG(e,t,n,a,l){const{autoFocus:o}=e,[c,d]=w.useState(),m=yG(t.days,n,a||(()=>!1),c),[f,p]=w.useState(o?m:void 0);return{isFocusTarget:k=>!!m?.isEqualTo(k),setFocused:p,focused:f,blur:()=>{d(f),p(void 0)},moveFocus:(k,S)=>{if(!f)return;const T=qN(k,S,f,t.navStart,t.navEnd,e,l);T&&(e.disableNavigation&&!t.days.some(A=>A.isEqualTo(T))||(t.goToDay(T),p(T)))}}}function jG(e,t){const{selected:n,required:a,onSelect:l}=e,[o,c]=eh(n,l?n:void 0),d=l?n:o,{isSameDay:m}=t,f=b=>d?.some(N=>m(N,b))??!1,{min:p,max:x}=e;return{selected:d,select:(b,N,k)=>{let S=[...d??[]];if(f(b)){if(d?.length===p||a&&d?.length===1)return;S=d?.filter(T=>!m(T,b))}else d?.length===x?S=[b]:S=[...S,b];return l||c(S),l?.(S,b,N,k),S},isSelected:f}}function NG(e,t,n=0,a=0,l=!1,o=us){const{from:c,to:d}=t||{},{isSameDay:m,isAfter:f,isBefore:p}=o;let x;if(!c&&!d)x={from:e,to:n>0?void 0:e};else if(c&&!d)m(c,e)?n===0?x={from:c,to:e}:l?x={from:c,to:void 0}:x=void 0:p(e,c)?x={from:e,to:c}:x={from:c,to:e};else if(c&&d)if(m(c,e)&&m(d,e))l?x={from:c,to:d}:x=void 0;else if(m(c,e))x={from:c,to:n>0?void 0:e};else if(m(d,e))x={from:e,to:n>0?void 0:e};else if(p(e,c))x={from:e,to:d};else if(f(e,c))x={from:c,to:e};else if(f(e,d))x={from:c,to:e};else throw new Error("Invalid range");if(x?.from&&x?.to){const y=o.differenceInCalendarDays(x.to,x.from);a>0&&y>a?x={from:e,to:void 0}:n>1&&y<n&&(x={from:e,to:void 0})}return x}function SG(e,t,n=us){const a=Array.isArray(t)?t:[t];let l=e.from;const o=n.differenceInCalendarDays(e.to,e.from),c=Math.min(o,6);for(let d=0;d<=c;d++){if(a.includes(l.getDay()))return!0;l=n.addDays(l,1)}return!1}function M5(e,t,n=us){return zs(e,t.from,!1,n)||zs(e,t.to,!1,n)||zs(t,e.from,!1,n)||zs(t,e.to,!1,n)}function kG(e,t,n=us){const a=Array.isArray(t)?t:[t];if(a.filter(d=>typeof d!="function").some(d=>typeof d=="boolean"?d:n.isDate(d)?zs(e,d,!1,n):LN(d,n)?d.some(m=>zs(e,m,!1,n)):Dg(d)?d.from&&d.to?M5(e,{from:d.from,to:d.to},n):!1:RN(d)?SG(e,d.dayOfWeek,n):DN(d)?n.isAfter(d.before,d.after)?M5(e,{from:n.addDays(d.after,1),to:n.addDays(d.before,-1)},n):Os(e.from,d,n)||Os(e.to,d,n):zN(d)||ON(d)?Os(e.from,d,n)||Os(e.to,d,n):!1))return!0;const c=a.filter(d=>typeof d=="function");if(c.length){let d=e.from;const m=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=m;f++){if(c.some(p=>p(d)))return!0;d=n.addDays(d,1)}}return!1}function CG(e,t){const{disabled:n,excludeDisabled:a,selected:l,required:o,onSelect:c}=e,[d,m]=eh(l,c?l:void 0),f=c?l:d;return{selected:f,select:(y,b,N)=>{const{min:k,max:S}=e,T=y?NG(y,f,k,S,o,t):void 0;return a&&n&&T?.from&&T.to&&kG({from:T.from,to:T.to},n,t)&&(T.from=y,T.to=void 0),c||m(T),c?.(T,y,b,N),T},isSelected:y=>f&&zs(f,y,!1,t)}}function TG(e,t){const{selected:n,required:a,onSelect:l}=e,[o,c]=eh(n,l?n:void 0),d=l?n:o,{isSameDay:m}=t;return{selected:d,select:(x,y,b)=>{let N=x;return!a&&d&&d&&m(x,d)&&(N=void 0),l||c(N),l?.(N,x,y,b),N},isSelected:x=>d?m(d,x):!1}}function _G(e,t){const n=TG(e,t),a=jG(e,t),l=CG(e,t);switch(e.mode){case"single":return n;case"multiple":return a;case"range":return l;default:return}}function EG(e){let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new vr(t.today,t.timeZone)),t.month&&(t.month=new vr(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new vr(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new vr(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new vr(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new vr(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(st=>new vr(st,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new vr(t.selected.from,t.timeZone):void 0,to:t.selected.to?new vr(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:a,labels:l,dateLib:o,locale:c,classNames:d}=w.useMemo(()=>{const st={...Ag,...t.locale};return{dateLib:new ma({locale:st,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:zV(t.components),formatters:UV(t.formatters),labels:{...sG,...t.labels},locale:st,classNames:{...zg(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:m,mode:f,navLayout:p,numberOfMonths:x=1,onDayBlur:y,onDayClick:b,onDayFocus:N,onDayKeyDown:k,onDayMouseEnter:S,onDayMouseLeave:T,onNextClick:M,onPrevClick:A,showWeekNumber:R,styles:B}=t,{formatCaption:O,formatDay:L,formatMonthDropdown:$,formatWeekNumber:U,formatWeekNumberHeader:I,formatWeekdayName:G,formatYearDropdown:ee}=a,Ne=vG(t,o),{days:J,months:se,navStart:H,navEnd:le,previousMonth:re,nextMonth:ge,goToMonth:E}=Ne,we=AV(J,t,H,le,o),{isSelected:Z,select:z,selected:X}=_G(t,o)??{},{blur:q,focused:ce,isFocusTarget:fe,moveFocus:De,setFocused:oe}=wG(t,Ne,we,Z??(()=>!1),o),{labelDayButton:He,labelGridcell:at,labelGrid:je,labelMonthDropdown:Ze,labelNav:qe,labelPrevious:Ot,labelNext:bn,labelWeekday:Dn,labelWeekNumber:Xe,labelWeekNumberHeader:wn,labelYearDropdown:Wn}=l,Ar=w.useMemo(()=>GV(o,t.ISOWeek),[o,t.ISOWeek]),Cn=f!==void 0||b!==void 0,cr=w.useCallback(()=>{re&&(E(re),A?.(re))},[re,E,A]),$e=w.useCallback(()=>{ge&&(E(ge),M?.(ge))},[E,ge,M]),Fn=w.useCallback((st,gn)=>ot=>{ot.preventDefault(),ot.stopPropagation(),oe(st),z?.(st.date,gn,ot),b?.(st.date,gn,ot)},[z,b,oe]),K=w.useCallback((st,gn)=>ot=>{oe(st),N?.(st.date,gn,ot)},[N,oe]),be=w.useCallback((st,gn)=>ot=>{q(),y?.(st.date,gn,ot)},[q,y]),Re=w.useCallback((st,gn)=>ot=>{const $t={ArrowLeft:[ot.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ot.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ot.shiftKey?"year":"week","after"],ArrowUp:[ot.shiftKey?"year":"week","before"],PageUp:[ot.shiftKey?"year":"month","before"],PageDown:[ot.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if($t[ot.key]){ot.preventDefault(),ot.stopPropagation();const[ar,bt]=$t[ot.key];De(ar,bt)}k?.(st.date,gn,ot)},[De,k,t.dir]),nt=w.useCallback((st,gn)=>ot=>{S?.(st.date,gn,ot)},[S]),kt=w.useCallback((st,gn)=>ot=>{T?.(st.date,gn,ot)},[T]),rr=w.useCallback(st=>gn=>{const ot=Number(gn.target.value),$t=o.setMonth(o.startOfMonth(st),ot);E($t)},[o,E]),Dr=w.useCallback(st=>gn=>{const ot=Number(gn.target.value),$t=o.setYear(o.startOfMonth(st),ot);E($t)},[o,E]),{className:pe,style:Ee}=w.useMemo(()=>({className:[d[Ke.Root],t.className].filter(Boolean).join(" "),style:{...B?.[Ke.Root],...t.style}}),[d,t.className,t.style,B]),dt=OV(t),mt=w.useRef(null);cG(mt,!!t.animate,{classNames:d,months:se,focused:ce,dateLib:o});const zr={dayPickerProps:t,selected:X,select:z,isSelected:Z,months:se,nextMonth:ge,previousMonth:re,goToMonth:E,getModifiers:we,components:n,classNames:d,styles:B,labels:l,formatters:a};return Fe.createElement(AN.Provider,{value:zr},Fe.createElement(n.Root,{rootRef:t.animate?mt:void 0,className:pe,style:Ee,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...dt},Fe.createElement(n.Months,{className:d[Ke.Months],style:B?.[Ke.Months]},!t.hideNavigation&&!p&&Fe.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Ke.Nav],style:B?.[Ke.Nav],"aria-label":qe(),onPreviousClick:cr,onNextClick:$e,previousMonth:re,nextMonth:ge}),se.map((st,gn)=>Fe.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Ke.Month],style:B?.[Ke.Month],key:gn,displayIndex:gn,calendarMonth:st},p==="around"&&!t.hideNavigation&&gn===0&&Fe.createElement(n.PreviousMonthButton,{type:"button",className:d[Ke.PreviousMonthButton],tabIndex:re?void 0:-1,"aria-disabled":re?void 0:!0,"aria-label":Ot(re),onClick:cr,"data-animated-button":t.animate?"true":void 0},Fe.createElement(n.Chevron,{disabled:re?void 0:!0,className:d[Ke.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Fe.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Ke.MonthCaption],style:B?.[Ke.MonthCaption],calendarMonth:st,displayIndex:gn},m?.startsWith("dropdown")?Fe.createElement(n.DropdownNav,{className:d[Ke.Dropdowns],style:B?.[Ke.Dropdowns]},(()=>{const ot=m==="dropdown"||m==="dropdown-months"?Fe.createElement(n.MonthsDropdown,{key:"month",className:d[Ke.MonthsDropdown],"aria-label":Ze(),classNames:d,components:n,disabled:!!t.disableNavigation,onChange:rr(st.date),options:$V(st.date,H,le,a,o),style:B?.[Ke.Dropdown],value:o.getMonth(st.date)}):Fe.createElement("span",{key:"month"},$(st.date,o)),$t=m==="dropdown"||m==="dropdown-years"?Fe.createElement(n.YearsDropdown,{key:"year",className:d[Ke.YearsDropdown],"aria-label":Wn(o.options),classNames:d,components:n,disabled:!!t.disableNavigation,onChange:Dr(st.date),options:YV(H,le,a,o,!!t.reverseYears),style:B?.[Ke.Dropdown],value:o.getYear(st.date)}):Fe.createElement("span",{key:"year"},ee(st.date,o));return o.getMonthYearOrder()==="year-first"?[$t,ot]:[ot,$t]})(),Fe.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"}},O(st.date,o.options,o))):Fe.createElement(n.CaptionLabel,{className:d[Ke.CaptionLabel],role:"status","aria-live":"polite"},O(st.date,o.options,o))),p==="around"&&!t.hideNavigation&&gn===x-1&&Fe.createElement(n.NextMonthButton,{type:"button",className:d[Ke.NextMonthButton],tabIndex:ge?void 0:-1,"aria-disabled":ge?void 0:!0,"aria-label":bn(ge),onClick:$e,"data-animated-button":t.animate?"true":void 0},Fe.createElement(n.Chevron,{disabled:ge?void 0:!0,className:d[Ke.Chevron],orientation:t.dir==="rtl"?"left":"right"})),gn===x-1&&p==="after"&&!t.hideNavigation&&Fe.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Ke.Nav],style:B?.[Ke.Nav],"aria-label":qe(),onPreviousClick:cr,onNextClick:$e,previousMonth:re,nextMonth:ge}),Fe.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":f==="multiple"||f==="range","aria-label":je(st.date,o.options,o)||void 0,className:d[Ke.MonthGrid],style:B?.[Ke.MonthGrid]},!t.hideWeekdays&&Fe.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Ke.Weekdays],style:B?.[Ke.Weekdays]},R&&Fe.createElement(n.WeekNumberHeader,{"aria-label":wn(o.options),className:d[Ke.WeekNumberHeader],style:B?.[Ke.WeekNumberHeader],scope:"col"},I()),Ar.map(ot=>Fe.createElement(n.Weekday,{"aria-label":Dn(ot,o.options,o),className:d[Ke.Weekday],key:String(ot),style:B?.[Ke.Weekday],scope:"col"},G(ot,o.options,o)))),Fe.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Ke.Weeks],style:B?.[Ke.Weeks]},st.weeks.map(ot=>Fe.createElement(n.Week,{className:d[Ke.Week],key:ot.weekNumber,style:B?.[Ke.Week],week:ot},R&&Fe.createElement(n.WeekNumber,{week:ot,style:B?.[Ke.WeekNumber],"aria-label":Xe(ot.weekNumber,{locale:c}),className:d[Ke.WeekNumber],scope:"row",role:"rowheader"},U(ot.weekNumber,o)),ot.days.map($t=>{const{date:ar}=$t,bt=we($t);if(bt[En.focused]=!bt.hidden&&!!ce?.isEqualTo($t),bt[Fa.selected]=Z?.(ar)||bt.selected,Dg(X)){const{from:Di,to:Il}=X;bt[Fa.range_start]=!!(Di&&Il&&o.isSameDay(ar,Di)),bt[Fa.range_end]=!!(Di&&Il&&o.isSameDay(ar,Il)),bt[Fa.range_middle]=zs(X,ar,!0,o)}const Ai=VV(bt,B,t.modifiersStyles),Fl=DV(bt,d,t.modifiersClassNames),sh=!Cn&&!bt.hidden?at(ar,bt,o.options,o):void 0;return Fe.createElement(n.Day,{key:`${o.format(ar,"yyyy-MM-dd")}_${o.format($t.displayMonth,"yyyy-MM")}`,day:$t,modifiers:bt,className:Fl.join(" "),style:Ai,role:"gridcell","aria-selected":bt.selected||void 0,"aria-label":sh,"data-day":o.format(ar,"yyyy-MM-dd"),"data-month":$t.outside?o.format(ar,"yyyy-MM"):void 0,"data-selected":bt.selected||void 0,"data-disabled":bt.disabled||void 0,"data-hidden":bt.hidden||void 0,"data-outside":$t.outside||void 0,"data-focused":bt.focused||void 0,"data-today":bt.today||void 0},!bt.hidden&&Cn?Fe.createElement(n.DayButton,{className:d[Ke.DayButton],style:B?.[Ke.DayButton],type:"button",day:$t,modifiers:bt,disabled:bt.disabled||void 0,tabIndex:fe($t)?0:-1,"aria-label":He(ar,bt,o.options,o),onClick:Fn($t,bt),onBlur:be($t,bt),onFocus:K($t,bt),onKeyDown:Re($t,bt),onMouseEnter:nt($t,bt),onMouseLeave:kt($t,bt)},L(ar,o.options,o)):!bt.hidden&&L($t.date,o.options,o))})))))))),t.footer&&Fe.createElement(n.Footer,{className:d[Ke.Footer],style:B?.[Ke.Footer],role:"status","aria-live":"polite"},t.footer)))}function A5({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:a="label",buttonVariant:l="ghost",formatters:o,components:c,...d}){const m=zg();return r.jsx(EG,{showOutsideDays:n,className:he("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:a,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...o},classNames:{root:he("w-fit",m.root),months:he("relative flex flex-col gap-4 md:flex-row",m.months),month:he("flex w-full flex-col gap-4",m.month),nav:he("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",m.nav),button_previous:he(gu({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",m.button_previous),button_next:he(gu({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",m.button_next),month_caption:he("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",m.month_caption),dropdowns:he("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",m.dropdowns),dropdown_root:he("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",m.dropdown_root),dropdown:he("bg-popover absolute inset-0 opacity-0",m.dropdown),caption_label:he("select-none font-medium",a==="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",m.caption_label),table:"w-full border-collapse",weekdays:he("flex",m.weekdays),weekday:he("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",m.weekday),week:he("mt-2 flex w-full",m.week),week_number_header:he("w-[--cell-size] select-none",m.week_number_header),week_number:he("text-muted-foreground select-none text-[0.8rem]",m.week_number),day:he("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",m.day),range_start:he("bg-accent rounded-l-md",m.range_start),range_middle:he("rounded-none",m.range_middle),range_end:he("bg-accent rounded-r-md",m.range_end),today:he("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",m.today),outside:he("text-muted-foreground aria-selected:text-muted-foreground",m.outside),disabled:he("text-muted-foreground opacity-50",m.disabled),hidden:he("invisible",m.hidden),...t},components:{Root:({className:f,rootRef:p,...x})=>r.jsx("div",{"data-slot":"calendar",ref:p,className:he(f),...x}),Chevron:({className:f,orientation:p,...x})=>p==="left"?r.jsx(bi,{className:he("size-4",f),...x}):p==="right"?r.jsx(wi,{className:he("size-4",f),...x}):r.jsx(pu,{className:he("size-4",f),...x}),DayButton:MG,WeekNumber:({children:f,...p})=>r.jsx("td",{...p,children:r.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...c},...d})}function MG({className:e,day:t,modifiers:n,...a}){const l=zg(),o=w.useRef(null);return w.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),r.jsx(ne,{ref:o,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:he("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",l.day,e),...a})}class AG{ws=null;reconnectTimeout=null;reconnectAttempts=0;maxReconnectAttempts=10;heartbeatInterval=null;logCallbacks=new Set;connectionCallbacks=new Set;isConnected=!1;logCache=[];maxCacheSize=1e3;getWebSocketUrl(){{const t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.host;return`${t}//${n}/ws/logs`}}connect(){if(this.ws?.readyState===WebSocket.OPEN||this.ws?.readyState===WebSocket.CONNECTING)return;const t=this.getWebSocketUrl();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.isConnected=!0,this.reconnectAttempts=0,this.notifyConnection(!0),this.startHeartbeat()},this.ws.onmessage=n=>{try{if(n.data==="pong")return;const a=JSON.parse(n.data);this.notifyLog(a)}catch(a){console.error("解析日志消息失败:",a)}},this.ws.onerror=n=>{console.error("❌ WebSocket 错误:",n),this.isConnected=!1,this.notifyConnection(!1)},this.ws.onclose=()=>{this.isConnected=!1,this.notifyConnection(!1),this.stopHeartbeat(),this.attemptReconnect()}}catch(n){console.error("创建 WebSocket 连接失败:",n),this.attemptReconnect()}}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return;this.reconnectAttempts+=1;const t=Math.min(1e3*this.reconnectAttempts,1e4);this.reconnectTimeout=window.setTimeout(()=>{this.connect()},t)}startHeartbeat(){this.heartbeatInterval=window.setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send("ping")},3e4)}stopHeartbeat(){this.heartbeatInterval!==null&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}disconnect(){this.reconnectTimeout!==null&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.isConnected=!1,this.reconnectAttempts=0}onLog(t){return this.logCallbacks.add(t),()=>this.logCallbacks.delete(t)}onConnectionChange(t){return this.connectionCallbacks.add(t),t(this.isConnected),()=>this.connectionCallbacks.delete(t)}notifyLog(t){this.logCache.some(a=>a.id===t.id)||(this.logCache.push(t),this.logCache.length>this.maxCacheSize&&(this.logCache=this.logCache.slice(-this.maxCacheSize)),this.logCallbacks.forEach(a=>{try{a(t)}catch(l){console.error("日志回调执行失败:",l)}}))}notifyConnection(t){this.connectionCallbacks.forEach(n=>{try{n(t)}catch(a){console.error("连接状态回调执行失败:",a)}})}getAllLogs(){return[...this.logCache]}clearLogs(){this.logCache=[]}getConnectionStatus(){return this.isConnected}}const Eo=new AG;typeof window<"u"&&Eo.connect();const DG={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}} 年"}},zG=(e,t,n)=>{let a;const l=DG[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?a+"内":a+"前":a},OG={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},RG={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},LG={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},BG={date:Lo({formats:OG,defaultWidth:"full"}),time:Lo({formats:RG,defaultWidth:"full"}),dateTime:Lo({formats:LG,defaultWidth:"full"})};function D5(e,t,n){const a="eeee p";return W$(e,t,n)?a:e.getTime()>t.getTime()?"'下个'"+a:"'上个'"+a}const PG={lastWeek:D5,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:D5,other:"PP p"},FG=(e,t,n,a)=>{const l=PG[e];return typeof l=="function"?l(t,n,a):l},IG={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},qG={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},HG={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},UG={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},$G={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:"夜间"}},VG={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:"夜间"}},GG=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},YG={ordinalNumber:GG,era:Ja({values:IG,defaultWidth:"wide"}),quarter:Ja({values:qG,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ja({values:HG,defaultWidth:"wide"}),day:Ja({values:UG,defaultWidth:"wide"}),dayPeriod:Ja({values:$G,defaultWidth:"wide",formattingValues:VG,defaultFormattingWidth:"wide"})},WG=/^(第\s*)?\d+(日|时|分|秒)?/i,XG=/\d+/i,KG={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},QG={any:[/^(前)/i,/^(公元)/i]},ZG={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},JG={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},eY={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},tY={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]},nY={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},rY={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},aY={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},sY={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},lY={ordinalNumber:SN({matchPattern:WG,parsePattern:XG,valueCallback:e=>parseInt(e,10)}),era:es({matchPatterns:KG,defaultMatchWidth:"wide",parsePatterns:QG,defaultParseWidth:"any"}),quarter:es({matchPatterns:ZG,defaultMatchWidth:"wide",parsePatterns:JG,defaultParseWidth:"any",valueCallback:e=>e+1}),month:es({matchPatterns:eY,defaultMatchWidth:"wide",parsePatterns:tY,defaultParseWidth:"any"}),day:es({matchPatterns:nY,defaultMatchWidth:"wide",parsePatterns:rY,defaultParseWidth:"any"}),dayPeriod:es({matchPatterns:aY,defaultMatchWidth:"any",parsePatterns:sY,defaultParseWidth:"any"})},P0={code:"zh-CN",formatDistance:zG,formatLong:BG,formatRelative:FG,localize:YG,match:lY,options:{weekStartsOn:1,firstWeekContainsDate:4}};function iY(){const[e,t]=w.useState([]),[n,a]=w.useState(""),[l,o]=w.useState("all"),[c,d]=w.useState("all"),[m,f]=w.useState(void 0),[p,x]=w.useState(void 0),[y,b]=w.useState(!0),[N,k]=w.useState(!1),S=w.useRef(null),T=w.useRef(null);w.useEffect(()=>{const G=Eo.getAllLogs();t(G);const ee=Eo.onLog(()=>{t(Eo.getAllLogs())}),Ne=Eo.onConnectionChange(J=>{k(J)});return()=>{ee(),Ne()}},[]),w.useEffect(()=>{y&&T.current&&T.current.scrollIntoView({behavior:"smooth",block:"end"})},[e,y]);const M=w.useMemo(()=>{const G=new Set(e.map(ee=>ee.module));return Array.from(G).sort()},[e]),A=G=>{switch(G){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"}},R=G=>{switch(G){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"}},B=()=>{window.location.reload()},O=()=>{Eo.clearLogs(),t([])},L=()=>{const G=I.map(se=>`${se.timestamp} [${se.level.padEnd(8)}] [${se.module}] ${se.message}`).join(`
`),ee=new Blob([G],{type:"text/plain;charset=utf-8"}),Ne=URL.createObjectURL(ee),J=document.createElement("a");J.href=Ne,J.download=`logs-${Z0(new Date,"yyyy-MM-dd-HHmmss")}.txt`,J.click(),URL.revokeObjectURL(Ne)},$=()=>{b(!y)},U=()=>{f(void 0),x(void 0)},I=w.useMemo(()=>e.filter(G=>{const ee=n===""||G.message.toLowerCase().includes(n.toLowerCase())||G.module.toLowerCase().includes(n.toLowerCase()),Ne=l==="all"||G.level===l,J=c==="all"||G.module===c;let se=!0;if(m||p){const H=new Date(G.timestamp);if(m){const le=new Date(m);le.setHours(0,0,0,0),se=se&&H>=le}if(p){const le=new Date(p);le.setHours(23,59,59,999),se=se&&H<=le}}return ee&&Ne&&J&&se}),[e,n,l,c,m,p]);return r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 p-3 sm:p-4 lg:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),r.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:he("h-2.5 w-2.5 sm:h-3 sm:w-3 rounded-full",N?"bg-green-500 animate-pulse":"bg-red-500")}),r.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:N?"已连接":"未连接"})]})]}),r.jsx(ct,{className:"p-3 sm:p-4",children:r.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[r.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Yr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索日志...",value:n,onChange:G=>a(G.target.value),className:"pl-9 h-9 text-sm"})]}),r.jsxs(_t,{value:l,onValueChange:o,children:[r.jsxs(jt,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[r.jsx(Sx,{className:"h-4 w-4 mr-2"}),r.jsx(Et,{placeholder:"级别"})]}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部级别"}),r.jsx(Oe,{value:"DEBUG",children:"DEBUG"}),r.jsx(Oe,{value:"INFO",children:"INFO"}),r.jsx(Oe,{value:"WARNING",children:"WARNING"}),r.jsx(Oe,{value:"ERROR",children:"ERROR"}),r.jsx(Oe,{value:"CRITICAL",children:"CRITICAL"})]})]}),r.jsxs(_t,{value:c,onValueChange:d,children:[r.jsxs(jt,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[r.jsx(Sx,{className:"h-4 w-4 mr-2"}),r.jsx(Et,{placeholder:"模块"})]}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部模块"}),M.map(G=>r.jsx(Oe,{value:G,children:G},G))]})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",className:he("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!m&&"text-muted-foreground"),children:[r.jsx(Yy,{className:"mr-2 h-4 w-4"}),r.jsx("span",{className:"text-xs sm:text-sm",children:m?Z0(m,"PPP",{locale:P0}):"开始日期"})]})}),r.jsx(Ps,{className:"w-auto p-0",align:"start",children:r.jsx(A5,{mode:"single",selected:m,onSelect:f,initialFocus:!0,locale:P0})})]}),r.jsxs(Cl,{children:[r.jsx(Tl,{asChild:!0,children:r.jsxs(ne,{variant:"outline",size:"sm",className:he("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!p&&"text-muted-foreground"),children:[r.jsx(Yy,{className:"mr-2 h-4 w-4"}),r.jsx("span",{className:"text-xs sm:text-sm",children:p?Z0(p,"PPP",{locale:P0}):"结束日期"})]})}),r.jsx(Ps,{className:"w-auto p-0",align:"start",children:r.jsx(A5,{mode:"single",selected:p,onSelect:x,initialFocus:!0,locale:P0})})]}),(m||p)&&r.jsxs(ne,{variant:"outline",size:"sm",onClick:U,className:"w-full sm:w-auto h-9",children:[r.jsx(Au,{className:"h-4 w-4 sm:mr-2"}),r.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),r.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[r.jsxs("div",{className:"flex gap-2 flex-wrap",children:[r.jsxs(ne,{variant:y?"default":"outline",size:"sm",onClick:$,className:"flex-1 sm:flex-none h-9",children:[y?r.jsx(_T,{className:"h-4 w-4"}):r.jsx(ET,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:y?"自动滚动":"已暂停"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:B,className:"flex-1 sm:flex-none h-9",children:[r.jsx(Ia,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:O,className:"flex-1 sm:flex-none h-9",children:[r.jsx(zt,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:L,className:"flex-1 sm:flex-none h-9",children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),r.jsx("div",{className:"flex-1 hidden sm:block"}),r.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[r.jsxs("span",{className:"font-mono",children:[I.length," / ",e.length]}),r.jsx("span",{className:"ml-1",children:"条日志"})]})]})]})}),r.jsx(ct,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900",children:r.jsx(an,{className:"h-[calc(100vh-280px)] sm:h-[calc(100vh-320px)] lg:h-[calc(100vh-400px)]",children:r.jsxs("div",{ref:S,className:"p-2 sm:p-3 lg:p-4 font-mono text-xs sm:text-sm space-y-1",children:[I.length===0?r.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):I.map(G=>r.jsxs("div",{className:he("py-2 px-2 sm:px-3 rounded hover:bg-white/5 transition-colors group",R(G.level)),children:[r.jsxs("div",{className:"flex flex-col gap-1 sm:hidden",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-gray-500 dark:text-gray-600 text-xs",children:G.timestamp}),r.jsxs("span",{className:he("text-xs font-semibold",A(G.level)),children:["[",G.level,"]"]})]}),r.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 text-xs truncate",children:G.module}),r.jsx("div",{className:"text-gray-300 dark:text-gray-400 text-xs break-all",children:G.message})]}),r.jsxs("div",{className:"hidden sm:flex gap-3 items-start",children:[r.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[140px] lg:w-[180px] text-xs lg:text-sm",children:G.timestamp}),r.jsxs("span",{className:he("flex-shrink-0 w-[70px] lg:w-[80px] font-semibold text-xs lg:text-sm",A(G.level)),children:["[",G.level,"]"]}),r.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:G.module}),r.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 break-all text-xs lg:text-sm",children:G.message})]})]},G.id)),r.jsx("div",{ref:T,className:"h-4"})]})})})]})})}const oY="Mai-with-u",cY="plugin-repo",uY="main",dY="plugin_details.json";async function mY(){try{const e=await lt("/api/webui/plugins/fetch-raw",{method:"POST",headers:pt(),body:JSON.stringify({owner:oY,repo:cY,branch:uY,file_path:dY})});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success||!t.data)throw new Error(t.error||"获取插件列表失败");return JSON.parse(t.data).filter(l=>!l?.id||!l?.manifest?(console.warn("跳过无效插件数据:",l),!1):!l.manifest.name||!l.manifest.version?(console.warn("跳过缺少必需字段的插件:",l.id),!1):!0).map(l=>({id:l.id,manifest:{manifest_version:l.manifest.manifest_version||1,name:l.manifest.name,version:l.manifest.version,description:l.manifest.description||"",author:l.manifest.author||{name:"Unknown"},license:l.manifest.license||"Unknown",host_application:l.manifest.host_application||{min_version:"0.0.0"},homepage_url:l.manifest.homepage_url,repository_url:l.manifest.repository_url,keywords:l.manifest.keywords||[],categories:l.manifest.categories||[],default_locale:l.manifest.default_locale||"zh-CN",locales_path:l.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!1,published_at:new Date().toISOString(),updated_at:new Date().toISOString()}))}catch(e){throw console.error("Failed to fetch plugin list:",e),e}}async function hY(){try{const e=await lt("/api/webui/plugins/git-status");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to check Git status:",e),{installed:!1,error:"无法检测 Git 安装状态"}}}async function fY(){try{const e=await lt("/api/webui/plugins/version");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.error("Failed to get Maimai version:",e),{version:"0.0.0",version_major:0,version_minor:0,version_patch:0}}}function pY(e,t,n){const a=e.split(".").map(d=>parseInt(d)||0),l=a[0]||0,o=a[1]||0,c=a[2]||0;if(n.version_major<l||n.version_major===l&&n.version_minor<o||n.version_major===l&&n.version_minor===o&&n.version_patch<c)return!1;if(t){const d=t.split(".").map(x=>parseInt(x)||0),m=d[0]||0,f=d[1]||0,p=d[2]||0;if(n.version_major>m||n.version_major===m&&n.version_minor>f||n.version_major===m&&n.version_minor===f&&n.version_patch>p)return!1}return!0}function xY(e,t){const n=window.location.protocol==="https:"?"wss:":"ws:",a=window.location.host,l=new WebSocket(`${n}//${a}/api/webui/ws/plugin-progress`);return l.onopen=()=>{console.log("Plugin progress WebSocket connected");const o=setInterval(()=>{l.readyState===WebSocket.OPEN?l.send("ping"):clearInterval(o)},3e4)},l.onmessage=o=>{try{if(o.data==="pong")return;const c=JSON.parse(o.data);e(c)}catch(c){console.error("Failed to parse progress data:",c)}},l.onerror=o=>{console.error("Plugin progress WebSocket error:",o),t?.(o)},l.onclose=()=>{console.log("Plugin progress WebSocket disconnected")},l}async function F0(){try{const e=await lt("/api/webui/plugins/installed",{headers:pt()});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(!t.success)throw new Error(t.message||"获取已安装插件列表失败");return t.plugins||[]}catch(e){return console.error("Failed to get installed plugins:",e),[]}}function I0(e,t){return t.some(n=>n.id===e)}function q0(e,t){const n=t.find(a=>a.id===e);if(n)return n.manifest?.version||n.version}async function gY(e,t,n="main"){const a=await lt("/api/webui/plugins/install",{method:"POST",headers:pt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"安装失败")}return await a.json()}async function vY(e){const t=await lt("/api/webui/plugins/uninstall",{method:"POST",headers:pt(),body:JSON.stringify({plugin_id:e})});if(!t.ok){const n=await t.json();throw new Error(n.detail||"卸载失败")}return await t.json()}async function yY(e,t,n="main"){const a=await lt("/api/webui/plugins/update",{method:"POST",headers:pt(),body:JSON.stringify({plugin_id:e,repository_url:t,branch:n})});if(!a.ok){const l=await a.json();throw new Error(l.detail||"更新失败")}return await a.json()}const ed="https://maibot-plugin-stats.maibot-webui.workers.dev";async function HN(e){try{const t=await fetch(`${ed}/stats/${e}`);return t.ok?await t.json():(console.error("Failed to fetch plugin stats:",t.statusText),null)}catch(t){return console.error("Error fetching plugin stats:",t),null}}async function bY(e,t){try{const n=t||Og(),a=await fetch(`${ed}/stats/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:e,user_id:n})}),l=await a.json();return a.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:a.ok?{success:!0,...l}:{success:!1,error:l.error||"点赞失败"}}catch(n){return console.error("Error liking plugin:",n),{success:!1,error:"网络错误"}}}async function wY(e,t){try{const n=t||Og(),a=await fetch(`${ed}/stats/dislike`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:e,user_id:n})}),l=await a.json();return a.status===429?{success:!1,error:"操作过于频繁,请稍后再试"}:a.ok?{success:!0,...l}:{success:!1,error:l.error||"点踩失败"}}catch(n){return console.error("Error disliking plugin:",n),{success:!1,error:"网络错误"}}}async function jY(e,t,n,a){if(t<1||t>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const l=a||Og(),o=await fetch(`${ed}/stats/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:e,rating:t,comment:n,user_id:l})}),c=await o.json();return o.status===429?{success:!1,error:"每天最多评分 3 次"}:o.ok?{success:!0,...c}:{success:!1,error:c.error||"评分失败"}}catch(l){return console.error("Error rating plugin:",l),{success:!1,error:"网络错误"}}}async function NY(e){try{const t=await fetch(`${ed}/stats/download`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin_id:e})}),n=await t.json();return t.status===429?(console.warn("Download recording rate limited"),{success:!0}):t.ok?{success:!0,...n}:(console.error("Failed to record download:",n.error),{success:!1,error:n.error})}catch(t){return console.error("Error recording download:",t),{success:!1,error:"网络错误"}}}function SY(){const e=navigator,t=[navigator.userAgent,navigator.language,navigator.languages?.join(",")||"",navigator.platform,navigator.hardwareConcurrency||0,screen.width,screen.height,screen.colorDepth,screen.pixelDepth,new Date().getTimezoneOffset(),Intl.DateTimeFormat().resolvedOptions().timeZone,navigator.maxTouchPoints||0,e.deviceMemory||0].join("|");let n=0;for(let a=0;a<t.length;a++){const l=t.charCodeAt(a);n=(n<<5)-n+l,n=n&n}return`fp_${Math.abs(n).toString(36)}`}function Og(){const e="maibot_user_id";let t=localStorage.getItem(e);if(!t){const n=SY(),a=Date.now().toString(36),l=Math.random().toString(36).substring(2,15);t=`${n}_${a}_${l}`,localStorage.setItem(e,t)}return t}function kY({pluginId:e,compact:t=!1}){const[n,a]=w.useState(null),[l,o]=w.useState(!0),[c,d]=w.useState(0),[m,f]=w.useState(""),[p,x]=w.useState(!1),{toast:y}=or(),b=async()=>{o(!0);const T=await HN(e);T&&a(T),o(!1)};w.useEffect(()=>{b()},[e]);const N=async()=>{const T=await bY(e);T.success?(y({title:"已点赞",description:"感谢你的支持!"}),b()):y({title:"点赞失败",description:T.error||"未知错误",variant:"destructive"})},k=async()=>{const T=await wY(e);T.success?(y({title:"已反馈",description:"感谢你的反馈!"}),b()):y({title:"操作失败",description:T.error||"未知错误",variant:"destructive"})},S=async()=>{if(c===0){y({title:"请选择评分",description:"至少选择 1 颗星",variant:"destructive"});return}const T=await jY(e,c,m||void 0);T.success?(y({title:"评分成功",description:"感谢你的评价!"}),x(!1),d(0),f(""),b()):y({title:"评分失败",description:T.error||"未知错误",variant:"destructive"})};return l?r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsx("span",{children:"-"})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(wl,{className:"h-4 w-4"}),r.jsx("span",{children:"-"})]})]}):n?t?r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsx("span",{children:n.downloads.toLocaleString()})]}),r.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[r.jsx(wl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsx("span",{children:n.rating.toFixed(1)})]}),r.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[r.jsx(yp,{className:"h-4 w-4"}),r.jsx("span",{children:n.likes})]})]}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[r.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[r.jsx(hi,{className:"h-5 w-5 text-muted-foreground mb-1"}),r.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),r.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[r.jsx(wl,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),r.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),r.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[r.jsx(yp,{className:"h-5 w-5 text-green-500 mb-1"}),r.jsx("span",{className:"text-2xl font-bold",children:n.likes}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),r.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[r.jsx(Wy,{className:"h-5 w-5 text-red-500 mb-1"}),r.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(ne,{variant:"outline",size:"sm",onClick:N,children:[r.jsx(yp,{className:"h-4 w-4 mr-1"}),"点赞"]}),r.jsxs(ne,{variant:"outline",size:"sm",onClick:k,children:[r.jsx(Wy,{className:"h-4 w-4 mr-1"}),"点踩"]}),r.jsxs(ir,{open:p,onOpenChange:x,children:[r.jsx(I1,{asChild:!0,children:r.jsxs(ne,{variant:"default",size:"sm",children:[r.jsx(wl,{className:"h-4 w-4 mr-1"}),"评分"]})}),r.jsxs(Jn,{children:[r.jsxs(er,{children:[r.jsx(tr,{children:"为插件评分"}),r.jsx(xr,{children:"分享你的使用体验,帮助其他用户"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(T=>r.jsx("button",{onClick:()=>d(T),className:"focus:outline-none",children:r.jsx(wl,{className:`h-8 w-8 transition-colors ${T<=c?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},T))}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[c===0&&"点击星星进行评分",c===1&&"很差",c===2&&"一般",c===3&&"还行",c===4&&"不错",c===5&&"非常好"]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),r.jsx(fn,{value:m,onChange:T=>f(T.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),r.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[m.length," / 500"]})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>x(!1),children:"取消"}),r.jsx(ne,{onClick:S,disabled:c===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),r.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((T,M)=>r.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(A=>r.jsx(wl,{className:`h-3 w-3 ${A<=T.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},A))}),r.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(T.created_at).toLocaleDateString()})]}),T.comment&&r.jsx("p",{className:"text-sm text-muted-foreground",children:T.comment})]},M))})]})]}):null}const z5={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function CY(){const e=as(),[t,n]=w.useState(null),[a,l]=w.useState(""),[o,c]=w.useState("all"),[d,m]=w.useState("all"),[f,p]=w.useState(!1),[x,y]=w.useState([]),[b,N]=w.useState(!0),[k,S]=w.useState(null),[T,M]=w.useState(null),[A,R]=w.useState(null),[B,O]=w.useState(null),[,L]=w.useState([]),[$,U]=w.useState({}),{toast:I}=or(),G=async E=>{const we=E.map(async X=>{try{const q=await HN(X.id);return{id:X.id,stats:q}}catch(q){return console.warn(`Failed to load stats for ${X.id}:`,q),{id:X.id,stats:null}}}),Z=await Promise.all(we),z={};Z.forEach(({id:X,stats:q})=>{q&&(z[X]=q)}),U(z)};w.useEffect(()=>{let E=null,we=!1;return(async()=>{if(E=xY(z=>{we||(R(z),z.stage==="success"?setTimeout(()=>{we||R(null)},2e3):z.stage==="error"&&(N(!1),S(z.error||"加载失败")))},z=>{console.error("WebSocket error:",z),we||I({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(z=>{if(!E){z();return}const X=()=>{E&&E.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),z()):E&&E.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),z()):setTimeout(X,100)};X()}),!we){const z=await hY();M(z),z.installed||I({title:"Git 未安装",description:z.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!we){const z=await fY();O(z)}if(!we)try{N(!0),S(null);const z=await mY();if(!we){const X=await F0();L(X);const q=z.map(ce=>{const fe=I0(ce.id,X),De=q0(ce.id,X);return{...ce,installed:fe,installed_version:De}});for(const ce of X)!q.some(De=>De.id===ce.id)&&ce.manifest&&q.push({id:ce.id,manifest:{manifest_version:ce.manifest.manifest_version||1,name:ce.manifest.name,version:ce.manifest.version,description:ce.manifest.description||"",author:ce.manifest.author,license:ce.manifest.license||"Unknown",host_application:ce.manifest.host_application,homepage_url:ce.manifest.homepage_url,repository_url:ce.manifest.repository_url,keywords:ce.manifest.keywords||[],categories:ce.manifest.categories||[],default_locale:ce.manifest.default_locale||"zh-CN",locales_path:ce.manifest.locales_path},downloads:0,rating:0,review_count:0,installed:!0,installed_version:ce.manifest.version,published_at:new Date().toISOString(),updated_at:new Date().toISOString()});y(q),G(q)}}catch(z){if(!we){const X=z instanceof Error?z.message:"加载插件列表失败";S(X),I({title:"加载失败",description:X,variant:"destructive"})}}finally{we||N(!1)}})(),()=>{we=!0,E&&E.close()}},[I]);const ee=E=>{if(!E.installed&&B&&!Ne(E))return r.jsxs(un,{variant:"destructive",className:"gap-1",children:[r.jsx(xi,{className:"h-3 w-3"}),"不兼容"]});if(E.installed){const we=E.installed_version?.trim(),Z=E.manifest.version?.trim();if(we!==Z){const z=we?.split(".").map(Number)||[0,0,0],X=Z?.split(".").map(Number)||[0,0,0];for(let q=0;q<3;q++){if((X[q]||0)>(z[q]||0))return r.jsxs(un,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[r.jsx(xi,{className:"h-3 w-3"}),"可更新"]});if((X[q]||0)<(z[q]||0))break}}return r.jsxs(un,{variant:"default",className:"gap-1",children:[r.jsx($r,{className:"h-3 w-3"}),"已安装"]})}return null},Ne=E=>!B||!E.manifest?.host_application?!0:pY(E.manifest.host_application.min_version,E.manifest.host_application.max_version,B),J=E=>{if(!E.installed||!E.installed_version||!E.manifest?.version)return!1;const we=E.installed_version.trim(),Z=E.manifest.version.trim();if(we===Z)return!1;const z=we.split(".").map(Number),X=Z.split(".").map(Number);for(let q=0;q<3;q++){if((X[q]||0)>(z[q]||0))return!0;if((X[q]||0)<(z[q]||0))return!1}return!1},se=x.filter(E=>{if(!E.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",E.id),!1;const we=a===""||E.manifest.name?.toLowerCase().includes(a.toLowerCase())||E.manifest.description?.toLowerCase().includes(a.toLowerCase())||E.manifest.keywords&&E.manifest.keywords.some(q=>q.toLowerCase().includes(a.toLowerCase())),Z=o==="all"||E.manifest.categories&&E.manifest.categories.includes(o);let z=!0;d==="installed"?z=E.installed===!0:d==="updates"&&(z=E.installed===!0&&J(E));const X=!f||!B||Ne(E);return we&&Z&&z&&X}),H=()=>{n(null)},le=async E=>{if(!T?.installed){I({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(B&&!Ne(E)){I({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await gY(E.id,E.manifest.repository_url||"","main"),NY(E.id).catch(Z=>{console.warn("Failed to record download:",Z)}),I({title:"安装成功",description:`${E.manifest.name} 已成功安装`});const we=await F0();L(we),y(Z=>Z.map(z=>{if(z.id===E.id){const X=I0(z.id,we),q=q0(z.id,we);return{...z,installed:X,installed_version:q}}return z}))}catch(we){I({title:"安装失败",description:we instanceof Error?we.message:"未知错误",variant:"destructive"})}},re=async E=>{try{await vY(E.id),I({title:"卸载成功",description:`${E.manifest.name} 已成功卸载`});const we=await F0();L(we),y(Z=>Z.map(z=>{if(z.id===E.id){const X=I0(z.id,we),q=q0(z.id,we);return{...z,installed:X,installed_version:q}}return z}))}catch(we){I({title:"卸载失败",description:we instanceof Error?we.message:"未知错误",variant:"destructive"})}},ge=async E=>{if(!T?.installed){I({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const we=await yY(E.id,E.manifest.repository_url||"","main");I({title:"更新成功",description:`${E.manifest.name} 已从 ${we.old_version} 更新到 ${we.new_version}`});const Z=await F0();L(Z),y(z=>z.map(X=>{if(X.id===E.id){const q=I0(X.id,Z),ce=q0(X.id,Z);return{...X,installed:q,installed_version:ce}}return X}))}catch(we){I({title:"更新失败",description:we instanceof Error?we.message:"未知错误",variant:"destructive"})}};return r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),r.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),r.jsxs(ne,{onClick:()=>e({to:"/plugin-mirrors"}),children:[r.jsx(MT,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),T&&!T.installed&&r.jsxs(ct,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[r.jsx(Lt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ao,{className:"h-5 w-5 text-orange-600"}),r.jsxs("div",{children:[r.jsx(Bt,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),r.jsx(Qn,{className:"text-orange-800 dark:text-orange-200",children:T.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),r.jsx(Gt,{children:r.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",r.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),r.jsx(ct,{className:"p-4",children:r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Yr,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),r.jsx(Te,{placeholder:"搜索插件...",value:a,onChange:E=>l(E.target.value),className:"pl-9"})]}),r.jsxs(_t,{value:o,onValueChange:c,children:[r.jsx(jt,{className:"w-full sm:w-[200px]",children:r.jsx(Et,{placeholder:"选择分类"})}),r.jsxs(Nt,{children:[r.jsx(Oe,{value:"all",children:"全部分类"}),r.jsx(Oe,{value:"Group Management",children:"群组管理"}),r.jsx(Oe,{value:"Entertainment & Interaction",children:"娱乐互动"}),r.jsx(Oe,{value:"Utility Tools",children:"实用工具"}),r.jsx(Oe,{value:"Content Generation",children:"内容生成"}),r.jsx(Oe,{value:"Multimedia",children:"多媒体"}),r.jsx(Oe,{value:"External Integration",children:"外部集成"}),r.jsx(Oe,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),r.jsx(Oe,{value:"Other",children:"其他"})]})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(jr,{id:"compatible-only",checked:f,onCheckedChange:E=>p(E===!0)}),r.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),r.jsx(kl,{value:d,onValueChange:m,className:"w-full",children:r.jsxs(Bs,{className:"grid w-full grid-cols-3",children:[r.jsxs(Pt,{value:"all",children:["全部插件 (",x.length,")"]}),r.jsxs(Pt,{value:"installed",children:["已安装 (",x.filter(E=>E.installed).length,")"]}),r.jsxs(Pt,{value:"updates",children:["可更新 (",x.filter(E=>E.installed&&J(E)).length,")"]})]})}),A&&A.stage==="loading"&&r.jsx(ct,{className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(xu,{className:"h-4 w-4 animate-spin"}),r.jsxs("span",{className:"text-sm font-medium",children:[A.operation==="fetch"&&"加载插件列表",A.operation==="install"&&`安装插件${A.plugin_id?`: ${A.plugin_id}`:""}`,A.operation==="uninstall"&&`卸载插件${A.plugin_id?`: ${A.plugin_id}`:""}`,A.operation==="update"&&`更新插件${A.plugin_id?`: ${A.plugin_id}`:""}`]})]}),r.jsxs("span",{className:"text-sm font-medium",children:[A.progress,"%"]})]}),r.jsx(Fu,{value:A.progress,className:"h-2"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:A.message}),A.operation==="fetch"&&A.total_plugins>0&&r.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",A.loaded_plugins," / ",A.total_plugins," 个插件"]})]})}),A&&A.stage==="error"&&A.error&&r.jsx(ct,{className:"border-destructive bg-destructive/10",children:r.jsx(Lt,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ao,{className:"h-5 w-5 text-destructive"}),r.jsxs("div",{children:[r.jsx(Bt,{className:"text-lg text-destructive",children:"加载失败"}),r.jsx(Qn,{className:"text-destructive/80",children:A.error})]})]})})}),b?r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsx(xu,{className:"h-8 w-8 animate-spin text-muted-foreground"}),r.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):k?r.jsx(ct,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Ao,{className:"h-12 w-12 text-destructive mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:k}),r.jsx(ne,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):se.length===0?r.jsx(ct,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Yr,{className:"h-12 w-12 text-muted-foreground mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:a||o!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:se.map(E=>r.jsxs(ct,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[r.jsxs(Lt,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsx(Bt,{className:"text-xl",children:E.manifest?.name||E.id}),r.jsxs("div",{className:"flex flex-col gap-1",children:[E.manifest?.categories&&E.manifest.categories[0]&&r.jsx(un,{variant:"secondary",className:"text-xs whitespace-nowrap",children:z5[E.manifest.categories[0]]||E.manifest.categories[0]}),ee(E)]})]}),r.jsx(Qn,{className:"line-clamp-2",children:E.manifest?.description||"无描述"})]}),r.jsx(Gt,{className:"flex-1",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(hi,{className:"h-4 w-4"}),r.jsx("span",{children:($[E.id]?.downloads??E.downloads??0).toLocaleString()})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(wl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsx("span",{children:($[E.id]?.rating??E.rating??0).toFixed(1)})]})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[E.manifest?.keywords&&E.manifest.keywords.slice(0,3).map(we=>r.jsx(un,{variant:"outline",className:"text-xs",children:we},we)),E.manifest?.keywords&&E.manifest.keywords.length>3&&r.jsxs(un,{variant:"outline",className:"text-xs",children:["+",E.manifest.keywords.length-3]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[r.jsxs("div",{children:["v",E.manifest?.version||"unknown"," · ",E.manifest?.author?.name||"Unknown"]}),E.manifest?.host_application&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{children:"支持:"}),r.jsxs("span",{className:"font-medium",children:[E.manifest.host_application.min_version,E.manifest.host_application.max_version?` - ${E.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),r.jsx(Y6,{className:"pt-4",children:r.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>n(E),children:"查看详情"}),E.installed?J(E)?r.jsxs(ne,{size:"sm",disabled:!T?.installed,title:T?.installed?void 0:"Git 未安装",onClick:()=>ge(E),children:[r.jsx(Ia,{className:"h-4 w-4 mr-1"}),"更新"]}):r.jsxs(ne,{variant:"destructive",size:"sm",disabled:!T?.installed,title:T?.installed?void 0:"Git 未安装",onClick:()=>re(E),children:[r.jsx(zt,{className:"h-4 w-4 mr-1"}),"卸载"]}):r.jsxs(ne,{size:"sm",disabled:!T?.installed||A?.operation==="install"||B!==null&&!Ne(E),title:T?.installed?B!==null&&!Ne(E)?`不兼容当前版本 (需要 ${E.manifest?.host_application?.min_version||"未知"}${E.manifest?.host_application?.max_version?` - ${E.manifest.host_application.max_version}`:"+"},当前 ${B?.version})`:void 0:"Git 未安装",onClick:()=>le(E),children:[r.jsx(hi,{className:"h-4 w-4 mr-1"}),A?.operation==="install"&&A?.plugin_id===E.id?"安装中...":"安装"]})]})})]},E.id))}),r.jsx(ir,{open:t!==null,onOpenChange:H,children:t&&t.manifest&&r.jsxs(Jn,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[r.jsx(er,{children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-2 flex-1",children:[r.jsx(tr,{className:"text-2xl",children:t.manifest.name}),r.jsxs(xr,{children:["作者: ",t.manifest.author?.name||"Unknown",t.manifest.author?.url&&r.jsx("a",{href:t.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:r.jsx(ou,{className:"h-3 w-3 inline"})})]})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[t.manifest.categories&&t.manifest.categories[0]&&r.jsx(un,{variant:"secondary",children:z5[t.manifest.categories[0]]||t.manifest.categories[0]}),ee(t)]})]})}),r.jsxs("div",{className:"space-y-6",children:[r.jsx(kY,{pluginId:t.id}),r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"版本"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",t.manifest?.version||"unknown"]}),t.installed&&t.installed_version&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",t.installed_version]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"下载量"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:($[t.id]?.downloads??t.downloads??0).toLocaleString()})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"评分"}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(wl,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),r.jsxs("span",{className:"text-sm text-muted-foreground",children:[($[t.id]?.rating??t.rating??0).toFixed(1)," (",$[t.id]?.rating_count??t.review_count??0,")"]})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"许可证"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.license||"Unknown"})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.manifest.host_application?.min_version||"未知",t.manifest.host_application?.max_version?` - ${t.manifest.host_application.max_version}`:" - 最新版本"]})]})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:t.manifest.keywords&&t.manifest.keywords.map(E=>r.jsx(un,{variant:"outline",children:E},E))})]}),t.detailed_description&&r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),r.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:t.detailed_description})]}),!t.detailed_description&&r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:t.manifest.description||"无描述"})]}),r.jsxs("div",{className:"space-y-2",children:[t.manifest.homepage_url&&r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"font-medium",children:"主页: "}),r.jsx("a",{href:t.manifest.homepage_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.homepage_url})]}),t.manifest.repository_url&&r.jsxs("div",{className:"text-sm",children:[r.jsx("span",{className:"font-medium",children:"仓库: "}),r.jsx("a",{href:t.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t.manifest.repository_url})]})]})]}),r.jsxs(Er,{children:[t.manifest.homepage_url&&r.jsxs(ne,{onClick:()=>window.open(t.manifest.homepage_url,"_blank"),children:[r.jsx(ou,{className:"h-4 w-4 mr-2"}),"访问主页"]}),t.manifest.repository_url&&r.jsxs(ne,{variant:"outline",onClick:()=>window.open(t.manifest.repository_url,"_blank"),children:[r.jsx(ou,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function TY(){return r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),r.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(ne,{variant:"outline",size:"sm",children:[r.jsx(Ia,{className:"h-4 w-4 mr-2"}),"刷新"]}),r.jsxs(ne,{size:"sm",children:[r.jsx(Pa,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"已安装插件"}),r.jsx(nm,{className:"h-4 w-4 text-muted-foreground"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"已启用"}),r.jsx($r,{className:"h-4 w-4 text-green-600"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"已禁用"}),r.jsx(xi,{className:"h-4 w-4 text-orange-600"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[r.jsx(Bt,{className:"text-sm font-medium",children:"可更新"}),r.jsx(Ia,{className:"h-4 w-4 text-blue-600"})]}),r.jsxs(Gt,{children:[r.jsx("div",{className:"text-2xl font-bold",children:"0"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),r.jsxs(ct,{children:[r.jsxs(Lt,{children:[r.jsx(Bt,{children:"已安装的插件"}),r.jsx(Qn,{children:"查看和管理已安装插件的配置"})]}),r.jsx(Gt,{children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[r.jsx(nm,{className:"h-16 w-16 text-muted-foreground/50"}),r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),r.jsx("div",{className:"flex gap-2",children:r.jsx(ne,{variant:"outline",asChild:!0,children:r.jsxs("a",{href:"/plugins",children:[r.jsx(ou,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),r.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[r.jsxs(ct,{children:[r.jsx(Lt,{children:r.jsx(Bt,{className:"text-base",children:"即将推出的功能"})}),r.jsx(Gt,{children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx($r,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"插件启用/禁用"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"快速切换插件运行状态"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx($r,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"配置参数编辑"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"可视化编辑插件配置文件"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx($r,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"依赖管理"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"查看和安装插件依赖包"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-primary/10 p-1 mt-0.5",children:r.jsx($r,{className:"h-4 w-4 text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"插件日志"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"查看插件运行日志和错误信息"})]})]})]})})]}),r.jsxs(ct,{children:[r.jsx(Lt,{children:r.jsx(Bt,{className:"text-base",children:"开发者工具"})}),r.jsx(Gt,{children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"热重载"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"无需重启即可重新加载插件"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"配置验证"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"检查配置文件格式和完整性"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"性能监控"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"监控插件的资源占用情况"})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"rounded-full bg-blue-500/10 p-1 mt-0.5",children:r.jsx(Pa,{className:"h-4 w-4 text-blue-600"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium",children:"调试模式"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"详细的调试信息和错误追踪"})]})]})]})})]})]}),r.jsx(ct,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:r.jsx(Gt,{className:"pt-6",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(xi,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),r.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",r.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function _Y(){const e=as(),{toast:t}=or(),[n,a]=w.useState([]),[l,o]=w.useState(!0),[c,d]=w.useState(null),[m,f]=w.useState(null),[p,x]=w.useState(!1),[y,b]=w.useState(!1),[N,k]=w.useState({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S=w.useCallback(async()=>{try{o(!0),d(null);const L=localStorage.getItem("access-token"),$=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${L}`}});if(!$.ok)throw new Error("获取镜像源列表失败");const U=await $.json();a(U.mirrors||[])}catch(L){const $=L instanceof Error?L.message:"加载镜像源失败";d($),t({title:"加载失败",description:$,variant:"destructive"})}finally{o(!1)}},[t]);w.useEffect(()=>{S()},[S]);const T=async()=>{try{const L=localStorage.getItem("access-token"),$=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${L}`,"Content-Type":"application/json"},body:JSON.stringify(N)});if(!$.ok){const U=await $.json();throw new Error(U.detail||"添加镜像源失败")}t({title:"添加成功",description:"镜像源已添加"}),x(!1),k({id:"",name:"",raw_prefix:"",clone_prefix:"",enabled:!0,priority:1}),S()}catch(L){t({title:"添加失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},M=async()=>{if(m)try{const L=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${m.id}`,{method:"PUT",headers:{Authorization:`Bearer ${L}`,"Content-Type":"application/json"},body:JSON.stringify({name:N.name,raw_prefix:N.raw_prefix,clone_prefix:N.clone_prefix,enabled:N.enabled,priority:N.priority})})).ok)throw new Error("更新镜像源失败");t({title:"更新成功",description:"镜像源已更新"}),b(!1),f(null),S()}catch(L){t({title:"更新失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},A=async L=>{if(confirm("确定要删除这个镜像源吗?"))try{const $=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${L}`,{method:"DELETE",headers:{Authorization:`Bearer ${$}`}})).ok)throw new Error("删除镜像源失败");t({title:"删除成功",description:"镜像源已删除"}),S()}catch($){t({title:"删除失败",description:$ instanceof Error?$.message:"未知错误",variant:"destructive"})}},R=async L=>{try{const $=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${L.id}`,{method:"PUT",headers:{Authorization:`Bearer ${$}`,"Content-Type":"application/json"},body:JSON.stringify({enabled:!L.enabled})})).ok)throw new Error("更新状态失败");S()}catch($){t({title:"更新失败",description:$ instanceof Error?$.message:"未知错误",variant:"destructive"})}},B=L=>{f(L),k({id:L.id,name:L.name,raw_prefix:L.raw_prefix,clone_prefix:L.clone_prefix,enabled:L.enabled,priority:L.priority}),b(!0)},O=async(L,$)=>{const U=$==="up"?L.priority-1:L.priority+1;if(!(U<1))try{const I=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${L.id}`,{method:"PUT",headers:{Authorization:`Bearer ${I}`,"Content-Type":"application/json"},body:JSON.stringify({priority:U})})).ok)throw new Error("更新优先级失败");S()}catch(I){t({title:"更新失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}};return r.jsx(an,{className:"h-full",children:r.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>e({to:"/plugins"}),children:r.jsx(i6,{className:"h-5 w-5"})}),r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),r.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),r.jsxs(ne,{onClick:()=>x(!0),children:[r.jsx(pr,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),l?r.jsx(ct,{className:"p-6",children:r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(xu,{className:"h-8 w-8 animate-spin text-primary"})})}):c?r.jsx(ct,{className:"p-6",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[r.jsx(Ao,{className:"h-12 w-12 text-destructive mb-4"}),r.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),r.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:c}),r.jsx(ne,{onClick:S,children:"重新加载"})]})}):r.jsxs(ct,{children:[r.jsx("div",{className:"hidden md:block",children:r.jsxs(ji,{children:[r.jsx(Ni,{children:r.jsxs(Vn,{children:[r.jsx(ut,{children:"状态"}),r.jsx(ut,{children:"名称"}),r.jsx(ut,{children:"ID"}),r.jsx(ut,{children:"优先级"}),r.jsx(ut,{className:"text-right",children:"操作"})]})}),r.jsx(Si,{children:n.map(L=>r.jsxs(Vn,{children:[r.jsx(et,{children:r.jsx(vt,{checked:L.enabled,onCheckedChange:()=>R(L)})}),r.jsx(et,{children:r.jsxs("div",{children:[r.jsx("div",{className:"font-medium",children:L.name}),r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",L.raw_prefix]})]})}),r.jsx(et,{children:r.jsx(un,{variant:"outline",children:L.id})}),r.jsx(et,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-mono",children:L.priority}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(ne,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>O(L,"up"),disabled:L.priority===1,children:r.jsx(Nx,{className:"h-3 w-3"})}),r.jsx(ne,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>O(L,"down"),children:r.jsx(pu,{className:"h-3 w-3"})})]})]})}),r.jsx(et,{className:"text-right",children:r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>B(L),children:r.jsx(Bo,{className:"h-4 w-4"})}),r.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>A(L.id),children:r.jsx(zt,{className:"h-4 w-4 text-destructive"})})]})})]},L.id))})]})}),r.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(L=>r.jsx(ct,{className:"p-4",children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold",children:L.name}),L.enabled&&r.jsx(un,{variant:"default",className:"text-xs",children:"启用"})]}),r.jsx(un,{variant:"outline",className:"mt-1 text-xs",children:L.id})]}),r.jsx(vt,{checked:L.enabled,onCheckedChange:()=>R(L)})]}),r.jsxs("div",{className:"text-sm space-y-1",children:[r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"Raw: "}),r.jsx("span",{className:"break-all",children:L.raw_prefix})]}),r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"优先级: "}),r.jsx("span",{className:"font-mono",children:L.priority})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[r.jsxs(ne,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>B(L),children:[r.jsx(Bo,{className:"h-4 w-4 mr-1"}),"编辑"]}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>O(L,"up"),disabled:L.priority===1,children:r.jsx(Nx,{className:"h-4 w-4"})}),r.jsx(ne,{variant:"outline",size:"sm",onClick:()=>O(L,"down"),children:r.jsx(pu,{className:"h-4 w-4"})}),r.jsx(ne,{variant:"destructive",size:"sm",onClick:()=>A(L.id),children:r.jsx(zt,{className:"h-4 w-4"})})]})]})},L.id))})]}),r.jsx(ir,{open:p,onOpenChange:x,children:r.jsxs(Jn,{className:"max-w-lg",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"添加镜像源"}),r.jsx(xr,{children:"添加新的 Git 镜像源配置"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-id",children:"镜像源 ID *"}),r.jsx(Te,{id:"add-id",placeholder:"例如: my-mirror",value:N.id,onChange:L=>k({...N,id:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-name",children:"名称 *"}),r.jsx(Te,{id:"add-name",placeholder:"例如: 我的镜像源",value:N.name,onChange:L=>k({...N,name:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),r.jsx(Te,{id:"add-raw",placeholder:"https://example.com/raw",value:N.raw_prefix,onChange:L=>k({...N,raw_prefix:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-clone",children:"克隆前缀 *"}),r.jsx(Te,{id:"add-clone",placeholder:"https://example.com/clone",value:N.clone_prefix,onChange:L=>k({...N,clone_prefix:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"add-priority",children:"优先级"}),r.jsx(Te,{id:"add-priority",type:"number",min:"1",value:N.priority,onChange:L=>k({...N,priority:parseInt(L.target.value)||1})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"add-enabled",checked:N.enabled,onCheckedChange:L=>k({...N,enabled:L})}),r.jsx(Q,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>x(!1),children:"取消"}),r.jsx(ne,{onClick:T,children:"添加"})]})]})}),r.jsx(ir,{open:y,onOpenChange:b,children:r.jsxs(Jn,{className:"max-w-lg",children:[r.jsxs(er,{children:[r.jsx(tr,{children:"编辑镜像源"}),r.jsx(xr,{children:"修改镜像源配置"})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{children:"镜像源 ID"}),r.jsx(Te,{value:N.id,disabled:!0})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-name",children:"名称 *"}),r.jsx(Te,{id:"edit-name",value:N.name,onChange:L=>k({...N,name:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),r.jsx(Te,{id:"edit-raw",value:N.raw_prefix,onChange:L=>k({...N,raw_prefix:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-clone",children:"克隆前缀 *"}),r.jsx(Te,{id:"edit-clone",value:N.clone_prefix,onChange:L=>k({...N,clone_prefix:L.target.value})})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(Q,{htmlFor:"edit-priority",children:"优先级"}),r.jsx(Te,{id:"edit-priority",type:"number",min:"1",value:N.priority,onChange:L=>k({...N,priority:parseInt(L.target.value)||1})}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(vt,{id:"edit-enabled",checked:N.enabled,onCheckedChange:L=>k({...N,enabled:L})}),r.jsx(Q,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),r.jsxs(Er,{children:[r.jsx(ne,{variant:"outline",onClick:()=>b(!1),children:"取消"}),r.jsx(ne,{onClick:M,children:"保存"})]})]})})]})})}const EY=Ko("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"}}),UN=w.forwardRef(({className:e,size:t,abbrTitle:n,children:a,...l},o)=>r.jsx("kbd",{className:he(EY({size:t,className:e})),ref:o,...l,children:n?r.jsx("abbr",{title:n,children:a}):a}));UN.displayName="Kbd";const MY=[{icon:J0,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:Nl,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:o6,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:c6,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:N1,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:Mu,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:u6,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:AT,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:nm,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:em,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:Pa,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function AY({open:e,onOpenChange:t}){const[n,a]=w.useState(""),[l,o]=w.useState(0),c=as(),d=MY.filter(p=>p.title.toLowerCase().includes(n.toLowerCase())||p.description.toLowerCase().includes(n.toLowerCase())||p.category.toLowerCase().includes(n.toLowerCase()));w.useEffect(()=>{e&&(a(""),o(0))},[e]);const m=w.useCallback(p=>{c({to:p}),t(!1)},[c,t]),f=w.useCallback(p=>{p.key==="ArrowDown"?(p.preventDefault(),o(x=>(x+1)%d.length)):p.key==="ArrowUp"?(p.preventDefault(),o(x=>(x-1+d.length)%d.length)):p.key==="Enter"&&d[l]&&(p.preventDefault(),m(d[l].path))},[d,l,m]);return r.jsx(ir,{open:e,onOpenChange:t,children:r.jsxs(Jn,{className:"max-w-2xl p-0 gap-0",children:[r.jsxs(er,{className:"px-4 pt-4 pb-0",children:[r.jsx(tr,{className:"sr-only",children:"搜索"}),r.jsxs("div",{className:"relative",children:[r.jsx(Yr,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),r.jsx(Te,{value:n,onChange:p=>{a(p.target.value),o(0)},onKeyDown:f,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),r.jsx("div",{className:"border-t",children:r.jsx(an,{className:"h-[400px]",children:d.length>0?r.jsx("div",{className:"p-2",children:d.map((p,x)=>{const y=p.icon;return r.jsxs("button",{onClick:()=>m(p.path),onMouseEnter:()=>o(x),className:he("w-full flex items-center gap-3 px-3 py-2.5 rounded-md text-left transition-colors",x===l?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[r.jsx(y,{className:"h-5 w-5 flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-medium text-sm",children:p.title}),r.jsx("div",{className:"text-xs text-muted-foreground truncate",children:p.description})]}),r.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:p.category})]},p.path)})}):r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(Yr,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),r.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function DY(e){const t=zY(e),n=w.forwardRef((a,l)=>{const{children:o,...c}=a,d=w.Children.toArray(o),m=d.find(RY);if(m){const f=m.props.children,p=d.map(x=>x===m?w.Children.count(f)>1?w.Children.only(null):w.isValidElement(f)?f.props.children:null:x);return r.jsx(t,{...c,ref:l,children:w.isValidElement(f)?w.cloneElement(f,void 0,p):null})}return r.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function zY(e){const t=w.forwardRef((n,a)=>{const{children:l,...o}=n;if(w.isValidElement(l)){const c=BY(l),d=LY(o,l.props);return l.type!==w.Fragment&&(d.ref=a?Sl(a,c):c),w.cloneElement(l,d)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OY=Symbol("radix.slottable");function RY(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OY}function LY(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...d)=>{const m=o(...d);return l(...d),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function BY(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var i1=["Enter"," "],PY=["ArrowDown","PageUp","Home"],$N=["ArrowUp","PageDown","End"],FY=[...PY,...$N],IY={ltr:[...i1,"ArrowRight"],rtl:[...i1,"ArrowLeft"]},qY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},td="Menu",[Cu,HY,UY]=bm(td),[Mi,VN]=Ua(td,[UY,Vo,Dm]),nd=Vo(),GN=Dm(),[YN,Pl]=Mi(td),[$Y,rd]=Mi(td),WN=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:l,onOpenChange:o,modal:c=!0}=e,d=nd(t),[m,f]=w.useState(null),p=w.useRef(!1),x=yr(o),y=Eu(l);return w.useEffect(()=>{const b=()=>{p.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},N=()=>p.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),r.jsx(Sm,{...d,children:r.jsx(YN,{scope:t,open:n,onOpenChange:x,content:m,onContentChange:f,children:r.jsx($Y,{scope:t,onClose:w.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:p,dir:y,modal:c,children:a})})})};WN.displayName=td;var VY="MenuAnchor",Rg=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=nd(n);return r.jsx(km,{...l,...a,ref:t})});Rg.displayName=VY;var Lg="MenuPortal",[GY,XN]=Mi(Lg,{forceMount:void 0}),KN=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:l}=e,o=Pl(Lg,t);return r.jsx(GY,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(Nm,{asChild:!0,container:l,children:a})})})};KN.displayName=Lg;var _a="MenuContent",[YY,Bg]=Mi(_a),QN=w.forwardRef((e,t)=>{const n=XN(_a,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,o=Pl(_a,e.__scopeMenu),c=rd(_a,e.__scopeMenu);return r.jsx(Cu.Provider,{scope:e.__scopeMenu,children:r.jsx(Wr,{present:a||o.open,children:r.jsx(Cu.Slot,{scope:e.__scopeMenu,children:c.modal?r.jsx(WY,{...l,ref:t}):r.jsx(XY,{...l,ref:t})})})})}),WY=w.forwardRef((e,t)=>{const n=Pl(_a,e.__scopeMenu),a=w.useRef(null),l=mn(t,a);return w.useEffect(()=>{const o=a.current;if(o)return Z5(o)},[]),r.jsx(Pg,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),XY=w.forwardRef((e,t)=>{const n=Pl(_a,e.__scopeMenu);return r.jsx(Pg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),KY=DY("MenuContent.ScrollLock"),Pg=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:l,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:x,onInteractOutside:y,onDismiss:b,disableOutsideScroll:N,...k}=e,S=Pl(_a,n),T=rd(_a,n),M=nd(n),A=GN(n),R=HY(n),[B,O]=w.useState(null),L=w.useRef(null),$=mn(t,L,S.onContentChange),U=w.useRef(0),I=w.useRef(""),G=w.useRef(0),ee=w.useRef(null),Ne=w.useRef("right"),J=w.useRef(0),se=N?J5:w.Fragment,H=N?{as:KY,allowPinchZoom:!0}:void 0,le=ge=>{const E=I.current+ge,we=R().filter(fe=>!fe.disabled),Z=document.activeElement,z=we.find(fe=>fe.ref.current===Z)?.textValue,X=we.map(fe=>fe.textValue),q=oW(X,E,z),ce=we.find(fe=>fe.textValue===q)?.ref.current;(function fe(De){I.current=De,window.clearTimeout(U.current),De!==""&&(U.current=window.setTimeout(()=>fe(""),1e3))})(E),ce&&setTimeout(()=>ce.focus())};w.useEffect(()=>()=>window.clearTimeout(U.current),[]),e6();const re=w.useCallback(ge=>Ne.current===ee.current?.side&&uW(ge,ee.current?.area),[]);return r.jsx(YY,{scope:n,searchRef:I,onItemEnter:w.useCallback(ge=>{re(ge)&&ge.preventDefault()},[re]),onItemLeave:w.useCallback(ge=>{re(ge)||(L.current?.focus(),O(null))},[re]),onTriggerLeave:w.useCallback(ge=>{re(ge)&&ge.preventDefault()},[re]),pointerGraceTimerRef:G,onPointerGraceIntentChange:w.useCallback(ge=>{ee.current=ge},[]),children:r.jsx(se,{...H,children:r.jsx(t6,{asChild:!0,trapped:l,onMountAutoFocus:Pe(o,ge=>{ge.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:r.jsx(b1,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:x,onInteractOutside:y,onDismiss:b,children:r.jsx(J6,{asChild:!0,...A,dir:T.dir,orientation:"vertical",loop:a,currentTabStopId:B,onCurrentTabStopIdChange:O,onEntryFocus:Pe(m,ge=>{T.isUsingKeyboardRef.current||ge.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(w1,{role:"menu","aria-orientation":"vertical","data-state":f9(S.open),"data-radix-menu-content":"",dir:T.dir,...M,...k,ref:$,style:{outline:"none",...k.style},onKeyDown:Pe(k.onKeyDown,ge=>{const we=ge.target.closest("[data-radix-menu-content]")===ge.currentTarget,Z=ge.ctrlKey||ge.altKey||ge.metaKey,z=ge.key.length===1;we&&(ge.key==="Tab"&&ge.preventDefault(),!Z&&z&&le(ge.key));const X=L.current;if(ge.target!==X||!FY.includes(ge.key))return;ge.preventDefault();const ce=R().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);$N.includes(ge.key)&&ce.reverse(),lW(ce)}),onBlur:Pe(e.onBlur,ge=>{ge.currentTarget.contains(ge.target)||(window.clearTimeout(U.current),I.current="")}),onPointerMove:Pe(e.onPointerMove,Tu(ge=>{const E=ge.target,we=J.current!==ge.clientX;if(ge.currentTarget.contains(E)&&we){const Z=ge.clientX>J.current?"right":"left";Ne.current=Z,J.current=ge.clientX}}))})})})})})})});QN.displayName=_a;var QY="MenuGroup",Fg=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(It.div,{role:"group",...a,ref:t})});Fg.displayName=QY;var ZY="MenuLabel",ZN=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(It.div,{...a,ref:t})});ZN.displayName=ZY;var vm="MenuItem",O5="menu.itemSelect",th=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...l}=e,o=w.useRef(null),c=rd(vm,e.__scopeMenu),d=Bg(vm,e.__scopeMenu),m=mn(t,o),f=w.useRef(!1),p=()=>{const x=o.current;if(!n&&x){const y=new CustomEvent(O5,{bubbles:!0,cancelable:!0});x.addEventListener(O5,b=>a?.(b),{once:!0}),r6(x,y),y.defaultPrevented?f.current=!1:c.onClose()}};return r.jsx(JN,{...l,ref:m,disabled:n,onClick:Pe(e.onClick,p),onPointerDown:x=>{e.onPointerDown?.(x),f.current=!0},onPointerUp:Pe(e.onPointerUp,x=>{f.current||x.currentTarget?.click()}),onKeyDown:Pe(e.onKeyDown,x=>{const y=d.searchRef.current!=="";n||y&&x.key===" "||i1.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})});th.displayName=vm;var JN=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:l,...o}=e,c=Bg(vm,n),d=GN(n),m=w.useRef(null),f=mn(t,m),[p,x]=w.useState(!1),[y,b]=w.useState("");return w.useEffect(()=>{const N=m.current;N&&b((N.textContent??"").trim())},[o.children]),r.jsx(Cu.ItemSlot,{scope:n,disabled:a,textValue:l??y,children:r.jsx(ew,{asChild:!0,...d,focusable:!a,children:r.jsx(It.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...o,ref:f,onPointerMove:Pe(e.onPointerMove,Tu(N=>{a?c.onItemLeave(N):(c.onItemEnter(N),N.defaultPrevented||N.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,Tu(N=>c.onItemLeave(N))),onFocus:Pe(e.onFocus,()=>x(!0)),onBlur:Pe(e.onBlur,()=>x(!1))})})})}),JY="MenuCheckboxItem",e9=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...l}=e;return r.jsx(s9,{scope:e.__scopeMenu,checked:n,children:r.jsx(th,{role:"menuitemcheckbox","aria-checked":ym(n)?"mixed":n,...l,ref:t,"data-state":Hg(n),onSelect:Pe(l.onSelect,()=>a?.(ym(n)?!0:!n),{checkForDefaultPrevented:!1})})})});e9.displayName=JY;var t9="MenuRadioGroup",[eW,tW]=Mi(t9,{value:void 0,onValueChange:()=>{}}),n9=w.forwardRef((e,t)=>{const{value:n,onValueChange:a,...l}=e,o=yr(a);return r.jsx(eW,{scope:e.__scopeMenu,value:n,onValueChange:o,children:r.jsx(Fg,{...l,ref:t})})});n9.displayName=t9;var r9="MenuRadioItem",a9=w.forwardRef((e,t)=>{const{value:n,...a}=e,l=tW(r9,e.__scopeMenu),o=n===l.value;return r.jsx(s9,{scope:e.__scopeMenu,checked:o,children:r.jsx(th,{role:"menuitemradio","aria-checked":o,...a,ref:t,"data-state":Hg(o),onSelect:Pe(a.onSelect,()=>l.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});a9.displayName=r9;var Ig="MenuItemIndicator",[s9,nW]=Mi(Ig,{checked:!1}),l9=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...l}=e,o=nW(Ig,n);return r.jsx(Wr,{present:a||ym(o.checked)||o.checked===!0,children:r.jsx(It.span,{...l,ref:t,"data-state":Hg(o.checked)})})});l9.displayName=Ig;var rW="MenuSeparator",i9=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return r.jsx(It.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});i9.displayName=rW;var aW="MenuArrow",o9=w.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=nd(n);return r.jsx(j1,{...l,...a,ref:t})});o9.displayName=aW;var qg="MenuSub",[sW,c9]=Mi(qg),u9=e=>{const{__scopeMenu:t,children:n,open:a=!1,onOpenChange:l}=e,o=Pl(qg,t),c=nd(t),[d,m]=w.useState(null),[f,p]=w.useState(null),x=yr(l);return w.useEffect(()=>(o.open===!1&&x(!1),()=>x(!1)),[o.open,x]),r.jsx(Sm,{...c,children:r.jsx(YN,{scope:t,open:a,onOpenChange:x,content:f,onContentChange:p,children:r.jsx(sW,{scope:t,contentId:Ta(),triggerId:Ta(),trigger:d,onTriggerChange:m,children:n})})})};u9.displayName=qg;var lu="MenuSubTrigger",d9=w.forwardRef((e,t)=>{const n=Pl(lu,e.__scopeMenu),a=rd(lu,e.__scopeMenu),l=c9(lu,e.__scopeMenu),o=Bg(lu,e.__scopeMenu),c=w.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=o,f={__scopeMenu:e.__scopeMenu},p=w.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return w.useEffect(()=>p,[p]),w.useEffect(()=>{const x=d.current;return()=>{window.clearTimeout(x),m(null)}},[d,m]),r.jsx(Rg,{asChild:!0,...f,children:r.jsx(JN,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":f9(n.open),...e,ref:Sl(t,l.onTriggerChange),onClick:x=>{e.onClick?.(x),!(e.disabled||x.defaultPrevented)&&(x.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,Tu(x=>{o.onItemEnter(x),!x.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Pe(e.onPointerLeave,Tu(x=>{p();const y=n.content?.getBoundingClientRect();if(y){const b=n.content?.dataset.side,N=b==="right",k=N?-5:5,S=y[N?"left":"right"],T=y[N?"right":"left"];o.onPointerGraceIntentChange({area:[{x:x.clientX+k,y:x.clientY},{x:S,y:y.top},{x:T,y:y.top},{x:T,y:y.bottom},{x:S,y:y.bottom}],side:b}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(x),x.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,x=>{const y=o.searchRef.current!=="";e.disabled||y&&x.key===" "||IY[a.dir].includes(x.key)&&(n.onOpenChange(!0),n.content?.focus(),x.preventDefault())})})})});d9.displayName=lu;var m9="MenuSubContent",h9=w.forwardRef((e,t)=>{const n=XN(_a,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,o=Pl(_a,e.__scopeMenu),c=rd(_a,e.__scopeMenu),d=c9(m9,e.__scopeMenu),m=w.useRef(null),f=mn(t,m);return r.jsx(Cu.Provider,{scope:e.__scopeMenu,children:r.jsx(Wr,{present:a||o.open,children:r.jsx(Cu.Slot,{scope:e.__scopeMenu,children:r.jsx(Pg,{id:d.contentId,"aria-labelledby":d.triggerId,...l,ref:f,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{c.isUsingKeyboardRef.current&&m.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,p=>{p.target!==d.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:Pe(e.onKeyDown,p=>{const x=p.currentTarget.contains(p.target),y=qY[c.dir].includes(p.key);x&&y&&(o.onOpenChange(!1),d.trigger?.focus(),p.preventDefault())})})})})})});h9.displayName=m9;function f9(e){return e?"open":"closed"}function ym(e){return e==="indeterminate"}function Hg(e){return ym(e)?"indeterminate":e?"checked":"unchecked"}function lW(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function iW(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function oW(e,t,n){const l=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let c=iW(e,Math.max(o,0));l.length===1&&(c=c.filter(f=>f!==n));const m=c.find(f=>f.toLowerCase().startsWith(l.toLowerCase()));return m!==n?m:void 0}function cW(e,t){const{x:n,y:a}=e;let l=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],m=t[c],f=d.x,p=d.y,x=m.x,y=m.y;p>a!=y>a&&n<(x-f)*(a-p)/(y-p)+f&&(l=!l)}return l}function uW(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cW(n,t)}function Tu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var dW=WN,mW=Rg,hW=KN,fW=QN,pW=Fg,xW=ZN,gW=th,vW=e9,yW=n9,bW=a9,wW=l9,jW=i9,NW=o9,SW=u9,kW=d9,CW=h9,Ug="ContextMenu",[TW]=Ua(Ug,[VN]),Sr=VN(),[_W,p9]=TW(Ug),x9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:a,dir:l,modal:o=!0}=e,[c,d]=w.useState(!1),m=Sr(t),f=yr(a),p=w.useCallback(x=>{d(x),f(x)},[f]);return r.jsx(_W,{scope:t,open:c,onOpenChange:p,modal:o,children:r.jsx(dW,{...m,dir:l,open:c,onOpenChange:p,modal:o,children:n})})};x9.displayName=Ug;var g9="ContextMenuTrigger",v9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:a=!1,...l}=e,o=p9(g9,n),c=Sr(n),d=w.useRef({x:0,y:0}),m=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...d.current})}),f=w.useRef(0),p=w.useCallback(()=>window.clearTimeout(f.current),[]),x=y=>{d.current={x:y.clientX,y:y.clientY},o.onOpenChange(!0)};return w.useEffect(()=>p,[p]),w.useEffect(()=>void(a&&p()),[a,p]),r.jsxs(r.Fragment,{children:[r.jsx(mW,{...c,virtualRef:m}),r.jsx(It.span,{"data-state":o.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:a?e.onContextMenu:Pe(e.onContextMenu,y=>{p(),x(y),y.preventDefault()}),onPointerDown:a?e.onPointerDown:Pe(e.onPointerDown,H0(y=>{p(),f.current=window.setTimeout(()=>x(y),700)})),onPointerMove:a?e.onPointerMove:Pe(e.onPointerMove,H0(p)),onPointerCancel:a?e.onPointerCancel:Pe(e.onPointerCancel,H0(p)),onPointerUp:a?e.onPointerUp:Pe(e.onPointerUp,H0(p))})]})});v9.displayName=g9;var EW="ContextMenuPortal",y9=e=>{const{__scopeContextMenu:t,...n}=e,a=Sr(t);return r.jsx(hW,{...a,...n})};y9.displayName=EW;var b9="ContextMenuContent",w9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=p9(b9,n),o=Sr(n),c=w.useRef(!1);return r.jsx(fW,{...o,...a,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:d=>{e.onCloseAutoFocus?.(d),!d.defaultPrevented&&c.current&&d.preventDefault(),c.current=!1},onInteractOutside:d=>{e.onInteractOutside?.(d),!d.defaultPrevented&&!l.modal&&(c.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});w9.displayName=b9;var MW="ContextMenuGroup",AW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(pW,{...l,...a,ref:t})});AW.displayName=MW;var DW="ContextMenuLabel",j9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(xW,{...l,...a,ref:t})});j9.displayName=DW;var zW="ContextMenuItem",N9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(gW,{...l,...a,ref:t})});N9.displayName=zW;var OW="ContextMenuCheckboxItem",S9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(vW,{...l,...a,ref:t})});S9.displayName=OW;var RW="ContextMenuRadioGroup",LW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(yW,{...l,...a,ref:t})});LW.displayName=RW;var BW="ContextMenuRadioItem",k9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(bW,{...l,...a,ref:t})});k9.displayName=BW;var PW="ContextMenuItemIndicator",C9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(wW,{...l,...a,ref:t})});C9.displayName=PW;var FW="ContextMenuSeparator",T9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(jW,{...l,...a,ref:t})});T9.displayName=FW;var IW="ContextMenuArrow",qW=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(NW,{...l,...a,ref:t})});qW.displayName=IW;var _9="ContextMenuSub",E9=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:a,open:l,defaultOpen:o}=e,c=Sr(t),[d,m]=zl({prop:l,defaultProp:o??!1,onChange:a,caller:_9});return r.jsx(SW,{...c,open:d,onOpenChange:m,children:n})};E9.displayName=_9;var HW="ContextMenuSubTrigger",M9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(kW,{...l,...a,ref:t})});M9.displayName=HW;var UW="ContextMenuSubContent",A9=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...a}=e,l=Sr(n);return r.jsx(CW,{...l,...a,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});A9.displayName=UW;function H0(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var $W=x9,VW=v9,GW=y9,D9=w9,z9=j9,O9=N9,R9=S9,L9=k9,B9=C9,P9=T9,YW=E9,F9=M9,I9=A9;const WW=$W,XW=VW,KW=YW,q9=w.forwardRef(({className:e,inset:t,children:n,...a},l)=>r.jsxs(F9,{ref:l,className:he("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...a,children:[n,r.jsx(wi,{className:"ml-auto h-4 w-4"})]}));q9.displayName=F9.displayName;const H9=w.forwardRef(({className:e,...t},n)=>r.jsx(I9,{ref:n,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t}));H9.displayName=I9.displayName;const U9=w.forwardRef(({className:e,...t},n)=>r.jsx(GW,{children:r.jsx(D9,{ref:n,className:he("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",e),...t})}));U9.displayName=D9.displayName;const La=w.forwardRef(({className:e,inset:t,...n},a)=>r.jsx(O9,{ref:a,className:he("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));La.displayName=O9.displayName;const QW=w.forwardRef(({className:e,children:t,checked:n,...a},l)=>r.jsxs(R9,{ref:l,className:he("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...a,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(B9,{children:r.jsx(mi,{className:"h-4 w-4"})})}),t]}));QW.displayName=R9.displayName;const ZW=w.forwardRef(({className:e,children:t,...n},a)=>r.jsxs(L9,{ref:a,className:he("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(B9,{children:r.jsx(DT,{className:"h-2 w-2 fill-current"})})}),t]}));ZW.displayName=L9.displayName;const JW=w.forwardRef(({className:e,inset:t,...n},a)=>r.jsx(z9,{ref:a,className:he("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));JW.displayName=z9.displayName;const iu=w.forwardRef(({className:e,...t},n)=>r.jsx(P9,{ref:n,className:he("-mx-1 my-1 h-px bg-border",e),...t}));iu.displayName=P9.displayName;const Mo=({className:e,...t})=>r.jsx("span",{className:he("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Mo.displayName="ContextMenuShortcut";var eX=Symbol("radix.slottable");function tX(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eX,t}var[nh]=Ua("Tooltip",[Vo]),rh=Vo(),$9="TooltipProvider",nX=700,o1="tooltip.open",[rX,$g]=nh($9),V9=e=>{const{__scopeTooltip:t,delayDuration:n=nX,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:o}=e,c=w.useRef(!0),d=w.useRef(!1),m=w.useRef(0);return w.useEffect(()=>{const f=m.current;return()=>window.clearTimeout(f)},[]),r.jsx(rX,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(m.current),c.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.current=!0,a)},[a]),isPointerInTransitRef:d,onPointerInTransitChange:w.useCallback(f=>{d.current=f},[]),disableHoverableContent:l,children:o})};V9.displayName=$9;var _u="Tooltip",[aX,ad]=nh(_u),G9=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:l,onOpenChange:o,disableHoverableContent:c,delayDuration:d}=e,m=$g(_u,e.__scopeTooltip),f=rh(t),[p,x]=w.useState(null),y=Ta(),b=w.useRef(0),N=c??m.disableHoverableContent,k=d??m.delayDuration,S=w.useRef(!1),[T,M]=zl({prop:a,defaultProp:l??!1,onChange:L=>{L?(m.onOpen(),document.dispatchEvent(new CustomEvent(o1))):m.onClose(),o?.(L)},caller:_u}),A=w.useMemo(()=>T?S.current?"delayed-open":"instant-open":"closed",[T]),R=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,S.current=!1,M(!0)},[M]),B=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,M(!1)},[M]),O=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{S.current=!0,M(!0),b.current=0},k)},[k,M]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),r.jsx(Sm,{...f,children:r.jsx(aX,{scope:t,contentId:y,open:T,stateAttribute:A,trigger:p,onTriggerChange:x,onTriggerEnter:w.useCallback(()=>{m.isOpenDelayedRef.current?O():R()},[m.isOpenDelayedRef,O,R]),onTriggerLeave:w.useCallback(()=>{N?B():(window.clearTimeout(b.current),b.current=0)},[B,N]),onOpen:R,onClose:B,disableHoverableContent:N,children:n})})};G9.displayName=_u;var c1="TooltipTrigger",Y9=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=ad(c1,n),o=$g(c1,n),c=rh(n),d=w.useRef(null),m=mn(t,d,l.onTriggerChange),f=w.useRef(!1),p=w.useRef(!1),x=w.useCallback(()=>f.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(km,{asChild:!0,...c,children:r.jsx(It.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:m,onPointerMove:Pe(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(l.onTriggerEnter(),p.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{l.onTriggerLeave(),p.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{l.open&&l.onClose(),f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Pe(e.onFocus,()=>{f.current||l.onOpen()}),onBlur:Pe(e.onBlur,l.onClose),onClick:Pe(e.onClick,l.onClose)})})});Y9.displayName=c1;var Vg="TooltipPortal",[sX,lX]=nh(Vg,{forceMount:void 0}),W9=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:l}=e,o=ad(Vg,t);return r.jsx(sX,{scope:t,forceMount:n,children:r.jsx(Wr,{present:n||o.open,children:r.jsx(Nm,{asChild:!0,container:l,children:a})})})};W9.displayName=Vg;var $o="TooltipContent",X9=w.forwardRef((e,t)=>{const n=lX($o,e.__scopeTooltip),{forceMount:a=n.forceMount,side:l="top",...o}=e,c=ad($o,e.__scopeTooltip);return r.jsx(Wr,{present:a||c.open,children:c.disableHoverableContent?r.jsx(K9,{side:l,...o,ref:t}):r.jsx(iX,{side:l,...o,ref:t})})}),iX=w.forwardRef((e,t)=>{const n=ad($o,e.__scopeTooltip),a=$g($o,e.__scopeTooltip),l=w.useRef(null),o=mn(t,l),[c,d]=w.useState(null),{trigger:m,onClose:f}=n,p=l.current,{onPointerInTransitChange:x}=a,y=w.useCallback(()=>{d(null),x(!1)},[x]),b=w.useCallback((N,k)=>{const S=N.currentTarget,T={x:N.clientX,y:N.clientY},M=mX(T,S.getBoundingClientRect()),A=hX(T,M),R=fX(k.getBoundingClientRect()),B=xX([...A,...R]);d(B),x(!0)},[x]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(m&&p){const N=S=>b(S,p),k=S=>b(S,m);return m.addEventListener("pointerleave",N),p.addEventListener("pointerleave",k),()=>{m.removeEventListener("pointerleave",N),p.removeEventListener("pointerleave",k)}}},[m,p,b,y]),w.useEffect(()=>{if(c){const N=k=>{const S=k.target,T={x:k.clientX,y:k.clientY},M=m?.contains(S)||p?.contains(S),A=!pX(T,c);M?y():A&&(y(),f())};return document.addEventListener("pointermove",N),()=>document.removeEventListener("pointermove",N)}},[m,p,c,f,y]),r.jsx(K9,{...e,ref:o})}),[oX,cX]=nh(_u,{isInside:!1}),uX=tX("TooltipContent"),K9=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":l,onEscapeKeyDown:o,onPointerDownOutside:c,...d}=e,m=ad($o,n),f=rh(n),{onClose:p}=m;return w.useEffect(()=>(document.addEventListener(o1,p),()=>document.removeEventListener(o1,p)),[p]),w.useEffect(()=>{if(m.trigger){const x=y=>{y.target?.contains(m.trigger)&&p()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[m.trigger,p]),r.jsx(b1,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:p,children:r.jsxs(w1,{"data-state":m.stateAttribute,...f,...d,ref:t,style:{...d.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:[r.jsx(uX,{children:a}),r.jsx(oX,{scope:n,isInside:!0,children:r.jsx(cT,{id:m.contentId,role:"tooltip",children:l||a})})]})})});X9.displayName=$o;var Q9="TooltipArrow",dX=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=rh(n);return cX(Q9,n).isInside?null:r.jsx(j1,{...l,...a,ref:t})});dX.displayName=Q9;function mX(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,a,l,o)){case o:return"left";case l:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function hX(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function fX(e){const{top:t,right:n,bottom:a,left:l}=e;return[{x:l,y:t},{x:n,y:t},{x:n,y:a},{x:l,y:a}]}function pX(e,t){const{x:n,y:a}=e;let l=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],m=t[c],f=d.x,p=d.y,x=m.x,y=m.y;p>a!=y>a&&n<(x-f)*(a-p)/(y-p)+f&&(l=!l)}return l}function xX(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),gX(t)}function gX(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const l=e[a];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(l.y-c.y)>=(o.y-c.y)*(l.x-c.x))t.pop();else break}t.push(l)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const l=e[a];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(l.y-c.y)>=(o.y-c.y)*(l.x-c.x))n.pop();else break}n.push(l)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vX=V9,yX=G9,bX=Y9,wX=W9,Z9=X9;const jX=vX,NX=yX,SX=bX,J9=w.forwardRef(({className:e,sideOffset:t=4,...n},a)=>r.jsx(wX,{children:r.jsx(Z9,{ref:a,sideOffset:t,className:he("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n})}));J9.displayName=Z9.displayName;function kX({children:e}){MA();const[t,n]=w.useState(!0),[a,l]=w.useState(!1),[o,c]=w.useState(!1),{theme:d,setTheme:m}=B1(),f=LC(),p=as();w.useEffect(()=>{const k=S=>{(S.metaKey||S.ctrlKey)&&S.key==="k"&&(S.preventDefault(),c(!0))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[]);const x=[{title:"概览",items:[{icon:J0,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:Nl,label:"麦麦主程序配置",path:"/config/bot"},{icon:o6,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:c6,label:"麦麦模型配置",path:"/config/model"},{icon:Xy,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:N1,label:"表情包管理",path:"/resource/emoji"},{icon:Mu,label:"表达方式管理",path:"/resource/expression"},{icon:u6,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:nm,label:"插件市场",path:"/plugins"},{icon:Xy,label:"插件配置",path:"/plugin-config"},{icon:em,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:Pa,label:"系统设置",path:"/settings"}]}],b=d==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":d,N=()=>{localStorage.removeItem("access-token"),p({to:"/auth"})};return r.jsx(jX,{delayDuration:300,children:r.jsxs("div",{className:"flex h-screen overflow-hidden",children:[r.jsxs("aside",{className:he("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",a?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[r.jsx("div",{className:"flex h-16 items-center border-b px-4",children:r.jsxs("div",{className:he("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[r.jsxs("div",{className:he("flex items-baseline gap-2",!t&&"lg:hidden"),children:[r.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),r.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:lA()})]}),!t&&r.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),r.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:r.jsx("ul",{className:he("space-y-6",!t&&"lg:space-y-3"),children:x.map((k,S)=>r.jsxs("li",{children:[r.jsx("div",{className:he("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:k.title})}),!t&&S>0&&r.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),r.jsx("ul",{className:"space-y-1",children:k.items.map(T=>{const M=f({to:T.path}),A=T.icon,R=r.jsxs(r.Fragment,{children:[M&&r.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"}),r.jsxs("div",{className:he("flex items-center transition-all duration-300",t?"gap-3":"lg:gap-0"),children:[r.jsx(A,{className:he("h-5 w-5 flex-shrink-0",M&&"text-primary"),strokeWidth:2,fill:"none"}),r.jsx("span",{className:he("text-sm font-medium whitespace-nowrap transition-all duration-300",M&&"font-semibold",t?"opacity-100 max-w-[200px]":"lg:opacity-0 lg:max-w-0 lg:overflow-hidden"),children:T.label})]})]});return r.jsx("li",{className:"relative",children:r.jsxs(NX,{children:[r.jsx(SX,{asChild:!0,children:r.jsx(BC,{to:T.path,className:he("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",M?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",t?"px-3":"lg:px-0 lg:justify-center"),onClick:()=>l(!1),children:R})}),!t&&r.jsx(J9,{side:"right",className:"hidden lg:block",children:r.jsx("p",{children:T.label})})]})},T.path)})})]},k.title))})})]}),a&&r.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>l(!1)}),r.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[r.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:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("button",{onClick:()=>l(!a),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:r.jsx(zT,{className:"h-5 w-5"})}),r.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:t?"收起侧边栏":"展开侧边栏",children:r.jsx(bi,{className:he("h-5 w-5 transition-transform",!t&&"rotate-180")})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{onClick:()=>c(!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:[r.jsx(Yr,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),r.jsxs(UN,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[r.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),r.jsx(AY,{open:o,onOpenChange:c}),r.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[r.jsx(OT,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),r.jsx("button",{onClick:k=>{VM(b==="dark"?"light":"dark",m,k)},className:"rounded-lg p-2 hover:bg-accent",title:b==="dark"?"切换到浅色模式":"切换到深色模式",children:b==="dark"?r.jsx(wx,{className:"h-5 w-5"}):r.jsx(jx,{className:"h-5 w-5"})}),r.jsx("div",{className:"h-6 w-px bg-border"}),r.jsxs(ne,{variant:"ghost",size:"sm",onClick:N,className:"gap-2",title:"登出系统",children:[r.jsx(Ky,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),r.jsxs(WW,{children:[r.jsx(XW,{asChild:!0,children:r.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:e})}),r.jsxs(U9,{className:"w-64",children:[r.jsxs(La,{onClick:()=>p({to:"/"}),children:[r.jsx(J0,{className:"mr-2 h-4 w-4"}),"首页"]}),r.jsxs(La,{onClick:()=>p({to:"/settings"}),children:[r.jsx(Pa,{className:"mr-2 h-4 w-4"}),"系统设置"]}),r.jsxs(La,{onClick:()=>p({to:"/logs"}),children:[r.jsx(em,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),r.jsx(iu,{}),r.jsxs(KW,{children:[r.jsxs(q9,{children:[r.jsx(s6,{className:"mr-2 h-4 w-4"}),"切换主题"]}),r.jsxs(H9,{className:"w-48",children:[r.jsxs(La,{onClick:()=>m("light"),disabled:d==="light",children:[r.jsx(wx,{className:"mr-2 h-4 w-4"}),"浅色",d==="light"&&r.jsx(Mo,{children:"✓"})]}),r.jsxs(La,{onClick:()=>m("dark"),disabled:d==="dark",children:[r.jsx(jx,{className:"mr-2 h-4 w-4"}),"深色",d==="dark"&&r.jsx(Mo,{children:"✓"})]}),r.jsxs(La,{onClick:()=>m("system"),disabled:d==="system",children:[r.jsx(Pa,{className:"mr-2 h-4 w-4"}),"跟随系统",d==="system"&&r.jsx(Mo,{children:"✓"})]})]})]}),r.jsx(iu,{}),r.jsxs(La,{onClick:()=>window.location.reload(),children:[r.jsx(RT,{className:"mr-2 h-4 w-4"}),"刷新页面",r.jsx(Mo,{children:"⌘R"})]}),r.jsxs(La,{onClick:()=>c(!0),children:[r.jsx(Yr,{className:"mr-2 h-4 w-4"}),"搜索",r.jsx(Mo,{children:"⌘K"})]}),r.jsx(iu,{}),r.jsxs(La,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[r.jsx(ou,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),r.jsx(iu,{}),r.jsxs(La,{onClick:N,className:"text-destructive focus:text-destructive",children:[r.jsx(Ky,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}const sd=PC({component:()=>r.jsxs(r.Fragment,{children:[r.jsx(L5,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!hj())throw IC({to:"/auth"})}}),CX=gr({getParentRoute:()=>sd,path:"/auth",component:AA}),TX=gr({getParentRoute:()=>sd,path:"/setup",component:KA}),Zr=gr({getParentRoute:()=>sd,id:"protected",component:()=>r.jsx(kX,{children:r.jsx(L5,{})})}),_X=gr({getParentRoute:()=>Zr,path:"/",component:UM}),EX=gr({getParentRoute:()=>Zr,path:"/config/bot",component:qD}),MX=gr({getParentRoute:()=>Zr,path:"/config/modelProvider",component:rz}),AX=gr({getParentRoute:()=>Zr,path:"/config/model",component:Az}),DX=gr({getParentRoute:()=>Zr,path:"/config/adapter",component:Rz}),zX=gr({getParentRoute:()=>Zr,path:"/resource/emoji",component:sU}),OX=gr({getParentRoute:()=>Zr,path:"/resource/expression",component:pU}),RX=gr({getParentRoute:()=>Zr,path:"/resource/person",component:CU}),LX=gr({getParentRoute:()=>Zr,path:"/logs",component:iY}),BX=gr({getParentRoute:()=>Zr,path:"/plugins",component:CY}),PX=gr({getParentRoute:()=>Zr,path:"/plugin-config",component:TY}),FX=gr({getParentRoute:()=>Zr,path:"/plugin-mirrors",component:_Y}),IX=gr({getParentRoute:()=>Zr,path:"/settings",component:NA}),qX=gr({getParentRoute:()=>sd,path:"*",component:xj}),HX=sd.addChildren([CX,TX,Zr.addChildren([_X,EX,MX,AX,DX,zX,OX,RX,BX,PX,FX,LX,IX]),qX]),UX=FC({routeTree:HX,defaultNotFoundComponent:xj});function $X({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...a}){const[l,o]=w.useState(()=>localStorage.getItem(n)||t);w.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),l==="system"){const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(m);return}d.classList.add(l)},[l]),w.useEffect(()=>{const d=localStorage.getItem("accent-color");if(d){const m=document.documentElement,p={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%)"}}[d];p&&(m.style.setProperty("--primary",p.hsl),p.gradient?(m.style.setProperty("--primary-gradient",p.gradient),m.classList.add("has-gradient")):(m.style.removeProperty("--primary-gradient"),m.classList.remove("has-gradient")))}},[]);const c={theme:l,setTheme:d=>{localStorage.setItem(n,d),o(d)}};return r.jsx(Bw.Provider,{...a,value:c,children:e})}function VX({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:a="enable-animations",wavesStorageKey:l="enable-waves-background"}){const[o,c]=w.useState(()=>{const p=localStorage.getItem(a);return p!==null?p==="true":t}),[d,m]=w.useState(()=>{const p=localStorage.getItem(l);return p!==null?p==="true":n});w.useEffect(()=>{const p=document.documentElement;o?p.classList.remove("no-animations"):p.classList.add("no-animations"),localStorage.setItem(a,String(o))},[o,a]),w.useEffect(()=>{localStorage.setItem(l,String(d))},[d,l]);const f={enableAnimations:o,setEnableAnimations:c,enableWavesBackground:d,setEnableWavesBackground:m};return r.jsx(Pw.Provider,{value:f,children:e})}var Gg="ToastProvider",[Yg,GX,YX]=bm("Toast"),[eS]=Ua("Toast",[YX]),[WX,ah]=eS(Gg),tS=e=>{const{__scopeToast:t,label:n="Notification",duration:a=5e3,swipeDirection:l="right",swipeThreshold:o=50,children:c}=e,[d,m]=w.useState(null),[f,p]=w.useState(0),x=w.useRef(!1),y=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Gg}\`. Expected non-empty \`string\`.`),r.jsx(Yg.Provider,{scope:t,children:r.jsx(WX,{scope:t,label:n,duration:a,swipeDirection:l,swipeThreshold:o,toastCount:f,viewport:d,onViewportChange:m,onToastAdd:w.useCallback(()=>p(b=>b+1),[]),onToastRemove:w.useCallback(()=>p(b=>b-1),[]),isFocusedToastEscapeKeyDownRef:x,isClosePausedRef:y,children:c})})};tS.displayName=Gg;var nS="ToastViewport",XX=["F8"],u1="toast.viewportPause",d1="toast.viewportResume",rS=w.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:a=XX,label:l="Notifications ({hotkey})",...o}=e,c=ah(nS,n),d=GX(n),m=w.useRef(null),f=w.useRef(null),p=w.useRef(null),x=w.useRef(null),y=mn(t,x,c.onViewportChange),b=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=c.toastCount>0;w.useEffect(()=>{const S=T=>{a.length!==0&&a.every(A=>T[A]||T.code===A)&&x.current?.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[a]),w.useEffect(()=>{const S=m.current,T=x.current;if(N&&S&&T){const M=()=>{if(!c.isClosePausedRef.current){const O=new CustomEvent(u1);T.dispatchEvent(O),c.isClosePausedRef.current=!0}},A=()=>{if(c.isClosePausedRef.current){const O=new CustomEvent(d1);T.dispatchEvent(O),c.isClosePausedRef.current=!1}},R=O=>{!S.contains(O.relatedTarget)&&A()},B=()=>{S.contains(document.activeElement)||A()};return S.addEventListener("focusin",M),S.addEventListener("focusout",R),S.addEventListener("pointermove",M),S.addEventListener("pointerleave",B),window.addEventListener("blur",M),window.addEventListener("focus",A),()=>{S.removeEventListener("focusin",M),S.removeEventListener("focusout",R),S.removeEventListener("pointermove",M),S.removeEventListener("pointerleave",B),window.removeEventListener("blur",M),window.removeEventListener("focus",A)}}},[N,c.isClosePausedRef]);const k=w.useCallback(({tabbingDirection:S})=>{const M=d().map(A=>{const R=A.ref.current,B=[R,...oK(R)];return S==="forwards"?B:B.reverse()});return(S==="forwards"?M.reverse():M).flat()},[d]);return w.useEffect(()=>{const S=x.current;if(S){const T=M=>{const A=M.altKey||M.ctrlKey||M.metaKey;if(M.key==="Tab"&&!A){const B=document.activeElement,O=M.shiftKey;if(M.target===S&&O){f.current?.focus();return}const U=k({tabbingDirection:O?"backwards":"forwards"}),I=U.findIndex(G=>G===B);gx(U.slice(I+1))?M.preventDefault():O?f.current?.focus():p.current?.focus()}};return S.addEventListener("keydown",T),()=>S.removeEventListener("keydown",T)}},[d,k]),r.jsxs(uT,{ref:m,role:"region","aria-label":l.replace("{hotkey}",b),tabIndex:-1,style:{pointerEvents:N?void 0:"none"},children:[N&&r.jsx(m1,{ref:f,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"forwards"});gx(S)}}),r.jsx(Yg.Slot,{scope:n,children:r.jsx(It.ol,{tabIndex:-1,...o,ref:y})}),N&&r.jsx(m1,{ref:p,onFocusFromOutsideViewport:()=>{const S=k({tabbingDirection:"backwards"});gx(S)}})]})});rS.displayName=nS;var aS="ToastFocusProxy",m1=w.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:a,...l}=e,o=ah(aS,n);return r.jsx(a6,{tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:c=>{const d=c.relatedTarget;!o.viewport?.contains(d)&&a()}})});m1.displayName=aS;var ld="Toast",KX="toast.swipeStart",QX="toast.swipeMove",ZX="toast.swipeCancel",JX="toast.swipeEnd",sS=w.forwardRef((e,t)=>{const{forceMount:n,open:a,defaultOpen:l,onOpenChange:o,...c}=e,[d,m]=zl({prop:a,defaultProp:l??!0,onChange:o,caller:ld});return r.jsx(Wr,{present:n||d,children:r.jsx(nK,{open:d,...c,ref:t,onClose:()=>m(!1),onPause:yr(e.onPause),onResume:yr(e.onResume),onSwipeStart:Pe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,f=>{const{x:p,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${x}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,f=>{const{x:p,y:x}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${x}px`),m(!1)})})})});sS.displayName=ld;var[eK,tK]=eS(ld,{onClose(){}}),nK=w.forwardRef((e,t)=>{const{__scopeToast:n,type:a="foreground",duration:l,open:o,onClose:c,onEscapeKeyDown:d,onPause:m,onResume:f,onSwipeStart:p,onSwipeMove:x,onSwipeCancel:y,onSwipeEnd:b,...N}=e,k=ah(ld,n),[S,T]=w.useState(null),M=mn(t,J=>T(J)),A=w.useRef(null),R=w.useRef(null),B=l||k.duration,O=w.useRef(0),L=w.useRef(B),$=w.useRef(0),{onToastAdd:U,onToastRemove:I}=k,G=yr(()=>{S?.contains(document.activeElement)&&k.viewport?.focus(),c()}),ee=w.useCallback(J=>{!J||J===1/0||(window.clearTimeout($.current),O.current=new Date().getTime(),$.current=window.setTimeout(G,J))},[G]);w.useEffect(()=>{const J=k.viewport;if(J){const se=()=>{ee(L.current),f?.()},H=()=>{const le=new Date().getTime()-O.current;L.current=L.current-le,window.clearTimeout($.current),m?.()};return J.addEventListener(u1,H),J.addEventListener(d1,se),()=>{J.removeEventListener(u1,H),J.removeEventListener(d1,se)}}},[k.viewport,B,m,f,ee]),w.useEffect(()=>{o&&!k.isClosePausedRef.current&&ee(B)},[o,B,k.isClosePausedRef,ee]),w.useEffect(()=>(U(),()=>I()),[U,I]);const Ne=w.useMemo(()=>S?mS(S):null,[S]);return k.viewport?r.jsxs(r.Fragment,{children:[Ne&&r.jsx(rK,{__scopeToast:n,role:"status","aria-live":a==="foreground"?"assertive":"polite",children:Ne}),r.jsx(eK,{scope:n,onClose:G,children:qC.createPortal(r.jsx(Yg.ItemSlot,{scope:n,children:r.jsx(dT,{asChild:!0,onEscapeKeyDown:Pe(d,()=>{k.isFocusedToastEscapeKeyDownRef.current||G(),k.isFocusedToastEscapeKeyDownRef.current=!1}),children:r.jsx(It.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":k.swipeDirection,...N,ref:M,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,J=>{J.key==="Escape"&&(d?.(J.nativeEvent),J.nativeEvent.defaultPrevented||(k.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Pe(e.onPointerDown,J=>{J.button===0&&(A.current={x:J.clientX,y:J.clientY})}),onPointerMove:Pe(e.onPointerMove,J=>{if(!A.current)return;const se=J.clientX-A.current.x,H=J.clientY-A.current.y,le=!!R.current,re=["left","right"].includes(k.swipeDirection),ge=["left","up"].includes(k.swipeDirection)?Math.min:Math.max,E=re?ge(0,se):0,we=re?0:ge(0,H),Z=J.pointerType==="touch"?10:2,z={x:E,y:we},X={originalEvent:J,delta:z};le?(R.current=z,U0(QX,x,X,{discrete:!1})):R5(z,k.swipeDirection,Z)?(R.current=z,U0(KX,p,X,{discrete:!1}),J.target.setPointerCapture(J.pointerId)):(Math.abs(se)>Z||Math.abs(H)>Z)&&(A.current=null)}),onPointerUp:Pe(e.onPointerUp,J=>{const se=R.current,H=J.target;if(H.hasPointerCapture(J.pointerId)&&H.releasePointerCapture(J.pointerId),R.current=null,A.current=null,se){const le=J.currentTarget,re={originalEvent:J,delta:se};R5(se,k.swipeDirection,k.swipeThreshold)?U0(JX,b,re,{discrete:!0}):U0(ZX,y,re,{discrete:!0}),le.addEventListener("click",ge=>ge.preventDefault(),{once:!0})}})})})}),k.viewport)})]}):null}),rK=e=>{const{__scopeToast:t,children:n,...a}=e,l=ah(ld,t),[o,c]=w.useState(!1),[d,m]=w.useState(!1);return lK(()=>c(!0)),w.useEffect(()=>{const f=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(f)},[]),d?null:r.jsx(Nm,{asChild:!0,children:r.jsx(a6,{...a,children:o&&r.jsxs(r.Fragment,{children:[l.label," ",n]})})})},aK="ToastTitle",lS=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return r.jsx(It.div,{...a,ref:t})});lS.displayName=aK;var sK="ToastDescription",iS=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return r.jsx(It.div,{...a,ref:t})});iS.displayName=sK;var oS="ToastAction",cS=w.forwardRef((e,t)=>{const{altText:n,...a}=e;return n.trim()?r.jsx(dS,{altText:n,asChild:!0,children:r.jsx(Wg,{...a,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${oS}\`. Expected non-empty \`string\`.`),null)});cS.displayName=oS;var uS="ToastClose",Wg=w.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e,l=tK(uS,n);return r.jsx(dS,{asChild:!0,children:r.jsx(It.button,{type:"button",...a,ref:t,onClick:Pe(e.onClick,l.onClose)})})});Wg.displayName=uS;var dS=w.forwardRef((e,t)=>{const{__scopeToast:n,altText:a,...l}=e;return r.jsx(It.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...l,ref:t})});function mS(e){const t=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),iK(a)){const l=a.ariaHidden||a.hidden||a.style.display==="none",o=a.dataset.radixToastAnnounceExclude==="";if(!l)if(o){const c=a.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...mS(a))}}),t}function U0(e,t,n,{discrete:a}){const l=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?r6(l,o):l.dispatchEvent(o)}var R5=(e,t,n=0)=>{const a=Math.abs(e.x),l=Math.abs(e.y),o=a>l;return t==="left"||t==="right"?o&&a>n:!o&&l>n};function lK(e=()=>{}){const t=yr(e);F5(()=>{let n=0,a=0;return n=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(a)}},[t])}function iK(e){return e.nodeType===e.ELEMENT_NODE}function oK(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gx(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var cK=tS,hS=rS,fS=sS,pS=lS,xS=iS,gS=cS,vS=Wg;const uK=cK,yS=w.forwardRef(({className:e,...t},n)=>r.jsx(hS,{ref:n,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));yS.displayName=hS.displayName;const dK=Ko("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"}}),bS=w.forwardRef(({className:e,variant:t,...n},a)=>r.jsx(fS,{ref:a,className:he(dK({variant:t}),e),...n}));bS.displayName=fS.displayName;const mK=w.forwardRef(({className:e,...t},n)=>r.jsx(gS,{ref:n,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));mK.displayName=gS.displayName;const wS=w.forwardRef(({className:e,...t},n)=>r.jsx(vS,{ref:n,className:he("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:r.jsx(Au,{className:"h-4 w-4"})}));wS.displayName=vS.displayName;const jS=w.forwardRef(({className:e,...t},n)=>r.jsx(pS,{ref:n,className:he("text-sm font-semibold [&+div]:text-xs",e),...t}));jS.displayName=pS.displayName;const NS=w.forwardRef(({className:e,...t},n)=>r.jsx(xS,{ref:n,className:he("text-sm opacity-90",e),...t}));NS.displayName=xS.displayName;function hK(){const{toasts:e}=or();return r.jsxs(uK,{children:[e.map(function({id:t,title:n,description:a,action:l,...o}){return r.jsxs(bS,{...o,children:[r.jsxs("div",{className:"grid gap-1",children:[n&&r.jsx(jS,{children:n}),a&&r.jsx(NS,{children:a})]}),l,r.jsx(wS,{})]},t)}),r.jsx(yS,{})]})}IT.createRoot(document.getElementById("root")).render(r.jsx(w.StrictMode,{children:r.jsx($X,{defaultTheme:"system",children:r.jsxs(VX,{children:[r.jsx(HC,{router:UX}),r.jsx(hK,{})]})})}));